preval
Version:
Wannabe compiler tool for JS
1,325 lines (1,168 loc) • 959 kB
JavaScript
var prettier = function (global, window) {
function Se(Qh, $h) {
return $h = {exports: {}}, Qh($h, $h.exports), $h.exports
}
function Te() {
$l = !0;
var Qh = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
for (var $h = 0, Sg = Qh.length; $h < Sg; ++$h) Zl[$h] = Qh[$h], Kl[Qh.charCodeAt($h)] = $h;
Kl['-'.charCodeAt(0)] = 62, Kl['_'.charCodeAt(0)] = 63
}
function _e(Qh) {
$l || Te();
var Lg = Qh.length, $h, Sg, Tg, _g, Pg, Ng;
if (0 < Lg % 4) throw new Error('Invalid string. Length must be a multiple of 4');
Pg = '=' === Qh[Lg - 2] ? 2 : '=' === Qh[Lg - 1] ? 1 : 0, Ng = new Ql(3 * Lg / 4 - Pg), Tg = 0 < Pg ? Lg - 4 : Lg;
var Ig = 0;
for ($h = 0, Sg = 0; $h < Tg; $h += 4, Sg += 3) _g = Kl[Qh.charCodeAt($h)] << 18 | Kl[Qh.charCodeAt($h + 1)] << 12 | Kl[Qh.charCodeAt($h + 2)] << 6 | Kl[Qh.charCodeAt($h + 3)], Ng[Ig++] = 255 & _g >> 16, Ng[Ig++] = 255 & _g >> 8, Ng[Ig++] = 255 & _g;
return 2 === Pg ? (_g = Kl[Qh.charCodeAt($h)] << 2 | Kl[Qh.charCodeAt($h + 1)] >> 4, Ng[Ig++] = 255 & _g) : 1 == Pg && (_g = Kl[Qh.charCodeAt($h)] << 10 | Kl[Qh.charCodeAt($h + 1)] << 4 | Kl[Qh.charCodeAt($h + 2)] >> 2, Ng[Ig++] = 255 & _g >> 8, Ng[Ig++] = 255 & _g), Ng
}
function Pe(Qh) {
return Zl[63 & Qh >> 18] + Zl[63 & Qh >> 12] + Zl[63 & Qh >> 6] + Zl[63 & Qh]
}
function Ne(Qh, $h, Sg) {
var Tg, _g = [];
for (var Pg = $h; Pg < Sg; Pg += 3) Tg = (Qh[Pg] << 16) + (Qh[Pg + 1] << 8) + Qh[Pg + 2], _g.push(Pe(Tg));
return _g.join('')
}
function Le(Qh) {
$l || Te();
var Sg = Qh.length, Tg = Sg % 3, _g = '', Pg = [], Ng = 16383, $h;
for (var Lg = 0, Ig = Sg - Tg; Lg < Ig; Lg += Ng) Pg.push(Ne(Qh, Lg, Lg + Ng > Ig ? Ig : Lg + Ng));
return 1 == Tg ? ($h = Qh[Sg - 1], _g += Zl[$h >> 2], _g += Zl[63 & $h << 4], _g += '==') : 2 == Tg && ($h = (Qh[Sg - 2] << 8) + Qh[Sg - 1], _g += Zl[$h >> 10], _g += Zl[63 & $h >> 4], _g += Zl[63 & $h << 2], _g += '='), Pg.push(_g), Pg.join('')
}
function Re(Qh, $h, Sg, Tg, _g) {
var Pg, Ng, Lg = 8 * _g - Tg - 1, Ig = (1 << Lg) - 1, Rg = Ig >> 1, Mg = -7, Og = Sg ? _g - 1 : 0, Yg = Sg ? -1 : 1,
Vg = Qh[$h + Og];
for (Og += Yg, Pg = Vg & (1 << -Mg) - 1, Vg >>= -Mg, Mg += Lg; 0 < Mg; Pg = 256 * Pg + Qh[$h + Og], Og += Yg, Mg -= 8) ;
for (Ng = Pg & (1 << -Mg) - 1, Pg >>= -Mg, Mg += Tg; 0 < Mg; Ng = 256 * Ng + Qh[$h + Og], Og += Yg, Mg -= 8) ;
if (0 === Pg) Pg = 1 - Rg; else {
if (Pg === Ig) return Ng ? NaN : (Vg ? -1 : 1) * Infinity;
Ng += Math.pow(2, Tg), Pg -= Rg
}
return (Vg ? -1 : 1) * Ng * Math.pow(2, Pg - Tg)
}
function Me(Qh, $h, Sg, Tg, _g, Pg) {
var Ng, Lg, Ig, Rg = 8 * Pg - _g - 1, Mg = (1 << Rg) - 1, Og = Mg >> 1,
Yg = 23 === _g ? Math.pow(2, -24) - Math.pow(2, -77) : 0, Vg = Tg ? 0 : Pg - 1, Ug = Tg ? 1 : -1,
Xg = 0 > $h || 0 === $h && 0 > 1 / $h ? 1 : 0;
for ($h = Math.abs($h), isNaN($h) || $h === Infinity ? (Lg = isNaN($h) ? 1 : 0, Ng = Mg) : (Ng = Math.floor(Math.log($h) / Math.LN2), 1 > $h * (Ig = Math.pow(2, -Ng)) && (Ng--, Ig *= 2), $h += 1 <= Ng + Og ? Yg / Ig : Yg * Math.pow(2, 1 - Og), 2 <= $h * Ig && (Ng++, Ig /= 2), Ng + Og >= Mg ? (Lg = 0, Ng = Mg) : 1 <= Ng + Og ? (Lg = ($h * Ig - 1) * Math.pow(2, _g), Ng += Og) : (Lg = $h * Math.pow(2, Og - 1) * Math.pow(2, _g), Ng = 0)); 8 <= _g; Qh[Sg + Vg] = 255 & Lg, Vg += Ug, Lg /= 256, _g -= 8) ;
for (Ng = Ng << _g | Lg, Rg += _g; 0 < Rg; Qh[Sg + Vg] = 255 & Ng, Vg += Ug, Ng /= 256, Rg -= 8) ;
Qh[Sg + Vg - Ug] |= 128 * Xg
}
function Oe() {
return Ve.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
}
function Ye(Qh, $h) {
if (Oe() < $h) throw new RangeError('Invalid typed array length');
return Ve.TYPED_ARRAY_SUPPORT ? (Qh = new Uint8Array($h), Qh.__proto__ = Ve.prototype) : (null === Qh && (Qh = new Ve($h)), Qh.length = $h), Qh
}
function Ve(Qh, $h, Sg) {
if (!Ve.TYPED_ARRAY_SUPPORT && !(this instanceof Ve)) return new Ve(Qh, $h, Sg);
if ('number' == typeof Qh) {
if ('string' == typeof $h) throw new Error('If encoding is specified then the first argument must be a string');
return Je(this, Qh)
}
return Ue(this, Qh, $h, Sg)
}
function Ue(Qh, $h, Sg, Tg) {
if ('number' == typeof $h) throw new TypeError('"value" argument must not be a number');
return 'undefined' != typeof ArrayBuffer && $h instanceof ArrayBuffer ? Qe(Qh, $h, Sg, Tg) : 'string' == typeof $h ? Ze(Qh, $h, Sg) : $e(Qh, $h)
}
function Xe(Qh) {
if ('number' != typeof Qh) throw new TypeError('"size" argument must be a number'); else if (0 > Qh) throw new RangeError('"size" argument must not be negative')
}
function We(Qh, $h, Sg, Tg) {
return Xe($h), 0 >= $h ? Ye(Qh, $h) : void 0 === Sg ? Ye(Qh, $h) : 'string' == typeof Tg ? Ye(Qh, $h).fill(Sg, Tg) : Ye(Qh, $h).fill(Sg)
}
function Je(Qh, $h) {
if (Xe($h), Qh = Ye(Qh, 0 > $h ? 0 : 0 | St($h)), !Ve.TYPED_ARRAY_SUPPORT) for (var Sg = 0; Sg < $h; ++Sg) Qh[Sg] = 0;
return Qh
}
function Ze(Qh, $h, Sg) {
if (('string' != typeof Sg || '' === Sg) && (Sg = 'utf8'), !Ve.isEncoding(Sg)) throw new TypeError('"encoding" must be a valid string encoding');
var Tg = 0 | _t($h, Sg);
Qh = Ye(Qh, Tg);
var _g = Qh.write($h, Sg);
return _g !== Tg && (Qh = Qh.slice(0, _g)), Qh
}
function Ke(Qh, $h) {
var Sg = 0 > $h.length ? 0 : 0 | St($h.length);
Qh = Ye(Qh, Sg);
for (var Tg = 0; Tg < Sg; Tg += 1) Qh[Tg] = 255 & $h[Tg];
return Qh
}
function Qe(Qh, $h, Sg, Tg) {
if ($h.byteLength, 0 > Sg || $h.byteLength < Sg) throw new RangeError('\'offset\' is out of bounds');
if ($h.byteLength < Sg + (Tg || 0)) throw new RangeError('\'length\' is out of bounds');
return $h = void 0 === Sg && void 0 === Tg ? new Uint8Array($h) : void 0 === Tg ? new Uint8Array($h, Sg) : new Uint8Array($h, Sg, Tg), Ve.TYPED_ARRAY_SUPPORT ? (Qh = $h, Qh.__proto__ = Ve.prototype) : Qh = Ke(Qh, $h), Qh
}
function $e(Qh, $h) {
if (Tt($h)) {
var Sg = 0 | St($h.length);
return (Qh = Ye(Qh, Sg), 0 === Qh.length) ? Qh : ($h.copy(Qh, 0, 0, Sg), Qh)
}
if ($h) {
if ('undefined' != typeof ArrayBuffer && $h.buffer instanceof ArrayBuffer || 'length' in $h) return 'number' != typeof $h.length || Za($h.length) ? Ye(Qh, 0) : Ke(Qh, $h);
if ('Buffer' === $h.type && _p($h.data)) return Ke(Qh, $h.data)
}
throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
}
function St(Qh) {
if (Qh >= Oe()) throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' + Oe().toString(16) + ' bytes');
return 0 | Qh
}
function Tt(Qh) {
return !!(null != Qh && Qh._isBuffer)
}
function _t(Qh, $h) {
if (Tt(Qh)) return Qh.length;
if ('undefined' != typeof ArrayBuffer && 'function' == typeof ArrayBuffer.isView && (ArrayBuffer.isView(Qh) || Qh instanceof ArrayBuffer)) return Qh.byteLength;
'string' != typeof Qh && (Qh = '' + Qh);
var Sg = Qh.length;
if (0 === Sg) return 0;
for (var Tg = !1; ;) switch ($h) {
case'ascii':
case'latin1':
case'binary':
return Sg;
case'utf8':
case'utf-8':
case void 0:
return Va(Qh).length;
case'ucs2':
case'ucs-2':
case'utf16le':
case'utf-16le':
return 2 * Sg;
case'hex':
return Sg >>> 1;
case'base64':
return Wa(Qh).length;
default:
if (Tg) return Va(Qh).length;
$h = ('' + $h).toLowerCase(), Tg = !0;
}
}
function Pt(Qh, $h, Sg) {
var Tg = !1;
if ((void 0 === $h || 0 > $h) && ($h = 0), $h > this.length) return '';
if ((void 0 === Sg || Sg > this.length) && (Sg = this.length), 0 >= Sg) return '';
if (Sg >>>= 0, $h >>>= 0, Sg <= $h) return '';
for (Qh || (Qh = 'utf8'); !0;) switch (Qh) {
case'hex':
return Qt(this, $h, Sg);
case'utf8':
case'utf-8':
return Wt(this, $h, Sg);
case'ascii':
return Zt(this, $h, Sg);
case'latin1':
case'binary':
return Kt(this, $h, Sg);
case'base64':
return Xt(this, $h, Sg);
case'ucs2':
case'ucs-2':
case'utf16le':
case'utf-16le':
return $t(this, $h, Sg);
default:
if (Tg) throw new TypeError('Unknown encoding: ' + Qh);
Qh = (Qh + '').toLowerCase(), Tg = !0;
}
}
function Nt(Qh, $h, Sg) {
var Tg = Qh[$h];
Qh[$h] = Qh[Sg], Qh[Sg] = Tg
}
function Lt(Qh, $h, Sg, Tg, _g) {
if (0 === Qh.length) return -1;
if ('string' == typeof Sg ? (Tg = Sg, Sg = 0) : 2147483647 < Sg ? Sg = 2147483647 : -2147483648 > Sg && (Sg = -2147483648), Sg = +Sg, isNaN(Sg) && (Sg = _g ? 0 : Qh.length - 1), 0 > Sg && (Sg = Qh.length + Sg), Sg >= Qh.length) {
if (_g) return -1;
Sg = Qh.length - 1
} else if (0 > Sg) if (_g) Sg = 0; else return -1;
if ('string' == typeof $h && ($h = Ve.from($h, Tg)), Tt($h)) return 0 === $h.length ? -1 : It(Qh, $h, Sg, Tg, _g);
if ('number' == typeof $h) return $h &= 255, Ve.TYPED_ARRAY_SUPPORT && 'function' == typeof Uint8Array.prototype.indexOf ? _g ? Uint8Array.prototype.indexOf.call(Qh, $h, Sg) : Uint8Array.prototype.lastIndexOf.call(Qh, $h, Sg) : It(Qh, [$h], Sg, Tg, _g);
throw new TypeError('val must be string, number or Buffer')
}
function It(Qh, $h, Sg, Tg, _g) {
function Pg(Vg, Ug) {
return 1 === Ng ? Vg[Ug] : Vg.readUInt16BE(Ug * Ng)
}
var Ng = 1, Lg = Qh.length, Ig = $h.length;
if (void 0 !== Tg && (Tg = (Tg + '').toLowerCase(), 'ucs2' === Tg || 'ucs-2' === Tg || 'utf16le' === Tg || 'utf-16le' === Tg)) {
if (2 > Qh.length || 2 > $h.length) return -1;
Ng = 2, Lg /= 2, Ig /= 2, Sg /= 2
}
var Rg;
if (_g) {
var Mg = -1;
for (Rg = Sg; Rg < Lg; Rg++) if (Pg(Qh, Rg) !== Pg($h, -1 == Mg ? 0 : Rg - Mg)) -1 != Mg && (Rg -= Mg), Mg = -1; else if (-1 == Mg && (Mg = Rg), Rg - Mg + 1 === Ig) return Mg * Ng
} else for (Sg + Ig > Lg && (Sg = Lg - Ig), Rg = Sg; 0 <= Rg; Rg--) {
var Og = !0;
for (var Yg = 0; Yg < Ig; Yg++) if (Pg(Qh, Rg + Yg) !== Pg($h, Yg)) {
Og = !1;
break
}
if (Og) return Rg
}
return -1
}
function Rt(Qh, $h, Sg, Tg) {
Sg = +Sg || 0;
var _g = Qh.length - Sg;
Tg ? (Tg = +Tg, Tg > _g && (Tg = _g)) : Tg = _g;
var Pg = $h.length;
if (0 != Pg % 2) throw new TypeError('Invalid hex string');
Tg > Pg / 2 && (Tg = Pg / 2);
for (var Ng = 0; Ng < Tg; ++Ng) {
var Lg = parseInt($h.substr(2 * Ng, 2), 16);
if (isNaN(Lg)) return Ng;
Qh[Sg + Ng] = Lg
}
return Ng
}
function Mt(Qh, $h, Sg, Tg) {
return Ja(Va($h, Qh.length - Sg), Qh, Sg, Tg)
}
function Ot(Qh, $h, Sg, Tg) {
return Ja(Ua($h), Qh, Sg, Tg)
}
function Yt(Qh, $h, Sg, Tg) {
return Ot(Qh, $h, Sg, Tg)
}
function Vt(Qh, $h, Sg, Tg) {
return Ja(Wa($h), Qh, Sg, Tg)
}
function Ut(Qh, $h, Sg, Tg) {
return Ja(Xa($h, Qh.length - Sg), Qh, Sg, Tg)
}
function Xt(Qh, $h, Sg) {
return 0 === $h && Sg === Qh.length ? Le(Qh) : Le(Qh.slice($h, Sg))
}
function Wt(Qh, $h, Sg) {
Sg = Math.min(Qh.length, Sg);
for (var Tg = [], _g = $h; _g < Sg;) {
var Pg = Qh[_g], Ng = null, Lg = 239 < Pg ? 4 : 223 < Pg ? 3 : 191 < Pg ? 2 : 1;
if (_g + Lg <= Sg) {
var Ig, Rg, Mg, Og;
1 == Lg ? 128 > Pg && (Ng = Pg) : 2 == Lg ? (Ig = Qh[_g + 1], 128 == (192 & Ig) && (Og = (31 & Pg) << 6 | 63 & Ig, 127 < Og && (Ng = Og))) : 3 == Lg ? (Ig = Qh[_g + 1], Rg = Qh[_g + 2], 128 == (192 & Ig) && 128 == (192 & Rg) && (Og = (15 & Pg) << 12 | (63 & Ig) << 6 | 63 & Rg, 2047 < Og && (55296 > Og || 57343 < Og) && (Ng = Og))) : 4 == Lg ? (Ig = Qh[_g + 1], Rg = Qh[_g + 2], Mg = Qh[_g + 3], 128 == (192 & Ig) && 128 == (192 & Rg) && 128 == (192 & Mg) && (Og = (15 & Pg) << 18 | (63 & Ig) << 12 | (63 & Rg) << 6 | 63 & Mg, 65535 < Og && 1114112 > Og && (Ng = Og))) : void 0
}
null === Ng ? (Ng = 65533, Lg = 1) : 65535 < Ng && (Ng -= 65536, Tg.push(55296 | 1023 & Ng >>> 10), Ng = 56320 | 1023 & Ng), Tg.push(Ng), _g += Lg
}
return Jt(Tg)
}
function Jt(Qh) {
var $h = Qh.length;
if ($h <= Np) return String.fromCharCode.apply(String, Qh);
for (var Sg = '', Tg = 0; Tg < $h;) Sg += String.fromCharCode.apply(String, Qh.slice(Tg, Tg += Np));
return Sg
}
function Zt(Qh, $h, Sg) {
var Tg = '';
Sg = Math.min(Qh.length, Sg);
for (var _g = $h; _g < Sg; ++_g) Tg += String.fromCharCode(127 & Qh[_g]);
return Tg
}
function Kt(Qh, $h, Sg) {
var Tg = '';
Sg = Math.min(Qh.length, Sg);
for (var _g = $h; _g < Sg; ++_g) Tg += String.fromCharCode(Qh[_g]);
return Tg
}
function Qt(Qh, $h, Sg) {
var Tg = Qh.length;
(!$h || 0 > $h) && ($h = 0), (!Sg || 0 > Sg || Sg > Tg) && (Sg = Tg);
var _g = '';
for (var Pg = $h; Pg < Sg; ++Pg) _g += Ya(Qh[Pg]);
return _g
}
function $t(Qh, $h, Sg) {
var Tg = Qh.slice($h, Sg), _g = '';
for (var Pg = 0; Pg < Tg.length; Pg += 2) _g += String.fromCharCode(Tg[Pg] + 256 * Tg[Pg + 1]);
return _g
}
function Sa(Qh, $h, Sg) {
if (0 != Qh % 1 || 0 > Qh) throw new RangeError('offset is not uint');
if (Qh + $h > Sg) throw new RangeError('Trying to access beyond buffer length')
}
function Ta(Qh, $h, Sg, Tg, _g, Pg) {
if (!Tt(Qh)) throw new TypeError('"buffer" argument must be a Buffer instance');
if ($h > _g || $h < Pg) throw new RangeError('"value" argument is out of bounds');
if (Sg + Tg > Qh.length) throw new RangeError('Index out of range')
}
function _a(Qh, $h, Sg, Tg) {
0 > $h && ($h = 65535 + $h + 1);
for (var _g = 0, Pg = Math.min(Qh.length - Sg, 2); _g < Pg; ++_g) Qh[Sg + _g] = ($h & 255 << 8 * (Tg ? _g : 1 - _g)) >>> 8 * (Tg ? _g : 1 - _g)
}
function Pa(Qh, $h, Sg, Tg) {
0 > $h && ($h = 4294967295 + $h + 1);
for (var _g = 0, Pg = Math.min(Qh.length - Sg, 4); _g < Pg; ++_g) Qh[Sg + _g] = 255 & $h >>> 8 * (Tg ? _g : 3 - _g)
}
function Na(Qh, $h, Sg, Tg) {
if (Sg + Tg > Qh.length) throw new RangeError('Index out of range');
if (0 > Sg) throw new RangeError('Index out of range')
}
function La(Qh, $h, Sg, Tg, _g) {
return _g || Na(Qh, $h, Sg, 4, 3.4028234663852886e38, -3.4028234663852886e38), Me(Qh, $h, Sg, Tg, 23, 4), Sg + 4
}
function Ra(Qh, $h, Sg, Tg, _g) {
return _g || Na(Qh, $h, Sg, 8, 1.7976931348623157e308, -1.7976931348623157e308), Me(Qh, $h, Sg, Tg, 52, 8), Sg + 8
}
function Ma(Qh) {
if (Qh = Oa(Qh).replace(Lp, ''), 2 > Qh.length) return '';
for (; 0 != Qh.length % 4;) Qh += '=';
return Qh
}
function Oa(Qh) {
return Qh.trim ? Qh.trim() : Qh.replace(/^\s+|\s+$/g, '')
}
function Ya(Qh) {
return 16 > Qh ? '0' + Qh.toString(16) : Qh.toString(16)
}
function Va(Qh, $h) {
$h = $h || Infinity;
var Sg, Tg = Qh.length, _g = null, Pg = [];
for (var Ng = 0; Ng < Tg; ++Ng) {
if (Sg = Qh.charCodeAt(Ng), 55295 < Sg && 57344 > Sg) {
if (!_g) {
if (56319 < Sg) {
-1 < ($h -= 3) && Pg.push(239, 191, 189);
continue
} else if (Ng + 1 === Tg) {
-1 < ($h -= 3) && Pg.push(239, 191, 189);
continue
}
_g = Sg;
continue
}
if (56320 > Sg) {
-1 < ($h -= 3) && Pg.push(239, 191, 189), _g = Sg;
continue
}
Sg = (_g - 55296 << 10 | Sg - 56320) + 65536
} else _g && -1 < ($h -= 3) && Pg.push(239, 191, 189);
if (_g = null, 128 > Sg) {
if (0 > ($h -= 1)) break;
Pg.push(Sg)
} else if (2048 > Sg) {
if (0 > ($h -= 2)) break;
Pg.push(192 | Sg >> 6, 128 | 63 & Sg)
} else if (65536 > Sg) {
if (0 > ($h -= 3)) break;
Pg.push(224 | Sg >> 12, 128 | 63 & Sg >> 6, 128 | 63 & Sg)
} else if (1114112 > Sg) {
if (0 > ($h -= 4)) break;
Pg.push(240 | Sg >> 18, 128 | 63 & Sg >> 12, 128 | 63 & Sg >> 6, 128 | 63 & Sg)
} else throw new Error('Invalid code point')
}
return Pg
}
function Ua(Qh) {
var $h = [];
for (var Sg = 0; Sg < Qh.length; ++Sg) $h.push(255 & Qh.charCodeAt(Sg));
return $h
}
function Xa(Qh, $h) {
var Sg, Tg, _g, Pg = [];
for (var Ng = 0; Ng < Qh.length && !(0 > ($h -= 2)); ++Ng) Sg = Qh.charCodeAt(Ng), Tg = Sg >> 8, _g = Sg % 256, Pg.push(_g), Pg.push(Tg);
return Pg
}
function Wa(Qh) {
return _e(Ma(Qh))
}
function Ja(Qh, $h, Sg, Tg) {
for (var _g = 0; _g < Tg && !(_g + Sg >= $h.length || _g >= Qh.length); ++_g) $h[_g + Sg] = Qh[_g];
return _g
}
function Za(Qh) {
return Qh !== Qh
}
function Ka(Qh) {
return null != Qh && (!!Qh._isBuffer || Qa(Qh) || $a(Qh))
}
function Qa(Qh) {
return !!Qh.constructor && 'function' == typeof Qh.constructor.isBuffer && Qh.constructor.isBuffer(Qh)
}
function $a(Qh) {
return 'function' == typeof Qh.readFloatLE && 'function' == typeof Qh.slice && Qa(Qh.slice(0, 0))
}
function Sn() {
throw new Error('setTimeout has not been defined')
}
function Tn() {
throw new Error('clearTimeout has not been defined')
}
function _n(Qh) {
if (Ip === setTimeout) return setTimeout(Qh, 0);
if ((Ip === Sn || !Ip) && setTimeout) return Ip = setTimeout, setTimeout(Qh, 0);
try {
return Ip(Qh, 0)
} catch ($h) {
try {
return Ip.call(null, Qh, 0)
} catch (Sg) {
return Ip.call(this, Qh, 0)
}
}
}
function Pn(Qh) {
if (Rp === clearTimeout) return clearTimeout(Qh);
if ((Rp === Tn || !Rp) && clearTimeout) return Rp = clearTimeout, clearTimeout(Qh);
try {
return Rp(Qh)
} catch ($h) {
try {
return Rp.call(null, Qh)
} catch (Sg) {
return Rp.call(this, Qh)
}
}
}
function Nn() {
Yp && Up && (Yp = !1, Up.length ? Mp = Up.concat(Mp) : Xp = -1, Mp.length && Ln())
}
function Ln() {
if (!Yp) {
var Qh = _n(Nn);
Yp = !0;
for (var $h = Mp.length; $h;) {
for (Up = Mp, Mp = []; ++Xp < $h;) Up && Up[Xp].run();
Xp = -1, $h = Mp.length
}
Up = null, Yp = !1, Pn(Qh)
}
}
function In(Qh, $h) {
var Sg = {seen: [], stylize: Mn};
return 3 <= arguments.length && (Sg.depth = arguments[2]), 4 <= arguments.length && (Sg.colors = arguments[3]), Kn($h) ? Sg.showHidden = $h : $h && Or(Sg, $h), Tr(Sg.showHidden) && (Sg.showHidden = !1), Tr(Sg.depth) && (Sg.depth = 2), Tr(Sg.colors) && (Sg.colors = !1), Tr(Sg.customInspect) && (Sg.customInspect = !0), Sg.colors && (Sg.stylize = Rn), Yn(Sg, Qh, Sg.depth)
}
function Rn(Qh, $h) {
var Sg = In.styles[$h];
return Sg ? '\x1B[' + In.colors[Sg][0] + 'm' + Qh + '\x1B[' + In.colors[Sg][1] + 'm' : Qh
}
function Mn(Qh) {
return Qh
}
function On(Qh) {
var $h = {};
return Qh.forEach(function (Sg) {
$h[Sg] = !0
}), $h
}
function Yn(Qh, $h, Sg) {
if (Qh.customInspect && $h && Ir($h.inspect) && $h.inspect !== In && !($h.constructor && $h.constructor.prototype === $h)) {
var Tg = $h.inspect(Sg, Qh);
return Sr(Tg) || (Tg = Yn(Qh, Tg, Sg)), Tg
}
var _g = Vn(Qh, $h);
if (_g) return _g;
var Pg = Object.keys($h), Ng = On(Pg);
if (Qh.showHidden && (Pg = Object.getOwnPropertyNames($h)), Lr($h) && (0 <= Pg.indexOf('message') || 0 <= Pg.indexOf('description'))) return Un($h);
if (0 === Pg.length) {
if (Ir($h)) {
var Lg = $h.name ? ': ' + $h.name : '';
return Qh.stylize('[Function' + Lg + ']', 'special')
}
if (_r($h)) return Qh.stylize(RegExp.prototype.toString.call($h), 'regexp');
if (Nr($h)) return Qh.stylize(Date.prototype.toString.call($h), 'date');
if (Lr($h)) return Un($h)
}
var Ig = '', Rg = !1, Mg = ['{', '}'];
if (Zn($h) && (Rg = !0, Mg = ['[', ']']), Ir($h)) {
var Og = $h.name ? ': ' + $h.name : '';
Ig = ' [Function' + Og + ']'
}
if (_r($h) && (Ig = ' ' + RegExp.prototype.toString.call($h)), Nr($h) && (Ig = ' ' + Date.prototype.toUTCString.call($h)), Lr($h) && (Ig = ' ' + Un($h)), 0 === Pg.length && (!Rg || 0 == $h.length)) return Mg[0] + Ig + Mg[1];
if (0 > Sg) return _r($h) ? Qh.stylize(RegExp.prototype.toString.call($h), 'regexp') : Qh.stylize('[Object]', 'special');
Qh.seen.push($h);
var Yg;
return Yg = Rg ? Xn(Qh, $h, Sg, Ng, Pg) : Pg.map(function (Vg) {
return Wn(Qh, $h, Sg, Ng, Vg, Rg)
}), Qh.seen.pop(), Jn(Yg, Ig, Mg)
}
function Vn(Qh, $h) {
if (Tr($h)) return Qh.stylize('undefined', 'undefined');
if (Sr($h)) {
var Sg = '\'' + JSON.stringify($h).replace(/^"|"$/g, '').replace(/'/g, '\\\'').replace(/\\"/g, '"') + '\'';
return Qh.stylize(Sg, 'string')
}
return $n($h) ? Qh.stylize('' + $h, 'number') : Kn($h) ? Qh.stylize('' + $h, 'boolean') : Qn($h) ? Qh.stylize('null', 'null') : void 0
}
function Un(Qh) {
return '[' + Error.prototype.toString.call(Qh) + ']'
}
function Xn(Qh, $h, Sg, Tg, _g) {
var Pg = [];
for (var Ng = 0, Lg = $h.length; Ng < Lg; ++Ng) Yr($h, Ng + '') ? Pg.push(Wn(Qh, $h, Sg, Tg, Ng + '', !0)) : Pg.push('');
return _g.forEach(function (Ig) {
Ig.match(/^\d+$/) || Pg.push(Wn(Qh, $h, Sg, Tg, Ig, !0))
}), Pg
}
function Wn(Qh, $h, Sg, Tg, _g, Pg) {
var Ng, Lg, Ig;
if (Ig = Object.getOwnPropertyDescriptor($h, _g) || {value: $h[_g]}, Ig.get ? Ig.set ? Lg = Qh.stylize('[Getter/Setter]', 'special') : Lg = Qh.stylize('[Getter]', 'special') : Ig.set && (Lg = Qh.stylize('[Setter]', 'special')), Yr(Tg, _g) || (Ng = '[' + _g + ']'), Lg || (0 > Qh.seen.indexOf(Ig.value) ? (Lg = Qn(Sg) ? Yn(Qh, Ig.value, null) : Yn(Qh, Ig.value, Sg - 1), -1 < Lg.indexOf('\n') && (Pg ? Lg = Lg.split('\n').map(function (Rg) {
return ' ' + Rg
}).join('\n').substr(2) : Lg = '\n' + Lg.split('\n').map(function (Rg) {
return ' ' + Rg
}).join('\n'))) : Lg = Qh.stylize('[Circular]', 'special')), Tr(Ng)) {
if (Pg && _g.match(/^\d+$/)) return Lg;
Ng = JSON.stringify('' + _g), Ng.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (Ng = Ng.substr(1, Ng.length - 2), Ng = Qh.stylize(Ng, 'name')) : (Ng = Ng.replace(/'/g, '\\\'').replace(/\\"/g, '"').replace(/(^"|"$)/g, '\''), Ng = Qh.stylize(Ng, 'string'))
}
return Ng + ': ' + Lg
}
function Jn(Qh, $h, Sg) {
var Tg = 0, _g = Qh.reduce(function (Pg, Ng) {
return Tg++, 0 <= Ng.indexOf('\n') && Tg++, Pg + Ng.replace(/\u001b\[\d\d?m/g, '').length + 1
}, 0);
return 60 < _g ? Sg[0] + ('' === $h ? '' : $h + '\n ') + ' ' + Qh.join(',\n ') + ' ' + Sg[1] : Sg[0] + $h + ' ' + Qh.join(', ') + ' ' + Sg[1]
}
function Zn(Qh) {
return Array.isArray(Qh)
}
function Kn(Qh) {
return 'boolean' == typeof Qh
}
function Qn(Qh) {
return null === Qh
}
function $n(Qh) {
return 'number' == typeof Qh
}
function Sr(Qh) {
return 'string' == typeof Qh
}
function Tr(Qh) {
return void 0 === Qh
}
function _r(Qh) {
return Pr(Qh) && '[object RegExp]' === Mr(Qh)
}
function Pr(Qh) {
return 'object' == typeof Qh && null !== Qh
}
function Nr(Qh) {
return Pr(Qh) && '[object Date]' === Mr(Qh)
}
function Lr(Qh) {
return Pr(Qh) && ('[object Error]' === Mr(Qh) || Qh instanceof Error)
}
function Ir(Qh) {
return 'function' == typeof Qh
}
function Rr(Qh) {
return null === Qh || 'boolean' == typeof Qh || 'number' == typeof Qh || 'string' == typeof Qh || 'symbol' == typeof Qh || 'undefined' == typeof Qh
}
function Mr(Qh) {
return Object.prototype.toString.call(Qh)
}
function Or(Qh, $h) {
if (!$h || !Pr($h)) return Qh;
for (var Sg = Object.keys($h), Tg = Sg.length; Tg--;) Qh[Sg[Tg]] = $h[Sg[Tg]];
return Qh
}
function Yr(Qh, $h) {
return Object.prototype.hasOwnProperty.call(Qh, $h)
}
function Vr(Qh, $h) {
if (Qh === $h) return 0;
var Sg = Qh.length, Tg = $h.length;
for (var _g = 0, Pg = Math.min(Sg, Tg); _g < Pg; ++_g) if (Qh[_g] !== $h[_g]) {
Sg = Qh[_g], Tg = $h[_g];
break
}
return Sg < Tg ? -1 : Tg < Sg ? 1 : 0
}
function Ur() {
return 'undefined' == typeof Sd ? Sd = function () {
return 'foo' === function () {
}.name
}() : Sd
}
function Xr(Qh) {
return Object.prototype.toString.call(Qh)
}
function Wr(Qh) {
return !Ka(Qh) && !('function' != typeof global.ArrayBuffer) && ('function' == typeof ArrayBuffer.isView ? ArrayBuffer.isView(Qh) : !!Qh && (!!(Qh instanceof DataView) || Qh.buffer && Qh.buffer instanceof ArrayBuffer))
}
function Jr(Qh, $h) {
Qh || Ts(Qh, !0, $h, '==', _s)
}
function Zr(Qh) {
if (Ir(Qh)) {
if (Ur()) return Qh.name;
var $h = Qh.toString(), Sg = $h.match(Td);
return Sg && Sg[1]
}
}
function Kr(Qh) {
this.name = 'AssertionError', this.actual = Qh.actual, this.expected = Qh.expected, this.operator = Qh.operator, Qh.message ? (this.message = Qh.message, this.generatedMessage = !1) : (this.message = Ss(this), this.generatedMessage = !0);
var $h = Qh.stackStartFunction || Ts;
if (Error.captureStackTrace) Error.captureStackTrace(this, $h); else {
var Sg = new Error;
if (Sg.stack) {
var Tg = Sg.stack, _g = Zr($h), Pg = Tg.indexOf('\n' + _g);
if (0 <= Pg) {
var Ng = Tg.indexOf('\n', Pg + 1);
Tg = Tg.substring(Ng + 1)
}
this.stack = Tg
}
}
}
function Qr(Qh, $h) {
return 'string' == typeof Qh ? Qh.length < $h ? Qh : Qh.slice(0, $h) : Qh
}
function $r(Qh) {
if (Ur() || !Ir(Qh)) return In(Qh);
var $h = Zr(Qh), Sg = $h ? ': ' + $h : '';
return '[Function' + Sg + ']'
}
function Ss(Qh) {
return Qr($r(Qh.actual), 128) + ' ' + Qh.operator + ' ' + Qr($r(Qh.expected), 128)
}
function Ts(Qh, $h, Sg, Tg, _g) {
throw new Kr({message: Sg, actual: Qh, expected: $h, operator: Tg, stackStartFunction: _g})
}
function _s(Qh, $h) {
Qh || Ts(Qh, !0, $h, '==', _s)
}
function Ps(Qh, $h, Sg) {
Qh != $h && Ts(Qh, $h, Sg, '==', Ps)
}
function Ns(Qh, $h, Sg) {
Qh == $h && Ts(Qh, $h, Sg, '!=', Ns)
}
function Ls(Qh, $h, Sg) {
Rs(Qh, $h, !1) || Ts(Qh, $h, Sg, 'deepEqual', Ls)
}
function Is(Qh, $h, Sg) {
Rs(Qh, $h, !0) || Ts(Qh, $h, Sg, 'deepStrictEqual', Is)
}
function Rs(Qh, $h, Sg, Tg) {
if (Qh === $h) return !0;
if (Ka(Qh) && Ka($h)) return 0 === Vr(Qh, $h);
if (Nr(Qh) && Nr($h)) return Qh.getTime() === $h.getTime();
if (_r(Qh) && _r($h)) return Qh.source === $h.source && Qh.global === $h.global && Qh.multiline === $h.multiline && Qh.lastIndex === $h.lastIndex && Qh.ignoreCase === $h.ignoreCase;
if ((null === Qh || 'object' != typeof Qh) && (null === $h || 'object' != typeof $h)) return Sg ? Qh == $h : Qh == $h;
if (Wr(Qh) && Wr($h) && Xr(Qh) === Xr($h) && !(Qh instanceof Float32Array || Qh instanceof Float64Array)) return 0 === Vr(new Uint8Array(Qh.buffer), new Uint8Array($h.buffer));
if (Ka(Qh) !== Ka($h)) return !1;
Tg = Tg || {actual: [], expected: []};
var _g = Tg.actual.indexOf(Qh);
return -1 !== _g && _g === Tg.expected.indexOf($h) || (Tg.actual.push(Qh), Tg.expected.push($h), Os(Qh, $h, Sg, Tg))
}
function Ms(Qh) {
return '[object Arguments]' == Object.prototype.toString.call(Qh)
}
function Os(Qh, $h, Sg, Tg) {
if (null === Qh || Qh === void 0 || null === $h || $h === void 0) return !1;
if (Rr(Qh) || Rr($h)) return Qh === $h;
if (Sg && Object.getPrototypeOf(Qh) !== Object.getPrototypeOf($h)) return !1;
var _g = Ms(Qh), Pg = Ms($h);
if (_g && !Pg || !_g && Pg) return !1;
if (_g) return Qh = $p.call(Qh), $h = $p.call($h), Rs(Qh, $h, Sg);
var Ng = Qp(Qh), Lg = Qp($h), Ig, Rg;
if (Ng.length !== Lg.length) return !1;
for (Ng.sort(), Lg.sort(), Rg = Ng.length - 1; 0 <= Rg; Rg--) if (Ng[Rg] !== Lg[Rg]) return !1;
for (Rg = Ng.length - 1; 0 <= Rg; Rg--) if (Ig = Ng[Rg], !Rs(Qh[Ig], $h[Ig], Sg, Tg)) return !1;
return !0
}
function Ys(Qh, $h, Sg) {
Rs(Qh, $h, !1) && Ts(Qh, $h, Sg, 'notDeepEqual', Ys)
}
function Vs(Qh, $h, Sg) {
Rs(Qh, $h, !0) && Ts(Qh, $h, Sg, 'notDeepStrictEqual', Vs)
}
function Us(Qh, $h, Sg) {
Qh !== $h && Ts(Qh, $h, Sg, '===', Us)
}
function Xs(Qh, $h, Sg) {
Qh === $h && Ts(Qh, $h, Sg, '!==', Xs)
}
function Ws(Qh, $h) {
if (!Qh || !$h) return !1;
if ('[object RegExp]' == Object.prototype.toString.call($h)) return $h.test(Qh);
try {
if (Qh instanceof $h) return !0
} catch (Sg) {
}
return !Error.isPrototypeOf($h) && !0 === $h.call({}, Qh)
}
function Js(Qh) {
var $h;
try {
Qh()
} catch (Sg) {
$h = Sg
}
return $h
}
function Zs(Qh, $h, Sg, Tg) {
var _g;
if ('function' != typeof $h) throw new TypeError('"block" argument must be a function');
'string' == typeof Sg && (Tg = Sg, Sg = null), _g = Js($h), Tg = (Sg && Sg.name ? ' (' + Sg.name + ').' : '.') + (Tg ? ' ' + Tg : '.'), Qh && !_g && Ts(_g, Sg, 'Missing expected exception' + Tg);
var Pg = 'string' == typeof Tg, Ng = !Qh && Lr(_g), Lg = !Qh && _g && !Sg;
if ((Ng && Pg && Ws(_g, Sg) || Lg) && Ts(_g, Sg, 'Got unwanted exception' + Tg), Qh && _g && Sg && !Ws(_g, Sg) || !Qh && _g) throw _g
}
function Ks(Qh, $h, Sg) {
Zs(!0, Qh, $h, Sg)
}
function Qs(Qh, $h, Sg) {
Zs(!1, Qh, $h, Sg)
}
function $s(Qh) {
if (Qh) throw Qh
}
function Si(Qh) {
return 0 > Qh ? (-Qh << 1) + 1 : (Qh << 1) + 0
}
function Ti(Qh) {
var $h = Qh >> 1;
return 1 == (1 & Qh) ? -$h : $h
}
function Pi() {
this._array = [], this._set = Object.create(null)
}
function Ni(Qh, $h) {
var Sg = Qh.generatedLine, Tg = $h.generatedLine, _g = Qh.generatedColumn, Pg = $h.generatedColumn;
return Tg > Sg || Tg == Sg && Pg >= _g || 0 >= Jd.compareByGeneratedPositionsInflated(Qh, $h)
}
function Li() {
this._array = [], this._sorted = !0, this._last = {generatedLine: -1, generatedColumn: 0}
}
function Ii(Qh) {
Qh || (Qh = {}), this._file = Kd.getArg(Qh, 'file', null), this._sourceRoot = Kd.getArg(Qh, 'sourceRoot', null), this._skipValidation = Kd.getArg(Qh, 'skipValidation', !1), this._sources = new Qd, this._names = new Qd, this._mappings = new $d, this._sourcesContents = null
}
function Ri(Qh, $h, Sg) {
var Tg = Qh[$h];
Qh[$h] = Qh[Sg], Qh[Sg] = Tg
}
function Mi(Qh, $h) {
return Math.round(Qh + Math.random() * ($h - Qh))
}
function Oi(Qh, $h, Sg, Tg) {
if (Sg < Tg) {
var _g = Mi(Sg, Tg), Pg = Sg - 1;
Ri(Qh, _g, Tg);
var Ng = Qh[Tg];
for (var Lg = Sg; Lg < Tg; Lg++) 0 >= $h(Qh[Lg], Ng) && (Pg += 1, Ri(Qh, Pg, Lg));
Ri(Qh, Pg + 1, Lg);
var Ig = Pg + 1;
Oi(Qh, $h, Sg, Ig - 1), Oi(Qh, $h, Ig + 1, Tg)
}
}
function Yi(Qh) {
var $h = Qh;
return 'string' == typeof Qh && ($h = JSON.parse(Qh.replace(/^\)\]\}'/, ''))), null == $h.sections ? new Vi($h) : new Xi($h)
}
function Vi(Qh) {
var $h = Qh;
'string' == typeof Qh && ($h = JSON.parse(Qh.replace(/^\)\]\}'/, '')));
var Sg = _c.getArg($h, 'version'), Tg = _c.getArg($h, 'sources'), _g = _c.getArg($h, 'names', []),
Pg = _c.getArg($h, 'sourceRoot', null), Ng = _c.getArg($h, 'sourcesContent', null),
Lg = _c.getArg($h, 'mappings'), Ig = _c.getArg($h, 'file', null);
if (Sg != this._version) throw new Error('Unsupported version: ' + Sg);
Tg = Tg.map(String).map(_c.normalize).map(function (Rg) {
return Pg && _c.isAbsolute(Pg) && _c.isAbsolute(Rg) ? _c.relative(Pg, Rg) : Rg
}), this._names = Nc.fromArray(_g.map(String), !0), this._sources = Nc.fromArray(Tg, !0), this.sourceRoot = Pg, this.sourcesContent = Ng, this._mappings = Lg, this.file = Ig
}
function Ui() {
this.generatedLine = 0, this.generatedColumn = 0, this.source = null, this.originalLine = null, this.originalColumn = null, this.name = null
}
function Xi(Qh) {
var $h = Qh;
'string' == typeof Qh && ($h = JSON.parse(Qh.replace(/^\)\]\}'/, '')));
var Sg = _c.getArg($h, 'version'), Tg = _c.getArg($h, 'sections');
if (Sg != this._version) throw new Error('Unsupported version: ' + Sg);
this._sources = new Nc, this._names = new Nc;
var _g = {line: -1, column: 0};
this._sections = Tg.map(function (Pg) {
if (Pg.url) throw new Error('Support for url field in sections not implemented.');
var Ng = _c.getArg(Pg, 'offset'), Lg = _c.getArg(Ng, 'line'), Ig = _c.getArg(Ng, 'column');
if (Lg < _g.line || Lg === _g.line && Ig < _g.column) throw new Error('Section offsets must be ordered and non-overlapping.');
return _g = Ng, {
generatedOffset: {generatedLine: Lg + 1, generatedColumn: Ig + 1},
consumer: new Yi(_c.getArg(Pg, 'map'))
}
})
}
function Wi(Qh, $h, Sg, Tg, _g) {
this.children = [], this.sourceContents = {}, this.line = null == Qh ? null : Qh, this.column = null == $h ? null : $h, this.source = null == Sg ? null : Sg, this.name = null == _g ? null : _g, this[Yc] = !0, null != Tg && this.add(Tg)
}
function Ji(Qh) {
$u('string' == typeof Qh || null != Qh && 'string' == typeof Qh.type, 'Value is a valid document')
}
function Zi(Qh) {
return Qh.forEach(Ji), {type: 'concat', parts: Qh}
}
function Ki(Qh, $h) {
return $h = $h || {}, Ji(Qh), {
type: 'group',
contents: Qh,
break: !!$h.shouldBreak,
expandedStates: $h.expandedStates
}
}
function Qi(Qh, $h) {
for (const Sg = [Qh]; 0 !== Sg.length;) {
const _g = Sg.pop();
if (void 0, 'string' == typeof _g) {
const Pg = $h('string', _g);
if (Pg) return Pg
} else {
const Pg = $h(_g.type, _g);
if (Pg) return Pg;
if ('concat' === _g.type) for (var Tg = _g.parts.length - 1; 0 <= Tg; Tg--) Sg.push(_g.parts[Tg]); else 'line' !== _g.type && Sg.push(_g.contents)
}
}
}
function $i(Qh) {
return !!Qi(Qh, ($h, Sg) => {
switch ($h) {
case'line':
if (Sg.hard) return !0;
}
})
}
function So(Qh) {
var $h = '';
for (var Sg = 0; Sg < Qh; Sg++) $h += ' ';
return $h
}
function To(Qh, $h, Sg) {
let Tg = $h.length;
for (const _g = [Qh]; 0 <= Sg;) {
if (0 === _g.length) {
if (0 === Tg) return !0;
_g.push($h[Tg - 1]), Tg--;
continue
}
const Ng = _g.pop(), Lg = Ng[0], Ig = Ng[1], Rg = Ng[2];
if ('string' == typeof Rg) Sg -= Rg.length; else switch (Rg.type) {
case'concat':
for (var Pg = Rg.parts.length - 1; 0 <= Pg; Pg--) _g.push([Lg, Ig, Rg.parts[Pg]]);
break;
case'indent':
_g.push([Lg + Rg.n, Ig, Rg.contents]);
break;
case'group':
_g.push([Lg, Rg.break ? Sf : Ig, Rg.contents]);
break;
case'if-break':
Ig === Sf && _g.push([Lg, Ig, Rg.contents]);
break;
case'line':
switch (Ig) {
case Tf:
if (!Rg.hard) {
Rg.soft || (Sg -= 1);
break
}
case Sf:
return !0;
}
}
}
return !1
}
function _o(Qh, $h, Sg) {
if (Qh) {
if (Wf.fixFaultyLocations(Qh, $h), Sg) {
if (Mf.Node.check(Qh)) {
for (var Tg = Sg.length - 1; 0 <= Tg && !(0 >= Kf(Sg[Tg]) - Zf(Qh)); --Tg) ;
return void Sg.splice(Tg + 1, 0, Qh)
}
} else if (Qh[Jf]) return Qh[Jf];
var _g;
if (Of.check(Qh)) _g = Object.keys(Qh); else if (Yf.check(Qh)) _g = Rf.getFieldNames(Qh); else return;
Sg || Object.defineProperty(Qh, Jf, {value: Sg = [], enumerable: !1});
for (var Tg = 0, Pg = _g.length; Tg < Pg; ++Tg) _o(Qh[_g[Tg]], $h, Sg);
return Sg
}
}
function Po(Qh, $h, Sg) {
for (var Tg = _o(Qh, Sg), _g = 0, Pg = Tg.length; _g < Pg;) {
var Ng = _g + Pg >> 1, Lg = Tg[Ng];
if (0 >= Zf(Lg) - Zf($h) && 0 >= Kf($h) - Kf(Lg)) return $h.enclosingNode = Lg, void Po(Lg, $h, Sg);
if (0 >= Kf(Lg) - Zf($h)) {
var Ig = Lg;
_g = Ng + 1;
continue
}
if (0 >= Kf($h) - Zf(Lg)) {
var Rg = Lg;
Pg = Ng;
continue
}
throw new Error('Comment location overlaps with node location')
}
Ig && ($h.precedingNode = Ig), Rg && ($h.followingNode = Rg)
}
function No(Qh, $h) {
var Sg = Qh.length;
if (0 !== Sg) {
var Tg = Qh[0].precedingNode, _g = Qh[0].followingNode, Pg = Zf(_g);
for (var Ng = Sg; 0 < Ng; --Ng) {
var Lg = Qh[Ng - 1];
Lf.strictEqual(Lg.precedingNode, Tg), Lf.strictEqual(Lg.followingNode, _g);
var Ig = $h.slice(Kf(Lg), Pg);
if (/\S/.test(Ig)) break;
Pg = Zf(Lg)
}
Qh.forEach(function (Rg, Mg) {
Mg < Ng ? Mo(Tg, Rg) : Io(_g, Rg)
}), Qh.length = 0
}
}
function Lo(Qh, $h) {
var Sg = Qh.comments || (Qh.comments = []);
Sg.push($h)
}
function Io(Qh, $h) {
$h.leading = !0, $h.trailing = !1, Lo(Qh, $h)
}
function Ro(Qh, $h) {
$h.leading = !1, $h.trailing = !1, Lo(Qh, $h)
}
function Mo(Qh, $h) {
$h.leading = !1, $h.trailing = !0, Lo(Qh, $h)
}
function Oo(Qh, $h) {
var Sg = Qh.getValue();
return Mf.Comment.assert(Sg), Uf([$h(Qh), Xf])
}
function Yo(Qh, $h, Sg) {
const Tg = Qh.getValue(Qh);
Mf.Comment.assert(Tg);
const _g = Sg.originalText;
return Uf([Wf.newlineExistsBefore(_g, Zf(Tg)) ? Xf : ' ', $h(Qh)])
}
function Vo(Qh) {
Sm.ok(this instanceof Vo), this.stack = [Qh]
}
function Uo(Qh, $h) {
var Sg = Qh.stack;
for (var Tg = Sg.length - 1; 0 <= Tg; Tg -= 2) {
var _g = Sg[Tg];
if (_m.Node.check(_g) && 0 > --$h) return _g
}
return null
}
function Xo(Qh) {
return _m.BinaryExpression.check(Qh) || _m.LogicalExpression.check(Qh)
}
function Wo(Qh) {
return !!_m.CallExpression.check(Qh) || (Pm.check(Qh) ? Qh.some(Wo) : !!_m.Node.check(Qh) && Tm.someField(Qh, function ($h, Sg) {
return Wo(Sg)
}))
}
function Jo(Qh, $h) {
Rm.ok(this instanceof Jo), Mh.assert(Qh), this.code = Qh, $h && (Oh.assert($h), this.map = $h)
}
function Zo(Qh) {
function $h(Tg) {
return Mm(Tg, _g => Ko(_g, Sg, $h), Sg)
}
Rm.ok(this instanceof Zo), Qh && Qh.tabWidth;
var Sg = Lh(Qh);
Rm.notStrictEqual(Sg, Qh), Sg.sourceFileName = null, this.print = function (Tg) {
if (!Tg) return Wh;
var _g = print(Yh.from(Tg), !0);
return new Jo(_g.toString(Sg), Vh.composeSourceMaps(Sg.inputSourceMap, _g.getSourceMap(Sg.sourceMapName, Sg.sourceRoot)))
}, this.printGenerically = function (Tg) {
if (!Tg) return Wh;
var _g = Yh.from(Tg), Pg = Sg.reuseWhitespace;
Sg.reuseWhitespace = !1;
var Ng = $h(_g), Lg = new Jo(Om.print(Sg.printWidth, Ng));
return Sg.reuseWhitespace = Pg, Lg
}
}
function Ko(Qh, $h, Sg) {
Rm.ok(Qh instanceof Yh);
var Tg = Qh.getValue(), _g = [], Pg = !1, Ng = Qo(Qh, $h, Sg);
return !Tg || Um(Ng) ? Ng : (Tg.decorators && 0 < Tg.decorators.length && !Vh.getParentExportDeclaration(Qh) ? Qh.each(function (Lg) {
_g.push(Sg(Lg), Wm)
}, 'decorators') : Vh.isExportDeclaration(Tg) && Tg.declaration && Tg.declaration.decorators ? Qh.each(function (Lg) {
_g.push(Sg(Lg), Wm)
}, 'declaration', 'decorators') : Pg = Qh.needsParens(), Pg && _g.unshift('('), _g.push(Ng), Pg && _g.push(')'), Vm(_g))
}
function Qo(Qh, $h, Sg) {
var Tg = Qh.getValue();
if (!Tg) return Ym('');
if ('string' == typeof Tg) return Ym(Tg, $h);
var _g = [];
switch (Tg.type) {
case'File':
return Qh.call(Sg, 'program');
case'Program':
return Tg.directives && Qh.each(function (Vy) {
_g.push(Sg(Vy), ';', Jm)
}, 'directives'), _g.push(Qh.call(function (Vy) {
return $o(Vy, $h, Sg)
}, 'body')), Vm(_g);
case'Noop':
case'EmptyStatement':
return Ym('');
case'ExpressionStatement':
return Vm([Qh.call(Sg, 'expression'), ';']);
case'ParenthesizedExpression':
return Vm(['(', Qh.call(Sg, 'expression'), ')']);
case'AssignmentExpression':
return Qm(Vm([Qh.call(Sg, 'left'), ' ', Tg.operator, ' ', Qh.call(Sg, 'right')]));
case'BinaryExpression':
case'LogicalExpression':
return Qm(Vm([Qh.call(Sg, 'left'), ' ', Tg.operator, Sh($h.tabWidth, Vm([Wm, Qh.call(Sg, 'right')]))]));
case'AssignmentPattern':
return Vm([Qh.call(Sg, 'left'), ' = ', Qh.call(Sg, 'right')]);
case'MemberExpression':
return Vm([Qh.call(Sg, 'object'), Rl(Qh, Sg)]);
case'MetaProperty':
return Vm([Qh.call(Sg, 'meta'), '.', Qh.call(Sg, 'property')]);
case'BindExpression':
return Tg.object && _g.push(Qh.call(Sg, 'object')), _g.push('::', Qh.call(Sg, 'callee')), Vm(_g);
case'Path':
return Xm('.', Tg.body);
case'Identifier':
return Vm([Tg.name, Tg.optional ? '?' : '', Qh.call(Sg, 'typeAnnotation')]);
case'SpreadElement':
case'SpreadElementPattern':
case'RestProperty':
case'SpreadProperty':
case'SpreadPropertyPattern':
case'RestElement':
return Vm(['...', Qh.call(Sg, 'argument')]);
case'FunctionDeclaration':
case'FunctionExpression':
return Tg.async && _g.push('async '), _g.push('function'), Tg.generator && _g.push('*'), Tg.id && _g.push(' ', Qh.call(Sg, 'id')), _g.push(Qh.call(Sg, 'typeParameters'), $m(Vm([Tl(Qh, Sg, $h), Pl(Qh, Sg)])), ' ', Qh.call(Sg, 'body')), Vm(_g);
case'ArrowFunctionExpression':
return Tg.async && _g.push('async '), Tg.typeParameters && _g.push(Qh.call(Sg, 'typeParameters')), $h.arrowParensAlways || 1 !== Tg.params.length || Tg.rest || 'Identifier' !== Tg.params[0].type || Tg.params[0].typeAnnotation || Tg.predicate || Tg.returnType ? _g.push($m(Vm([Tl(Qh, Sg, $h), Pl(Qh, Sg)]))) : _g.push(Qh.call(Sg, 'params', 0)), _g.push(' => '), Ph([Vm([Vm(_g), Qh.call(Sg, 'body')]), Vm([Vm(_g), Sh($h.tabWidth, Vm([Wm, Qh.call(Sg, 'body')]))])]);
case'MethodDefinition':
return Tg.static && _g.push('static '), _g.push(el(Qh, $h, Sg)), Vm(_g);
case'YieldExpression':
return _g.push('yield'), Tg.delegate && _g.push('*'), Tg.argument && _g.push(' ', Qh.call(Sg, 'argument')), Vm(_g);
case'AwaitExpression':
return _g.push('await'), Tg.all && _g.push('*'), Tg.argument && _g.push(' ', Qh.call(Sg, 'argument')), Vm(_g);
case'ModuleDeclaration':
return _g.push('module', Qh.call(Sg, 'id')), Tg.source ? (Rm.ok(!Tg.body), _g.push('from', Qh.call(Sg, 'source'))) : _g.push(Qh.call(Sg, 'body')), Xm(' ', _g);
case'ImportSpecifier':
return Tg.imported ? (_g.push(Qh.call(Sg, 'imported')), Tg.local && Tg.local.name !== Tg.imported.name && _g.push(' as ', Qh.call(Sg, 'local'))) : Tg.id && (_g.push(Qh.call(Sg, 'id')), Tg.name && _g.push(' as ', Qh.call(Sg, 'name'))), Vm(_g);
case'ExportSpecifier':
return Tg.local ? (_g.push(Qh.call(Sg, 'local')), Tg.exported && Tg.exported.name !== Tg.local.name && _g.push(' as ', Qh.call(Sg, 'exported'))) : Tg.id && (_g.push(Qh.call(Sg, 'id')), Tg.name && _g.push(' as ', Qh.call(Sg, 'name'))), Vm(_g);
case'ExportBatchSpecifier':
return Ym('*');
case'ImportNamespaceSpecifier':
return _g.push('* as '), Tg.local ? _g.push(Qh.call(Sg, 'local')) : Tg.id && _g.push(Qh.call(Sg, 'id')), Vm(_g);
case'ImportDefaultSpecifier':
return Tg.local ? Qh.call(Sg, 'local') : Qh.call(Sg, 'id');
case'ExportDeclaration':
case'ExportDefaultDeclaration':
case'ExportNamedDeclaration':
return Nl(Qh, $h, Sg);
case'ExportAllDeclaration':
return _g.push('export *'), Tg.exported && _g.push(' as ', Qh.call(Sg, 'exported')), _g.push(' from ', Qh.call(Sg, 'source')), Vm(_g);
case'ExportNamespaceSpecifier':
return Vm(['* as ', Qh.call(Sg, 'exported')]);
case'ExportDefaultSpecifier':
return Qh.call(Sg, 'exported');
case'ImportDeclaration':
if (_g.push('import '), Tg.importKind && 'value' !== Tg.importKind && _g.push(Tg.importKind + ' '), Tg.specifiers && 0 < Tg.specifiers.length) {
var Pg = !1;
Qh.each(function (Vy) {
var Uy = Vy.getName();
0 < Uy && _g.push(', ');
var Xy = Vy.getValue();
Rh.ImportDefaultSpecifier.check(Xy) || Rh.ImportNamespaceSpecifier.check(Xy) ? Rm.strictEqual(Pg, !1) : (Rh.ImportSpecifier.assert(Xy), !Pg && (Pg = !0, _g.push($h.bracketSpacing ? '{ ' : '{'))), _g.push(Sg(Vy))
}, 'specifiers'), Pg && _g.push($h.bracketSpacing ? ' }' : '}'), _g.push(' from ')
}
return _g.push(Qh.call(Sg, 'source'), ';'), Vm(_g);
case'BlockStatement':
var Ng = Qh.call(function (Vy) {
return $o(Vy, $h, Sg)
}, 'body');
return Th(Ng) ? (_g.push('{'), Tg.directives && Qh.each(function (Vy) {
_g.push(Sh($h.tabWidth, Vm([Wm, Sg(Vy), ';', Wm])))
}, 'directives'), _g.push(Sh($h.tabWidth, Vm([Jm, Ng]))), _g.push(Jm, '}'), Vm(_g)) : '{}';
case'ReturnStatement':
_g.push('return');
var Lg = Qh.call(Sg, 'argument');
return Tg.argument && (Rh.JSXElement && Rh.JSXElement.check(Tg.argument) && _h(Lg) ? _g.push(' (', Sh($h.tabWidth, Vm([Jm, Lg])), Jm, ')') : _g.push(' ', Lg)), _g.push(';'), Vm(_g);
case'CallExpression': {
if (Qh.getParentNode(), 'MemberExpression' === Tg.callee.type) {
const Vy = Ml(Tg, $h, Sg);
if (Vy) return Vy
}
return Vm([Qh.call(Sg, 'callee'), Sl(Qh, $h, Sg)])
}
case'ObjectExpression':
case'ObjectPattern':
case'ObjectTypeAnnotation':
var Ig = 'ObjectTypeAnnotation' === Tg.type, Rg = Ig ? ',' : ',', Mg = [], Og = Tg.exact ? '{|' : '{',
Yg = Tg.exact ? '|}' : '}';
Ig && Mg.push('indexers', 'callProperties'), Mg.push('properties');
var Vg = [];
return Mg.forEach(function (Vy) {
Qh.each(function (Uy) {
Vg.push(Qm(Sg(Uy)))
}, Vy)
}), 0 === Vg.length ? '{}' : $m(Vm([Og, Sh($h.tabWidth, Vm([$h.bracketSpacing ? Wm : Zm, Xm(Vm([Rg, Wm]), Vg)])), Nh($h.trailingComma ? ',' : ''), $h.bracketSpacing ? Wm : Zm, Yg, Qh.call(Sg, 'typeAnnotation')]));
case'PropertyPattern':
return Vm([Qh.call(Sg, 'key'), ': ', Qh.call(Sg, 'pattern')]);
case'ObjectProperty':
case'Property':
return Tg.method || 'get' === Tg.kind || 'set' === Tg.kind ? el(Qh, $h, Sg) : (Tg.computed ? _g.push('[', Qh.call(Sg, 'key'), ']') : _g.push(Qh.call(Sg, Tg.shorthand ? 'value' : 'key')), Tg.shorthand || _g.push(': ', Qh.call(Sg, 'value')), Vm(_g));
case'ClassMethod':
return Tg.static && _g.push('static '), _g = _g.concat(_l(Qh, $h, Sg)), Vm(_g);
case'ObjectMethod':
return _l(Qh, $h, Sg);
case'Decorator':
return Vm(['@', Qh.call(Sg, 'expression')]);
case'ArrayExpression':
case'ArrayPattern':
return 0 === Tg.elements.length ? _g.push('[]') : _g.push($m(Vm(['[', Sh($h.tabWidth, Vm([$h.bracketSpacing ? Wm : Zm, Xm(Vm([',', Wm]), Qh.map(Sg, 'elements'))])), Nh($h.trailingComma ? ',' : ''), $h.bracketSpacing ? Wm : Zm, ']']))), Tg.typeAnnotation && _g.push(Qh.call(Sg, 'typeAnnotation')), Vm(_g);
case'SequenceExpression':
return Xm(', ', Qh.map(Sg, 'expressions'));
case'ThisExpression':
return Ym('this');
case'Super':
return Ym('super');
case'NullLiteral':
return Ym('null');
case'RegExpLiteral':
return Ym(Tg.extra.raw);
case'BooleanLiteral':
case'NumericLiteral':
case'StringLiteral':
case'Literal':
return 'string' == typeof Tg.value ? Xl(Tg.value, $h) : Ym(Tg.value, $h);
case'Directive':
return Qh.call(Sg, 'value');
case'DirectiveLiteral':
return Ym(Xl(Tg.value, $h));
case'ModuleSpecifier':
if (Tg.local) throw new Error('The ESTree ModuleSpecifier type should be abstract');
return Ym(Xl(Tg.value, $h), $h);
case'UnaryExpression':
return _g.push(Tg.operator), /[a-z]$/.test(Tg.operator) && _g.push(' '), _g.push(Qh.call(Sg, 'argument')), Vm(_g);
case'UpdateExpression':
return _g.push(Qh.call(Sg, 'argument'), Tg.operator), Tg.prefix && _g.reverse(), Vm(_g);
case'ConditionalExpression':
return Qm(Vm([Qh.call(Sg, 'test'), Sh($h.tabWidth, Vm([Wm, '? ', Qh.call(Sg, 'consequent'), Wm, ': ', Qh.call(Sg, 'alternate')]))]));
case'NewExpression':
_g.push('new ', Qh.call(Sg, 'callee'));
var Ug = Tg.arguments;
return Ug && _g.push(Sl(Qh, $h, Sg)), Vm(_g);
case'VariableDeclaration':
var Xg = Qh.map(function (Vy) {
return Sg(Vy)
}, 'declarations');
_g = [Tg.kind, ' ', Xg[0], Sh($h.tabWidth, Vm(Xg.slice(1).map(Vy => Vm([',', Wm, Vy]))))];
var Wg = Qh.getParentNode();
return Rh.ForStatement.check(Wg) || Rh.ForInStatement.check(Wg) || Rh.ForOfStatement && Rh.ForOfStatement.check(Wg) || Rh.ForAwaitStatement && Rh.ForAwaitStatement.check(Wg) || _g.push(';'), $m(Vm(_g));
case'VariableDeclarator':
return Tg.init ? Vm([Qh.call(Sg, 'id'), ' = ', Qh.call(Sg, 'init')]) : Qh.call(Sg, 'id');
case'WithStatement':
return Vm(['with (', Qh.call(Sg, 'object'), ') ', Qh.call(Sg, 'body')]);
case'IfStatement':
const Oy = Ol(Qh.call(Sg, 'consequent'), $h);
if (_g = ['if (', Qm(Vm([Sh($h.tabWidth, Vm([Zm, Qh.call(Sg, 'test')