imba
Version:
793 lines • 874 kB
JavaScript
var imbac = (() => {
var __defProp = Object.defineProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, {get: all[name], enumerable: true});
};
var stdin_exports = {};
__export(stdin_exports, {
default: () => stdin_default
});
var z3 = Object.create;
var d1 = Object.defineProperty;
var U3 = Object.getPrototypeOf;
var Y3 = Object.prototype.hasOwnProperty;
var K3 = Object.getOwnPropertyNames;
var q3 = Object.getOwnPropertyDescriptor;
var Hi = (t) => d1(t, "__esModule", {value: true});
var er = (t, e) => () => (e || (e = {exports: {}}, t(e.exports, e)), e.exports);
var Fi = (t, e) => {
for (var r in e)
d1(t, r, {get: e[r], enumerable: true});
};
var fn = (t, e, r) => {
if (e && typeof e == "object" || typeof e == "function")
for (let i of K3(e))
!Y3.call(t, i) && i !== "default" && d1(t, i, {get: () => e[i], enumerable: !(r = q3(e, i)) || r.enumerable});
return t;
};
var Ou = (t) => fn(Hi(d1(t != null ? z3(U3(t)) : {}, "default", t && t.__esModule && "default" in t ? {get: () => t.default, enumerable: true} : {value: t, enumerable: true})), t);
var ta = er((or) => {
var zi = {}, Ts = or.TOK = {}, Y_ = Ts.TERMINATOR = 1, K_ = Ts.IDENTIFIER = Ts.IVAR = 2, q_ = Ts.CONST = 3, X_ = Ts.VAR = 4, W_ = Ts.IF = 5, J_ = Ts.ELSE = 6, Z_ = Ts.DEF = 7;
function Je(t, e, r, i) {
return this._type = t, this._value = e, this._loc = r != null ? r : -1, this._len = i != null ? i : this._value.length, this._meta = null, this.generated = false, this.newLine = false, this.spaced = false, this.call = false, this;
}
or.Token = Je;
Je.prototype.type = function() {
return this._type;
};
Je.prototype.value = function() {
return this._value;
};
Je.prototype.traverse = function() {
};
Je.prototype.c = function() {
return "" + this._value;
};
Je.prototype.prepend = function(t) {
return this._value = t + this._value, this;
};
Je.prototype.toString = function() {
return this._value;
};
Je.prototype.charAt = function(t) {
return this._value.charAt(t);
};
Je.prototype.slice = function(t) {
return this._value.slice(t);
};
Je.prototype.cloneSlice = function(t, e) {
return new Je(e || this._type, this.slice(t), this._loc + t, this._len - t);
};
Je.prototype.region = function() {
return [this._loc, this._loc + this._len];
};
Je.prototype.startLoc = function() {
return this._loc;
};
Je.prototype.endLoc = function() {
return this._loc + this._len;
};
Je.prototype.loc = function() {
return [this._loc, this.endLoc()];
};
or.lex = zi.lex = function() {
var t = this.tokens[this.pos++], e;
return t ? (e = t._type, this.yytext = t) : e = "", e;
};
or.token = zi.token = function(t, e) {
return new Je(t, e, -1, 0);
};
or.typ = zi.typ = function(t) {
return t._type;
};
or.val = zi.val = function(t) {
return t._value;
};
or.line = zi.line = function(t) {
return t._line;
};
or.loc = zi.loc = function(t) {
return t._loc;
};
or.setTyp = zi.setTyp = function(t, e) {
return t._type = e;
};
or.setVal = zi.setVal = function(t, e) {
return t._value = e;
};
or.setLine = zi.setLine = function(t, e) {
return t._line = e;
};
or.setLoc = zi.setLoc = function(t, e) {
return t._loc = e;
};
var X3 = or.LBRACKET = new Je("{", "{", 0, 0, 0), W3 = or.RBRACKET = new Je("}", "}", 0, 0, 0), J3 = or.LPAREN = new Je("(", "(", 0, 0, 0), Z3 = or.RPAREN = new Je(")", ")", 0, 0, 0);
X3.generated = true;
W3.generated = true;
J3.generated = true;
Z3.generated = true;
var Q_ = or.INDENT = new Je("INDENT", "2", 0, 0, 0), $_ = or.OUTDENT = new Je("OUTDENT", "2", 0, 0, 0);
});
var Cu = er((exports, module) => {
(function() {
"use strict";
var root = typeof window == "object" ? window : {}, NODE_JS = !root.JS_SHA1_NO_NODE_JS && typeof process == "object" && process.versions && process.versions.node;
NODE_JS && (root = global);
var COMMON_JS = !root.JS_SHA1_NO_COMMON_JS && typeof module == "object" && module.exports, AMD = typeof define == "function" && define.amd, HEX_CHARS = "0123456789abcdef".split(""), EXTRA = [-2147483648, 8388608, 32768, 128], SHIFT = [24, 16, 8, 0], OUTPUT_TYPES = ["hex", "array", "digest", "arrayBuffer"], blocks = [], createOutputMethod = function(t) {
return function(e) {
return new Sha1(true).update(e)[t]();
};
}, createMethod = function() {
var t = createOutputMethod("hex");
t.create = function() {
return new Sha1();
}, t.update = function(i) {
return t.create().update(i);
};
for (var e = 0; e < OUTPUT_TYPES.length; ++e) {
var r = OUTPUT_TYPES[e];
t[r] = createOutputMethod(r);
}
return t;
}, nodeWrap = function(method) {
var crypto = eval("require('crypto')"), Buffer = eval("require('buffer').Buffer"), nodeMethod = function(t) {
if (typeof t == "string")
return crypto.createHash("sha1").update(t, "utf8").digest("hex");
if (t.constructor === ArrayBuffer)
t = new Uint8Array(t);
else if (t.length === void 0)
return method(t);
return crypto.createHash("sha1").update(new Buffer(t)).digest("hex");
};
return nodeMethod;
};
function Sha1(t) {
t ? (blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0, this.blocks = blocks) : this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], this.h0 = 1732584193, this.h1 = 4023233417, this.h2 = 2562383102, this.h3 = 271733878, this.h4 = 3285377520, this.block = this.start = this.bytes = this.hBytes = 0, this.finalized = this.hashed = false, this.first = true;
}
Sha1.prototype.update = function(t) {
if (!this.finalized) {
var e = typeof t != "string";
e && t.constructor === root.ArrayBuffer && (t = new Uint8Array(t));
for (var r, i = 0, s, n = t.length || 0, o = this.blocks; i < n; ) {
if (this.hashed && (this.hashed = false, o[0] = this.block, o[16] = o[1] = o[2] = o[3] = o[4] = o[5] = o[6] = o[7] = o[8] = o[9] = o[10] = o[11] = o[12] = o[13] = o[14] = o[15] = 0), e)
for (s = this.start; i < n && s < 64; ++i)
o[s >> 2] |= t[i] << SHIFT[s++ & 3];
else
for (s = this.start; i < n && s < 64; ++i)
r = t.charCodeAt(i), r < 128 ? o[s >> 2] |= r << SHIFT[s++ & 3] : r < 2048 ? (o[s >> 2] |= (192 | r >> 6) << SHIFT[s++ & 3], o[s >> 2] |= (128 | r & 63) << SHIFT[s++ & 3]) : r < 55296 || r >= 57344 ? (o[s >> 2] |= (224 | r >> 12) << SHIFT[s++ & 3], o[s >> 2] |= (128 | r >> 6 & 63) << SHIFT[s++ & 3], o[s >> 2] |= (128 | r & 63) << SHIFT[s++ & 3]) : (r = 65536 + ((r & 1023) << 10 | t.charCodeAt(++i) & 1023), o[s >> 2] |= (240 | r >> 18) << SHIFT[s++ & 3], o[s >> 2] |= (128 | r >> 12 & 63) << SHIFT[s++ & 3], o[s >> 2] |= (128 | r >> 6 & 63) << SHIFT[s++ & 3], o[s >> 2] |= (128 | r & 63) << SHIFT[s++ & 3]);
this.lastByteIndex = s, this.bytes += s - this.start, s >= 64 ? (this.block = o[16], this.start = s - 64, this.hash(), this.hashed = true) : this.start = s;
}
return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this;
}
}, Sha1.prototype.finalize = function() {
if (!this.finalized) {
this.finalized = true;
var t = this.blocks, e = this.lastByteIndex;
t[16] = this.block, t[e >> 2] |= EXTRA[e & 3], this.block = t[16], e >= 56 && (this.hashed || this.hash(), t[0] = this.block, t[16] = t[1] = t[2] = t[3] = t[4] = t[5] = t[6] = t[7] = t[8] = t[9] = t[10] = t[11] = t[12] = t[13] = t[14] = t[15] = 0), t[14] = this.hBytes << 3 | this.bytes >>> 29, t[15] = this.bytes << 3, this.hash();
}
}, Sha1.prototype.hash = function() {
var t = this.h0, e = this.h1, r = this.h2, i = this.h3, s = this.h4, n, o, a, l = this.blocks;
for (o = 16; o < 80; ++o)
a = l[o - 3] ^ l[o - 8] ^ l[o - 14] ^ l[o - 16], l[o] = a << 1 | a >>> 31;
for (o = 0; o < 20; o += 5)
n = e & r | ~e & i, a = t << 5 | t >>> 27, s = a + n + s + 1518500249 + l[o] << 0, e = e << 30 | e >>> 2, n = t & e | ~t & r, a = s << 5 | s >>> 27, i = a + n + i + 1518500249 + l[o + 1] << 0, t = t << 30 | t >>> 2, n = s & t | ~s & e, a = i << 5 | i >>> 27, r = a + n + r + 1518500249 + l[o + 2] << 0, s = s << 30 | s >>> 2, n = i & s | ~i & t, a = r << 5 | r >>> 27, e = a + n + e + 1518500249 + l[o + 3] << 0, i = i << 30 | i >>> 2, n = r & i | ~r & s, a = e << 5 | e >>> 27, t = a + n + t + 1518500249 + l[o + 4] << 0, r = r << 30 | r >>> 2;
for (; o < 40; o += 5)
n = e ^ r ^ i, a = t << 5 | t >>> 27, s = a + n + s + 1859775393 + l[o] << 0, e = e << 30 | e >>> 2, n = t ^ e ^ r, a = s << 5 | s >>> 27, i = a + n + i + 1859775393 + l[o + 1] << 0, t = t << 30 | t >>> 2, n = s ^ t ^ e, a = i << 5 | i >>> 27, r = a + n + r + 1859775393 + l[o + 2] << 0, s = s << 30 | s >>> 2, n = i ^ s ^ t, a = r << 5 | r >>> 27, e = a + n + e + 1859775393 + l[o + 3] << 0, i = i << 30 | i >>> 2, n = r ^ i ^ s, a = e << 5 | e >>> 27, t = a + n + t + 1859775393 + l[o + 4] << 0, r = r << 30 | r >>> 2;
for (; o < 60; o += 5)
n = e & r | e & i | r & i, a = t << 5 | t >>> 27, s = a + n + s - 1894007588 + l[o] << 0, e = e << 30 | e >>> 2, n = t & e | t & r | e & r, a = s << 5 | s >>> 27, i = a + n + i - 1894007588 + l[o + 1] << 0, t = t << 30 | t >>> 2, n = s & t | s & e | t & e, a = i << 5 | i >>> 27, r = a + n + r - 1894007588 + l[o + 2] << 0, s = s << 30 | s >>> 2, n = i & s | i & t | s & t, a = r << 5 | r >>> 27, e = a + n + e - 1894007588 + l[o + 3] << 0, i = i << 30 | i >>> 2, n = r & i | r & s | i & s, a = e << 5 | e >>> 27, t = a + n + t - 1894007588 + l[o + 4] << 0, r = r << 30 | r >>> 2;
for (; o < 80; o += 5)
n = e ^ r ^ i, a = t << 5 | t >>> 27, s = a + n + s - 899497514 + l[o] << 0, e = e << 30 | e >>> 2, n = t ^ e ^ r, a = s << 5 | s >>> 27, i = a + n + i - 899497514 + l[o + 1] << 0, t = t << 30 | t >>> 2, n = s ^ t ^ e, a = i << 5 | i >>> 27, r = a + n + r - 899497514 + l[o + 2] << 0, s = s << 30 | s >>> 2, n = i ^ s ^ t, a = r << 5 | r >>> 27, e = a + n + e - 899497514 + l[o + 3] << 0, i = i << 30 | i >>> 2, n = r ^ i ^ s, a = e << 5 | e >>> 27, t = a + n + t - 899497514 + l[o + 4] << 0, r = r << 30 | r >>> 2;
this.h0 = this.h0 + t << 0, this.h1 = this.h1 + e << 0, this.h2 = this.h2 + r << 0, this.h3 = this.h3 + i << 0, this.h4 = this.h4 + s << 0;
}, Sha1.prototype.hex = function() {
this.finalize();
var t = this.h0, e = this.h1, r = this.h2, i = this.h3, s = this.h4;
return HEX_CHARS[t >> 28 & 15] + HEX_CHARS[t >> 24 & 15] + HEX_CHARS[t >> 20 & 15] + HEX_CHARS[t >> 16 & 15] + HEX_CHARS[t >> 12 & 15] + HEX_CHARS[t >> 8 & 15] + HEX_CHARS[t >> 4 & 15] + HEX_CHARS[t & 15] + HEX_CHARS[e >> 28 & 15] + HEX_CHARS[e >> 24 & 15] + HEX_CHARS[e >> 20 & 15] + HEX_CHARS[e >> 16 & 15] + HEX_CHARS[e >> 12 & 15] + HEX_CHARS[e >> 8 & 15] + HEX_CHARS[e >> 4 & 15] + HEX_CHARS[e & 15] + HEX_CHARS[r >> 28 & 15] + HEX_CHARS[r >> 24 & 15] + HEX_CHARS[r >> 20 & 15] + HEX_CHARS[r >> 16 & 15] + HEX_CHARS[r >> 12 & 15] + HEX_CHARS[r >> 8 & 15] + HEX_CHARS[r >> 4 & 15] + HEX_CHARS[r & 15] + HEX_CHARS[i >> 28 & 15] + HEX_CHARS[i >> 24 & 15] + HEX_CHARS[i >> 20 & 15] + HEX_CHARS[i >> 16 & 15] + HEX_CHARS[i >> 12 & 15] + HEX_CHARS[i >> 8 & 15] + HEX_CHARS[i >> 4 & 15] + HEX_CHARS[i & 15] + HEX_CHARS[s >> 28 & 15] + HEX_CHARS[s >> 24 & 15] + HEX_CHARS[s >> 20 & 15] + HEX_CHARS[s >> 16 & 15] + HEX_CHARS[s >> 12 & 15] + HEX_CHARS[s >> 8 & 15] + HEX_CHARS[s >> 4 & 15] + HEX_CHARS[s & 15];
}, Sha1.prototype.toString = Sha1.prototype.hex, Sha1.prototype.digest = function() {
this.finalize();
var t = this.h0, e = this.h1, r = this.h2, i = this.h3, s = this.h4;
return [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255, e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255, r >> 24 & 255, r >> 16 & 255, r >> 8 & 255, r & 255, i >> 24 & 255, i >> 16 & 255, i >> 8 & 255, i & 255, s >> 24 & 255, s >> 16 & 255, s >> 8 & 255, s & 255];
};
var alphabet = "0123456789abcdefghjkmnpqrtuvwxyz", alias = {o: 0, i: 1, l: 1, s: 5};
Sha1.prototype.b32 = function() {
for (var t = this.digest(), e = 0, r = 0, i = "", s = 0; s < t.length; ) {
var n = t[s];
if (e < 0 ? r |= n >> -e : r = n << e & 248, e > 3) {
e -= 8, s += 1;
continue;
}
e < 4 && (i += alphabet[r >> 3], e += 5);
}
return i = i + (e < 0 ? alphabet[r >> 3] : ""), i;
}, Sha1.prototype.array = Sha1.prototype.digest, Sha1.prototype.arrayBuffer = function() {
this.finalize();
var t = new ArrayBuffer(20), e = new DataView(t);
return e.setUint32(0, this.h0), e.setUint32(4, this.h1), e.setUint32(8, this.h2), e.setUint32(12, this.h3), e.setUint32(16, this.h4), t;
};
var exports = createMethod();
COMMON_JS ? module.exports = exports : (root.sha1 = exports, AMD && define(function() {
return exports;
}));
})();
});
var J2 = er((Q3) => {
Hi(Q3);
Fi(Q3, {InternalPrefixes: () => Lu, ReservedIdentifierRegex: () => $3, ReservedPrefixes: () => Du, ToImbaMap: () => Mu, ToJSMap: () => Fu, toCustomTagIdentifier: () => of, toImbaIdentifier: () => nf, toJSIdentifier: () => Pu});
var Lu = {TAG: "\u03C4", FLIP: "\u03C9", VALUE: "\u03C5", CACHE: "\u03F2", KEY: "\u03BA", ANY: "\u03C6", SYM: "\u03B5", SEP: "\u03B9", PRIVATE: "\u03A8", B: "\u03B9", T: "\u03C4", C: "\u03C1", V: "\u03C5", K: "\u03BA", D: "\u0394", H: "\u03B8", EXTEND: "\u03A9"}, Du = new Set(Object.values(Lu)), $3 = new RegExp("^[" + Array.from(Du).join("") + "]", "u"), Fu = {"-": "\u039E", "?": "\u03A6", "#": "\u03A8", "@": "\u03B1"}, tf = new RegExp("[-?#@]", "gu"), ef = function(t) {
return Fu[t];
};
function Pu(t) {
return t.replace(tf, ef);
}
var Mu = {\u039E: "-", \u03A6: "?", \u03A8: "#", \u03B1: "@"}, rf = new RegExp("[\u039E\u03A6\u03A8\u03B1]", "gu"), sf = function(t) {
return Mu[t];
};
function nf(t) {
return t.replace(rf, sf);
}
function of(t) {
return "\u0393" + Pu(t);
}
});
var lo = er((Ee) => {
function Z2(t) {
return t ? t.toArray ? t.toArray() : t : [];
}
var ge = {}, af = Cu(), lf = {reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29], black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], gray: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39]}, ao = Ee.ansi = {bold: function(t) {
return "[1m" + t + "[22m";
}, red: function(t) {
return "[31m" + t + "[39m";
}, green: function(t) {
return "[32m" + t + "[39m";
}, yellow: function(t) {
return "[33m" + t + "[39m";
}, blue: function(t) {
return "[94m" + t + "[39m";
}, gray: function(t) {
return "[90m" + t + "[39m";
}, white: function(t) {
return "[37m" + t + "[39m";
}, f: function(t, e) {
let r = lf[t];
return "[" + r[0] + "m" + e + "[" + r[1] + "m";
}};
ao.warn = ao.yellow;
ao.error = ao.red;
var Vu = J2(), cf = Vu.toImbaIdentifier, uf = Vu.toJSIdentifier, hf = "\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C4\u03C5\u03C6\u03C7\u03C8\u03C9";
Ee.brace = ge.brace = function(t) {
var e = t.match(/\n/);
return e ? "{" + t + `
}` : `{
` + t + `
}`;
};
Ee.normalizeIndentation = ge.normalizeIndentation = function(t) {
for (var e, r = /\n+([^\n\S]*)/g, i = null, s; e = r.exec(t); ) {
var n = e[1];
(i === null || 0 < (s = n.length) && s < i.length) && (i = n);
}
return i && (t = t.replace(RegExp("\\n" + i, "g"), `
`)), t;
};
Ee.flatten = ge.flatten = function(t) {
var e = [];
return t.forEach(function(r) {
return r instanceof Array ? e.push.apply(e, ge.flatten(r)) : e.push(r);
}), e;
};
Ee.clearLocationMarkers = ge.clearLocationMarkers = function(t) {
return t.replace(/\/\*\%([\w\|]*)\$\*\//g, "");
};
Ee.pascalCase = ge.pascalCase = function(t) {
return t.replace(/(^|[\-\_\s])(\w)/g, function(e, r, i) {
return i.toUpperCase();
});
};
Ee.camelCase = ge.camelCase = function(t) {
return t = String(t), t.replace(/([\-\_\s])(\w)/g, function(e, r, i) {
return i.toUpperCase();
});
};
Ee.dashToCamelCase = ge.dashToCamelCase = function(t) {
return t = String(t), t.indexOf("-") >= 0 && (t = t.replace(/([\-\s])(\w)/g, function(e, r, i) {
return i.toUpperCase();
})), t;
};
Ee.snakeCase = ge.snakeCase = function(t) {
var t = t.replace(/([\-\s])(\w)/g, "_");
return t.replace(/()([A-Z])/g, "_$1", function(e, r, i) {
return i.toUpperCase();
});
};
Ee.dasherize = ge.dasherize = function(t) {
return t.replace(/([a-z\d])([A-Z])/g, "$1-$2").toLowerCase();
};
Ee.setterSym = ge.setterSym = function(t) {
return ge.dashToCamelCase("set-" + t);
};
Ee.quote = ge.quote = function(t) {
return '"' + t + '"';
};
Ee.singlequote = ge.singlequote = function(t) {
return "'" + t + "'";
};
Ee.isValidIdentifier = ge.isValidIdentifier = function(t) {
return !/[?-\s]/.test(t) && t[0] != "#";
};
Ee.toValidIdentifier = ge.toValidIdentifier = function(t) {
return uf(t);
};
Ee.fromValidIdentifier = ge.fromValidIdentifier = function(t) {
return cf(t);
};
Ee.isSystemIdentifier = ge.isSystemIdentifier = function(t) {
return hf.indexOf(t[0]) >= 0;
};
Ee.symbolize = ge.symbolize = function(t, e) {
return t = String(t), ge.toValidIdentifier(t);
return e && e.tsc(), t;
var r = t.charAt(t.length - 1);
return r == "?" && (t = "is" + t[0].toUpperCase() + t.slice(1, -1)), t.indexOf("-") >= 0 && (t = t.replace(/([\-\s])(\w)/g, function(i, s, n) {
return n.toUpperCase();
})), t;
};
Ee.indent = ge.indent = function(t) {
return String(t).replace(/^/g, " ").replace(/\n/g, `
`).replace(/\n\t$/g, `
`);
};
Ee.bracketize = ge.bracketize = function(t, e) {
return e === void 0 && (e = true), e && (t = `
` + ge.indent(t) + `
`), "{" + t + "}";
};
Ee.parenthesize = ge.parenthesize = function(t) {
return "(" + String(t) + ")";
};
Ee.unionOfLocations = ge.unionOfLocations = function() {
for (var t = arguments, e = t.length, r = new Array(e > 0 ? e : 0); e > 0; )
r[e - 1] = t[--e];
var i = Infinity, s = -Infinity;
for (let n = 0, o = Z2(r), a = o.length, l; n < a; n++)
l = o[n], l && l._loc != null && (l = l._loc), l && l.loc instanceof Function && (l = l.loc()), l instanceof Array ? (i > l[0] && (i = l[0]), s < l[0] && (s = l[1])) : (typeof l == "number" || l instanceof Number) && (i > l && (i = l), s < l && (s = l));
return [i, s];
};
Ee.locationToLineColMap = ge.locationToLineColMap = function(t) {
for (var e = t.split(/\n/g), r = [], i, s = 0, n = 0, o = 0; i = t[s]; )
r[s] = [o, n], i == `
` ? (o++, n = 0) : n++, s++;
return r[s] = [o, n], r[s + 1] = [o, n], r;
};
Ee.markLineColForTokens = ge.markLineColForTokens = function(t, e) {
return ge;
};
Ee.parseArgs = ge.parseArgs = function(t, e) {
var r;
e === void 0 && (e = {});
var i = e.alias || (e.alias = {}), s = e.group || (e.group = []), n = e.schema || {};
n.main = {};
var o = {}, a = {};
t = t || process.argv.slice(2);
for (var l = null, p = 0, c; p < t.length; ) {
var _ = t[p];
if (p++, c = _.match(/^\-([a-zA-Z]+)(\=\S+)?$/)) {
l = null;
let b = c[1].split("");
for (let N = 0, y = Z2(b), v = y.length, d; N < v; N++) {
d = y[N];
var f = i[d] || d;
b[N] = f, o[f] = true;
}
b.length == 1 && (l = b);
continue;
} else if (c = _.match(/^\-\-([a-z0-9\-\_A-Z]+)(\=\S+)?$/)) {
var m = true;
f = c[1], f.indexOf("no-") == 0 && (f = f.substr(3), m = false), f = ge.dashToCamelCase(f), c[2] && (m = c[2].slice(1)), o[f] = m, l = f;
continue;
} else {
var g = n[l];
l && n[l] || (l = "main"), _.match(/^\d+$/) && (_ = parseInt(_)), m = o[l], m == true || m == false ? o[l] = _ : typeof m == "string" || m instanceof String || typeof m == "number" || m instanceof Number ? o[l] = [m].concat(_) : m instanceof Array ? m.push(_) : o[l] = _, g && g.multi || (l = "main");
}
}
for (let b = 0, N = Z2(s), y = N.length; b < y; b++) {
let v = ge.dashToCamelCase(N[b]);
for (let d, w = 0, k = Object.keys(o), T = k.length, S; w < T; w++)
if (S = k[w], d = o[S], S.indexOf(v) == 0) {
let C = S.substr(v.length).replace(/^\w/, function(L) {
return L.toLowerCase();
});
C ? (o[v] || (o[v] = {}), o[v][C] = d) : o[v] || (o[v] = {});
}
}
return (typeof (r = o.env) == "string" || r instanceof String) && (o["ENV_" + o.env] = true), o;
};
Ee.printExcerpt = ge.printExcerpt = function(t, e, r) {
(!r || r.constructor !== Object) && (r = {});
var i = r.hl !== void 0 ? r.hl : false, s = r.gutter !== void 0 ? r.gutter : true, n = r.type !== void 0 ? r.type : "warn", o = r.pad !== void 0 ? r.pad : 2, a = t.split(/\n/g), l = ge.locationToLineColMap(t), p = l[e[0]] || [0, 0], c = p[0], _ = p[1], f = a[c], m = Math.max(0, c - o), g = Math.min(m + o + 1 + o, a.length);
let b = c - m;
for (var N = m, y = []; N < g; )
y.push(a[N++]);
var v = y;
return s && (v = v.map(function(w, k) {
let T = "" + (m + k + 1), S;
for (; T.length < String(g).length; )
T = " " + T;
return k == b ? (S = " -> " + T + " | " + w, i && (S = ao.f(i, S))) : (S = " " + T + " | " + w, i && (S = ao.f("gray", S))), S;
})), v.join(`
`);
};
Ee.printWarning = ge.printWarning = function(t, e) {
let r = e.message, i = ge.printExcerpt(t, e.loc, {hl: "whiteBright", type: "warn", pad: 1});
return r + `
` + i;
};
Ee.identifierForPath = ge.identifierForPath = function(t) {
var e = af.create();
e.update(t);
var r = e.b32().replace(/^\d+/, "");
return r.slice(0, 6);
};
});
var v1 = er((Si) => {
function pf(t) {
return t ? t.toArray ? t.toArray() : t : [];
}
var Q2 = Si.BALANCED_PAIRS = [["(", ")"], ["[", "]"], ["{", "}"], ["{{", "}}"], ["INDENT", "OUTDENT"], ["CALL_START", "CALL_END"], ["PARAM_START", "PARAM_END"], ["INDEX_START", "INDEX_END"], ["TAG_START", "TAG_END"], ["STYLE_START", "STYLE_END"], ["BLOCK_PARAM_START", "BLOCK_PARAM_END"]], ju = Si.INVERSES = {};
for (let t = 0, e = Q2.length, r; t < e; t++)
r = Q2[t], m1 = r[0], y1 = r[1], ju[y1] = m1, ju[m1] = y1, Q2[m1] = y1;
var m1, y1, id = Si.ALL_KEYWORDS = ["true", "false", "null", "this", "delete", "typeof", "in", "instanceof", "throw", "break", "continue", "debugger", "if", "else", "switch", "for", "while", "do", "try", "catch", "finally", "class", "extends", "super", "return", "undefined", "then", "unless", "until", "loop", "of", "by", "when", "def", "tag", "do", "elif", "begin", "var", "let", "self", "await", "import", "and", "or", "is", "isnt", "not", "yes", "no", "isa", "case", "nil", "require"], sd = Si.TOK = {TERMINATOR: "TERMINATOR", INDENT: "INDENT", OUTDENT: "OUTDENT", DEF_BODY: "DEF_BODY", THEN: "THEN", CATCH: "CATCH"}, nd = Si.OPERATOR_ALIASES = {and: "&&", or: "||", is: "==", isnt: "!=", isa: "instanceof"}, od = Si.HEREGEX_OMIT = /\s+(?:#.*)?/g, ad = Si.HEREGEX = /^\/{3}([\s\S]+?)\/{3}([a-z]{0,8})(?!\w)/, ld = Si.TAG_GLOBAL_ATTRIBUTES = {itemid: 1, itemprop: 1, itemref: 1, itemscope: 1, itemtype: 1, enterkeyhint: 1, autofocus: 1, autocapitalize: 1, autocomplete: 1, accesskey: 1, inputmode: 1, spellcheck: 1, translate: 1, is: 1}, cd = Si.SYSVAR_PREFIX = {TAG: "\u03C4", FLIP: "\u03C9", VALUE: "\u03C5", CACHE: "\u03C1", KEY: "\u03BA", ANY: "\u03C6", B: "\u0398", T: "\u03C4", C: "\u03C1", V: "\u03C5", K: "\u03BA", D: "\u0394"}, g1 = Si.TAG_TYPES = {"": [-1, {id: 1, className: "class", slot: 1, part: 1, elementTiming: "elementtiming"}], HTML: [-1, {title: 1, lang: 1, translate: 1, dir: 1, accessKey: "accesskey", draggable: 1, spellcheck: 1, autocapitalize: 1, inputMode: "inputmode", style: 1, tabIndex: "tabindex", enterKeyHint: "enterkeyhint"}], HTMLAnchor: [1, {target: 1, download: 1, ping: 1, rel: 1, relList: "rel", hreflang: 1, type: 1, referrerPolicy: "referrerpolicy", coords: 1, charset: 1, name: 1, rev: 1, shape: 1, href: 1}], HTMLArea: [1, {alt: 1, coords: 1, download: 1, shape: 1, target: 1, ping: 1, rel: 1, relList: "rel", referrerPolicy: "referrerpolicy", href: 1}], HTMLMedia: [1, {src: 1, crossOrigin: "crossorigin", preload: 1, controlsList: "controlslist"}], HTMLAudio: [4, {}], HTMLBase: [1, {href: 1, target: 1}], HTMLQuote: [1, {cite: 1}], HTMLBody: [1, {text: 1, link: 1, vLink: "vlink", aLink: "alink", bgColor: "bgcolor", background: 1}], HTMLBR: [1, {clear: 1}], HTMLButton: [1, {formAction: "formaction", formEnctype: "formenctype", formMethod: "formmethod", formTarget: "formtarget", name: 1, type: 1, value: 1}], HTMLCanvas: [1, {width: 1, height: 1}], HTMLTableCaption: [1, {align: 1}], HTMLTableCol: [1, {span: 1, align: 1, ch: "char", chOff: "charoff", vAlign: "valign", width: 1}], HTMLData: [1, {value: 1}], HTMLDataList: [1, {}], HTMLMod: [1, {cite: 1, dateTime: "datetime"}], HTMLDetails: [1, {}], HTMLDialog: [1, {}], HTMLDiv: [1, {align: 1}], HTMLDList: [1, {}], HTMLEmbed: [1, {src: 1, type: 1, width: 1, height: 1, align: 1, name: 1}], HTMLFieldSet: [1, {name: 1}], HTMLForm: [1, {acceptCharset: "accept-charset", action: 1, autocomplete: 1, enctype: 1, encoding: "enctype", method: 1, name: 1, target: 1}], HTMLHeading: [1, {align: 1}], HTMLHead: [1, {}], HTMLHR: [1, {align: 1, color: 1, size: 1, width: 1}], HTMLHtml: [1, {version: 1}], HTMLIFrame: [1, {src: 1, srcdoc: 1, name: 1, sandbox: 1, width: 1, height: 1, referrerPolicy: "referrerpolicy", csp: 1, allow: 1, align: 1, scrolling: 1, frameBorder: "frameborder", longDesc: "longdesc", marginHeight: "marginheight", marginWidth: "marginwidth", loading: 1}], HTMLImage: [1, {alt: 1, src: 1, srcset: 1, sizes: 1, crossOrigin: "crossorigin", useMap: "usemap", width: 1, height: 1, referrerPolicy: "referrerpolicy", decoding: 1, name: 1, lowsrc: 1, align: 1, hspace: 1, vspace: 1, longDesc: "longdesc", border: 1, loading: 1}], HTMLInput: [1, {accept: 1, alt: 1, autocomplete: 1, dirName: "dirname", formAction: "formaction", formEnctype: "formenctype", formMethod: "formmethod", formTarget: "formtarget", height: 1, max: 1, maxLength: "maxlength", min: 1, minLength: "minlength", name: 1, pattern: 1, placeholder: 1, src: 1, step: 1, type: 1, defaultValue: "value", width: 1, align: 1, useMap: "usemap"}], HTMLLabel: [1, {htmlFor: "for"}], HTMLLegend: [1, {align: 1}], HTMLLI: [1, {value: 1, type: 1}], HTMLLink: [1, {href: 1, crossOrigin: "crossorigin", rel: 1, relList: "rel", media: 1, hreflang: 1, type: 1, as: 1, referrerPolicy: "referrerpolicy", sizes: 1, imageSrcset: "imagesrcset", imageSizes: "imagesizes", charset: 1, rev: 1, target: 1, integrity: 1}], HTMLMap: [1, {name: 1}], HTMLMenu: [1, {}], HTMLMeta: [1, {name: 1, httpEquiv: "http-equiv", content: 1, scheme: 1}], HTMLMeter: [1, {value: 1, min: 1, max: 1, low: 1, high: 1, optimum: 1}], HTMLObject: [1, {data: 1, type: 1, name: 1, useMap: "usemap", width: 1, height: 1, align: 1, archive: 1, code: 1, hspace: 1, standby: 1, vspace: 1, codeBase: "codebase", codeType: "codetype", border: 1}], HTMLOList: [1, {start: 1, type: 1}], HTMLOptGroup: [1, {label: 1}], HTMLOption: [1, {label: 1, value: 1}], HTMLOutput: [1, {htmlFor: "for", name: 1}], HTMLParagraph: [1, {align: 1}], HTMLParam: [1, {name: 1, value: 1, type: 1, valueType: "valuetype"}], HTMLPicture: [1, {}], HTMLPre: [1, {width: 1}], HTMLProgress: [1, {value: 1, max: 1}], HTMLScript: [1, {src: 1, type: 1, charset: 1, crossOrigin: "crossorigin", referrerPolicy: "referrerpolicy", event: 1, htmlFor: "for", integrity: 1}], HTMLSelect: [1, {autocomplete: 1, name: 1, size: 1}], HTMLSlot: [1, {name: 1}], HTMLSource: [1, {src: 1, type: 1, srcset: 1, sizes: 1, media: 1}], HTMLSpan: [1, {}], HTMLStyle: [1, {media: 1, type: 1}], HTMLTable: [1, {align: 1, border: 1, frame: 1, rules: 1, summary: 1, width: 1, bgColor: "bgcolor", cellPadding: "cellpadding", cellSpacing: "cellspacing"}], HTMLTableSection: [1, {align: 1, ch: "char", chOff: "charoff", vAlign: "valign"}], HTMLTableCell: [1, {colSpan: "colspan", rowSpan: "rowspan", headers: 1, align: 1, axis: 1, height: 1, width: 1, ch: "char", chOff: "charoff", vAlign: "valign", bgColor: "bgcolor", abbr: 1, scope: 1}], HTMLTemplate: [1, {}], HTMLTextArea: [1, {autocomplete: 1, cols: 1, dirName: "dirname", maxLength: "maxlength", minLength: "minlength", name: 1, placeholder: 1, rows: 1, wrap: 1}], HTMLTime: [1, {dateTime: "datetime"}], HTMLTitle: [1, {}], HTMLTableRow: [1, {align: 1, ch: "char", chOff: "charoff", vAlign: "valign", bgColor: "bgcolor"}], HTMLTrack: [1, {kind: 1, src: 1, srclang: 1, label: 1}], HTMLUList: [1, {type: 1}], HTMLVideo: [4, {width: 1, height: 1, poster: 1}], SVG: [-1, {}], SVGGraphics: [66, {transform: 1}], SVGA: [67, {}], SVGAnimation: [66, {}], SVGAnimate: [69, {}], SVGAnimateMotion: [69, {}], SVGAnimateTransform: [69, {}], SVGGeometry: [67, {}], SVGCircle: [73, {cx: 1, cy: 1, r: 1}], SVGClipPath: [67, {clipPathUnits: 1}], SVGDefs: [67, {}], SVGDesc: [66, {}], SVGDiscard: [66, {}], SVGEllipse: [73, {cx: 1, cy: 1, rx: 1, ry: 1}], SVGFEBlend: [66, {mode: 1, x: 1, y: 1, width: 1, height: 1}], SVGFEColorMatrix: [66, {type: 1, values: 1, x: 1, y: 1, width: 1, height: 1}], SVGFEComponentTransfer: [66, {x: 1, y: 1, width: 1, height: 1}], SVGFEComposite: [66, {operator: 1, x: 1, y: 1, width: 1, height: 1}], SVGFEConvolveMatrix: [66, {orderX: 1, orderY: 1, kernelMatrix: 1, divisor: 1, edgeMode: 1, x: 1, y: 1, width: 1, height: 1}], SVGFEDiffuseLighting: [66, {surfaceScale: 1, diffuseConstant: 1, x: 1, y: 1, width: 1, height: 1}], SVGFEDisplacementMap: [66, {xChannelSelector: 1, yChannelSelector: 1, x: 1, y: 1, width: 1, height: 1}], SVGFEDistantLight: [66, {}], SVGFEDropShadow: [66, {dx: 1, dy: 1, stdDeviationX: 1, stdDeviationY: 1, x: 1, y: 1, width: 1, height: 1}], SVGFEFlood: [66, {x: 1, y: 1, width: 1, height: 1}], SVGComponentTransferFunction: [66, {type: 1, tableValues: 1, slope: 1, amplitude: 1, exponent: 1}], SVGFEFuncA: [90, {}], SVGFEFuncB: [90, {}], SVGFEFuncG: [90, {}], SVGFEFuncR: [90, {}], SVGFEGaussianBlur: [66, {x: 1, y: 1, width: 1, height: 1}], SVGFEImage: [66, {preserveAspectRatio: 1, x: 1, y: 1, width: 1, height: 1}], SVGFEMerge: [66, {x: 1, y: 1, width: 1, height: 1}], SVGFEMergeNode: [66, {}], SVGFEMorphology: [66, {operator: 1, x: 1, y: 1, width: 1, height: 1}], SVGFEOffset: [66, {x: 1, y: 1, width: 1, height: 1}], SVGFEPointLight: [66, {}], SVGFESpecularLighting: [66, {surfaceScale: 1, specularConstant: 1, specularExponent: 1, x: 1, y: 1, width: 1, height: 1}], SVGFESpotLight: [66, {specularExponent: 1}], SVGFETile: [66, {x: 1, y: 1, width: 1, height: 1}], SVGFETurbulence: [66, {numOctaves: 1, stitchTiles: 1, type: 1, x: 1, y: 1, width: 1, height: 1}], SVGFilter: [66, {filterUnits: 1, primitiveUnits: 1, x: 1, y: 1, width: 1, height: 1}], SVGForeignObject: [67, {x: 1, y: 1, width: 1, height: 1}], SVGG: [67, {}], SVGImage: [67, {x: 1, y: 1, width: 1, height: 1, preserveAspectRatio: 1}], SVGLine: [73, {x1: 1, y1: 1, x2: 1, y2: 1}], SVGGradient: [66, {gradientUnits: 1, gradientTransform: 1, spreadMethod: 1}], SVGLinearGradient: [111, {x1: 1, y1: 1, x2: 1, y2: 1}], SVGMarker: [66, {refX: 1, refY: 1, markerUnits: 1, markerWidth: 1, markerHeight: 1, orientType: 1, orientAngle: 1, viewBox: 1, preserveAspectRatio: 1}], SVGMask: [66, {maskUnits: 1, maskContentUnits: 1, x: 1, y: 1, width: 1, height: 1}], SVGMetadata: [66, {}], SVGMPath: [66, {}], SVGPath: [73, {}], SVGPattern: [66, {patternUnits: 1, patternContentUnits: 1, patternTransform: 1, x: 1, y: 1, width: 1, height: 1, viewBox: 1, preserveAspectRatio: 1}], SVGPolygon: [73, {}], SVGPolyline: [73, {}], SVGRadialGradient: [111, {cx: 1, cy: 1, r: 1, fx: 1, fy: 1, fr: 1}], SVGRect: [73, {x: 1, y: 1, width: 1, height: 1, rx: 1, ry: 1}], SVGScript: [66, {}], SVGSet: [69, {}], SVGStop: [66, {}], SVGStyle: [66, {}], SVGSVG: [67, {x: 1, y: 1, width: 1, height: 1, viewBox: 1, preserveAspectRatio: 1}], SVGSwitch: [67, {}], SVGSymbol: [66, {viewBox: 1, preserveAspectRatio: 1}], SVGTextContent: [67, {textLength: 1, lengthAdjust: 1}], SVGTextPositioning: [130, {x: 1, y: 1, dx: 1, dy: 1, rotate: 1}], SVGText: [131, {}], SVGTextPath: [130, {startOffset: 1, method: 1, spacing: 1}], SVGTitle: [66, {}], SVGTSpan: [131, {}], SVGUse: [67, {x: 1, y: 1, width: 1, height: 1}], SVGView: [66, {viewBox: 1, preserveAspectRatio: 1}]}, $2 = Si.TAG_NAMES = {a: 2, abbr: 1, address: 1, area: 3, article: 1, aside: 1, audio: 5, b: 1, base: 6, bdi: 1, bdo: 1, blockquote: 7, body: 8, br: 9, button: 10, canvas: 11, caption: 12, cite: 1, code: 1, col: 13, colgroup: 13, data: 14, datalist: 15, dd: 1, del: 16, details: 17, dfn: 1, dialog: 18, div: 19, dl: 20, dt: 1, em: 1, embed: 21, fieldset: 22, figcaption: 1, figure: 1, footer: 1, form: 23, h1: 24, h2: 24, h3: 24, h4: 24, h5: 24, h6: 24, head: 25, header: 1, hgroup: 1, hr: 26, html: 27, i: 1, iframe: 28, img: 29, input: 30, ins: 16, kbd: 1, label: 31, legend: 32, li: 33, link: 34, main: 1, map: 35, mark: 1, menu: 36, meta: 37, meter: 38, nav: 1, noscript: 1, object: 39, ol: 40, optgroup: 41, option: 42, output: 43, p: 44, param: 45, picture: 46, pre: 47, progress: 48, q: 7, rp: 1, rt: 1, ruby: 1, s: 1, samp: 1, script: 49, section: 1, select: 50, slot: 51, small: 1, source: 52, span: 53, strike: 1, strong: 1, style: 54, sub: 1, summary: 1, sup: 1, table: 55, tbody: 56, td: 57, template: 58, textarea: 59, tfoot: 56, th: 57, thead: 56, time: 60, title: 61, tr: 62, track: 63, u: 1, ul: 64, var: 1, video: 65, wbr: 1, svg_a: 68, svg_animate: 70, svg_animateMotion: 71, svg_animateTransform: 72, svg_audio: 66, svg_canvas: 66, svg_circle: 74, svg_clipPath: 75, svg_defs: 76, svg_desc: 77, svg_discard: 78, svg_ellipse: 79, svg_feBlend: 80, svg_feColorMatrix: 81, svg_feComponentTransfer: 82, svg_feComposite: 83, svg_feConvolveMatrix: 84, svg_feDiffuseLighting: 85, svg_feDisplacementMap: 86, svg_feDistantLight: 87, svg_feDropShadow: 88, svg_feFlood: 89, svg_feFuncA: 91, svg_feFuncB: 92, svg_feFuncG: 93, svg_feFuncR: 94, svg_feGaussianBlur: 95, svg_feImage: 96, svg_feMerge: 97, svg_feMergeNode: 98, svg_feMorphology: 99, svg_feOffset: 100, svg_fePointLight: 101, svg_feSpecularLighting: 102, svg_feSpotLight: 103, svg_feTile: 104, svg_feTurbulence: 105, svg_filter: 106, svg_foreignObject: 107, svg_g: 108, svg_iframe: 66, svg_image: 109, svg_line: 110, svg_linearGradient: 112, svg_marker: 113, svg_mask: 114, svg_metadata: 115, svg_mpath: 116, svg_path: 117, svg_pattern: 118, svg_polygon: 119, svg_polyline: 120, svg_radialGradient: 121, svg_rect: 122, svg_script: 123, svg_set: 124, svg_stop: 125, svg_style: 126, svg_svg: 127, svg_switch: 128, svg_symbol: 129, svg_text: 132, svg_textPath: 133, svg_title: 134, svg_tspan: 135, svg_unknown: 66, svg_use: 136, svg_video: 66, svg_view: 137}, tl = Object.keys(g1);
for (let t = 0, e = pf(tl), r = e.length, i; t < r; t++) {
i = e[t];
let s = g1[i];
s.up = g1[tl[s[0]]], s.name = i + "Element";
}
for (let t, e = 0, r = Object.keys($2), i = r.length, s; e < i; e++)
s = r[e], t = $2[s], $2[s] = g1[tl[t]];
});
var N1 = er((Rf) => {
Hi(Rf);
Fi(Rf, {basename: () => qh, default: () => Cf, delimiter: () => Yh, dirname: () => Kh, extname: () => Xh, isAbsolute: () => wl, join: () => Hh, normalize: () => Sl, relative: () => zh, resolve: () => R1, sep: () => Uh});
function Bh(t, e) {
for (var r = 0, i = t.length - 1; i >= 0; i--) {
var s = t[i];
s === "." ? t.splice(i, 1) : s === ".." ? (t.splice(i, 1), r++) : r && (t.splice(i, 1), r--);
}
if (e)
for (; r--; r)
t.unshift("..");
return t;
}
var Nf = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/, kl = function(t) {
return Nf.exec(t).slice(1);
};
function R1() {
for (var t = "", e = false, r = arguments.length - 1; r >= -1 && !e; r--) {
var i = r >= 0 ? arguments[r] : "/";
if (typeof i != "string")
throw new TypeError("Arguments to path.resolve must be strings");
if (!i)
continue;
t = i + "/" + t, e = i.charAt(0) === "/";
}
return t = Bh(xl(t.split("/"), function(s) {
return !!s;
}), !e).join("/"), (e ? "/" : "") + t || ".";
}
function Sl(t) {
var e = wl(t), r = Of(t, -1) === "/";
return t = Bh(xl(t.split("/"), function(i) {
return !!i;
}), !e).join("/"), !t && !e && (t = "."), t && r && (t += "/"), (e ? "/" : "") + t;
}
function wl(t) {
return t.charAt(0) === "/";
}
function Hh() {
var t = Array.prototype.slice.call(arguments, 0);
return Sl(xl(t, function(e, r) {
if (typeof e != "string")
throw new TypeError("Arguments to path.join must be strings");
return e;
}).join("/"));
}
function zh(t, e) {
t = R1(t).substr(1), e = R1(e).substr(1);
function r(p) {
for (var c = 0; c < p.length && p[c] === ""; c++)
;
for (var _ = p.length - 1; _ >= 0 && p[_] === ""; _--)
;
return c > _ ? [] : p.slice(c, _ - c + 1);
}
for (var i = r(t.split("/")), s = r(e.split("/")), n = Math.min(i.length, s.length), o = n, a = 0; a < n; a++)
if (i[a] !== s[a]) {
o = a;
break;
}
for (var l = [], a = o; a < i.length; a++)
l.push("..");
return l = l.concat(s.slice(o)), l.join("/");
}
var Uh = "/", Yh = ":";
function Kh(t) {
var e = kl(t), r = e[0], i = e[1];
return !r && !i ? "." : (i && (i = i.substr(0, i.length - 1)), r + i);
}
function qh(t, e) {
var r = kl(t)[2];
return e && r.substr(-1 * e.length) === e && (r = r.substr(0, r.length - e.length)), r;
}
function Xh(t) {
return kl(t)[3];
}
var Cf = {extname: Xh, basename: qh, dirname: Kh, sep: Uh, delimiter: Yh, relative: zh, join: Hh, isAbsolute: wl, normalize: Sl, resolve: R1};
function xl(t, e) {
if (t.filter)
return t.filter(e);
for (var r = [], i = 0; i < t.length; i++)
e(t[i], i, t) && r.push(t[i]);
return r;
}
var Of = "ab".substr(-1) === "b" ? function(t, e, r) {
return t.substr(e, r);
} : function(t, e, r) {
return e < 0 && (e = t.length + e), t.substr(e, r);
};
});
var Tl = er((Lf) => {
Hi(Lf);
Fi(Lf, {SourceMapper: () => Wh});
var Wh = class {
static strip(e) {
return e.replace(/\/\*\%([\w\|]*)\$\*\//g, "");
}
static run(e, r = {}) {
return {code: e.replace(/\/\*\%([\w\|]*)\$\*\//g, ""), map: null, toString: function() {
return this.code;
}};
}
};
});
var O1 = er((Df) => {
Hi(Df);
Fi(Df, {Compilation: () => Is, CompilationResult: () => $h});
var Jh = N1(), El = Tl(), Zh = Symbol.for("#__init__"), f4 = Symbol.for("#__initor__"), _4 = Symbol.for("#__inited__"), Qh = Symbol.for("#doc"), Al = {TOKENIZE: 1, REWRITE: 2, PARSE: 4, TRAVERSE: 8, COMPILE: 16}, d4 = new WeakMap(), $h = class {
}, Is = class {
static [Zh]() {
return this.current = void 0, this;
}
static error(e) {
var r, i;
return (i = (r = this.current) == null ? void 0 : r.addDiagnostic) == null ? void 0 : i.call(r, "error", e);
}
static warn(e) {
var r, i;
return (i = (r = this.current) == null ? void 0 : r.addDiagnostic) == null ? void 0 : i.call(r, "warning", e);
}
static info(e) {
var r, i;
return (i = (r = this.current) == null ? void 0 : r.addDiagnostic) == null ? void 0 : i.call(r, "info", e);
}
static deserialize(e, r = {}) {
return new Is("", r).deserialize(e);
}
constructor(e, r) {
this.sourceCode = e, this.sourcePath = r.sourcePath, this.options = r, this.flags = 0, this.js = "", this.css = "", this.result = {}, this.diagnostics = [], this.tokens = null, this.ast = null;
}
deserialize(e) {
let r;
try {
r = JSON.parse(e);
} catch (i) {
throw console.log("failed", e, this.options), i;
}
return this.rawResult = r, this.deserialized = r, this;
}
serialize() {
if (this.rawResult)
return JSON.stringify(this.rawResult, null, 2);
}
tokenize() {
var e;
if ((this.flags & (e = Al.TOKENIZE)) == 0 ? (this.flags |= e, true) : false)
try {
Is.current = this, this.lexer.reset(), this.tokens = this.lexer.tokenize(this.sourceCode, this.options, this), this.tokens = this.rewriter.rewrite(this.tokens, this.options, this);
} catch (r) {
}
return this.tokens;
}
parse() {
var e;
if (this.tokenize(), ((this.flags & (e = Al.PARSE)) == 0 ? (this.flags |= e, true) : false) && !this.errored\u03A6) {
Is.current = this;
try {
this.ast = this.parser.parse(this.tokens, this);
} catch (r) {
}
}
return this;
}
compile() {
var e;
return this.parse(), ((this.flags & (e = Al.COMPILE)) == 0 ? (this.flags |= e, true) : false) && (this.errored\u03A6 || (Is.current = this, this.result = this.ast.compile(this.options, this)), this.options.raiseErrors && this.raiseErrors()), this;
}
recompile(e = {}) {
if (this.deserialized) {
let r = this.deserialized.js, i = {};
return i.js = El.SourceMapper.run(r, e), i.css = El.SourceMapper.run(this.deserialized.css || "", e), e.styles == "import" && i.css.code && (i.js.code += `
import './` + Jh.default.basename(this.sourcePath) + ".css'"), i;
}
return {js: this.js};
}
addDiagnostic(e, r) {
r.severity || (r.severity = e);
let i = new el(r, this);
return this.diagnostics.push(i), i;
}
get errored\u03A6() {
return this.errors.length > 0;
}
get errors() {
return this.diagnostics.filter(function(e) {
return e.severity == ea.Error;
});
}
get warnings() {
return this.diagnostics.filter(function(e) {
return e.severity == ea.Warning;
});
}
get info() {
return this.diagnostics.filter(function(e) {
return e.severity == ea.Information;
});
}
get doc() {
return this[Qh] || (this[Qh] = new vn(null, "imba", 0, this.sourceCode));
}
positionAt(e) {
return this.doc.positionAt(e);
}
offsetAt(e) {
return this.doc.offsetAt(e);
}
rangeAt(e, r) {
return this.doc.rangeAt(e, r);
}
toString() {
return this.js;
}
raiseErrors() {
if (this.errors.length)
throw this.errors[0].toError();
return this;
}
};
Is[Zh]();
});
var C1 = er((Il) => {
function tp(t, e) {
for (var r in e)
e.hasOwnProperty(r) && (t[r] = e[r]);
t.prototype = Object.create(e.prototype), t.__super__ = t.prototype.__super__ = e.prototype, t.prototype.initialize = t.prototype.constructor = t;
}
var Rl = lo(), ep = new WeakMap();
function Sr(t, e) {
var r;
this.error = t, this._options = e || {}, this.severity = this._options.severity || "error";
let i = t.message;
(r = i.match(/Unexpected '([\w\-]+)'/)) && r[1] == "TERMINATOR" && (i = "Unexpected newline"), this.message = i, this.sourcePath = t.sourcePath, this.line = t.line;
}
tp(Sr, Error);
Il.ImbaParseError = Sr;
Sr.wrap = function(t) {
return new this(t);
};
Object.defineProperty(Sr.prototype, "_options", {get: function() {
return ep.get(this);
}, configurable: true});
Object.defineProperty(Sr.prototype, "_options", {set: function(t) {
return ep.set(this, t);
}, configurable: true});
Sr.prototype.set = function(t) {
this._options || (this._options = {});
for (let e, r = 0, i = Object.keys(t), s = i.length, n; r < s; r++)
n = i[r], e = t[n], this._options[n] = e;
return this;
};
Sr.prototype.start = function() {
for (var t = this._options, e = t.pos - 1, r = t.tokens && t.tokens[e]; r && (r._loc == -1 || r._loc == 0 || r._len == 0); )
r = t.tokens[--e];
return r;
};
Object.defineProperty(Sr.prototype, "token", {get: function() {
if (this._token)
return this._token;
for (var t = this._options, e = t.pos - 1, r = t.tokens && t.tokens[e]; r && (r._loc == -1 || r._loc == 0 || r._len == 0); )
r = t.tokens[--e];
return this._token = r;
}, configurable: true});
Sr.prototype.desc = function() {
var t = this._options;
let e = this.message;
return t.token && t.token._loc == -1 ? "Syntax Error" : e;
};
Sr.prototype.loc = function() {
var t;
return this._loc || (t = this.start()) && t.region && t.region();
};
Sr.prototype.toJSON = function() {
var t = this._options, e = this.start();
return {warn: true, message: this.desc(), loc: this.loc()};
};
Sr.prototype.toNativeError = function() {
let t = new SyntaxError("hello");
return t.fileName = this._sourcePath, t.message = this.message, t.stack = this.excerpt({colors: false, details: true}), t.lineNumber = this.lineNumber, t.columnNumber = this.columnNumber, t;
};
Sr.prototype.excerpt = function(t) {
(!t || t.constructor !== Object) && (t = {});
var e = t.gutter !== void 0 ? t.gutter : true, r = t.colors !== void 0 ? t.colors : false, i = t.details !== void 0 ? t.details : true;
try {
var s = this._code, n = this.loc(), o = s.split(/\n/g), a = Rl.locationToLineColMap(s), l = a[n[0]] || [0, 0], p = l[0], c = l[1], _ = o[p];
this.lineNumber = p + 1, this.columnNumber = c;
var f = Math.max(0, p - 2), m = Math.min(f + 5, o.length);
let v = p - f;
var g = f, b = function(d) {
return d;
};
if (r) {
let d = this.severity == "warn" ? "yellow" : "red";
(typeof r == "string" || r instanceof String) && (d = r), b = function(w) {
return Rl.ansi[d](Rl.ansi.bold(w));
};
}
for (var N = []; g < m; )
N.push(_ = o[g++]);
var y = N;
return e && (y = y.map(function(d, w) {
let k = "" + (f + w + 1);
for (; k.length < String(m).length; )
k = " " + k;
return w == v ? " -> " + k + " | " + d : " " + k + " | " + d;
})), y[v] = b(y[v]), i && y.unshift(b(this.message)), y.join(`
`) + `
`;
} catch (v) {
return "";
}
};
Sr.prototype.prettyMessage = function() {
var t;
return t = this.excerpt();
};
function ha() {
return Sr.apply(this, arguments);
}
tp(ha, Sr);
Il.ImbaTraverseError = ha;
ha.prototype.loc = function() {
return this._loc;
};
ha.prototype.excerpt = function() {
var t = ha.prototype.__super__.excerpt.apply(this, arguments);
return t + `
---
` + this.error.stack;
};
});
var pp = er((L1) => {
function Ff(t) {
return t && (t.len instanceof Function ? t.len() : t.length) || 0;
}
function gr(t, e) {
return e && e.indexOf ? e.indexOf(t) : [].indexOf.call(t, e);
}
function bn(t) {
return t ? t.toArray ? t.toArray() : t : [];
}
function Pf(t, e) {
for (var r in e)
e.hasOwnProperty(r) && (t[r] = e[r]);
t.prototype = Object.create(e.prototype), t.__super__ = t.prototype.__super__ = e.prototype, t.prototype.initialize = t.prototype.constructor = t;
}
var _o = ta(), kn = _o.Token, Nl = v1().INVERSES, g4 = O1().Compilation, v4 = C1(), Mf = lo(), Vf = ["true", "false", "null", "this", "delete", "typeof", "in", "instanceof", "throw", "break", "continue", "debugger", "if", "else", "switch", "for", "while", "do", "try", "catch", "finally", "class", "extends", "super", "return"], rp = {",": 1, "\n": 1, ")": 1, "]": 1, "}": 1, ">": 1, " ": 1}, jf = ["extend", "local", "global", "prop", "lazy"], Gf = L1.ALL_KEYWORDS = ["true", "false", "null", "this", "delete", "typeof", "in", "instanceof", "throw", "break", "continue", "debugger", "if", "else", "sw