diff --git a/main.js b/main.js index d2fd76c..1760a61 100644 --- a/main.js +++ b/main.js @@ -4953,7 +4953,7 @@ var require_lodash = __commonJS({ return string4.match(reUnicodeWord) || []; } var runInContext = function runInContext2(context) { - context = context == null ? root : _18.defaults(root.Object(), context, _18.pick(root, contextProps)); + context = context == null ? root : _17.defaults(root.Object(), context, _17.pick(root, contextProps)); var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError; var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype; var coreJsData = context["__core-js_shared__"]; @@ -9687,17 +9687,17 @@ var require_lodash = __commonJS({ } return lodash; }; - var _18 = runInContext(); + var _17 = runInContext(); if (typeof define == "function" && typeof define.amd == "object" && define.amd) { - root._ = _18; + root._ = _17; define(function() { - return _18; + return _17; }); } else if (freeModule) { - (freeModule.exports = _18)._ = _18; - freeExports._ = _18; + (freeModule.exports = _17)._ = _17; + freeExports._ = _17; } else { - root._ = _18; + root._ = _17; } }).call(exports); } @@ -21112,17 +21112,17 @@ var require_jszip_min = __commonJS({ return n4; } function n3(e6, t6, r3, n4, i5, s5) { - var a4, o2, h3 = e6.file, u3 = e6.compression, l2 = s5 !== O2.utf8encode, f2 = I2.transformTo("string", s5(h3.name)), c3 = I2.transformTo("string", O2.utf8encode(h3.name)), d4 = h3.comment, p = I2.transformTo("string", s5(d4)), m4 = I2.transformTo("string", O2.utf8encode(d4)), _18 = c3.length !== h3.name.length, g = m4.length !== d4.length, b2 = "", v2 = "", y3 = "", w2 = h3.dir, k2 = h3.date, x2 = { crc32: 0, compressedSize: 0, uncompressedSize: 0 }; + var a4, o2, h3 = e6.file, u3 = e6.compression, l2 = s5 !== O2.utf8encode, f2 = I2.transformTo("string", s5(h3.name)), c3 = I2.transformTo("string", O2.utf8encode(h3.name)), d4 = h3.comment, p = I2.transformTo("string", s5(d4)), m4 = I2.transformTo("string", O2.utf8encode(d4)), _17 = c3.length !== h3.name.length, g = m4.length !== d4.length, b2 = "", v2 = "", y3 = "", w2 = h3.dir, k2 = h3.date, x2 = { crc32: 0, compressedSize: 0, uncompressedSize: 0 }; t6 && !r3 || (x2.crc32 = e6.crc32, x2.compressedSize = e6.compressedSize, x2.uncompressedSize = e6.uncompressedSize); var S3 = 0; - t6 && (S3 |= 8), l2 || !_18 && !g || (S3 |= 2048); + t6 && (S3 |= 8), l2 || !_17 && !g || (S3 |= 2048); var z2 = 0, C = 0; w2 && (z2 |= 16), "UNIX" === i5 ? (C = 798, z2 |= function(e7, t7) { var r4 = e7; return e7 || (r4 = t7 ? 16893 : 33204), (65535 & r4) << 16; }(h3.unixPermissions, w2)) : (C = 20, z2 |= function(e7) { return 63 & (e7 || 0); - }(h3.dosPermissions)), a4 = k2.getUTCHours(), a4 <<= 6, a4 |= k2.getUTCMinutes(), a4 <<= 5, a4 |= k2.getUTCSeconds() / 2, o2 = k2.getUTCFullYear() - 1980, o2 <<= 4, o2 |= k2.getUTCMonth() + 1, o2 <<= 5, o2 |= k2.getUTCDate(), _18 && (v2 = A(1, 1) + A(B2(f2), 4) + c3, b2 += "up" + A(v2.length, 2) + v2), g && (y3 = A(1, 1) + A(B2(p), 4) + m4, b2 += "uc" + A(y3.length, 2) + y3); + }(h3.dosPermissions)), a4 = k2.getUTCHours(), a4 <<= 6, a4 |= k2.getUTCMinutes(), a4 <<= 5, a4 |= k2.getUTCSeconds() / 2, o2 = k2.getUTCFullYear() - 1980, o2 <<= 4, o2 |= k2.getUTCMonth() + 1, o2 <<= 5, o2 |= k2.getUTCDate(), _17 && (v2 = A(1, 1) + A(B2(f2), 4) + c3, b2 += "up" + A(v2.length, 2) + v2), g && (y3 = A(1, 1) + A(B2(p), 4) + m4, b2 += "uc" + A(y3.length, 2) + y3); var E2 = ""; return E2 += "\n\0", E2 += A(S3, 2), E2 += u3.magic, E2 += A(a4, 2), E2 += A(o2, 2), E2 += A(x2.crc32, 4), E2 += A(x2.compressedSize, 4), E2 += A(x2.uncompressedSize, 4), E2 += A(f2.length, 2), E2 += A(b2.length, 2), { fileRecord: R2.LOCAL_FILE_HEADER + E2 + f2 + b2, dirRecord: R2.CENTRAL_FILE_HEADER + A(C, 2) + E2 + A(p.length, 2) + "\0\0\0\0" + A(z2, 4) + A(n4, 4) + f2 + b2 + p }; } @@ -21318,7 +21318,7 @@ var require_jszip_min = __commonJS({ "use strict"; function s4(e6, t6, r3) { var n4, i5 = u3.getTypeOf(t6), s5 = u3.extend(r3 || {}, f2); - s5.date = s5.date || new Date(), null !== s5.compression && (s5.compression = s5.compression.toUpperCase()), "string" == typeof s5.unixPermissions && (s5.unixPermissions = parseInt(s5.unixPermissions, 8)), s5.unixPermissions && 16384 & s5.unixPermissions && (s5.dir = true), s5.dosPermissions && 16 & s5.dosPermissions && (s5.dir = true), s5.dir && (e6 = g(e6)), s5.createFolders && (n4 = _18(e6)) && b2.call(this, n4, true); + s5.date = s5.date || new Date(), null !== s5.compression && (s5.compression = s5.compression.toUpperCase()), "string" == typeof s5.unixPermissions && (s5.unixPermissions = parseInt(s5.unixPermissions, 8)), s5.unixPermissions && 16384 & s5.unixPermissions && (s5.dir = true), s5.dosPermissions && 16 & s5.dosPermissions && (s5.dir = true), s5.dir && (e6 = g(e6)), s5.createFolders && (n4 = _17(e6)) && b2.call(this, n4, true); var a5 = "string" === i5 && false === s5.binary && false === s5.base64; r3 && void 0 !== r3.binary || (s5.binary = !a5), (t6 instanceof c3 && 0 === t6.uncompressedSize || s5.dir || !t6 || 0 === t6.length) && (s5.base64 = false, s5.binary = true, t6 = "", s5.compression = "STORE", i5 = "string"); var o3 = null; @@ -21326,7 +21326,7 @@ var require_jszip_min = __commonJS({ var h4 = new d4(e6, o3, s5); this.files[e6] = h4; } - var i4 = e5("./utf8"), u3 = e5("./utils"), l2 = e5("./stream/GenericWorker"), a4 = e5("./stream/StreamHelper"), f2 = e5("./defaults"), c3 = e5("./compressedObject"), d4 = e5("./zipObject"), o2 = e5("./generate"), p = e5("./nodejsUtils"), m4 = e5("./nodejs/NodejsStreamInputAdapter"), _18 = function(e6) { + var i4 = e5("./utf8"), u3 = e5("./utils"), l2 = e5("./stream/GenericWorker"), a4 = e5("./stream/StreamHelper"), f2 = e5("./defaults"), c3 = e5("./compressedObject"), d4 = e5("./zipObject"), o2 = e5("./generate"), p = e5("./nodejsUtils"), m4 = e5("./nodejs/NodejsStreamInputAdapter"), _17 = function(e6) { "/" === e6.slice(-1) && (e6 = e6.substring(0, e6.length - 1)); var t6 = e6.lastIndexOf("/"); return 0 < t6 ? e6.substring(0, t6) : ""; @@ -22367,7 +22367,7 @@ var require_jszip_min = __commonJS({ }; }, { "./utils/common": 41, "./utils/strings": 42, "./zlib/deflate": 46, "./zlib/messages": 51, "./zlib/zstream": 53 }], 40: [function(e5, t5, r2) { "use strict"; - var c3 = e5("./zlib/inflate"), d4 = e5("./utils/common"), p = e5("./utils/strings"), m4 = e5("./zlib/constants"), n3 = e5("./zlib/messages"), i4 = e5("./zlib/zstream"), s4 = e5("./zlib/gzheader"), _18 = Object.prototype.toString; + var c3 = e5("./zlib/inflate"), d4 = e5("./utils/common"), p = e5("./utils/strings"), m4 = e5("./zlib/constants"), n3 = e5("./zlib/messages"), i4 = e5("./zlib/zstream"), s4 = e5("./zlib/gzheader"), _17 = Object.prototype.toString; function a4(e6) { if (!(this instanceof a4)) return new a4(e6); @@ -22389,9 +22389,9 @@ var require_jszip_min = __commonJS({ var r3, n4, i5, s5, a5, o3, h3 = this.strm, u3 = this.options.chunkSize, l2 = this.options.dictionary, f2 = false; if (this.ended) return false; - n4 = t6 === ~~t6 ? t6 : true === t6 ? m4.Z_FINISH : m4.Z_NO_FLUSH, "string" == typeof e6 ? h3.input = p.binstring2buf(e6) : "[object ArrayBuffer]" === _18.call(e6) ? h3.input = new Uint8Array(e6) : h3.input = e6, h3.next_in = 0, h3.avail_in = h3.input.length; + n4 = t6 === ~~t6 ? t6 : true === t6 ? m4.Z_FINISH : m4.Z_NO_FLUSH, "string" == typeof e6 ? h3.input = p.binstring2buf(e6) : "[object ArrayBuffer]" === _17.call(e6) ? h3.input = new Uint8Array(e6) : h3.input = e6, h3.next_in = 0, h3.avail_in = h3.input.length; do { - if (0 === h3.avail_out && (h3.output = new d4.Buf8(u3), h3.next_out = 0, h3.avail_out = u3), (r3 = c3.inflate(h3, m4.Z_NO_FLUSH)) === m4.Z_NEED_DICT && l2 && (o3 = "string" == typeof l2 ? p.string2buf(l2) : "[object ArrayBuffer]" === _18.call(l2) ? new Uint8Array(l2) : l2, r3 = c3.inflateSetDictionary(this.strm, o3)), r3 === m4.Z_BUF_ERROR && true === f2 && (r3 = m4.Z_OK, f2 = false), r3 !== m4.Z_STREAM_END && r3 !== m4.Z_OK) + if (0 === h3.avail_out && (h3.output = new d4.Buf8(u3), h3.next_out = 0, h3.avail_out = u3), (r3 = c3.inflate(h3, m4.Z_NO_FLUSH)) === m4.Z_NEED_DICT && l2 && (o3 = "string" == typeof l2 ? p.string2buf(l2) : "[object ArrayBuffer]" === _17.call(l2) ? new Uint8Array(l2) : l2, r3 = c3.inflateSetDictionary(this.strm, o3)), r3 === m4.Z_BUF_ERROR && true === f2 && (r3 = m4.Z_OK, f2 = false), r3 !== m4.Z_STREAM_END && r3 !== m4.Z_OK) return this.onEnd(r3), !(this.ended = true); h3.next_out && (0 !== h3.avail_out && r3 !== m4.Z_STREAM_END && (0 !== h3.avail_in || n4 !== m4.Z_FINISH && n4 !== m4.Z_SYNC_FLUSH) || ("string" === this.options.to ? (i5 = p.utf8border(h3.output, h3.next_out), s5 = h3.next_out - i5, a5 = p.buf2string(h3.output, i5), h3.next_out = s5, h3.avail_out = u3 - s5, s5 && d4.arraySet(h3.output, h3.output, i5, s5, 0), this.onData(a5)) : this.onData(d4.shrinkBuf(h3.output, h3.next_out)))), 0 === h3.avail_in && 0 === h3.avail_out && (f2 = true); } while ((0 < h3.avail_in || 0 === h3.avail_out) && r3 !== m4.Z_STREAM_END); @@ -22529,7 +22529,7 @@ var require_jszip_min = __commonJS({ }; }, {}], 46: [function(e5, t5, r2) { "use strict"; - var h3, c3 = e5("../utils/common"), u3 = e5("./trees"), d4 = e5("./adler32"), p = e5("./crc32"), n3 = e5("./messages"), l2 = 0, f2 = 4, m4 = 0, _18 = -2, g = -1, b2 = 4, i4 = 2, v2 = 8, y3 = 9, s4 = 286, a4 = 30, o2 = 19, w2 = 2 * s4 + 1, k2 = 15, x2 = 3, S3 = 258, z2 = S3 + x2 + 1, C = 42, E2 = 113, A = 1, I2 = 2, O2 = 3, B2 = 4; + var h3, c3 = e5("../utils/common"), u3 = e5("./trees"), d4 = e5("./adler32"), p = e5("./crc32"), n3 = e5("./messages"), l2 = 0, f2 = 4, m4 = 0, _17 = -2, g = -1, b2 = 4, i4 = 2, v2 = 8, y3 = 9, s4 = 286, a4 = 30, o2 = 19, w2 = 2 * s4 + 1, k2 = 15, x2 = 3, S3 = 258, z2 = S3 + x2 + 1, C = 42, E2 = 113, A = 1, I2 = 2, O2 = 3, B2 = 4; function R2(e6, t6) { return e6.msg = n3[t6], t6; } @@ -22638,7 +22638,7 @@ var require_jszip_min = __commonJS({ } function G2(e6) { var t6; - return e6 && e6.state ? (e6.total_in = e6.total_out = 0, e6.data_type = i4, (t6 = e6.state).pending = 0, t6.pending_out = 0, t6.wrap < 0 && (t6.wrap = -t6.wrap), t6.status = t6.wrap ? C : E2, e6.adler = 2 === t6.wrap ? 0 : 1, t6.last_flush = l2, u3._tr_init(t6), m4) : R2(e6, _18); + return e6 && e6.state ? (e6.total_in = e6.total_out = 0, e6.data_type = i4, (t6 = e6.state).pending = 0, t6.pending_out = 0, t6.wrap < 0 && (t6.wrap = -t6.wrap), t6.status = t6.wrap ? C : E2, e6.adler = 2 === t6.wrap ? 0 : 1, t6.last_flush = l2, u3._tr_init(t6), m4) : R2(e6, _17); } function K2(e6) { var t6 = G2(e6); @@ -22648,10 +22648,10 @@ var require_jszip_min = __commonJS({ } function Y2(e6, t6, r3, n4, i5, s5) { if (!e6) - return _18; + return _17; var a5 = 1; if (t6 === g && (t6 = 6), n4 < 0 ? (a5 = 0, n4 = -n4) : 15 < n4 && (a5 = 2, n4 -= 16), i5 < 1 || y3 < i5 || r3 !== v2 || n4 < 8 || 15 < n4 || t6 < 0 || 9 < t6 || s5 < 0 || b2 < s5) - return R2(e6, _18); + return R2(e6, _17); 8 === n4 && (n4 = 9); var o3 = new H3(); return (e6.state = o3).strm = e6, o3.wrap = a5, o3.gzhead = null, o3.w_bits = n4, o3.w_size = 1 << o3.w_bits, o3.w_mask = o3.w_size - 1, o3.hash_bits = i5 + 7, o3.hash_size = 1 << o3.hash_bits, o3.hash_mask = o3.hash_size - 1, o3.hash_shift = ~~((o3.hash_bits + x2 - 1) / x2), o3.window = new c3.Buf8(2 * o3.w_size), o3.head = new c3.Buf16(o3.hash_size), o3.prev = new c3.Buf16(o3.w_size), o3.lit_bufsize = 1 << i5 + 6, o3.pending_buf_size = 4 * o3.lit_bufsize, o3.pending_buf = new c3.Buf8(o3.pending_buf_size), o3.d_buf = 1 * o3.lit_bufsize, o3.l_buf = 3 * o3.lit_bufsize, o3.level = t6, o3.strategy = s5, o3.method = r3, K2(e6); @@ -22676,13 +22676,13 @@ var require_jszip_min = __commonJS({ }), new M3(4, 4, 8, 4, Z), new M3(4, 5, 16, 8, Z), new M3(4, 6, 32, 32, Z), new M3(4, 4, 16, 16, W), new M3(8, 16, 32, 32, W), new M3(8, 16, 128, 128, W), new M3(8, 32, 128, 256, W), new M3(32, 128, 258, 1024, W), new M3(32, 258, 258, 4096, W)], r2.deflateInit = function(e6, t6) { return Y2(e6, t6, v2, 15, 8, 0); }, r2.deflateInit2 = Y2, r2.deflateReset = K2, r2.deflateResetKeep = G2, r2.deflateSetHeader = function(e6, t6) { - return e6 && e6.state ? 2 !== e6.state.wrap ? _18 : (e6.state.gzhead = t6, m4) : _18; + return e6 && e6.state ? 2 !== e6.state.wrap ? _17 : (e6.state.gzhead = t6, m4) : _17; }, r2.deflate = function(e6, t6) { var r3, n4, i5, s5; if (!e6 || !e6.state || 5 < t6 || t6 < 0) - return e6 ? R2(e6, _18) : _18; + return e6 ? R2(e6, _17) : _17; if (n4 = e6.state, !e6.output || !e6.input && 0 !== e6.avail_in || 666 === n4.status && t6 !== f2) - return R2(e6, 0 === e6.avail_out ? -5 : _18); + return R2(e6, 0 === e6.avail_out ? -5 : _17); if (n4.strm = e6, r3 = n4.last_flush, n4.last_flush = t6, n4.status === C) if (2 === n4.wrap) e6.adler = 0, U(n4, 31), U(n4, 139), U(n4, 8), n4.gzhead ? (U(n4, (n4.gzhead.text ? 1 : 0) + (n4.gzhead.hcrc ? 2 : 0) + (n4.gzhead.extra ? 4 : 0) + (n4.gzhead.name ? 8 : 0) + (n4.gzhead.comment ? 16 : 0)), U(n4, 255 & n4.gzhead.time), U(n4, n4.gzhead.time >> 8 & 255), U(n4, n4.gzhead.time >> 16 & 255), U(n4, n4.gzhead.time >> 24 & 255), U(n4, 9 === n4.level ? 2 : 2 <= n4.strategy || n4.level < 2 ? 4 : 0), U(n4, 255 & n4.gzhead.os), n4.gzhead.extra && n4.gzhead.extra.length && (U(n4, 255 & n4.gzhead.extra.length), U(n4, n4.gzhead.extra.length >> 8 & 255)), n4.gzhead.hcrc && (e6.adler = p(e6.adler, n4.pending_buf, n4.pending, 0)), n4.gzindex = 0, n4.status = 69) : (U(n4, 0), U(n4, 0), U(n4, 0), U(n4, 0), U(n4, 0), U(n4, 9 === n4.level ? 2 : 2 <= n4.strategy || n4.level < 2 ? 4 : 0), U(n4, 3), n4.status = E2); @@ -22769,13 +22769,13 @@ var require_jszip_min = __commonJS({ return t6 !== f2 ? m4 : n4.wrap <= 0 ? 1 : (2 === n4.wrap ? (U(n4, 255 & e6.adler), U(n4, e6.adler >> 8 & 255), U(n4, e6.adler >> 16 & 255), U(n4, e6.adler >> 24 & 255), U(n4, 255 & e6.total_in), U(n4, e6.total_in >> 8 & 255), U(n4, e6.total_in >> 16 & 255), U(n4, e6.total_in >> 24 & 255)) : (P3(n4, e6.adler >>> 16), P3(n4, 65535 & e6.adler)), F(e6), 0 < n4.wrap && (n4.wrap = -n4.wrap), 0 !== n4.pending ? m4 : 1); }, r2.deflateEnd = function(e6) { var t6; - return e6 && e6.state ? (t6 = e6.state.status) !== C && 69 !== t6 && 73 !== t6 && 91 !== t6 && 103 !== t6 && t6 !== E2 && 666 !== t6 ? R2(e6, _18) : (e6.state = null, t6 === E2 ? R2(e6, -3) : m4) : _18; + return e6 && e6.state ? (t6 = e6.state.status) !== C && 69 !== t6 && 73 !== t6 && 91 !== t6 && 103 !== t6 && t6 !== E2 && 666 !== t6 ? R2(e6, _17) : (e6.state = null, t6 === E2 ? R2(e6, -3) : m4) : _17; }, r2.deflateSetDictionary = function(e6, t6) { var r3, n4, i5, s5, a5, o3, h4, u4, l3 = t6.length; if (!e6 || !e6.state) - return _18; + return _17; if (2 === (s5 = (r3 = e6.state).wrap) || 1 === s5 && r3.status !== C || r3.lookahead) - return _18; + return _17; for (1 === s5 && (e6.adler = d4(e6.adler, t6, l3, 0)), r3.wrap = 0, l3 >= r3.w_size && (0 === s5 && (D2(r3.head), r3.strstart = 0, r3.block_start = 0, r3.insert = 0), u4 = new c3.Buf8(r3.w_size), c3.arraySet(u4, t6, l3 - r3.w_size, r3.w_size, 0), t6 = u4, l3 = r3.w_size), a5 = e6.avail_in, o3 = e6.next_in, h4 = e6.input, e6.avail_in = l3, e6.next_in = 0, e6.input = t6, j(r3); r3.lookahead >= x2; ) { for (n4 = r3.strstart, i5 = r3.lookahead - (x2 - 1); r3.ins_h = (r3.ins_h << r3.hash_shift ^ r3.window[n4 + x2 - 1]) & r3.hash_mask, r3.prev[n4 & r3.w_mask] = r3.head[r3.ins_h], r3.head[r3.ins_h] = n4, n4++, --i5; ) ; @@ -22791,8 +22791,8 @@ var require_jszip_min = __commonJS({ }, {}], 48: [function(e5, t5, r2) { "use strict"; t5.exports = function(e6, t6) { - var r3, n3, i4, s4, a4, o2, h3, u3, l2, f2, c3, d4, p, m4, _18, g, b2, v2, y3, w2, k2, x2, S3, z2, C; - r3 = e6.state, n3 = e6.next_in, z2 = e6.input, i4 = n3 + (e6.avail_in - 5), s4 = e6.next_out, C = e6.output, a4 = s4 - (t6 - e6.avail_out), o2 = s4 + (e6.avail_out - 257), h3 = r3.dmax, u3 = r3.wsize, l2 = r3.whave, f2 = r3.wnext, c3 = r3.window, d4 = r3.hold, p = r3.bits, m4 = r3.lencode, _18 = r3.distcode, g = (1 << r3.lenbits) - 1, b2 = (1 << r3.distbits) - 1; + var r3, n3, i4, s4, a4, o2, h3, u3, l2, f2, c3, d4, p, m4, _17, g, b2, v2, y3, w2, k2, x2, S3, z2, C; + r3 = e6.state, n3 = e6.next_in, z2 = e6.input, i4 = n3 + (e6.avail_in - 5), s4 = e6.next_out, C = e6.output, a4 = s4 - (t6 - e6.avail_out), o2 = s4 + (e6.avail_out - 257), h3 = r3.dmax, u3 = r3.wsize, l2 = r3.whave, f2 = r3.wnext, c3 = r3.window, d4 = r3.hold, p = r3.bits, m4 = r3.lencode, _17 = r3.distcode, g = (1 << r3.lenbits) - 1, b2 = (1 << r3.distbits) - 1; e: do { p < 15 && (d4 += z2[n3++] << p, p += 8, d4 += z2[n3++] << p, p += 8), v2 = m4[d4 & g]; @@ -22813,12 +22813,12 @@ var require_jszip_min = __commonJS({ e6.msg = "invalid literal/length code", r3.mode = 30; break e; } - w2 = 65535 & v2, (y3 &= 15) && (p < y3 && (d4 += z2[n3++] << p, p += 8), w2 += d4 & (1 << y3) - 1, d4 >>>= y3, p -= y3), p < 15 && (d4 += z2[n3++] << p, p += 8, d4 += z2[n3++] << p, p += 8), v2 = _18[d4 & b2]; + w2 = 65535 & v2, (y3 &= 15) && (p < y3 && (d4 += z2[n3++] << p, p += 8), w2 += d4 & (1 << y3) - 1, d4 >>>= y3, p -= y3), p < 15 && (d4 += z2[n3++] << p, p += 8, d4 += z2[n3++] << p, p += 8), v2 = _17[d4 & b2]; r: for (; ; ) { if (d4 >>>= y3 = v2 >>> 24, p -= y3, !(16 & (y3 = v2 >>> 16 & 255))) { if (0 == (64 & y3)) { - v2 = _18[(65535 & v2) + (d4 & (1 << y3) - 1)]; + v2 = _17[(65535 & v2) + (d4 & (1 << y3) - 1)]; continue r; } e6.msg = "invalid distance code", r3.mode = 30; @@ -22920,7 +22920,7 @@ var require_jszip_min = __commonJS({ r2.inflateReset = o2, r2.inflateReset2 = h3, r2.inflateResetKeep = a4, r2.inflateInit = function(e6) { return u3(e6, 15); }, r2.inflateInit2 = u3, r2.inflate = function(e6, t6) { - var r3, n4, i5, s5, a5, o3, h4, u4, l3, f3, c4, d4, p, m4, _18, g, b2, v2, y3, w2, k2, x2, S3, z2, C = 0, E2 = new I2.Buf8(4), A = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; + var r3, n4, i5, s5, a5, o3, h4, u4, l3, f3, c4, d4, p, m4, _17, g, b2, v2, y3, w2, k2, x2, S3, z2, C = 0, E2 = new I2.Buf8(4), A = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; if (!e6 || !e6.state || !e6.output || !e6.input && 0 !== e6.avail_in) return U; 12 === (r3 = e6.state).mode && (r3.mode = 13), a5 = e6.next_out, i5 = e6.output, h4 = e6.avail_out, s5 = e6.next_in, n4 = e6.input, o3 = e6.avail_in, u4 = r3.hold, l3 = r3.bits, f3 = o3, c4 = h4, x2 = N; @@ -23131,39 +23131,39 @@ var require_jszip_min = __commonJS({ r3.have = 0, r3.mode = 19; case 19: for (; r3.have < r3.nlen + r3.ndist; ) { - for (; g = (C = r3.lencode[u4 & (1 << r3.lenbits) - 1]) >>> 16 & 255, b2 = 65535 & C, !((_18 = C >>> 24) <= l3); ) { + for (; g = (C = r3.lencode[u4 & (1 << r3.lenbits) - 1]) >>> 16 & 255, b2 = 65535 & C, !((_17 = C >>> 24) <= l3); ) { if (0 === o3) break e; o3--, u4 += n4[s5++] << l3, l3 += 8; } if (b2 < 16) - u4 >>>= _18, l3 -= _18, r3.lens[r3.have++] = b2; + u4 >>>= _17, l3 -= _17, r3.lens[r3.have++] = b2; else { if (16 === b2) { - for (z2 = _18 + 2; l3 < z2; ) { + for (z2 = _17 + 2; l3 < z2; ) { if (0 === o3) break e; o3--, u4 += n4[s5++] << l3, l3 += 8; } - if (u4 >>>= _18, l3 -= _18, 0 === r3.have) { + if (u4 >>>= _17, l3 -= _17, 0 === r3.have) { e6.msg = "invalid bit length repeat", r3.mode = 30; break; } k2 = r3.lens[r3.have - 1], d4 = 3 + (3 & u4), u4 >>>= 2, l3 -= 2; } else if (17 === b2) { - for (z2 = _18 + 3; l3 < z2; ) { + for (z2 = _17 + 3; l3 < z2; ) { if (0 === o3) break e; o3--, u4 += n4[s5++] << l3, l3 += 8; } - l3 -= _18, k2 = 0, d4 = 3 + (7 & (u4 >>>= _18)), u4 >>>= 3, l3 -= 3; + l3 -= _17, k2 = 0, d4 = 3 + (7 & (u4 >>>= _17)), u4 >>>= 3, l3 -= 3; } else { - for (z2 = _18 + 7; l3 < z2; ) { + for (z2 = _17 + 7; l3 < z2; ) { if (0 === o3) break e; o3--, u4 += n4[s5++] << l3, l3 += 8; } - l3 -= _18, k2 = 0, d4 = 11 + (127 & (u4 >>>= _18)), u4 >>>= 7, l3 -= 7; + l3 -= _17, k2 = 0, d4 = 11 + (127 & (u4 >>>= _17)), u4 >>>= 7, l3 -= 7; } if (r3.have + d4 > r3.nlen + r3.ndist) { e6.msg = "invalid bit length repeat", r3.mode = 30; @@ -23196,20 +23196,20 @@ var require_jszip_min = __commonJS({ e6.next_out = a5, e6.avail_out = h4, e6.next_in = s5, e6.avail_in = o3, r3.hold = u4, r3.bits = l3, R2(e6, c4), a5 = e6.next_out, i5 = e6.output, h4 = e6.avail_out, s5 = e6.next_in, n4 = e6.input, o3 = e6.avail_in, u4 = r3.hold, l3 = r3.bits, 12 === r3.mode && (r3.back = -1); break; } - for (r3.back = 0; g = (C = r3.lencode[u4 & (1 << r3.lenbits) - 1]) >>> 16 & 255, b2 = 65535 & C, !((_18 = C >>> 24) <= l3); ) { + for (r3.back = 0; g = (C = r3.lencode[u4 & (1 << r3.lenbits) - 1]) >>> 16 & 255, b2 = 65535 & C, !((_17 = C >>> 24) <= l3); ) { if (0 === o3) break e; o3--, u4 += n4[s5++] << l3, l3 += 8; } if (g && 0 == (240 & g)) { - for (v2 = _18, y3 = g, w2 = b2; g = (C = r3.lencode[w2 + ((u4 & (1 << v2 + y3) - 1) >> v2)]) >>> 16 & 255, b2 = 65535 & C, !(v2 + (_18 = C >>> 24) <= l3); ) { + for (v2 = _17, y3 = g, w2 = b2; g = (C = r3.lencode[w2 + ((u4 & (1 << v2 + y3) - 1) >> v2)]) >>> 16 & 255, b2 = 65535 & C, !(v2 + (_17 = C >>> 24) <= l3); ) { if (0 === o3) break e; o3--, u4 += n4[s5++] << l3, l3 += 8; } u4 >>>= v2, l3 -= v2, r3.back += v2; } - if (u4 >>>= _18, l3 -= _18, r3.back += _18, r3.length = b2, 0 === g) { + if (u4 >>>= _17, l3 -= _17, r3.back += _17, r3.length = b2, 0 === g) { r3.mode = 26; break; } @@ -23233,20 +23233,20 @@ var require_jszip_min = __commonJS({ } r3.was = r3.length, r3.mode = 23; case 23: - for (; g = (C = r3.distcode[u4 & (1 << r3.distbits) - 1]) >>> 16 & 255, b2 = 65535 & C, !((_18 = C >>> 24) <= l3); ) { + for (; g = (C = r3.distcode[u4 & (1 << r3.distbits) - 1]) >>> 16 & 255, b2 = 65535 & C, !((_17 = C >>> 24) <= l3); ) { if (0 === o3) break e; o3--, u4 += n4[s5++] << l3, l3 += 8; } if (0 == (240 & g)) { - for (v2 = _18, y3 = g, w2 = b2; g = (C = r3.distcode[w2 + ((u4 & (1 << v2 + y3) - 1) >> v2)]) >>> 16 & 255, b2 = 65535 & C, !(v2 + (_18 = C >>> 24) <= l3); ) { + for (v2 = _17, y3 = g, w2 = b2; g = (C = r3.distcode[w2 + ((u4 & (1 << v2 + y3) - 1) >> v2)]) >>> 16 & 255, b2 = 65535 & C, !(v2 + (_17 = C >>> 24) <= l3); ) { if (0 === o3) break e; o3--, u4 += n4[s5++] << l3, l3 += 8; } u4 >>>= v2, l3 -= v2, r3.back += v2; } - if (u4 >>>= _18, l3 -= _18, r3.back += _18, 64 & g) { + if (u4 >>>= _17, l3 -= _17, r3.back += _17, 64 & g) { e6.msg = "invalid distance code", r3.mode = 30; break; } @@ -23342,7 +23342,7 @@ var require_jszip_min = __commonJS({ "use strict"; var D2 = e5("../utils/common"), F = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], N = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], U = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0], P3 = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64]; t5.exports = function(e6, t6, r3, n3, i4, s4, a4, o2) { - var h3, u3, l2, f2, c3, d4, p, m4, _18, g = o2.bits, b2 = 0, v2 = 0, y3 = 0, w2 = 0, k2 = 0, x2 = 0, S3 = 0, z2 = 0, C = 0, E2 = 0, A = null, I2 = 0, O2 = new D2.Buf16(16), B2 = new D2.Buf16(16), R2 = null, T3 = 0; + var h3, u3, l2, f2, c3, d4, p, m4, _17, g = o2.bits, b2 = 0, v2 = 0, y3 = 0, w2 = 0, k2 = 0, x2 = 0, S3 = 0, z2 = 0, C = 0, E2 = 0, A = null, I2 = 0, O2 = new D2.Buf16(16), B2 = new D2.Buf16(16), R2 = null, T3 = 0; for (b2 = 0; b2 <= 15; b2++) O2[b2] = 0; for (v2 = 0; v2 < n3; v2++) @@ -23365,7 +23365,7 @@ var require_jszip_min = __commonJS({ if (d4 = 0 === e6 ? (A = R2 = a4, 19) : 1 === e6 ? (A = F, I2 -= 257, R2 = N, T3 -= 257, 256) : (A = U, R2 = P3, -1), b2 = y3, c3 = s4, S3 = v2 = E2 = 0, l2 = -1, f2 = (C = 1 << (x2 = k2)) - 1, 1 === e6 && 852 < C || 2 === e6 && 592 < C) return 1; for (; ; ) { - for (p = b2 - S3, _18 = a4[v2] < d4 ? (m4 = 0, a4[v2]) : a4[v2] > d4 ? (m4 = R2[T3 + a4[v2]], A[I2 + a4[v2]]) : (m4 = 96, 0), h3 = 1 << b2 - S3, y3 = u3 = 1 << x2; i4[c3 + (E2 >> S3) + (u3 -= h3)] = p << 24 | m4 << 16 | _18 | 0, 0 !== u3; ) + for (p = b2 - S3, _17 = a4[v2] < d4 ? (m4 = 0, a4[v2]) : a4[v2] > d4 ? (m4 = R2[T3 + a4[v2]], A[I2 + a4[v2]]) : (m4 = 96, 0), h3 = 1 << b2 - S3, y3 = u3 = 1 << x2; i4[c3 + (E2 >> S3) + (u3 -= h3)] = p << 24 | m4 << 16 | _17 | 0, 0 !== u3; ) ; for (h3 = 1 << b2 - 1; E2 & h3; ) h3 >>= 1; @@ -23394,7 +23394,7 @@ var require_jszip_min = __commonJS({ for (var t6 = e6.length; 0 <= --t6; ) e6[t6] = 0; } - var s4 = 0, a4 = 29, u3 = 256, l2 = u3 + 1 + a4, f2 = 30, c3 = 19, _18 = 2 * l2 + 1, g = 15, d4 = 16, p = 7, m4 = 256, b2 = 16, v2 = 17, y3 = 18, w2 = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], k2 = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], x2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], S3 = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], z2 = new Array(2 * (l2 + 2)); + var s4 = 0, a4 = 29, u3 = 256, l2 = u3 + 1 + a4, f2 = 30, c3 = 19, _17 = 2 * l2 + 1, g = 15, d4 = 16, p = 7, m4 = 256, b2 = 16, v2 = 17, y3 = 18, w2 = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], k2 = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], x2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], S3 = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], z2 = new Array(2 * (l2 + 2)); n3(z2); var C = new Array(2 * f2); n3(C); @@ -23468,7 +23468,7 @@ var require_jszip_min = __commonJS({ } function Y2(e6, t6) { var r3, n4, i5, s5 = t6.dyn_tree, a5 = t6.stat_desc.static_tree, o3 = t6.stat_desc.has_stree, h4 = t6.stat_desc.elems, u4 = -1; - for (e6.heap_len = 0, e6.heap_max = _18, r3 = 0; r3 < h4; r3++) + for (e6.heap_len = 0, e6.heap_max = _17, r3 = 0; r3 < h4; r3++) 0 !== s5[2 * r3] ? (e6.heap[++e6.heap_len] = u4 = r3, e6.depth[r3] = 0) : s5[2 * r3 + 1] = 0; for (; e6.heap_len < 2; ) s5[2 * (i5 = e6.heap[++e6.heap_len] = u4 < 2 ? ++u4 : 0)] = 1, e6.depth[i5] = 0, e6.opt_len--, o3 && (e6.static_len -= a5[2 * i5 + 1]); @@ -23480,7 +23480,7 @@ var require_jszip_min = __commonJS({ var r4, n5, i6, s6, a6, o4, h5 = t7.dyn_tree, u5 = t7.max_code, l3 = t7.stat_desc.static_tree, f3 = t7.stat_desc.has_stree, c4 = t7.stat_desc.extra_bits, d5 = t7.stat_desc.extra_base, p2 = t7.stat_desc.max_length, m5 = 0; for (s6 = 0; s6 <= g; s6++) e7.bl_count[s6] = 0; - for (h5[2 * e7.heap[e7.heap_max] + 1] = 0, r4 = e7.heap_max + 1; r4 < _18; r4++) + for (h5[2 * e7.heap[e7.heap_max] + 1] = 0, r4 = e7.heap_max + 1; r4 < _17; r4++) p2 < (s6 = h5[2 * h5[2 * (n5 = e7.heap[r4]) + 1] + 1] + 1) && (s6 = p2, m5++), h5[2 * n5 + 1] = s6, u5 < n5 || (e7.bl_count[s6]++, a6 = 0, d5 <= n5 && (a6 = c4[n5 - d5]), o4 = h5[2 * n5], e7.opt_len += o4 * (s6 + a6), f3 && (e7.static_len += o4 * (l3[2 * n5 + 1] + a6))); if (0 !== m5) { do { @@ -29430,6 +29430,10 @@ var T = class { name: "Row Height", desc: "The height for each row in spaces (in pixels), default is 28" }, + coverHeight: { + name: "Cover Height", + desc: "The height for the cover of the note or space, default is 200" + }, makeChar: { name: "Flow Menu Trigger", desc: "Character to open the Flow Menu" @@ -43039,7 +43043,7 @@ var generateCodeForProp = (value, isClosure) => { var buildExecutable = (root) => { const treeNode = { ...root, execActions: {}, execProps: {}, execStyles: {}, execPropsOptions: {} }; const { sortedKeys, dependencies: dependencies314 } = sortKeysByDependencies(treeNode.node.props, `${treeNode.id}.props`); - const { sortedKeys: _18, dependencies: styleDependencies } = sortKeysByDependencies(treeNode.node.styles, `${treeNode.id}.styles`); + const { sortedKeys: _17, dependencies: styleDependencies } = sortKeysByDependencies(treeNode.node.styles, `${treeNode.id}.styles`); treeNode.execPropsOptions.props = sortedKeys.map((f2) => { return { name: f2, @@ -45524,16 +45528,6 @@ var insertRows = (folder, rows, index2) => { var updateRowAtIndex = (folder, row2, index2) => { return { ...folder, rows: folder.rows.map((f2, i4) => i4 == index2 ? row2 : f2) }; }; -var saveContextToProperties = (manager, path, cols, context) => { - if (!path) - return; - manager.saveProperties(path, Object.keys(context).filter( - (f2) => cols.find((c3) => c3.name == f2) && cols.find((c3) => c3.name == f2).hidden != "true" && !cols.find((c3) => c3.name == f2).type.includes("file") && context[f2] - ).reduce((f2, g) => { - const col = cols.find((c3) => c3.name == g); - return { ...f2, [g]: parseMDBValue(col.type, context[g]) }; - }, {})); -}; var updateContextValue = async (manager, space2, path, field, value, _updateFunction, rank) => { manager.contextForSpace(space2.path).then( (f2) => { @@ -45729,10 +45723,6 @@ var renamePathInContexts = async (manager, oldPath, newPath, spaces2) => { var removePathInContexts = async (manager, path, spaces2) => { const promises = spaces2.map((space2) => { return processContext(manager, space2, async (mdb, space3) => { - const removeRow = mdb.rows.find((f2) => f2[PathPropertyName] == path); - if (removeRow) { - saveContextToProperties(manager, path, mdb.cols, removeRow); - } const newDB = removeRowForPath(mdb, path); if (!import_lodash5.default.isEqual(mdb, newDB)) { await saveContext(manager, space3, newDB); @@ -45753,10 +45743,6 @@ var reorderPathsInContext = async (manager, paths, index2, space2) => { }; var removePathsInContext = async (manager, paths, space2) => { return processContext(manager, space2, async (mdb, context) => { - mdb.rows.forEach((row2) => { - if (paths.includes(row2[PathPropertyName])) - saveContextToProperties(manager, row2[PathPropertyName], mdb.cols, row2); - }); const newDB = removeRowsForPath(mdb, paths); if (!import_lodash5.default.isEqual(mdb, newDB)) { await saveContext(manager, context, newDB); @@ -53263,7 +53249,7 @@ var createNumber = /* @__PURE__ */ factory(name20, dependencies20, (_ref) => { typed: typed3 } = _ref; var number4 = typed3("number", { - "": function _18() { + "": function _17() { return 0; }, number: function number5(x2) { @@ -53329,7 +53315,7 @@ var createString = /* @__PURE__ */ factory(name21, dependencies21, (_ref) => { typed: typed3 } = _ref; return typed3(name21, { - "": function _18() { + "": function _17() { return ""; }, number: format2, @@ -53357,7 +53343,7 @@ var createBoolean = /* @__PURE__ */ factory(name22, dependencies22, (_ref) => { typed: typed3 } = _ref; return typed3(name22, { - "": function _18() { + "": function _17() { return false; }, boolean: function boolean2(x2) { @@ -53398,7 +53384,7 @@ var createBignumber = /* @__PURE__ */ factory(name23, dependencies23, (_ref) => BigNumber: BigNumber2 } = _ref; return typed3("bignumber", { - "": function _18() { + "": function _17() { return new BigNumber2(0); }, number: function number4(x2) { @@ -53449,7 +53435,7 @@ var createComplex = /* @__PURE__ */ factory(name24, dependencies24, (_ref) => { Complex: Complex3 } = _ref; return typed3("complex", { - "": function _18() { + "": function _17() { return Complex3.ZERO; }, number: function number4(x2) { @@ -53539,7 +53525,7 @@ var createMatrix = /* @__PURE__ */ factory(name26, dependencies26, (_ref) => { SparseMatrix: SparseMatrix2 } = _ref; return typed3(name26, { - "": function _18() { + "": function _17() { return _create([]); }, string: function string4(format8) { @@ -53605,7 +53591,7 @@ var createMatrixFromFunction = /* @__PURE__ */ factory(name27, dependencies27, ( m4 = matrix2(format8); } m4.resize(size2); - m4.forEach(function(_18, index2) { + m4.forEach(function(_17, index2) { var val = fn(index2); if (isZero2(val)) return; @@ -57553,7 +57539,7 @@ var createIdentity = /* @__PURE__ */ factory(name94, dependencies93, (_ref) => { SparseMatrix: SparseMatrix2 } = _ref; return typed3(name94, { - "": function _18() { + "": function _17() { return config4.matrix === "Matrix" ? matrix2([]) : []; }, string: function string4(format8) { @@ -57799,7 +57785,7 @@ var createOnes = /* @__PURE__ */ factory(name98, dependencies97, (_ref) => { BigNumber: BigNumber2 } = _ref; return typed3("ones", { - "": function _18() { + "": function _17() { return config4.matrix === "Array" ? _ones([]) : _ones([], "default"); }, "...number | BigNumber | string": function numberBigNumberString(size2) { @@ -58137,7 +58123,7 @@ var createRotationMatrix = /* @__PURE__ */ factory(name103, dependencies102, (_r sin: sin3 } = _ref; return typed3(name103, { - "": function _18() { + "": function _17() { return config4.matrix === "Matrix" ? matrix2([]) : []; }, string: function string4(format8) { @@ -58589,7 +58575,7 @@ var createZeros = /* @__PURE__ */ factory(name110, dependencies109, (_ref) => { BigNumber: BigNumber2 } = _ref; return typed3(name110, { - "": function _18() { + "": function _17() { return config4.matrix === "Array" ? _zeros([]) : _zeros([], "default"); }, "...number | BigNumber | string": function numberBigNumberString(size2) { @@ -58683,12 +58669,12 @@ var createFft = /* @__PURE__ */ factory(name111, dependencies110, (_ref) => { function _1dFft(arr, dim) { var size2 = arraySize(arr); if (dim !== 0) - return new Array(size2[0]).fill(0).map((_18, i4) => _1dFft(arr[i4], dim - 1)); + return new Array(size2[0]).fill(0).map((_17, i4) => _1dFft(arr[i4], dim - 1)); if (size2.length === 1) return _fft(arr); function _transpose(arr2) { var size3 = arraySize(arr2); - return new Array(size3[1]).fill(0).map((_18, j) => new Array(size3[0]).fill(0).map((_19, i4) => arr2[i4][j])); + return new Array(size3[1]).fill(0).map((_17, j) => new Array(size3[0]).fill(0).map((_18, i4) => arr2[i4][j])); } return _transpose(_1dFft(_transpose(arr), 1)); } @@ -58700,11 +58686,11 @@ var createFft = /* @__PURE__ */ factory(name111, dependencies110, (_ref) => { chirp.push(pow3(w2, divideScalar2(pow3(i4, 2), 2))); } var N2 = pow3(2, ceil3(log25(n3 + n3 - 1))); - var xp = [...new Array(n3).fill(0).map((_18, i5) => multiplyScalar2(arr[i5], chirp[n3 - 1 + i5])), ...new Array(N2 - n3).fill(0)]; - var ichirp = [...new Array(n3 + n3 - 1).fill(0).map((_18, i5) => divideScalar2(1, chirp[i5])), ...new Array(N2 - (n3 + n3 - 1)).fill(0)]; + var xp = [...new Array(n3).fill(0).map((_17, i5) => multiplyScalar2(arr[i5], chirp[n3 - 1 + i5])), ...new Array(N2 - n3).fill(0)]; + var ichirp = [...new Array(n3 + n3 - 1).fill(0).map((_17, i5) => divideScalar2(1, chirp[i5])), ...new Array(N2 - (n3 + n3 - 1)).fill(0)]; var fftXp = _fft(xp); var fftIchirp = _fft(ichirp); - var fftProduct = new Array(N2).fill(0).map((_18, i5) => multiplyScalar2(fftXp[i5], fftIchirp[i5])); + var fftProduct = new Array(N2).fill(0).map((_17, i5) => multiplyScalar2(fftXp[i5], fftIchirp[i5])); var ifftProduct = dotDivide2(conj2(_ndFft(conj2(fftProduct))), N2); var ret = []; for (var _i = n3 - 1; _i < n3 + n3 - 1; _i++) { @@ -58717,7 +58703,7 @@ var createFft = /* @__PURE__ */ factory(name111, dependencies110, (_ref) => { if (len === 1) return [arr[0]]; if (len % 2 === 0) { - var ret = [..._fft(arr.filter((_18, i4) => i4 % 2 === 0), len / 2), ..._fft(arr.filter((_18, i4) => i4 % 2 === 1), len / 2)]; + var ret = [..._fft(arr.filter((_17, i4) => i4 % 2 === 0), len / 2), ..._fft(arr.filter((_17, i4) => i4 % 2 === 1), len / 2)]; for (var k2 = 0; k2 < len / 2; k2++) { var p = ret[k2]; var q2 = multiplyScalar2(ret[k2 + len / 2], exp3(multiplyScalar2(multiplyScalar2(tau3, I2), divideScalar2(-k2, len)))); @@ -59131,7 +59117,7 @@ var createMode = /* @__PURE__ */ factory(name116, dependencies115, (_ref) => { } = _ref; return typed3(name116, { "Array | Matrix": _mode, - "...": function _18(args) { + "...": function _17(args) { return _mode(args); } }); @@ -59193,7 +59179,7 @@ var createProd = /* @__PURE__ */ factory(name117, dependencies116, (_ref) => { "Array | Matrix, number | BigNumber": function ArrayMatrixNumberBigNumber(array, dim) { throw new Error("prod(A, dim) is not yet supported"); }, - "...": function _18(args) { + "...": function _17(args) { return _prod(args); } }); @@ -61759,7 +61745,7 @@ var createMax = /* @__PURE__ */ factory(name156, dependencies155, (_ref) => { "Array | Matrix, number | BigNumber": function ArrayMatrixNumberBigNumber(array, dim) { return reduce(array, dim.valueOf(), _largest); }, - "...": function _18(args) { + "...": function _17(args) { if (containsCollections(args)) { throw new TypeError("Scalar values expected in function max"); } @@ -61811,7 +61797,7 @@ var createMin = /* @__PURE__ */ factory(name157, dependencies156, (_ref) => { "Array | Matrix, number | BigNumber": function ArrayMatrixNumberBigNumber(array, dim) { return reduce(array, dim.valueOf(), _smallest); }, - "...": function _18(args) { + "...": function _17(args) { if (containsCollections(args)) { throw new TypeError("Scalar values expected in function min"); } @@ -65754,7 +65740,7 @@ var createSparse = /* @__PURE__ */ factory(name164, dependencies163, (_ref) => { SparseMatrix: SparseMatrix2 } = _ref; return typed3(name164, { - "": function _18() { + "": function _17() { return new SparseMatrix2([]); }, string: function string4(datatype) { @@ -71503,7 +71489,7 @@ var createParser = /* @__PURE__ */ factory(name227, dependencies226, (_ref) => { Parser: Parser5 } = _ref; return typed3(name227, { - "": function _18() { + "": function _17() { return new Parser5(); } }); @@ -76178,7 +76164,7 @@ var createChain = /* @__PURE__ */ factory(name241, dependencies240, (_ref) => { Chain: Chain2 } = _ref; return typed3(name241, { - "": function _18() { + "": function _17() { return new Chain2(); }, any: function any(value) { @@ -76250,7 +76236,7 @@ var createDet = /* @__PURE__ */ factory(name242, dependencies241, (_ref) => { return subtractScalar2(multiply2(matrix3[0][0], matrix3[1][1]), multiply2(matrix3[1][0], matrix3[0][1])); } else { var negated = false; - var rowIndices = new Array(rows).fill(0).map((_18, i5) => i5); + var rowIndices = new Array(rows).fill(0).map((_17, i5) => i5); for (var k2 = 0; k2 < rows; k2++) { var k_ = rowIndices[k2]; if (isZero2(matrix3[k_][k2])) { @@ -76513,8 +76499,8 @@ var createPinv = /* @__PURE__ */ factory(name244, dependencies243, (_ref) => { } function _rankFact(mat, rows, cols) { var rref = _rref(mat, rows, cols); - var C = mat.map((_18, i4) => _18.filter((_19, j) => j < rows && !_isZero(dot2(rref[j], rref[j])))); - var F = rref.filter((_18, i4) => !_isZero(dot2(rref[i4], rref[i4]))); + var C = mat.map((_17, i4) => _17.filter((_18, j) => j < rows && !_isZero(dot2(rref[j], rref[j])))); + var F = rref.filter((_17, i4) => !_isZero(dot2(rref[i4], rref[i4]))); return { C, F @@ -76910,7 +76896,7 @@ function createComplexEigs(_ref) { function randomOrthogonalVector(N, orthog, type) { var big = type === "BigNumber"; var cplx = type === "Complex"; - var v2 = Array(N).fill(0).map((_18) => 2 * Math.random() - 1); + var v2 = Array(N).fill(0).map((_17) => 2 * Math.random() - 1); if (big) { v2 = v2.map((n3) => bignumber2(n3)); } @@ -78217,7 +78203,7 @@ var createSum = /* @__PURE__ */ factory(name254, dependencies253, (_ref) => { return typed3(name254, { "Array | Matrix": _sum, "Array | Matrix, number | BigNumber": _nsumDim, - "...": function _18(args) { + "...": function _17(args) { if (containsCollections(args)) { throw new TypeError("Scalar values expected in function sum"); } @@ -78269,7 +78255,7 @@ var createCumSum = /* @__PURE__ */ factory(name255, dependencies254, (_ref) => { "Matrix, number | BigNumber": function MatrixNumberBigNumber(matrix2, dim) { return matrix2.create(_ncumSumDim(matrix2.valueOf(), dim)); }, - "...": function _18(args) { + "...": function _17(args) { if (containsCollections(args)) { throw new TypeError("All values expected to be scalar in function cumsum"); } @@ -78340,7 +78326,7 @@ var createMean = /* @__PURE__ */ factory(name256, dependencies255, (_ref) => { return typed3(name256, { "Array | Matrix": _mean, "Array | Matrix, number | BigNumber": _nmeanDim, - "...": function _18(args) { + "...": function _17(args) { if (containsCollections(args)) { throw new TypeError("Scalar values expected in function mean"); } @@ -78425,7 +78411,7 @@ var createMedian = /* @__PURE__ */ factory(name257, dependencies256, (_ref) => { "Array | Matrix, number | BigNumber": function ArrayMatrixNumberBigNumber(array, dim) { throw new Error("median(A, dim) is not yet supported"); }, - "...": function _18(args) { + "...": function _17(args) { if (containsCollections(args)) { throw new TypeError("Scalar values expected in function median"); } @@ -78447,7 +78433,7 @@ var createMad = /* @__PURE__ */ factory(name258, dependencies257, (_ref) => { } = _ref; return typed3(name258, { "Array | Matrix": _mad, - "...": function _18(args) { + "...": function _17(args) { return _mad(args); } }); @@ -78494,7 +78480,7 @@ var createVariance = /* @__PURE__ */ factory(name259, dependencies258, (_ref) => return _varDim(array, dim, DEFAULT_NORMALIZATION); }, "Array | Matrix, number | BigNumber, string": _varDim, - "...": function _18(args) { + "...": function _17(args) { return _var(args, DEFAULT_NORMALIZATION); } }); @@ -78662,7 +78648,7 @@ var createStd = /* @__PURE__ */ factory(name261, dependencies260, (_ref) => { "Array | Matrix, string": _std, "Array | Matrix, number | BigNumber": _std, "Array | Matrix, number | BigNumber, string": _std, - "...": function _18(args) { + "...": function _17(args) { return _std(args); } }); @@ -86927,7 +86913,20 @@ var addPathToSpaceAtIndex = async (superstate, space2, path, rank) => { return pinPathToSpaceAtIndex(superstate, space2, path, rank); } }; -var defaultSpace = async (superstate, activeFile) => (superstate.settings.newFileLocation == "folder" ? superstate.spacesIndex.get(superstate.settings.newFileFolderPath) : superstate.settings.newFileLocation == "current" && activeFile && (activeFile.type == "space" ? superstate.spacesIndex.get(activeFile.path) : superstate.spacesIndex.get(activeFile.parent))) ?? superstate.spacesIndex.get("/"); +var defaultSpace = async (superstate, activeFile) => { + let spaceState = null; + if (superstate.settings.newFileLocation == "folder") { + spaceState = superstate.spacesIndex.get(superstate.settings.newFileFolderPath); + } else if (superstate.settings.newFileLocation == "current" && activeFile && activeFile.type == "space") { + spaceState = superstate.spacesIndex.get(activeFile.path); + } else if (activeFile) { + spaceState = superstate.spacesIndex.get(activeFile.parent); + } + if (!spaceState) { + spaceState = superstate.spacesIndex.get("/"); + } + return spaceState; +}; var pinPathToSpaceAtIndex = async (superstate, space2, path, rank) => { if (path == space2.path) { return; @@ -87541,7 +87540,7 @@ var showSpacesMenu = (e5, superstate, saveLink, includeDefaults, canAdd) => { { name: i18n_default.buttons.tag, value: "tag" }, { name: i18n_default.menu.folder, value: "folder" } ], - saveOptions: (_18, value) => { + saveOptions: (_17, value) => { saveLink(value[0], !options.some((f2) => f2.value == value[0])); }, placeholder: i18n_default.labels.spaceSelectPlaceholder, @@ -90965,7 +90964,6 @@ var propertyDependencies = (fields) => { const deps = parse4(value).filter((f3) => f3.type == "FunctionNode").filter((f3) => f3.fn.name == "prop" && f3.args[0].type == "ConstantNode").map((f3) => f3.args[0]?.value); localDependencies.push(...deps); } catch (e5) { - console.log(e5); } const key2 = f2.name; if (!graph.has(key2)) { @@ -91260,7 +91258,7 @@ q: \`+this.q.toString():"")+\` \`),a.seealso&&a.seealso.length&&(n+="See also: "+a.seealso.join(", ")+\` \`),n},t.prototype.toJSON=function(){var a=ar(this.doc);return a.mathjs="Help",a},t.fromJSON=function(a){var n={};return Object.keys(a).filter(i=>i!=="mathjs").forEach(i=>{n[i]=a[i]}),new t(n)},t.prototype.valueOf=t.prototype.toString,t},{isClass:!0});var O$="Chain",B$=["?on","math","typed"],cg=F(O$,B$,e=>{var{on:r,math:t,typed:a}=e;function n(o){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");bu(o)?this.value=o.value:this.value=o}n.prototype.type="Chain",n.prototype.isChain=!0,n.prototype.done=function(){return this.value},n.prototype.valueOf=function(){return this.value},n.prototype.toString=function(){return lr(this.value)},n.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},n.fromJSON=function(o){return new n(o.value)};function i(o,s){typeof s=="function"&&(n.prototype[o]=l(s))}function u(o,s){Du(n.prototype,o,function(){var d=s();if(typeof d=="function")return l(d)})}function l(o){return function(){if(arguments.length===0)return new n(o(this.value));for(var s=[this.value],m=0;mo[x])};for(var d in o)m(d)}};var c={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return n.createProxy(t),r&&r("import",function(o,s,m){m||u(o,s)}),n},{isClass:!0});var hD={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]};var lT={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};var mT={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]};var pT={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]};var dT={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};var hT={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};var vT={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]};var gT={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]};var xT={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};var yT={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};var bT={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as \`(1 + sqrt(5)) / 2\` and is approximately 1.618034...",examples:["phi"],seealso:[]};var vD={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]};var wT={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]};var DT={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};var ST={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]};var NT={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};var AT={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};var MT={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]};var CT={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]};var ET={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]};var TT={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]};var FT={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]};var _T={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]};var OT={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]};var BT={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]};var PT={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]};var IT={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]};var RT={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]};var qT={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]};var kT={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]};var LT={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]};var zT={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]};var UT={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]};var WT={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]};var YT={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]};var HT={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]};var $T={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]};var GT={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]};var VT={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]};var ZT={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix \`A\` is decomposed in two matrices (\`Q\`, \`R\`) where \`Q\` is an orthogonal matrix and \`R\` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]};var QT={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]};var XT={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]};var JT={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]};var KT={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]};var jT={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]};var eF={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]};var rF={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]};var tF={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]};var nF={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]};var aF={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};var iF={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]};var oF={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When \`x\` is a number or complex number, an optional second argument \`allRoots\` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]};var sF={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]};var uF={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]};var fF={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]};var cF={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]};var lF={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]};var mF={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]};var pF={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]};var dF={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]};var hF={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]};var vF={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]};var gF={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]};var xF={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]};var yF={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]};var bF={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \\u2263 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]};var wF={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]};var DF={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]};var SF={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]};var NF={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a \`value+1\`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]};var AF={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating \`log(x, 2)\`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]};var MF={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]};var CF={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]};var EF={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']};var TF={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]};var FF={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]};var _F={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]};var OF={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]};var BF={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]};var PF={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]};var IF={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix \`X\` of another matrix \`A\` is such that \`X * X = A\`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]};var RF={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]};var qF={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]};var kF={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]};var LF={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]};var zF={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]};var UF={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]};var WF={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};var YF={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]};var HF={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var $F={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var GF={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]};var VF={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]};var ZF={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]};var QF={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]};var XF={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]};var JF={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. \`bellNumbers\` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]};var KF={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]};var jF={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]};var e_={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. \`stirlingS2\` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]};var r_={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]};var t_={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]};var n_={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]};var a_={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]};var i_={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]};var o_={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};var s_={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]};var u_={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]};var f_={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]};var c_={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]};var l_={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]};var m_={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]};var p_={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]};var d_={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var h_={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]};var v_={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]};var g_={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var x_={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var y_={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var b_={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]};var w_={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]};var D_={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]};var S_={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]};var N_={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]};var A_={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]};var M_={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]};var C_={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var E_={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var T_={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore\\u2013Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]};var F_={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]};var __={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]};var O_={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]};var B_={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]};var P_={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]};var I_={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]};var R_={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]};var q_={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]};var k_={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]};var L_={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]};var z_={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]};var U_={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]};var W_={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]};var Y_={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]};var H_={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]};var $_={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]};var G_={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation \`l:u\`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]};var V_={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]};var Z_={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var Q_={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]};var X_={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};var J_={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};var K_={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]};var j_={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]};var eO={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]};var rO={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]};var tO={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]};var nO={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]};var aO={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from \`n\` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]};var iO={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]};var oO={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]};var sO={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]};var uO={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]};var fO={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]};var cO={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]};var lO={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]};var mO={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]};var pO={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]};var dO={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]};var hO={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]};var vO={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]};var gO={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]};var xO={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]};var yO={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]};var bO={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]};var wO={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]};var DO={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]};var SO={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]};var NO={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]};var AO={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]};var MO={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]};var CO={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]};var EO={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]};var TO={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]};var FO={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]};var _O={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]};var OO={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]};var BO={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]};var PO={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]};var IO={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]};var RO={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]};var qO={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]};var kO={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]};var LO={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]};var zO={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]};var UO={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:\`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. -In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.\`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]};var WO={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]};var YO={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var HO={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var $O={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]};var GO={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]};var VO={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]};var ZO={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as \`acosh(x) = ln(sqrt(x^2 - 1) + x)\`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]};var QO={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]};var XO={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as \`acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2\`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]};var JO={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]};var KO={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as \`acsch(x) = ln(1/x + sqrt(1/x^2 + 1))\`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]};var jO={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]};var e3={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};var r3={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]};var t3={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as \`asinh(x) = ln(x + sqrt(x^2 + 1))\`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]};var n3={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]};var a3={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]};var i3={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as \`atanh(x) = ln((1 + x)/(1 - x)) / 2\`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]};var o3={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]};var s3={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};var u3={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]};var f3={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]};var c3={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]};var l3={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]};var m3={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]};var p3={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]};var d3={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]};var h3={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};var v3={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]};var g3={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]};var x3={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]};var y3={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};var b3={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]};var w3={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]};var D3={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]};var S3={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};var N3={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var A3={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var M3={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]};var C3={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]};var E3={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var T3={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var F3={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]};var _3={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]};var O3={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};var B3={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]};var P3={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]};var I3={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]};var R3={bignumber:MT,boolean:CT,complex:ET,createUnit:TT,fraction:FT,index:_T,matrix:OT,number:BT,sparse:PT,splitUnit:IT,string:RT,unit:qT,e:hD,E:hD,false:lT,i:mT,Infinity:pT,LN2:hT,LN10:dT,LOG2E:gT,LOG10E:vT,NaN:xT,null:yT,pi:vD,PI:vD,phi:bT,SQRT1_2:wT,SQRT2:DT,tau:ST,true:NT,version:AT,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:UT,lsolve:YT,lsolveAll:HT,lup:$T,lusolve:GT,leafCount:WT,polynomialRoot:VT,resolve:XT,simplify:JT,simplifyConstant:KT,simplifyCore:jT,symbolicEqual:rF,rationalize:QT,slu:eF,usolve:tF,usolveAll:nF,qr:ZT,abs:aF,add:iF,cbrt:oF,ceil:sF,cube:uF,divide:fF,dotDivide:cF,dotMultiply:lF,dotPow:mF,exp:pF,expm:dF,expm1:hF,fix:vF,floor:gF,gcd:xF,hypot:yF,lcm:wF,log:DF,log2:AF,log1p:NF,log10:SF,mod:MF,multiply:CF,norm:EF,nthRoot:TF,nthRoots:FF,pow:_F,round:OF,sign:BF,sqrt:PF,sqrtm:IF,square:LF,subtract:zF,unaryMinus:UF,unaryPlus:WF,xgcd:YF,invmod:bF,bitAnd:HF,bitNot:$F,bitOr:GF,bitXor:VF,leftShift:ZF,rightArithShift:QF,rightLogShift:XF,bellNumbers:JF,catalan:KF,composition:jF,stirlingS2:e_,config:kT,import:LT,typed:zT,arg:r_,conj:t_,re:a_,im:n_,evaluate:i_,help:o_,distance:s_,intersect:u_,and:f_,not:c_,or:l_,xor:m_,concat:d_,count:h_,cross:v_,column:p_,ctranspose:g_,det:x_,diag:y_,diff:b_,dot:w_,getMatrixDataType:M_,identity:C_,filter:S_,flatten:N_,forEach:A_,inv:E_,pinv:T_,eigs:D_,kron:F_,matrixFromFunction:B_,matrixFromRows:P_,matrixFromColumns:O_,map:__,ones:I_,partitionSelect:R_,range:q_,resize:L_,reshape:k_,rotate:z_,rotationMatrix:U_,row:W_,size:Y_,sort:H_,squeeze:$_,subset:G_,trace:V_,transpose:Z_,zeros:Q_,fft:X_,ifft:J_,sylvester:RF,schur:qF,lyap:kF,solveODE:I3,combinations:K_,combinationsWithRep:j_,factorial:eO,gamma:rO,kldivergence:nO,lgamma:tO,multinomial:aO,permutations:iO,pickRandom:oO,random:sO,randomInt:uO,compare:fO,compareNatural:cO,compareText:lO,deepEqual:mO,equal:pO,equalText:dO,larger:hO,largerEq:vO,smaller:gO,smallerEq:xO,unequal:yO,setCartesian:bO,setDifference:wO,setDistinct:DO,setIntersect:SO,setIsSubset:NO,setMultiplicity:AO,setPowerset:MO,setSize:CO,setSymDifference:EO,setUnion:TO,zpk2tf:FO,freqz:_O,erf:OO,zeta:BO,cumsum:YO,mad:PO,max:IO,mean:RO,median:qO,min:kO,mode:LO,prod:zO,quantileSeq:UO,std:WO,sum:HO,variance:$O,corr:GO,acos:VO,acosh:ZO,acot:QO,acoth:XO,acsc:JO,acsch:KO,asec:jO,asech:e3,asin:r3,asinh:t3,atan:n3,atanh:i3,atan2:a3,cos:o3,cosh:s3,cot:u3,coth:f3,csc:c3,csch:l3,sec:m3,sech:p3,sin:d3,sinh:h3,tan:v3,tanh:g3,to:x3,clone:b3,format:w3,bin:y3,oct:O3,hex:S3,isNaN:A3,isInteger:N3,isNegative:M3,isNumeric:C3,hasNumericValue:D3,isPositive:E3,isPrime:T3,isZero:F3,print:B3,typeOf:P3,numeric:_3};var q3="help",P$=["typed","mathWithTransform","Help"],lg=F(q3,P$,e=>{var{typed:r,mathWithTransform:t,Help:a}=e;return r(q3,{any:function(i){var u,l=i;if(typeof i!="string"){for(u in t)if(Xe(t,u)&&i===t[u]){l=u;break}}var c=wt(R3,l);if(!c){var o=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+o+'"')}return new a(c)}})});var k3="chain",I$=["typed","Chain"],mg=F(k3,I$,e=>{var{typed:r,Chain:t}=e;return r(k3,{"":function(){return new t},any:function(n){return new t(n)}})});var L3="det",R$=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],pg=F(L3,R$,e=>{var{typed:r,matrix:t,subtractScalar:a,multiply:n,divideScalar:i,isZero:u,unaryMinus:l}=e;return r(L3,{any:function(s){return ar(s)},"Array | Matrix":function(s){var m;switch(Qe(s)?m=s.size():Array.isArray(s)?(s=t(s),m=s.size()):m=[],m.length){case 0:return ar(s);case 1:if(m[0]===1)return ar(s.valueOf()[0]);if(m[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(m)+")");case 2:{var d=m[0],h=m[1];if(d===h)return c(s.clone().valueOf(),d,h);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(m)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(m)+")")}}});function c(o,s,m){if(s===1)return ar(o[0][0]);if(s===2)return a(n(o[0][0],o[1][1]),n(o[1][0],o[0][1]));for(var d=!1,h=new Array(s).fill(0).map((O,_)=>_),x=0;x{var{typed:r,matrix:t,divideScalar:a,addScalar:n,multiply:i,unaryMinus:u,det:l,identity:c,abs:o}=e;return r(z3,{"Array | Matrix":function(d){var h=Qe(d)?d.size():ur(d);switch(h.length){case 1:if(h[0]===1)return Qe(d)?t([a(1,d.valueOf()[0])]):[a(1,d[0])];throw new RangeError("Matrix must be square (size: "+lr(h)+")");case 2:{var x=h[0],v=h[1];if(x===v)return Qe(d)?t(s(d.valueOf(),x,v),d.storage()):s(d,x,v);throw new RangeError("Matrix must be square (size: "+lr(h)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(h)+")")}},any:function(d){return a(1,d)}});function s(m,d,h){var x,v,y,w,C;if(d===1){if(w=m[0][0],w===0)throw Error("Cannot calculate inverse, determinant is zero");return[[a(1,w)]]}else if(d===2){var b=l(m);if(b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[a(m[1][1],b),a(u(m[0][1]),b)],[a(u(m[1][0]),b),a(m[0][0],b)]]}else{var M=m.concat();for(x=0;xO&&(O=o(M[x][S]),_=x),x++;if(O===0)throw Error("Cannot calculate inverse, determinant is zero");x=_,x!==S&&(C=M[S],M[S]=M[x],M[x]=C,C=A[S],A[S]=A[x],A[x]=C);var E=M[S],T=A[S];for(x=0;x{var{typed:r,matrix:t,inv:a,deepEqual:n,equal:i,dotDivide:u,dot:l,ctranspose:c,divideScalar:o,multiply:s,add:m,Complex:d}=e;return r(U3,{"Array | Matrix":function(b){var M=Qe(b)?b.size():ur(b);switch(M.length){case 1:return w(b)?c(b):M[0]===1?a(b):u(c(b),l(b,b));case 2:{if(w(b))return c(b);var A=M[0],S=M[1];if(A===S)try{return a(b)}catch(O){if(!(O instanceof Error&&O.message.match(/Cannot calculate inverse, determinant is zero/)))throw O}return Qe(b)?t(h(b.valueOf(),A,S),b.storage()):h(b,A,S)}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(M)+")")}},any:function(b){return i(b,0)?ar(b):o(1,b)}});function h(C,b,M){var{C:A,F:S}=v(C,b,M),O=s(a(s(c(A),A)),c(A)),_=s(c(S),a(s(S,c(S))));return s(_,O)}function x(C,b,M){for(var A=ar(C),S=0,O=0;O_.filter((T,R)=>R!y(l(A[E],A[E])));return{C:S,F:O}}function y(C){return i(m(C,d(1,1)),m(0,d(1,1)))}function w(C){return n(m(C,d(1,1)),m(s(C,0),d(1,1)))}});function W3(e){var{addScalar:r,subtract:t,flatten:a,multiply:n,multiplyScalar:i,divideScalar:u,sqrt:l,abs:c,bignumber:o,diag:s,size:m,reshape:d,inv:h,qr:x,usolve:v,usolveAll:y,equal:w,complex:C,larger:b,smaller:M,matrixFromColumns:A,dot:S}=e;function O(ae,$,le,Ee){var me=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ge=_(ae,$,le,Ee,me);E(ae,$,le,Ee,me,ge);var{values:Se,C:xe}=T(ae,$,le,Ee,me);if(me){var be=R(ae,$,xe,ge,Se,le,Ee);return{values:Se,eigenvectors:be}}return{values:Se}}function _(ae,$,le,Ee,me){var ge=Ee==="BigNumber",Se=Ee==="Complex",xe=ge?o(0):0,be=ge?o(1):Se?C(1):1,De=ge?o(1):1,Ae=ge?o(10):2,We=i(Ae,Ae),Je;me&&(Je=Array($).fill(be));for(var J=!1;!J;){J=!0;for(var re=0;re<$;re++){for(var ye=xe,j=xe,ne=0;ne<$;ne++)re!==ne&&(ye=r(ye,c(ae[ne][re])),j=r(j,c(ae[re][ne])));if(!w(ye,0)&&!w(j,0)){for(var ue=De,Me=ye,Ce=u(j,Ae),Le=i(j,Ae);M(Me,Ce);)Me=i(Me,We),ue=i(ue,Ae);for(;b(Me,Le);)Me=u(Me,We),ue=u(ue,Ae);var Ie=M(u(r(Me,j),ue),i(r(ye,j),.95));if(Ie){J=!1;for(var fr=u(1,ue),or=0;or<$;or++)re!==or&&(ae[re][or]=i(ae[re][or],fr),ae[or][re]=i(ae[or][re],ue));me&&(Je[re]=i(Je[re],fr))}}}}return me?s(Je):null}function E(ae,$,le,Ee,me,ge){var Se=Ee==="BigNumber",xe=Ee==="Complex",be=Se?o(0):xe?C(0):0;Se&&(le=o(le));for(var De=0;De<$-2;De++){for(var Ae=0,We=be,Je=De+1;Je<$;Je++){var J=ae[Je][De];M(c(We),c(J))&&(We=J,Ae=Je)}if(!M(c(We),le)){if(Ae!==De+1){var re=ae[Ae];ae[Ae]=ae[De+1],ae[De+1]=re;for(var ye=0;ye<$;ye++){var j=ae[ye][Ae];ae[ye][Ae]=ae[ye][De+1],ae[ye][De+1]=j}if(me){var ne=ge[Ae];ge[Ae]=ge[De+1],ge[De+1]=ne}}for(var ue=De+2;ue<$;ue++){var Me=u(ae[ue][De],We);if(Me!==0){for(var Ce=0;Ce<$;Ce++)ae[ue][Ce]=t(ae[ue][Ce],i(Me,ae[De+1][Ce]));for(var Le=0;Le<$;Le++)ae[Le][De+1]=r(ae[Le][De+1],i(Me,ae[Le][ue]));if(me)for(var Ie=0;Ie<$;Ie++)ge[ue][Ie]=t(ge[ue][Ie],i(Me,ge[De+1][Ie]))}}}}return ge}function T(ae,$,le,Ee,me){var ge=Ee==="BigNumber",Se=Ee==="Complex",xe=ge?o(1):Se?C(1):1;ge&&(le=o(le));for(var be=ar(ae),De=[],Ae=$,We=[],Je=me?s(Array($).fill(xe)):void 0,J=me?s(Array(Ae).fill(xe)):void 0,re=0;re<=100;){re+=1;for(var ye=be[Ae-1][Ae-1],j=0;j1&&(J=s(Array(Ae-1).fill(xe)))),Ae-=1,be.pop();for(var Ce=0;Ce2&&(J=s(Array(Ae-2).fill(xe)))),Ae-=2,be.pop(),be.pop();for(var Ie=0;Ie+t(c(Ke),c(Pr))),re>100){var fr=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+De.join(", "));throw fr.values=De,fr.vectors=[],fr}var or=me?n(Je,H(We,$)):void 0;return{values:De,C:or}}function R(ae,$,le,Ee,me,ge,Se){var xe=h(le),be=n(xe,ae,le),De=Se==="BigNumber",Ae=Se==="Complex",We=De?o(0):Ae?C(0):0,Je=De?o(1):Ae?C(1):1,J=[],re=[];for(var ye of me){var j=L(J,ye,w);j===-1?(J.push(ye),re.push(1)):re[j]+=1}for(var ne=[],ue=J.length,Me=Array($).fill(We),Ce=s(Array($).fill(Je)),Le=function(){var or=J[Ie],Ke=t(be,n(or,Ce)),Pr=y(Ke,Me);for(Pr.shift();Pr.lengthn(ce,we)),ne.push(...Pr.map(we=>({value:or,vector:a(we)})))},Ie=0;Ie=5)return null;for(xe=0;;){var be=v(ae,Se);if(M(oe(z(Se,[be])),Ee))break;if(++xe>=10)return null;Se=pe(be)}return Se}function K(ae,$,le){var Ee=le==="BigNumber",me=le==="Complex",ge=Array(ae).fill(0).map(Se=>2*Math.random()-1);return Ee&&(ge=ge.map(Se=>o(Se))),me&&(ge=ge.map(Se=>C(Se))),ge=z(ge,$),pe(ge,le)}function z(ae,$){var le=m(ae);for(var Ee of $)Ee=d(Ee,le),ae=t(ae,n(u(S(Ee,ae),S(Ee,Ee)),Ee));return ae}function oe(ae){return c(l(S(ae,ae)))}function pe(ae,$){var le=$==="BigNumber",Ee=$==="Complex",me=le?o(1):Ee?C(1):1;return n(u(me,oe(ae)),ae)}return O}function Y3(e){var{config:r,addScalar:t,subtract:a,abs:n,atan:i,cos:u,sin:l,multiplyScalar:c,inv:o,bignumber:s,multiply:m,add:d}=e;function h(E,T){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.epsilon,k=arguments.length>3?arguments[3]:void 0,W=arguments.length>4?arguments[4]:void 0;if(k==="number")return x(E,R,W);if(k==="BigNumber")return v(E,R,W);throw TypeError("Unsupported data type: "+k)}function x(E,T,R){var k=E.length,W=Math.abs(T/k),G,H;if(R){H=new Array(k);for(var L=0;L=Math.abs(W);){var K=q[0][0],z=q[0][1];G=y(E[K][K],E[z][z],E[K][z]),E=A(E,G,K,z),R&&(H=C(H,G,K,z)),q=S(E)}for(var oe=Array(k).fill(0),pe=0;pe=n(W);){var K=q[0][0],z=q[0][1];G=w(E[K][K],E[z][z],E[K][z]),E=M(E,G,K,z),R&&(H=b(H,G,K,z)),q=O(E)}for(var oe=Array(k).fill(0),pe=0;pe({value:W[$],vector:ae}));return{values:W,eigenvectors:pe}}return h}var L$="eigs",z$=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],vg=F(L$,z$,e=>{var{config:r,typed:t,matrix:a,addScalar:n,subtract:i,equal:u,abs:l,atan:c,cos:o,sin:s,multiplyScalar:m,divideScalar:d,inv:h,bignumber:x,multiply:v,add:y,larger:w,column:C,flatten:b,number:M,complex:A,sqrt:S,diag:O,size:_,reshape:E,qr:T,usolve:R,usolveAll:k,im:W,re:G,smaller:H,matrixFromColumns:L,dot:q}=e,K=Y3({config:r,addScalar:n,subtract:i,column:C,flatten:b,equal:u,abs:l,atan:c,cos:o,sin:s,multiplyScalar:m,inv:h,bignumber:x,complex:A,multiply:v,add:y}),z=W3({config:r,addScalar:n,subtract:i,multiply:v,multiplyScalar:m,flatten:b,divideScalar:d,sqrt:S,abs:l,bignumber:x,diag:O,size:_,reshape:E,qr:T,inv:h,usolve:R,usolveAll:k,equal:u,complex:A,larger:w,smaller:H,matrixFromColumns:L,dot:q});return t("eigs",{Array:function(ge){return oe(a(ge))},"Array, number|BigNumber":function(ge,Se){return oe(a(ge),{precision:Se})},"Array, Object"(me,ge){return oe(a(me),ge)},Matrix:function(ge){return oe(ge,{matricize:!0})},"Matrix, number|BigNumber":function(ge,Se){return oe(ge,{precision:Se,matricize:!0})},"Matrix, Object":function(ge,Se){var xe={matricize:!0};return ht(xe,Se),oe(ge,xe)}});function oe(me){var ge,Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},xe="eigenvectors"in Se?Se.eigenvectors:!0,be=(ge=Se.precision)!==null&&ge!==void 0?ge:r.epsilon,De=pe(me,be,xe);return Se.matricize&&(De.values=a(De.values),xe&&(De.eigenvectors=De.eigenvectors.map(Ae=>{var{value:We,vector:Je}=Ae;return{value:We,vector:a(Je)}}))),xe&&Object.defineProperty(De,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),De}function pe(me,ge,Se){var xe=me.toArray(),be=me.size();if(be.length!==2||be[0]!==be[1])throw new RangeError("Matrix must be square (size: ".concat(lr(be),")"));var De=be[0];if($(xe,De,ge)&&(le(xe,De),ae(xe,De,ge))){var Ae=Ee(me,xe,De);return K(xe,De,ge,Ae,Se)}var We=Ee(me,xe,De);return z(xe,De,ge,We,Se)}function ae(me,ge,Se){for(var xe=0;xe{var{typed:r,abs:t,add:a,identity:n,inv:i,multiply:u}=e;return r(H3,{Matrix:function(m){var d=m.size();if(d.length!==2||d[0]!==d[1])throw new RangeError("Matrix must be square (size: "+lr(d)+")");for(var h=d[0],x=1e-15,v=l(m),y=c(v,x),w=y.q,C=y.j,b=u(m,Math.pow(2,-C)),M=n(h),A=n(h),S=1,O=b,_=-1,E=1;E<=w;E++)E>1&&(O=u(O,b),_=-_),S=S*(w-E+1)/((2*w-E+1)*E),M=a(M,u(S,O)),A=a(A,u(S*_,O));for(var T=u(i(A),M),R=0;R{var{typed:r,abs:t,add:a,multiply:n,map:i,sqrt:u,subtract:l,inv:c,size:o,max:s,identity:m}=e,d=1e3,h=1e-6;function x(v){var y,w=0,C=v,b=m(o(v));do{var M=C;if(C=n(.5,a(M,c(b))),b=n(.5,a(b,c(M))),y=s(t(l(C,M))),y>h&&++w>d)throw new Error("computing square root of matrix: iterative method could not converge")}while(y>h);return C}return r($3,{"Array | Matrix":function(y){var w=Qe(y)?y.size():ur(y);switch(w.length){case 1:if(w[0]===1)return i(y,u);throw new RangeError("Matrix must be square (size: "+lr(w)+")");case 2:{var C=w[0],b=w[1];if(C===b)return x(y);throw new RangeError("Matrix must be square (size: "+lr(w)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+lr(w)+")")}}})});var G3="sylvester",Y$=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],yg=F(G3,Y$,e=>{var{typed:r,schur:t,matrixFromColumns:a,matrix:n,multiply:i,range:u,concat:l,transpose:c,index:o,subset:s,add:m,subtract:d,identity:h,lusolve:x,abs:v}=e;return r(G3,{"Matrix, Matrix, Matrix":y,"Array, Matrix, Matrix":function(C,b,M){return y(n(C),b,M)},"Array, Array, Matrix":function(C,b,M){return y(n(C),n(b),M)},"Array, Matrix, Array":function(C,b,M){return y(n(C),b,n(M))},"Matrix, Array, Matrix":function(C,b,M){return y(C,n(b),M)},"Matrix, Array, Array":function(C,b,M){return y(C,n(b),n(M))},"Matrix, Matrix, Array":function(C,b,M){return y(C,b,n(M))},"Array, Array, Array":function(C,b,M){return y(n(C),n(b),n(M)).toArray()}});function y(w,C,b){for(var M=C.size()[0],A=w.size()[0],S=t(w),O=S.T,_=S.U,E=t(i(-1,C)),T=E.T,R=E.U,k=i(i(c(_),b),R),W=u(0,A),G=[],H=(Ae,We)=>l(Ae,We,1),L=(Ae,We)=>l(Ae,We,0),q=0;q1e-5){for(var K=L(s(k,o(W,q)),s(k,o(W,q+1))),z=0;z{var{typed:r,matrix:t,identity:a,multiply:n,qr:i,norm:u,subtract:l}=e;return r(V3,{Array:function(s){var m=c(t(s));return{U:m.U.valueOf(),T:m.T.valueOf()}},Matrix:function(s){return c(s)}});function c(o){var s=o.size()[0],m=o,d=a(s),h=0,x;do{x=m;var v=i(m),y=v.Q,w=v.R;if(m=n(w,y),d=n(d,y),h++>100)break}while(u(l(m,x))>1e-4);return{U:d,T:m}}});var Z3="lyap",$$=["typed","matrix","sylvester","multiply","transpose"],wg=F(Z3,$$,e=>{var{typed:r,matrix:t,sylvester:a,multiply:n,transpose:i}=e;return r(Z3,{"Matrix, Matrix":function(l,c){return a(l,i(l),n(-1,c))},"Array, Matrix":function(l,c){return a(t(l),i(t(l)),n(-1,c))},"Matrix, Array":function(l,c){return a(l,i(t(l)),t(n(-1,c)))},"Array, Array":function(l,c){return a(t(l),i(t(l)),t(n(-1,c))).toArray()}})});var G$="divide",V$=["typed","matrix","multiply","equalScalar","divideScalar","inv"],Dg=F(G$,V$,e=>{var{typed:r,matrix:t,multiply:a,equalScalar:n,divideScalar:i,inv:u}=e,l=jr({typed:r,equalScalar:n}),c=kt({typed:r});return r("divide",xm({"Array | Matrix, Array | Matrix":function(s,m){return a(s,u(m))},"DenseMatrix, any":function(s,m){return c(s,m,i,!1)},"SparseMatrix, any":function(s,m){return l(s,m,i,!1)},"Array, any":function(s,m){return c(t(s),m,i,!1).valueOf()},"any, Array | Matrix":function(s,m){return a(s,u(m))}},i.signatures))});var Q3="distance",Z$=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],Sg=F(Q3,Z$,e=>{var{typed:r,addScalar:t,subtractScalar:a,multiplyScalar:n,divideScalar:i,deepEqual:u,sqrt:l,abs:c}=e;return r(Q3,{"Array, Array, Array":function(A,S,O){if(A.length===2&&S.length===2&&O.length===2){if(!s(A))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!s(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!s(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(u(S,O))throw new TypeError("LinePoint1 should not be same with LinePoint2");var _=a(O[1],S[1]),E=a(S[0],O[0]),T=a(n(O[0],S[1]),n(S[0],O[1]));return y(A[0],A[1],_,E,T)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(A,S,O){if(Object.keys(A).length===2&&Object.keys(S).length===2&&Object.keys(O).length===2){if(!s(A))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!s(S))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!s(O))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(u(x(S),x(O)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in A&&"pointY"in A&&"lineOnePtX"in S&&"lineOnePtY"in S&&"lineTwoPtX"in O&&"lineTwoPtY"in O){var _=a(O.lineTwoPtY,S.lineOnePtY),E=a(S.lineOnePtX,O.lineTwoPtX),T=a(n(O.lineTwoPtX,S.lineOnePtY),n(S.lineOnePtX,O.lineTwoPtY));return y(A.pointX,A.pointY,_,E,T)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(A,S){if(A.length===2&&S.length===3){if(!s(A))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!m(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return y(A[0],A[1],S[0],S[1],S[2])}else if(A.length===3&&S.length===6){if(!m(A))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!h(S))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return w(A[0],A[1],A[2],S[0],S[1],S[2],S[3],S[4],S[5])}else if(A.length===S.length&&A.length>0){if(!d(A))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!d(S))throw new TypeError("All values of an array should be numbers or BigNumbers");return C(A,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(A,S){if(Object.keys(A).length===2&&Object.keys(S).length===3){if(!s(A))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!m(S))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in A&&"pointY"in A&&"xCoeffLine"in S&&"yCoeffLine"in S&&"constant"in S)return y(A.pointX,A.pointY,S.xCoeffLine,S.yCoeffLine,S.constant);throw new TypeError("Key names do not match")}else if(Object.keys(A).length===3&&Object.keys(S).length===6){if(!m(A))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!h(S))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in A&&"pointY"in A&&"x0"in S&&"y0"in S&&"z0"in S&&"a"in S&&"b"in S&&"c"in S)return w(A.pointX,A.pointY,A.pointZ,S.x0,S.y0,S.z0,S.a,S.b,S.c);throw new TypeError("Key names do not match")}else if(Object.keys(A).length===2&&Object.keys(S).length===2){if(!s(A))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!s(S))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in A&&"pointOneY"in A&&"pointTwoX"in S&&"pointTwoY"in S)return C([A.pointOneX,A.pointOneY],[S.pointTwoX,S.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(A).length===3&&Object.keys(S).length===3){if(!m(A))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!m(S))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in A&&"pointOneY"in A&&"pointOneZ"in A&&"pointTwoX"in S&&"pointTwoY"in S&&"pointTwoZ"in S)return C([A.pointOneX,A.pointOneY,A.pointOneZ],[S.pointTwoX,S.pointTwoY,S.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(A){if(!v(A))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return b(A)}});function o(M){return typeof M=="number"||rr(M)}function s(M){return M.constructor!==Array&&(M=x(M)),o(M[0])&&o(M[1])}function m(M){return M.constructor!==Array&&(M=x(M)),o(M[0])&&o(M[1])&&o(M[2])}function d(M){return Array.isArray(M)||(M=x(M)),M.every(o)}function h(M){return M.constructor!==Array&&(M=x(M)),o(M[0])&&o(M[1])&&o(M[2])&&o(M[3])&&o(M[4])&&o(M[5])}function x(M){for(var A=Object.keys(M),S=[],O=0;OA.length!==2||!o(A[0])||!o(A[1])))return!1}else if(M[0].length===3&&o(M[0][0])&&o(M[0][1])&&o(M[0][2])){if(M.some(A=>A.length!==3||!o(A[0])||!o(A[1])||!o(A[2])))return!1}else return!1;return!0}function y(M,A,S,O,_){var E=c(t(t(n(S,M),n(O,A)),_)),T=l(t(n(S,S),n(O,O)));return i(E,T)}function w(M,A,S,O,_,E,T,R,k){var W=[a(n(a(_,A),k),n(a(E,S),R)),a(n(a(E,S),T),n(a(O,M),k)),a(n(a(O,M),R),n(a(_,A),T))];W=l(t(t(n(W[0],W[0]),n(W[1],W[1])),n(W[2],W[2])));var G=l(t(t(n(T,T),n(R,R)),n(k,k)));return i(W,G)}function C(M,A){for(var S=M.length,O=0,_=0,E=0;E{var{typed:r,config:t,abs:a,add:n,addScalar:i,matrix:u,multiply:l,multiplyScalar:c,divideScalar:o,subtract:s,smaller:m,equalScalar:d,flatten:h,isZero:x,isNumeric:v}=e;return r("intersect",{"Array, Array, Array":y,"Array, Array, Array, Array":w,"Matrix, Matrix, Matrix":function(R,k,W){var G=y(R.valueOf(),k.valueOf(),W.valueOf());return G===null?null:u(G)},"Matrix, Matrix, Matrix, Matrix":function(R,k,W,G){var H=w(R.valueOf(),k.valueOf(),W.valueOf(),G.valueOf());return H===null?null:u(H)}});function y(T,R,k){if(T=C(T),R=C(R),k=C(k),!M(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!M(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!A(k))throw new TypeError("Array with 4 numbers expected as third argument");return E(T[0],T[1],T[2],R[0],R[1],R[2],k[0],k[1],k[2],k[3])}function w(T,R,k,W){if(T=C(T),R=C(R),k=C(k),W=C(W),T.length===2){if(!b(T))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(R))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b(k))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(W))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return S(T,R,k,W)}else if(T.length===3){if(!M(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!M(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!M(k))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!M(W))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return _(T[0],T[1],T[2],R[0],R[1],R[2],k[0],k[1],k[2],W[0],W[1],W[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function C(T){return T.length===1?T[0]:T.length>1&&Array.isArray(T[0])&&T.every(R=>Array.isArray(R)&&R.length===1)?h(T):T}function b(T){return T.length===2&&v(T[0])&&v(T[1])}function M(T){return T.length===3&&v(T[0])&&v(T[1])&&v(T[2])}function A(T){return T.length===4&&v(T[0])&&v(T[1])&&v(T[2])&&v(T[3])}function S(T,R,k,W){var G=T,H=k,L=s(G,R),q=s(H,W),K=s(c(L[0],q[1]),c(q[0],L[1]));if(x(K)||m(a(K),t.epsilon))return null;var z=c(q[0],G[1]),oe=c(q[1],G[0]),pe=c(q[0],H[1]),ae=c(q[1],H[0]),$=o(i(s(s(z,oe),pe),ae),K);return n(l(L,$),G)}function O(T,R,k,W,G,H,L,q,K,z,oe,pe){var ae=c(s(T,R),s(k,W)),$=c(s(G,H),s(L,q)),le=c(s(K,z),s(oe,pe));return i(i(ae,$),le)}function _(T,R,k,W,G,H,L,q,K,z,oe,pe){var ae=O(T,L,z,L,R,q,oe,q,k,K,pe,K),$=O(z,L,W,T,oe,q,G,R,pe,K,H,k),le=O(T,L,W,T,R,q,G,R,k,K,H,k),Ee=O(z,L,z,L,oe,q,oe,q,pe,K,pe,K),me=O(W,T,W,T,G,R,G,R,H,k,H,k),ge=s(c(ae,$),c(le,Ee)),Se=s(c(me,Ee),c($,$));if(x(Se))return null;var xe=o(ge,Se),be=o(i(ae,c(xe,$)),Ee),De=i(T,c(xe,s(W,T))),Ae=i(R,c(xe,s(G,R))),We=i(k,c(xe,s(H,k))),Je=i(L,c(be,s(z,L))),J=i(q,c(be,s(oe,q))),re=i(K,c(be,s(pe,K)));return d(De,Je)&&d(Ae,J)&&d(We,re)?[De,Ae,We]:null}function E(T,R,k,W,G,H,L,q,K,z){var oe=c(T,L),pe=c(W,L),ae=c(R,q),$=c(G,q),le=c(k,K),Ee=c(H,K),me=s(s(s(z,oe),ae),le),ge=s(s(s(i(i(pe,$),Ee),oe),ae),le),Se=o(me,ge),xe=i(T,c(Se,s(W,T))),be=i(R,c(Se,s(G,R))),De=i(k,c(Se,s(H,k)));return[xe,be,De]}});var X3="sum",J$=["typed","config","add","numeric"],nf=F(X3,J$,e=>{var{typed:r,config:t,add:a,numeric:n}=e;return r(X3,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":u,"...":function(c){if(Ba(c))throw new TypeError("Scalar values expected in function sum");return i(c)}});function i(l){var c;return Nn(l,function(o){try{c=c===void 0?o:a(c,o)}catch(s){throw Et(s,"sum",o)}}),c===void 0&&(c=n(0,t.number)),typeof c=="string"&&(c=n(c,t.number)),c}function u(l,c){try{var o=qo(l,c,a);return o}catch(s){throw Et(s,"sum")}}});var Ag="cumsum",K$=["typed","add","unaryPlus"],af=F(Ag,K$,e=>{var{typed:r,add:t,unaryPlus:a}=e;return r(Ag,{Array:n,Matrix:function(o){return o.create(n(o.valueOf()))},"Array, number | BigNumber":u,"Matrix, number | BigNumber":function(o,s){return o.create(u(o.valueOf(),s))},"...":function(o){if(Ba(o))throw new TypeError("All values expected to be scalar in function cumsum");return n(o)}});function n(c){try{return i(c)}catch(o){throw Et(o,Ag)}}function i(c){if(c.length===0)return[];for(var o=[a(c[0])],s=1;s=s.length)throw new tn(o,s.length);try{return l(c,o)}catch(m){throw Et(m,Ag)}}function l(c,o){var s,m,d;if(o<=0){var h=c[0][0];if(Array.isArray(h)){for(d=Zm(c),m=[],s=0;s{var{typed:r,add:t,divide:a}=e;return r(J3,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":n,"...":function(l){if(Ba(l))throw new TypeError("Scalar values expected in function mean");return i(l)}});function n(u,l){try{var c=qo(u,l,t),o=Array.isArray(u)?ur(u):u.size();return a(c,o[l])}catch(s){throw Et(s,"mean")}}function i(u){var l,c=0;if(Nn(u,function(o){try{l=l===void 0?o:t(l,o),c++}catch(s){throw Et(s,"mean",o)}}),c===0)throw new Error("Cannot calculate the mean of an empty array");return a(l,c)}});var K3="median",eG=["typed","add","divide","compare","partitionSelect"],Mg=F(K3,eG,e=>{var{typed:r,add:t,divide:a,compare:n,partitionSelect:i}=e;function u(o){try{o=gr(o.valueOf());var s=o.length;if(s===0)throw new Error("Cannot calculate median of an empty array");if(s%2===0){for(var m=s/2-1,d=i(o,m+1),h=o[m],x=0;x0&&(h=o[x]);return c(h,d)}else{var v=i(o,(s-1)/2);return l(v)}}catch(y){throw Et(y,"median")}}var l=r({"number | BigNumber | Complex | Unit":function(s){return s}}),c=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(s,m){return a(t(s,m),2)}});return r(K3,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(s,m){throw new Error("median(A, dim) is not yet supported")},"...":function(s){if(Ba(s))throw new TypeError("Scalar values expected in function median");return u(s)}})});var j3="mad",rG=["typed","abs","map","median","subtract"],Cg=F(j3,rG,e=>{var{typed:r,abs:t,map:a,median:n,subtract:i}=e;return r(j3,{"Array | Matrix":u,"...":function(c){return u(c)}});function u(l){if(l=gr(l.valueOf()),l.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var c=n(l);return n(a(l,function(o){return t(i(o,c))}))}catch(o){throw o instanceof TypeError&&o.message.indexOf("median")!==-1?new TypeError(o.message.replace("median","mad")):Et(o,"mad")}}});var gD="unbiased",eB="variance",tG=["typed","add","subtract","multiply","divide","apply","isNaN"],sf=F(eB,tG,e=>{var{typed:r,add:t,subtract:a,multiply:n,divide:i,apply:u,isNaN:l}=e;return r(eB,{"Array | Matrix":function(m){return c(m,gD)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(m,d){return o(m,d,gD)},"Array | Matrix, number | BigNumber, string":o,"...":function(m){return c(m,gD)}});function c(s,m){var d,h=0;if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Nn(s,function(y){try{d=d===void 0?y:t(d,y),h++}catch(w){throw Et(w,"variance",y)}}),h===0)throw new Error("Cannot calculate variance of an empty array");var x=i(d,h);if(d=void 0,Nn(s,function(y){var w=a(y,x);d=d===void 0?n(w,w):t(d,n(w,w))}),l(d))return d;switch(m){case"uncorrected":return i(d,h);case"biased":return i(d,h+1);case"unbiased":{var v=rr(d)?d.mul(0):0;return h===1?v:i(d,h-1)}default:throw new Error('Unknown normalization "'+m+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function o(s,m,d){try{if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return u(s,m,h=>c(h,d))}catch(h){throw Et(h,"variance")}}});var rB="quantileSeq",nG=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],uf=F(rB,nG,e=>{var{typed:r,bignumber:t,add:a,subtract:n,divide:i,multiply:u,partitionSelect:l,compare:c,isInteger:o,smaller:s,smallerEq:m,larger:d}=e,h=ko({typed:r,isInteger:o});return r(rB,{"Array | Matrix, number | BigNumber":(C,b)=>v(C,b,!1),"Array | Matrix, number | BigNumber, number":(C,b,M)=>x(C,b,!1,M,v),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(C,b,M,A)=>x(C,b,M,A,v),"Array | Matrix, Array | Matrix":(C,b)=>y(C,b,!1),"Array | Matrix, Array | Matrix, number":(C,b,M)=>x(C,b,!1,M,y),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(C,b,M,A)=>x(C,b,M,A,y)});function x(C,b,M,A,S){return h(C,A,O=>S(O,b,M))}function v(C,b,M){var A,S=C.valueOf();if(s(b,0))throw new Error("N/prob must be non-negative");if(m(b,1))return sr(b)?w(S,b,M):t(w(S,b,M));if(d(b,1)){if(!o(b))throw new Error("N must be a positive integer");if(d(b,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var O=a(b,1);A=[];for(var _=0;s(_,b);_++){var E=i(_+1,O);A.push(w(S,E,M))}return sr(b)?A:t(A)}}function y(C,b,M){for(var A=C.valueOf(),S=b.valueOf(),O=[],_=0;_0&&(T=A[k])}return a(u(T,n(1,E)),u(R,E))}});var tB="std",aG=["typed","map","sqrt","variance"],ff=F(tB,aG,e=>{var{typed:r,map:t,sqrt:a,variance:n}=e;return r(tB,{"Array | Matrix":i,"Array | Matrix, string":i,"Array | Matrix, number | BigNumber":i,"Array | Matrix, number | BigNumber, string":i,"...":function(l){return i(l)}});function i(u,l){if(u.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var c=n.apply(null,arguments);return Nt(c)?t(c,a):a(c)}catch(o){throw o instanceof TypeError&&o.message.indexOf(" variance")!==-1?new TypeError(o.message.replace(" variance"," std")):o}}});var nB="corr",iG=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],Eg=F(nB,iG,e=>{var{typed:r,matrix:t,sqrt:a,sum:n,add:i,subtract:u,multiply:l,pow:c,divide:o}=e;return r(nB,{"Array, Array":function(h,x){return s(h,x)},"Matrix, Matrix":function(h,x){var v=s(h.toArray(),x.toArray());return Array.isArray(v)?t(v):v}});function s(d,h){var x=[];if(Array.isArray(d[0])&&Array.isArray(h[0])){if(d.length!==h.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var v=0;vi(S,l(O,h[_])),0),C=n(d.map(S=>c(S,2))),b=n(h.map(S=>c(S,2))),M=u(l(x,w),l(v,y)),A=a(l(u(l(x,C),c(v,2)),u(l(x,b),c(y,2))));return o(M,A)}});var aB="combinations",oG=["typed"],Tg=F(aB,oG,e=>{var{typed:r}=e;return r(aB,{"number, number":Fw,"BigNumber, BigNumber":function(a,n){var i=a.constructor,u,l,c=a.minus(n),o=new i(1);if(!iB(a)||!iB(n))throw new TypeError("Positive integer value expected in function combinations");if(n.gt(a))throw new TypeError("k must be less than n in function combinations");if(u=o,n.lt(c))for(l=o;l.lte(c);l=l.plus(o))u=u.times(n.plus(l)).dividedBy(l);else for(l=o;l.lte(n);l=l.plus(o))u=u.times(c.plus(l)).dividedBy(l);return u}})});function iB(e){return e.isInteger()&&e.gte(0)}var oB="combinationsWithRep",sG=["typed"],Fg=F(oB,sG,e=>{var{typed:r}=e;return r(oB,{"number, number":function(a,n){if(!Ze(a)||a<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Ze(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(a<1)throw new TypeError("k must be less than or equal to n + k - 1");if(n{var{typed:r,config:t,multiplyScalar:a,pow:n,BigNumber:i,Complex:u}=e;function l(o){if(o.im===0)return Tc(o.re);if(o.re<.5){var s=new u(1-o.re,-o.im),m=new u(Math.PI*o.re,Math.PI*o.im);return new u(Math.PI).div(m.sin()).div(l(s))}o=new u(o.re-1,o.im);for(var d=new u(Ts[0],0),h=1;h2;)d-=2,x+=d,h=h.times(x);return new i(h.toPrecision(i.precision))}});var fB="lgamma",fG=["Complex","typed"],Og=F(fB,fG,e=>{var{Complex:r,typed:t}=e,a=7,n=7,i=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(fB,{number:Fc,Complex:u,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function u(o){var s=6.283185307179586,m=1.1447298858494002,d=.1;if(o.isNaN())return new r(NaN,NaN);if(o.im===0)return new r(Fc(o.re),0);if(o.re>=a||Math.abs(o.im)>=n)return l(o);if(o.re<=d){var h=zA(s,o.im)*Math.floor(.5*o.re+.25),x=o.mul(Math.PI).sin().log(),v=u(new r(1-o.re,-o.im));return new r(m,h).sub(x).sub(v)}else return o.im>=0?c(o):c(o.conjugate()).conjugate()}function l(o){for(var s=o.sub(.5).mul(o.log()).sub(o).add(qw),m=new r(1,0).div(o),d=m.div(o),h=i[0],x=i[1],v=2*d.re,y=d.re*d.re+d.im*d.im,w=2;w<8;w++){var C=x;x=-y*h+i[w],h=v*h+C}var b=m.mul(d.mul(h).add(x));return s.add(b)}function c(o){var s=0,m=0,d=o;for(o=o.add(1);o.re<=a;){d=d.mul(o);var h=d.im<0?1:0;h!==0&&m===0&&s++,m=h,o=o.add(1)}return l(o).sub(d.log()).sub(new r(0,s*2*Math.PI*1))}});var cB="factorial",cG=["typed","gamma"],Bg=F(cB,cG,e=>{var{typed:r,gamma:t}=e;return r(cB,{number:function(n){if(n<0)throw new Error("Value must be non-negative");return t(n+1)},BigNumber:function(n){if(n.isNegative())throw new Error("Value must be non-negative");return t(n.plus(1))},"Array | Matrix":r.referToSelf(a=>n=>je(n,a))})});var lB="kldivergence",lG=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],Pg=F(lB,lG,e=>{var{typed:r,matrix:t,divide:a,sum:n,multiply:i,map:u,dotDivide:l,log:c,isNumeric:o}=e;return r(lB,{"Array, Array":function(d,h){return s(t(d),t(h))},"Matrix, Array":function(d,h){return s(d,t(h))},"Array, Matrix":function(d,h){return s(t(d),h)},"Matrix, Matrix":function(d,h){return s(d,h)}});function s(m,d){var h=d.size().length,x=m.size().length;if(h>1)throw new Error("first object must be one dimensional");if(x>1)throw new Error("second object must be one dimensional");if(h!==x)throw new Error("Length of two vectors must be equal");var v=n(m);if(v===0)throw new Error("Sum of elements in first object must be non zero");var y=n(d);if(y===0)throw new Error("Sum of elements in second object must be non zero");var w=a(m,n(m)),C=a(d,n(d)),b=n(i(w,u(l(w,C),M=>c(M))));return o(b)?b:Number.NaN}});var mB="multinomial",mG=["typed","add","divide","multiply","factorial","isInteger","isPositive"],Ig=F(mB,mG,e=>{var{typed:r,add:t,divide:a,multiply:n,factorial:i,isInteger:u,isPositive:l}=e;return r(mB,{"Array | Matrix":function(o){var s=0,m=1;return Nn(o,function(d){if(!u(d)||!l(d))throw new TypeError("Positive integer value expected in function multinomial");s=t(s,d),m=n(m,i(d))}),a(i(s),m)}})});var pB="permutations",pG=["typed","factorial"],Rg=F(pB,pG,e=>{var{typed:r,factorial:t}=e;return r(pB,{"number | BigNumber":t,"number, number":function(n,i){if(!Ze(n)||n<0)throw new TypeError("Positive integer value expected in function permutations");if(!Ze(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(i>n)throw new TypeError("second argument k must be less than or equal to first argument n");return da(n-i+1,n)},"BigNumber, BigNumber":function(n,i){var u,l;if(!dB(n)||!dB(i))throw new TypeError("Positive integer value expected in function permutations");if(i.gt(n))throw new TypeError("second argument k must be less than or equal to first argument n");var c=n.mul(0).add(1);for(u=c,l=n.minus(i).plus(1);l.lte(n);l=l.plus(1))u=u.times(l);return u}})});function dB(e){return e.isInteger()&&e.gte(0)}var ND=ca(_B(),1),bG=(0,ND.default)(Date.now());function to(e){var r;function t(n){r=n===null?bG:(0,ND.default)(String(n))}t(e);function a(){return r()}return a}var OB="pickRandom",wG=["typed","config","?on"],kg=F(OB,wG,e=>{var{typed:r,config:t,on:a}=e,n=to(t.randomSeed);return a&&a("config",function(u,l){u.randomSeed!==l.randomSeed&&(n=to(u.randomSeed))}),r(OB,{"Array | Matrix":function(l){return i(l,{})},"Array | Matrix, Object":function(l,c){return i(l,c)},"Array | Matrix, number":function(l,c){return i(l,{number:c})},"Array | Matrix, Array | Matrix":function(l,c){return i(l,{weights:c})},"Array | Matrix, Array | Matrix, number":function(l,c,o){return i(l,{number:o,weights:c})},"Array | Matrix, number, Array | Matrix":function(l,c,o){return i(l,{number:c,weights:o})}});function i(u,l){var{number:c,weights:o,elementWise:s=!0}=l,m=typeof c>"u";m&&(c=1);var d=Qe(u)?u.create:Qe(o)?o.create:null;u=u.valueOf(),o&&(o=o.valueOf()),s===!0&&(u=gr(u),o=gr(o));var h=0;if(typeof o<"u"){if(o.length!==u.length)throw new Error("Weights must have the same length as possibles");for(var x=0,v=o.length;x"u")C=u[Math.floor(n()*y)];else for(var b=n()*h,M=0,A=u.length;M1)for(var a=0,n=e.shift();a{var{typed:r,config:t,on:a}=e,n=to(t.randomSeed);return a&&a("config",function(l,c){l.randomSeed!==c.randomSeed&&(n=to(l.randomSeed))}),r(BB,{"":()=>u(0,1),number:l=>u(0,l),"number, number":(l,c)=>u(l,c),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,c)=>i(l,0,c),"Array | Matrix, number, number":(l,c,o)=>i(l,c,o)});function i(l,c,o){var s=Ic(l.valueOf(),()=>u(c,o));return Qe(l)?l.create(s):s}function u(l,c){return l+n()*(c-l)}});var PB="randomInt",SG=["typed","config","?on"],zg=F(PB,SG,e=>{var{typed:r,config:t,on:a}=e,n=to(t.randomSeed);return a&&a("config",function(l,c){l.randomSeed!==c.randomSeed&&(n=to(l.randomSeed))}),r(PB,{"":()=>u(0,1),number:l=>u(0,l),"number, number":(l,c)=>u(l,c),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,c)=>i(l,0,c),"Array | Matrix, number, number":(l,c,o)=>i(l,c,o)});function i(l,c,o){var s=Ic(l.valueOf(),()=>u(c,o));return Qe(l)?l.create(s):s}function u(l,c){return Math.floor(l+n()*(c-l))}});var IB="stirlingS2",NG=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],Ug=F(IB,NG,e=>{var{typed:r,addScalar:t,subtractScalar:a,multiplyScalar:n,divideScalar:i,pow:u,factorial:l,combinations:c,isNegative:o,isInteger:s,number:m,bignumber:d,larger:h}=e,x=[],v=[];return r(IB,{"number | BigNumber, number | BigNumber":function(w,C){if(!s(w)||o(w)||!s(C)||o(C))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(h(C,w))throw new TypeError("k must be less than or equal to n in function stirlingS2");var b=!(sr(w)&&sr(C)),M=b?v:x,A=b?d:m,S=m(w),O=m(C);if(M[S]&&M[S].length>O)return M[S][O];for(var _=0;_<=S;++_)if(M[_]||(M[_]=[A(_===0?1:0)]),_!==0)for(var E=M[_],T=M[_-1],R=E.length;R<=_&&R<=O;++R)R===_?E[R]=1:E[R]=t(n(A(R),T[R]),T[R-1]);return M[S][O]}})});var RB="bellNumbers",AG=["typed","addScalar","isNegative","isInteger","stirlingS2"],Wg=F(RB,AG,e=>{var{typed:r,addScalar:t,isNegative:a,isInteger:n,stirlingS2:i}=e;return r(RB,{"number | BigNumber":function(l){if(!n(l)||a(l))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var c=0,o=0;o<=l;o++)c=t(c,i(l,o));return c}})});var qB="catalan",MG=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],Yg=F(qB,MG,e=>{var{typed:r,addScalar:t,divideScalar:a,multiplyScalar:n,combinations:i,isNegative:u,isInteger:l}=e;return r(qB,{"number | BigNumber":function(o){if(!l(o)||u(o))throw new TypeError("Non-negative integer value expected in function catalan");return a(i(n(o,2),o),t(o,1))}})});var kB="composition",CG=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],Hg=F(kB,CG,e=>{var{typed:r,addScalar:t,combinations:a,isPositive:n,isNegative:i,isInteger:u,larger:l}=e;return r(kB,{"number | BigNumber, number | BigNumber":function(o,s){if(!u(o)||!n(o)||!u(s)||!n(s))throw new TypeError("Positive integer value expected in function composition");if(l(s,o))throw new TypeError("k must be less than or equal to n in function composition");return a(t(o,-1),t(s,-1))}})});var LB="leafCount",EG=["parse","typed"],$g=F(LB,EG,e=>{var{parse:r,typed:t}=e;function a(n){var i=0;return n.forEach(u=>{i+=a(u)}),i||1}return t(LB,{Node:function(i){return a(i)}})});function AD(e){return yr(e)||ct(e)&&e.isUnary()&&yr(e.args[0])}function Rc(e){return!!(yr(e)||(gn(e)||ct(e))&&e.args.every(Rc)||en(e)&&Rc(e.content))}function zB(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,a)}return t}function MD(e){for(var r=1;r{var{FunctionNode:r,OperatorNode:t,SymbolNode:a}=e,n=!0,i=!1,u="defaultF",l={add:{trivial:n,total:n,commutative:n,associative:n},unaryPlus:{trivial:n,total:n,commutative:n,associative:n},subtract:{trivial:i,total:n,commutative:i,associative:i},multiply:{trivial:n,total:n,commutative:n,associative:n},divide:{trivial:i,total:n,commutative:i,associative:i},paren:{trivial:n,total:n,commutative:n,associative:i},defaultF:{trivial:i,total:n,commutative:i,associative:i}},c={divide:{total:i},log:{total:i}},o={subtract:{total:i},abs:{trivial:n},log:{total:n}};function s(b,M){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l,S=u;if(typeof b=="string"?S=b:ct(b)?S=b.fn.toString():gn(b)?S=b.name:en(b)&&(S="paren"),Xe(A,S)){var O=A[S];if(Xe(O,M))return O[M];if(Xe(l,S))return l[S][M]}if(Xe(A,u)){var _=A[u];return Xe(_,M)?_[M]:l[u][M]}if(Xe(l,S)){var E=l[S];if(Xe(E,M))return E[M]}return l[u][M]}function m(b){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return s(b,"commutative",M)}function d(b){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return s(b,"associative",M)}function h(b,M){var A=MD({},b);for(var S in M)Xe(b,S)?A[S]=MD(MD({},M[S]),b[S]):A[S]=M[S];return A}function x(b,M){if(!b.args||b.args.length===0)return b;b.args=v(b,M);for(var A=0;A2&&d(b,M)){for(var _=b.args.pop();b.args.length>0;)_=A([b.args.pop(),_]);b.args=_.args}}}function w(b,M){if(!(!b.args||b.args.length===0)){for(var A=C(b),S=b.args.length,O=0;O2&&d(b,M)){for(var _=b.args.shift();b.args.length>0;)_=A([_,b.args.shift()]);b.args=_.args}}}function C(b){return ct(b)?function(M){try{return new t(b.op,b.fn,M,b.implicit)}catch(A){return console.error(A),[]}}:function(M){return new r(new a(b.name),M)}}return{createMakeNodeFunction:C,hasProperty:s,isCommutative:m,isAssociative:d,mergeContext:h,flatten:x,allChildren:v,unflattenr:y,unflattenl:w,defaultContext:l,realContext:c,positiveContext:o}});var _G="simplify",OG=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Gg=F(_G,OG,e=>{var{config:r,typed:t,parse:a,add:n,subtract:i,multiply:u,divide:l,pow:c,isZero:o,equal:s,resolve:m,simplifyConstant:d,simplifyCore:h,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:M,FunctionNode:A,IndexNode:S,ObjectNode:O,OperatorNode:_,ParenthesisNode:E,SymbolNode:T}=e,{hasProperty:R,isCommutative:k,isAssociative:W,mergeContext:G,flatten:H,unflattenr:L,unflattenl:q,createMakeNodeFunction:K,defaultContext:z,realContext:oe,positiveContext:pe}=cf({FunctionNode:A,OperatorNode:_,SymbolNode:T});t.addConversion({from:"Object",to:"Map",convert:Ki});var ae=t("simplify",{Node:xe,"Node, Map":(j,ne)=>xe(j,!1,ne),"Node, Map, Object":(j,ne,ue)=>xe(j,!1,ne,ue),"Node, Array":xe,"Node, Array, Map":xe,"Node, Array, Map, Object":xe});t.removeConversion({from:"Object",to:"Map",convert:Ki}),ae.defaultContext=z,ae.realContext=oe,ae.positiveContext=pe;function $(j){return j.transform(function(ne,ue,Me){return en(ne)?$(ne.content):ne})}var le={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};ae.rules=[h,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},d,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},d,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function Ee(j,ne){var ue={};if(j.s){var Me=j.s.split("->");if(Me.length===2)ue.l=Me[0],ue.r=Me[1];else throw SyntaxError("Could not parse rule: "+j.s)}else ue.l=j.l,ue.r=j.r;ue.l=$(a(ue.l)),ue.r=$(a(ue.r));for(var Ce of["imposeContext","repeat","assuming"])Ce in j&&(ue[Ce]=j[Ce]);if(j.evaluate&&(ue.evaluate=a(j.evaluate)),W(ue.l,ne)){var Le=!k(ue.l,ne),Ie;Le&&(Ie=Se());var fr=K(ue.l),or=Se();ue.expanded={},ue.expanded.l=fr([ue.l,or]),H(ue.expanded.l,ne),L(ue.expanded.l,ne),ue.expanded.r=fr([ue.r,or]),Le&&(ue.expandedNC1={},ue.expandedNC1.l=fr([Ie,ue.l]),ue.expandedNC1.r=fr([Ie,ue.r]),ue.expandedNC2={},ue.expandedNC2.l=fr([Ie,ue.expanded.l]),ue.expandedNC2.r=fr([Ie,ue.expanded.r]))}return ue}function me(j,ne){for(var ue=[],Me=0;Me2&&arguments[2]!==void 0?arguments[2]:Oo(),Me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ce=Me.consoleDebug;ne=me(ne||ae.rules,Me.context);var Le=m(j,ue);Le=$(Le);for(var Ie={},fr=Le.toString({parenthesis:"all"});!Ie[fr];){Ie[fr]=!0,ge=0;var or=fr;Ce&&console.log("Working on: ",fr);for(var Ke=0;Ke ").concat(ne[Ke].r.toString()))),Ce){var ee=Le.toString({parenthesis:"all"});ee!==or&&(console.log("Applying",Pr,"produced",ee),or=ee)}q(Le,Me.context)}fr=Le.toString({parenthesis:"all"})}return Le}function be(j,ne,ue){var Me=j;if(j)for(var Ce=0;Ce1&&(or=Le(j.args.slice(0,fr))),Ce=j.args.slice(fr),Me=Ce.length===1?Ce[0]:Le(Ce),ue.push(Le([or,Me]))}return ue}function We(j,ne){var ue={placeholders:{}};if(!j.placeholders&&!ne.placeholders)return ue;if(j.placeholders){if(!ne.placeholders)return j}else return ne;for(var Me in j.placeholders)if(Xe(j.placeholders,Me)&&(ue.placeholders[Me]=j.placeholders[Me],Xe(ne.placeholders,Me)&&!ye(j.placeholders[Me],ne.placeholders[Me])))return null;for(var Ce in ne.placeholders)Xe(ne.placeholders,Ce)&&(ue.placeholders[Ce]=ne.placeholders[Ce]);return ue}function Je(j,ne){var ue=[];if(j.length===0||ne.length===0)return ue;for(var Me,Ce=0;Ce2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var or=re(j.args[0],ne.args[1],ue);if(or.length===0)return[];var Ke=re(j.args[1],ne.args[0],ue);if(Ke.length===0)return[];Le=[or,Ke]}Ce=J(Le)}else if(ne.args.length>=2&&j.args.length===2){for(var Pr=Ae(ne,ue),ee=[],ce=0;ce2)throw Error("Unexpected non-binary associative function: "+j.toString());return[]}}else if(j instanceof T){if(j.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(le[j.name]){if(j.name!==ne.name)return[]}else switch(j.name[1]>="a"&&j.name[1]<="z"?j.name.substring(0,2):j.name[0]){case"n":case"_p":Ce[0].placeholders[j.name]=ne;break;case"c":case"cl":if(yr(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"v":if(!yr(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"vl":if(nt(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"cd":if(AD(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"vd":if(!AD(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"ce":if(Rc(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"ve":if(!Rc(ne))Ce[0].placeholders[j.name]=ne;else return[];break;default:throw new Error("Invalid symbol in rule: "+j.name)}}else if(j instanceof M){if(!s(j.value,ne.value))return[]}else return[];return Ce}function ye(j,ne){if(j instanceof M&&ne instanceof M){if(!s(j.value,ne.value))return!1}else if(j instanceof T&&ne instanceof T){if(j.name!==ne.name)return!1}else if(j instanceof _&&ne instanceof _||j instanceof A&&ne instanceof A){if(j instanceof _){if(j.op!==ne.op||j.fn!==ne.fn)return!1}else if(j instanceof A&&j.name!==ne.name)return!1;if(j.args.length!==ne.args.length)return!1;for(var ue=0;ue{var{typed:r,config:t,mathWithTransform:a,matrix:n,fraction:i,bignumber:u,AccessorNode:l,ArrayNode:c,ConstantNode:o,FunctionNode:s,IndexNode:m,ObjectNode:d,OperatorNode:h,SymbolNode:x}=e,{isCommutative:v,isAssociative:y,allChildren:w,createMakeNodeFunction:C}=cf({FunctionNode:s,OperatorNode:h,SymbolNode:x}),b=r("simplifyConstant",{Node:H=>O(G(H,{})),"Node, Object":function(L,q){return O(G(L,q))}});function M(H){return ma(H)?H.valueOf():H instanceof Array?H.map(M):Qe(H)?n(M(H.valueOf())):H}function A(H,L,q){try{return a[H].apply(null,L)}catch{return L=L.map(M),E(a[H].apply(null,L),q)}}var S=r({Fraction:R,number:function(L){return L<0?T(new o(-L)):new o(L)},BigNumber:function(L){return L<0?T(new o(-L)):new o(L)},Complex:function(L){throw new Error("Cannot convert Complex number to Node")},string:function(L){return new o(L)},Matrix:function(L){return new c(L.valueOf().map(q=>S(q)))}});function O(H){return Nr(H)?H:S(H)}function _(H,L){var q=L&&L.exactFractions!==!1;if(q&&isFinite(H)&&i){var K=i(H),z=L&&typeof L.fractionsLimit=="number"?L.fractionsLimit:1/0;if(K.valueOf()===H&&K.n0;)if(yr(K[0])&&typeof K[0].value!="string"){var z=E(K.shift().value,q);jt(H)?H=H.items[z-1]:(H=H.valueOf()[z-1],H instanceof Array&&(H=n(H)))}else if(K.length>1&&yr(K[1])&&typeof K[1].value!="string"){var oe=E(K[1].value,q),pe=[],ae=jt(H)?H.items:H.valueOf();for(var $ of ae)if(jt($))pe.push($.items[oe-1]);else if(Qe(H))pe.push($[oe-1]);else break;if(pe.length===ae.length)jt(H)?H=new c(pe):H=n(pe),K.splice(1,1);else break}else break;return K.length===L.dimensions.length?new l(O(H),L):K.length>0?(L=new m(K),new l(O(H),L)):H}if(Mi(H)&&L.dimensions.length===1&&yr(L.dimensions[0])){var le=L.dimensions[0].value;return le in H.properties?H.properties[le]:new o}return new l(O(H),L)}function W(H,L,q,K){var z=L.shift(),oe=L.reduce((pe,ae)=>{if(!Nr(ae)){var $=pe.pop();if(Nr($))return[$,ae];try{return pe.push(A(H,[$,ae],K)),pe}catch{pe.push($)}}pe.push(O(pe.pop()));var le=pe.length===1?pe[0]:q(pe);return[q([le,O(ae)])]},[z]);return oe.length===1?oe[0]:q([oe[0],S(oe[1])])}function G(H,L){switch(H.type){case"SymbolNode":return H;case"ConstantNode":switch(typeof H.value){case"number":return E(H.value,L);case"string":return H.value;default:if(!isNaN(H.value))return E(H.value,L)}return H;case"FunctionNode":if(a[H.name]&&a[H.name].rawArgs)return H;{var q=["add","multiply"];if(q.indexOf(H.name)===-1){var K=H.args.map(De=>G(De,L));if(!K.some(Nr))try{return A(H.name,K,L)}catch{}if(H.name==="size"&&K.length===1&&jt(K[0])){for(var z=[],oe=K[0];jt(oe);)z.push(oe.items.length),oe=oe.items[0];return n(z)}return new s(H.name,K.map(O))}}case"OperatorNode":{var pe=H.fn.toString(),ae,$,le=C(H);if(ct(H)&&H.isUnary())ae=[G(H.args[0],L)],Nr(ae[0])?$=le(ae):$=A(pe,ae,L);else if(y(H,L.context))if(ae=w(H,L.context),ae=ae.map(De=>G(De,L)),v(pe,L.context)){for(var Ee=[],me=[],ge=0;ge1?($=W(pe,Ee,le,L),me.unshift($),$=W(pe,me,le,L)):$=W(pe,ae,le,L)}else $=W(pe,ae,le,L);else ae=H.args.map(De=>G(De,L)),$=W(pe,ae,le,L);return $}case"ParenthesisNode":return G(H.content,L);case"AccessorNode":return k(G(H.object,L),G(H.index,L),L);case"ArrayNode":{var Se=H.items.map(De=>G(De,L));return Se.some(Nr)?new c(Se.map(O)):n(Se)}case"IndexNode":return new m(H.dimensions.map(De=>b(De,L)));case"ObjectNode":{var xe={};for(var be in H.properties)xe[be]=b(H.properties[be],L);return new d(xe)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(H.type))}}return b});var UB="simplifyCore",IG=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Zg=F(UB,IG,e=>{var{typed:r,parse:t,equal:a,isZero:n,add:i,subtract:u,multiply:l,divide:c,pow:o,AccessorNode:s,ArrayNode:m,ConstantNode:d,FunctionNode:h,IndexNode:x,ObjectNode:v,OperatorNode:y,ParenthesisNode:w,SymbolNode:C}=e,b=new d(0),M=new d(1),A=new d(!0),S=new d(!1);function O(R){return ct(R)&&["and","not","or"].includes(R.op)}var{hasProperty:_,isCommutative:E}=cf({FunctionNode:h,OperatorNode:y,SymbolNode:C});function T(R){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=k?k.context:void 0;if(_(R,"trivial",W)){if(gn(R)&&R.args.length===1)return T(R.args[0],k);var G=!1,H=0;if(R.forEach(me=>{++H,H===1&&(G=T(me,k))}),H===1)return G}var L=R;if(gn(L)){var q=kE(L.name);if(q){if(L.args.length>2&&_(L,"associative",W))for(;L.args.length>2;){var K=L.args.pop(),z=L.args.pop();L.args.push(new y(q,L.name,[K,z]))}L=new y(q,L.name,L.args)}else return new h(T(L.fn),L.args.map(me=>T(me,k)))}if(ct(L)&&L.isUnary()){var oe=T(L.args[0],k);if(L.op==="~"&&ct(oe)&&oe.isUnary()&&oe.op==="~"||L.op==="not"&&ct(oe)&&oe.isUnary()&&oe.op==="not"&&O(oe.args[0]))return oe.args[0];var pe=!0;if(L.op==="-"&&ct(oe)&&(oe.isBinary()&&oe.fn==="subtract"&&(L=new y("-","subtract",[oe.args[1],oe.args[0]]),pe=!1),oe.isUnary()&&oe.op==="-"))return oe.args[0];if(pe)return new y(L.op,L.fn,[oe])}if(ct(L)&&L.isBinary()){var ae=T(L.args[0],k),$=T(L.args[1],k);if(L.op==="+"){if(yr(ae)&&n(ae.value))return $;if(yr($)&&n($.value))return ae;ct($)&&$.isUnary()&&$.op==="-"&&($=$.args[0],L=new y("-","subtract",[ae,$]))}if(L.op==="-")return ct($)&&$.isUnary()&&$.op==="-"?T(new y("+","add",[ae,$.args[0]]),k):yr(ae)&&n(ae.value)?T(new y("-","unaryMinus",[$])):yr($)&&n($.value)?ae:new y(L.op,L.fn,[ae,$]);if(L.op==="*"){if(yr(ae)){if(n(ae.value))return b;if(a(ae.value,1))return $}if(yr($)){if(n($.value))return b;if(a($.value,1))return ae;if(E(L,W))return new y(L.op,L.fn,[$,ae],L.implicit)}return new y(L.op,L.fn,[ae,$],L.implicit)}if(L.op==="/")return yr(ae)&&n(ae.value)?b:yr($)&&a($.value,1)?ae:new y(L.op,L.fn,[ae,$]);if(L.op==="^"&&yr($)){if(n($.value))return M;if(a($.value,1))return ae}if(L.op==="and"){if(yr(ae))if(ae.value){if(O($))return $;if(yr($))return $.value?A:S}else return S;if(yr($))if($.value){if(O(ae))return ae}else return S}if(L.op==="or"){if(yr(ae)){if(ae.value)return A;if(O($))return $}if(yr($)){if($.value)return A;if(O(ae))return ae}}return new y(L.op,L.fn,[ae,$])}if(ct(L))return new y(L.op,L.fn,L.args.map(me=>T(me,k)));if(jt(L))return new m(L.items.map(me=>T(me,k)));if(qn(L))return new s(T(L.object,k),T(L.index,k));if(Qn(L))return new x(L.dimensions.map(me=>T(me,k)));if(Mi(L)){var le={};for(var Ee in L.properties)le[Ee]=T(L.properties[Ee],k);return new v(le)}return L}return r(UB,{Node:T,"Node,Object":T})});var RG="resolve",qG=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],Qg=F(RG,qG,e=>{var{typed:r,parse:t,ConstantNode:a,FunctionNode:n,OperatorNode:i,ParenthesisNode:u}=e;function l(c,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!o)return c;if(nt(c)){if(s.has(c.name)){var m=Array.from(s).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(m,"}"))}var d=o.get(c.name);if(Nr(d)){var h=new Set(s);return h.add(c.name),l(d,o,h)}else return typeof d=="number"?t(String(d)):d!==void 0?new a(d):c}else if(ct(c)){var x=c.args.map(function(y){return l(y,o,s)});return new i(c.op,c.fn,x,c.implicit)}else{if(en(c))return new u(l(c.content,o,s));if(gn(c)){var v=c.args.map(function(y){return l(y,o,s)});return new n(c.name,v)}}return c.map(y=>l(y,o,s))}return r("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(c,o)=>l(c,Ki(o)),"Array | Matrix":r.referToSelf(c=>o=>o.map(s=>c(s))),"Array | Matrix, null | undefined":r.referToSelf(c=>o=>o.map(s=>c(s))),"Array, Object":r.referTo("Array,Map",c=>(o,s)=>c(o,Ki(s))),"Matrix, Object":r.referTo("Matrix,Map",c=>(o,s)=>c(o,Ki(s))),"Array | Matrix, Map":r.referToSelf(c=>(o,s)=>o.map(m=>c(m,s)))})});var WB="symbolicEqual",kG=["parse","simplify","typed","OperatorNode"],Xg=F(WB,kG,e=>{var{parse:r,simplify:t,typed:a,OperatorNode:n}=e;function i(u,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=new n("-","subtract",[u,l]),s=t(o,{},c);return yr(s)&&!s.value}return a(WB,{"Node, Node":i,"Node, Node, Object":i})});var YB="derivative",LG=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],Jg=F(YB,LG,e=>{var{typed:r,config:t,parse:a,simplify:n,equal:i,isZero:u,numeric:l,ConstantNode:c,FunctionNode:o,OperatorNode:s,ParenthesisNode:m,SymbolNode:d}=e;function h(b,M){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},S={};y(S,b,M.name);var O=w(b,S);return A.simplify?n(O):O}r.addConversion({from:"identifier",to:"SymbolNode",convert:a});var x=r(YB,{"Node, SymbolNode":h,"Node, SymbolNode, Object":h});r.removeConversion({from:"identifier",to:"SymbolNode",convert:a}),x._simplify=!0,x.toTex=function(b){return v.apply(null,b.args)};var v=r("_derivTex",{"Node, SymbolNode":function(M,A){return yr(M)&&Fr(M.value)==="string"?v(a(M.value).toString(),A.toString(),1):v(M.toTex(),A.toString(),1)},"Node, ConstantNode":function(M,A){if(Fr(A.value)==="string")return v(M,a(A.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(M,A,S){return v(M.toString(),A.name,S.value)},"string, string, number":function(M,A,S){var O;return S===1?O="{d\\\\over d"+A+"}":O="{d^{"+S+"}\\\\over d"+A+"^{"+S+"}}",O+"\\\\left[".concat(M,"\\\\right]")}}),y=r("constTag",{"Object, ConstantNode, string":function(M,A){return M[A]=!0,!0},"Object, SymbolNode, string":function(M,A,S){return A.name!==S?(M[A]=!0,!0):!1},"Object, ParenthesisNode, string":function(M,A,S){return y(M,A.content,S)},"Object, FunctionAssignmentNode, string":function(M,A,S){return A.params.indexOf(S)===-1?(M[A]=!0,!0):y(M,A.expr,S)},"Object, FunctionNode | OperatorNode, string":function(M,A,S){if(A.args.length>0){for(var O=y(M,A.args[0],S),_=1;_0){var O=M.args.filter(function(H){return A[H]===void 0}),_=O.length===1?O[0]:new s("*","multiply",O),E=S.concat(w(_,A));return new s("*","multiply",E)}return new s("+","add",M.args.map(function(H){return new s("*","multiply",M.args.map(function(L){return L===H?w(L,A):L.clone()}))}))}if(M.op==="/"&&M.isBinary()){var T=M.args[0],R=M.args[1];return A[R]!==void 0?new s("/","divide",[w(T,A),R]):A[T]!==void 0?new s("*","multiply",[new s("-","unaryMinus",[T]),new s("/","divide",[w(R,A),new s("^","pow",[R.clone(),C(2)])])]):new s("/","divide",[new s("-","subtract",[new s("*","multiply",[w(T,A),R.clone()]),new s("*","multiply",[T.clone(),w(R,A)])]),new s("^","pow",[R.clone(),C(2)])])}if(M.op==="^"&&M.isBinary()){var k=M.args[0],W=M.args[1];if(A[k]!==void 0)return yr(k)&&(u(k.value)||i(k.value,1))?C(0):new s("*","multiply",[M,new s("*","multiply",[new o("log",[k.clone()]),w(W.clone(),A)])]);if(A[W]!==void 0){if(yr(W)){if(u(W.value))return C(0);if(i(W.value,1))return w(k,A)}var G=new s("^","pow",[k.clone(),new s("-","subtract",[W,C(1)])]);return new s("*","multiply",[W.clone(),new s("*","multiply",[w(k,A),G])])}return new s("*","multiply",[new s("^","pow",[k.clone(),W.clone()]),new s("+","add",[new s("*","multiply",[w(k,A),new s("/","divide",[W.clone(),k.clone()])]),new s("*","multiply",[w(W,A),new o("log",[k.clone()])])])])}throw new Error('Cannot process operator "'+M.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function C(b,M){return new c(l(b,M||t.number))}return x});var HB="rationalize",zG=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],Kg=F(HB,zG,e=>{var{config:r,typed:t,equal:a,isZero:n,add:i,subtract:u,multiply:l,divide:c,pow:o,parse:s,simplifyConstant:m,simplifyCore:d,simplify:h,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:M,FunctionNode:A,IndexNode:S,ObjectNode:O,OperatorNode:_,SymbolNode:E,ParenthesisNode:T}=e;function R(L){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,z=W(),oe=k(L,q,!0,z.firstRules),pe=oe.variables.length,ae={exactFractions:!1},$={exactFractions:!0};if(L=oe.expression,pe>=1){L=G(L);var le,Ee,me=!0,ge=!1;L=h(L,z.firstRules,{},ae);for(var Se;Ee=me?z.distrDivRules:z.sucDivRules,L=h(L,Ee,{},$),me=!me,Se=L.toString(),Se!==le;)ge=!0,le=Se;ge&&(L=h(L,z.firstRulesAgain,{},ae)),L=h(L,z.finalRules,{},ae)}var xe=[],be={};return L.type==="OperatorNode"&&L.isBinary()&&L.op==="/"?(pe===1&&(L.args[0]=H(L.args[0],xe),L.args[1]=H(L.args[1])),K&&(be.numerator=L.args[0],be.denominator=L.args[1])):(pe===1&&(L=H(L,xe)),K&&(be.numerator=L,be.denominator=null)),K?(be.coefficients=xe,be.variables=oe.variables,be.expression=L,be):L}return t(HB,{Node:R,"Node, boolean":(L,q)=>R(L,{},q),"Node, Object":R,"Node, Object, boolean":R});function k(L,q,K,z){var oe=[],pe=h(L,z,q,{exactFractions:!1});K=!!K;var ae="+-*"+(K?"/":"");le(pe);var $={};return $.expression=pe,$.variables=oe,$;function le(Ee){var me=Ee.type;if(me==="FunctionNode")throw new Error("There is an unsolved function call");if(me==="OperatorNode")if(Ee.op==="^"){if(Ee.args[1].type!=="ConstantNode"||!Ze(parseFloat(Ee.args[1].value)))throw new Error("There is a non-integer exponent");le(Ee.args[0])}else{if(ae.indexOf(Ee.op)===-1)throw new Error("Operator "+Ee.op+" invalid in polynomial expression");for(var ge=0;ge1;if(z==="OperatorNode"&&L.isBinary()){var pe=!1,ae;if(L.op==="^"&&(L.args[0].type==="ParenthesisNode"||L.args[0].type==="OperatorNode")&&L.args[1].type==="ConstantNode"&&(ae=parseFloat(L.args[1].value),pe=ae>=2&&Ze(ae)),pe){if(ae>2){var $=L.args[0],le=new _("^","pow",[L.args[0].cloneDeep(),new M(ae-1)]);L=new _("*","multiply",[$,le])}else L=new _("*","multiply",[L.args[0],L.args[0].cloneDeep()]);oe&&(K==="content"?q.content=L:q.args[K]=L)}}if(z==="ParenthesisNode")G(L.content,L,"content");else if(z!=="ConstantNode"&&z!=="SymbolNode")for(var Ee=0;Ee=0;$--)if(q[$]!==0){var le=new M(pe?q[$]:Math.abs(q[$])),Ee=q[$]<0?"-":"+";if($>0){var me=new E(oe);if($>1){var ge=new M($);me=new _("^","pow",[me,ge])}q[$]===-1&&pe?le=new _("-","unaryMinus",[me]):Math.abs(q[$])===1?le=me:le=new _("*","multiply",[le,me])}pe?ae=le:Ee==="+"?ae=new _("+","add",[ae,le]):ae=new _("-","subtract",[ae,le]),pe=!1}if(pe)return new M(0);return ae;function Se(xe,be,De){var Ae=xe.type;if(Ae==="FunctionNode")throw new Error("There is an unsolved function call");if(Ae==="OperatorNode"){if("+-*^".indexOf(xe.op)===-1)throw new Error("Operator "+xe.op+" invalid");if(be!==null){if((xe.fn==="unaryMinus"||xe.fn==="pow")&&be.fn!=="add"&&be.fn!=="subtract"&&be.fn!=="multiply")throw new Error("Invalid "+xe.op+" placing");if((xe.fn==="subtract"||xe.fn==="add"||xe.fn==="multiply")&&be.fn!=="add"&&be.fn!=="subtract")throw new Error("Invalid "+xe.op+" placing");if((xe.fn==="subtract"||xe.fn==="add"||xe.fn==="unaryMinus")&&De.noFil!==0)throw new Error("Invalid "+xe.op+" placing")}(xe.op==="^"||xe.op==="*")&&(De.fire=xe.op);for(var We=0;Wez&&(q[Je]=0),q[Je]+=De.cte*(De.oper==="+"?1:-1),z=Math.max(Je,z);return}De.cte=Je,De.fire===""&&(q[0]+=De.cte*(De.oper==="+"?1:-1))}else throw new Error("Type "+Ae+" is not allowed")}}});var $B="zpk2tf",UG=["typed","add","multiply","Complex","number"],jg=F($B,UG,e=>{var{typed:r,add:t,multiply:a,Complex:n,number:i}=e;return r($B,{"Array,Array,number":function(o,s,m){return u(o,s,m)},"Array,Array":function(o,s){return u(o,s,1)},"Matrix,Matrix,number":function(o,s,m){return u(o.valueOf(),s.valueOf(),m)},"Matrix,Matrix":function(o,s){return u(o.valueOf(),s.valueOf(),1)}});function u(c,o,s){c.some(C=>C.type==="BigNumber")&&(c=c.map(C=>i(C))),o.some(C=>C.type==="BigNumber")&&(o=o.map(C=>i(C)));for(var m=[n(1,0)],d=[n(1,0)],h=0;h=0&&m-d{var{typed:r,add:t,multiply:a,Complex:n,divide:i,matrix:u}=e;return r(GB,{"Array, Array":function(s,m){var d=c(512);return l(s,m,d)},"Array, Array, Array":function(s,m,d){return l(s,m,d)},"Array, Array, number":function(s,m,d){if(d<0)throw new Error("w must be a positive number");var h=c(d);return l(s,m,h)},"Matrix, Matrix":function(s,m){var d=c(512),{w:h,h:x}=l(s.valueOf(),m.valueOf(),d);return{w:u(h),h:u(x)}},"Matrix, Matrix, Matrix":function(s,m,d){var{h}=l(s.valueOf(),m.valueOf(),d.valueOf());return{h:u(h),w:u(d)}},"Matrix, Matrix, number":function(s,m,d){if(d<0)throw new Error("w must be a positive number");var h=c(d),{h:x}=l(s.valueOf(),m.valueOf(),h);return{h:u(x),w:u(h)}}});function l(o,s,m){for(var d=[],h=[],x=0;x{var{classes:r}=e;return function(a,n){var i=r[n&&n.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(n):n}});var $G="replacer",GG=[],t0=F($G,GG,()=>function(r,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t});var VB="12.4.1";var n0=F("true",[],()=>!0),a0=F("false",[],()=>!1),i0=F("null",[],()=>null),o0=va("Infinity",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1/0):1/0}),s0=va("NaN",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(NaN):NaN}),u0=va("pi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?Bc(t):CM}),f0=va("tau",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?QC(t):EM}),c0=va("e",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?VC(t):TM}),l0=va("phi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?ZC(t):FM}),m0=va("LN2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).ln():Math.LN2}),p0=va("LN10",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(10).ln():Math.LN10}),d0=va("LOG2E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),h0=va("LOG10E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),v0=va("SQRT1_2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),g0=va("SQRT2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),x0=va("i",["Complex"],e=>{var{Complex:r}=e;return r.I}),ZB=F("PI",["pi"],e=>{var{pi:r}=e;return r}),QB=F("E",["e"],e=>{var{e:r}=e;return r}),y0=F("version",[],()=>VB);function va(e,r,t){return F(e,r,t,{recreateOnConfigChange:!0})}var b0=Er("speedOfLight","299792458","m s^-1"),w0=Er("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),D0=Er("planckConstant","6.62607015e-34","J s"),S0=Er("reducedPlanckConstant","1.0545718176461565e-34","J s"),N0=Er("magneticConstant","1.25663706212e-6","N A^-2"),A0=Er("electricConstant","8.8541878128e-12","F m^-1"),M0=Er("vacuumImpedance","376.730313667","ohm"),C0=Er("coulomb","8.987551792261171e9","N m^2 C^-2"),E0=Er("elementaryCharge","1.602176634e-19","C"),T0=Er("bohrMagneton","9.2740100783e-24","J T^-1"),F0=Er("conductanceQuantum","7.748091729863649e-5","S"),_0=Er("inverseConductanceQuantum","12906.403729652257","ohm"),O0=Er("magneticFluxQuantum","2.0678338484619295e-15","Wb"),B0=Er("nuclearMagneton","5.0507837461e-27","J T^-1"),P0=Er("klitzing","25812.807459304513","ohm");var I0=Er("bohrRadius","5.29177210903e-11","m"),R0=Er("classicalElectronRadius","2.8179403262e-15","m"),q0=Er("electronMass","9.1093837015e-31","kg"),k0=Er("fermiCoupling","1.1663787e-5","GeV^-2"),L0=vx("fineStructure",.0072973525693),z0=Er("hartreeEnergy","4.3597447222071e-18","J"),U0=Er("protonMass","1.67262192369e-27","kg"),W0=Er("deuteronMass","3.3435830926e-27","kg"),Y0=Er("neutronMass","1.6749271613e-27","kg"),H0=Er("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),$0=Er("rydberg","10973731.568160","m^-1"),G0=Er("thomsonCrossSection","6.6524587321e-29","m^2"),V0=vx("weakMixingAngle",.2229),Z0=vx("efimovFactor",22.7),Q0=Er("atomicMass","1.66053906660e-27","kg"),X0=Er("avogadro","6.02214076e23","mol^-1"),J0=Er("boltzmann","1.380649e-23","J K^-1"),K0=Er("faraday","96485.33212331001","C mol^-1"),j0=Er("firstRadiation","3.7417718521927573e-16","W m^2"),ex=Er("loschmidt","2.686780111798444e25","m^-3"),rx=Er("gasConstant","8.31446261815324","J K^-1 mol^-1"),tx=Er("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),nx=Er("molarVolume","0.022413969545014137","m^3 mol^-1"),ax=vx("sackurTetrode",-1.16487052358),ix=Er("secondRadiation","0.014387768775039337","m K"),ox=Er("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),sx=Er("wienDisplacement","2.897771955e-3","m K"),ux=Er("molarMass","0.99999999965e-3","kg mol^-1"),fx=Er("molarMassC12","11.9999999958e-3","kg mol^-1"),cx=Er("gravity","9.80665","m s^-2"),lx=Er("planckLength","1.616255e-35","m"),mx=Er("planckMass","2.176435e-8","kg"),px=Er("planckTime","5.391245e-44","s"),dx=Er("planckCharge","1.87554603778e-18","C"),hx=Er("planckTemperature","1.416785e+32","K");function Er(e,r,t){var a=["config","Unit","BigNumber"];return F(e,a,n=>{var{config:i,Unit:u,BigNumber:l}=n,c=i.number==="BigNumber"?new l(r):parseFloat(r),o=new u(c,t);return o.fixPrefix=!0,o})}function vx(e,r){var t=["config","BigNumber"];return F(e,t,a=>{var{config:n,BigNumber:i}=a;return n.number==="BigNumber"?new i(r):r})}var VG="apply",ZG=["typed","isInteger"],gx=F(VG,ZG,e=>{var{typed:r,isInteger:t}=e,a=ko({typed:r,isInteger:t});return r("apply",{"...any":function(i){var u=i[1];sr(u)?i[1]=u-1:rr(u)&&(i[1]=u.minus(1));try{return a.apply(null,i)}catch(l){throw mt(l)}}})},{isTransformFunction:!0});var QG="column",XG=["typed","Index","matrix","range"],xx=F(QG,XG,e=>{var{typed:r,Index:t,matrix:a,range:n}=e,i=Wu({typed:r,Index:t,matrix:a,range:n});return r("column",{"...any":function(l){var c=l.length-1,o=l[c];sr(o)&&(l[c]=o-1);try{return i.apply(null,l)}catch(s){throw mt(s)}}})},{isTransformFunction:!0});function lf(e,r,t){var a=e.filter(function(c){return nt(c)&&!(c.name in r)&&!t.has(c.name)})[0];if(!a)throw new Error('No undefined variable found in inline expression "'+e+'"');var n=a.name,i=new Map,u=new Eu(t,i,new Set([n])),l=e.compile();return function(o){return i.set(n,o),l.evaluate(u)}}var JG="filter",KG=["typed"],yx=F(JG,KG,e=>{var{typed:r}=e;function t(n,i,u){var l,c;return n[0]&&(l=n[0].compile().evaluate(u)),n[1]&&(nt(n[1])||_a(n[1])?c=n[1].compile().evaluate(u):c=lf(n[1],i,u)),a(l,c)}t.rawArgs=!0;var a=r("filter",{"Array, function":XB,"Matrix, function":function(i,u){return i.create(XB(i.toArray(),u))},"Array, RegExp":Mu,"Matrix, RegExp":function(i,u){return i.create(Mu(i.toArray(),u))}});return t},{isTransformFunction:!0});function XB(e,r){return Em(e,function(t,a,n){return Ia(r,t,[a+1],n,"filter")})}var jG="forEach",eV=["typed"],bx=F(jG,eV,e=>{var{typed:r}=e;function t(n,i,u){var l,c;return n[0]&&(l=n[0].compile().evaluate(u)),n[1]&&(nt(n[1])||_a(n[1])?c=n[1].compile().evaluate(u):c=lf(n[1],i,u)),a(l,c)}t.rawArgs=!0;var a=r("forEach",{"Array | Matrix, function":function(i,u){var l=function c(o,s){if(Array.isArray(o))Fo(o,function(m,d){c(m,s.concat(d+1))});else return Ia(u,o,s,i,"forEach")};l(i.valueOf(),[])}});return t},{isTransformFunction:!0});var rV="index",tV=["Index","getMatrixDataType"],wx=F(rV,tV,e=>{var{Index:r,getMatrixDataType:t}=e;return function(){for(var n=[],i=0,u=arguments.length;i0?0:2;else if(l&&l.isSet===!0)l=l.map(function(o){return o-1});else if(Mr(l)||Qe(l))t(l)!=="boolean"&&(l=l.map(function(o){return o-1}));else if(sr(l))l--;else if(rr(l))l=l.toNumber()-1;else if(typeof l!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");n[i]=l}var c=new r;return r.apply(c,n),c}},{isTransformFunction:!0});var nV="map",aV=["typed"],Dx=F(nV,aV,e=>{var{typed:r}=e;function t(n,i,u){var l,c;return n[0]&&(l=n[0].compile().evaluate(u)),n[1]&&(nt(n[1])||_a(n[1])?c=n[1].compile().evaluate(u):c=lf(n[1],i,u)),a(l,c)}t.rawArgs=!0;var a=r("map",{"Array, function":function(i,u){return JB(i,u,i)},"Matrix, function":function(i,u){return i.create(JB(i.valueOf(),u,i))}});return t},{isTransformFunction:!0});function JB(e,r,t){function a(n,i){return Array.isArray(n)?Xn(n,function(u,l){return a(u,i.concat(l+1))}):Ia(r,n,i,t,"map")}return a(e,[])}function Mn(e){if(e.length===2&&Nt(e[0])){e=e.slice();var r=e[1];sr(r)?e[1]=r-1:rr(r)&&(e[1]=r.minus(1))}return e}var iV="max",oV=["typed","config","numeric","larger"],Sx=F(iV,oV,e=>{var{typed:r,config:t,numeric:a,larger:n}=e,i=ef({typed:r,config:t,numeric:a,larger:n});return r("max",{"...any":function(l){l=Mn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var sV="mean",uV=["typed","add","divide"],Nx=F(sV,uV,e=>{var{typed:r,add:t,divide:a}=e,n=of({typed:r,add:t,divide:a});return r("mean",{"...any":function(u){u=Mn(u);try{return n.apply(null,u)}catch(l){throw mt(l)}}})},{isTransformFunction:!0});var fV="min",cV=["typed","config","numeric","smaller"],Ax=F(fV,cV,e=>{var{typed:r,config:t,numeric:a,smaller:n}=e,i=rf({typed:r,config:t,numeric:a,smaller:n});return r("min",{"...any":function(l){l=Mn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var lV="range",mV=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Mx=F(lV,mV,e=>{var{typed:r,config:t,matrix:a,bignumber:n,smaller:i,smallerEq:u,larger:l,largerEq:c,add:o,isPositive:s}=e,m=$u({typed:r,config:t,matrix:a,bignumber:n,smaller:i,smallerEq:u,larger:l,largerEq:c,add:o,isPositive:s});return r("range",{"...any":function(h){var x=h.length-1,v=h[x];return typeof v!="boolean"&&h.push(!0),m.apply(null,h)}})},{isTransformFunction:!0});var pV="row",dV=["typed","Index","matrix","range"],Cx=F(pV,dV,e=>{var{typed:r,Index:t,matrix:a,range:n}=e,i=Gu({typed:r,Index:t,matrix:a,range:n});return r("row",{"...any":function(l){var c=l.length-1,o=l[c];sr(o)&&(l[c]=o-1);try{return i.apply(null,l)}catch(s){throw mt(s)}}})},{isTransformFunction:!0});var hV="subset",vV=["typed","matrix","zeros","add"],Ex=F(hV,vV,e=>{var{typed:r,matrix:t,zeros:a,add:n}=e,i=Vu({typed:r,matrix:t,zeros:a,add:n});return r("subset",{"...any":function(l){try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var gV="concat",xV=["typed","matrix","isInteger"],Tx=F(gV,xV,e=>{var{typed:r,matrix:t,isInteger:a}=e,n=Uu({typed:r,matrix:t,isInteger:a});return r("concat",{"...any":function(u){var l=u.length-1,c=u[l];sr(c)?u[l]=c-1:rr(c)&&(u[l]=c.minus(1));try{return n.apply(null,u)}catch(o){throw mt(o)}}})},{isTransformFunction:!0});var KB="diff",yV=["typed","matrix","subtract","number","bignumber"],Fx=F(KB,yV,e=>{var{typed:r,matrix:t,subtract:a,number:n,bignumber:i}=e,u=Yu({typed:r,matrix:t,subtract:a,number:n,bignumber:i});return r(KB,{"...any":function(c){c=Mn(c);try{return u.apply(null,c)}catch(o){throw mt(o)}}})},{isTransformFunction:!0});var bV="std",wV=["typed","map","sqrt","variance"],_x=F(bV,wV,e=>{var{typed:r,map:t,sqrt:a,variance:n}=e,i=ff({typed:r,map:t,sqrt:a,variance:n});return r("std",{"...any":function(l){l=Mn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var jB="sum",DV=["typed","config","add","numeric"],Ox=F(jB,DV,e=>{var{typed:r,config:t,add:a,numeric:n}=e,i=nf({typed:r,config:t,add:a,numeric:n});return r(jB,{"...any":function(l){l=Mn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var SV="quantileSeq",NV=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Bx=F(SV,NV,e=>{var{typed:r,bignumber:t,add:a,subtract:n,divide:i,multiply:u,partitionSelect:l,compare:c,isInteger:o,smaller:s,smallerEq:m,larger:d}=e,h=uf({typed:r,bignumber:t,add:a,subtract:n,divide:i,multiply:u,partitionSelect:l,compare:c,isInteger:o,smaller:s,smallerEq:m,larger:d});return r("quantileSeq",{"Array | Matrix, number | BigNumber":h,"Array | Matrix, number | BigNumber, number":(v,y,w)=>h(v,y,x(w)),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(v,y,w,C)=>h(v,y,w,x(C)),"Array | Matrix, Array | Matrix":h,"Array | Matrix, Array | Matrix, number":(v,y,w)=>h(v,y,x(w)),"Array | Matrix, Array | Matrix, boolean":h,"Array | Matrix, Array | Matrix, boolean, number":(v,y,w,C)=>h(v,y,w,x(C))});function x(v){return Mn([[],v])[1]}},{isTransformFunction:!0});var eP="cumsum",AV=["typed","add","unaryPlus"],Px=F(eP,AV,e=>{var{typed:r,add:t,unaryPlus:a}=e,n=af({typed:r,add:t,unaryPlus:a});return r(eP,{"...any":function(u){if(u.length===2&&Nt(u[0])){var l=u[1];sr(l)?u[1]=l-1:rr(l)&&(u[1]=l.minus(1))}try{return n.apply(null,u)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var rP="variance",MV=["typed","add","subtract","multiply","divide","apply","isNaN"],Ix=F(rP,MV,e=>{var{typed:r,add:t,subtract:a,multiply:n,divide:i,apply:u,isNaN:l}=e,c=sf({typed:r,add:t,subtract:a,multiply:n,divide:i,apply:u,isNaN:l});return r(rP,{"...any":function(s){s=Mn(s);try{return c.apply(null,s)}catch(m){throw mt(m)}}})},{isTransformFunction:!0});var tP="print",CV=["typed","matrix","zeros","add"],Rx=F(tP,CV,e=>{var{typed:r,matrix:t,zeros:a,add:n}=e,i=Qu({typed:r,matrix:t,zeros:a,add:n});return r(tP,{"string, Object | Array":function(c,o){return i(u(c),o)},"string, Object | Array, number | Object":function(c,o,s){return i(u(c),o,s)}});function u(l){return l.replace(Pd,c=>{var o=c.slice(1).split("."),s=o.map(function(m){return!isNaN(m)&&m.length>0?parseInt(m)-1:m});return"$"+s.join(".")})}},{isTransformFunction:!0});var EV="and",TV=["typed","matrix","zeros","add","equalScalar","not","concat"],qx=F(EV,TV,e=>{var{typed:r,matrix:t,equalScalar:a,zeros:n,not:i,concat:u}=e,l=ju({typed:r,matrix:t,equalScalar:a,zeros:n,not:i,concat:u});function c(o,s,m){var d=o[0].compile().evaluate(m);if(!Nt(d)&&!l(d,!0))return!1;var h=o[1].compile().evaluate(m);return l(d,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var FV="or",_V=["typed","matrix","equalScalar","DenseMatrix","concat"],kx=F(FV,_V,e=>{var{typed:r,matrix:t,equalScalar:a,DenseMatrix:n,concat:i}=e,u=zu({typed:r,matrix:t,equalScalar:a,DenseMatrix:n,concat:i});function l(c,o,s){var m=c[0].compile().evaluate(s);if(!Nt(m)&&u(m,!1))return!0;var d=c[1].compile().evaluate(s);return u(m,d)}return l.rawArgs=!0,l},{isTransformFunction:!0});var OV="bitAnd",BV=["typed","matrix","zeros","add","equalScalar","not","concat"],Lx=F(OV,BV,e=>{var{typed:r,matrix:t,equalScalar:a,zeros:n,not:i,concat:u}=e,l=ku({typed:r,matrix:t,equalScalar:a,zeros:n,not:i,concat:u});function c(o,s,m){var d=o[0].compile().evaluate(m);if(!Nt(d)){if(isNaN(d))return NaN;if(d===0||d===!1)return 0}var h=o[1].compile().evaluate(m);return l(d,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var PV="bitOr",IV=["typed","matrix","equalScalar","DenseMatrix","concat"],zx=F(PV,IV,e=>{var{typed:r,matrix:t,equalScalar:a,DenseMatrix:n,concat:i}=e,u=Lu({typed:r,matrix:t,equalScalar:a,DenseMatrix:n,concat:i});function l(c,o,s){var m=c[0].compile().evaluate(s);if(!Nt(m)){if(isNaN(m))return NaN;if(m===-1)return-1;if(m===!0)return 1}var d=c[1].compile().evaluate(s);return u(m,d)}return l.rawArgs=!0,l},{isTransformFunction:!0});var Ge=zm({config:Oe}),pt=Um({}),ED=c0({BigNumber:Ge,config:Oe}),nP=a0({}),aP=L0({BigNumber:Ge,config:Oe}),Uo=Wm({}),TD=x0({Complex:pt}),iP=o0({BigNumber:Ge,config:Oe}),oP=p0({BigNumber:Ge,config:Oe}),sP=h0({BigNumber:Ge,config:Oe}),qc=Hm({}),uP=s0({BigNumber:Ge,config:Oe}),fP=i0({}),cP=l0({BigNumber:Ge,config:Oe}),lP=Ym({}),FD=Om({}),mP=v0({BigNumber:Ge,config:Oe}),pP=ax({BigNumber:Ge,config:Oe}),_D=f0({BigNumber:Ge,config:Oe}),dP=n0({}),hP=y0({}),_r=Gm({Matrix:qc}),vP=Z0({BigNumber:Ge,config:Oe}),gP=m0({BigNumber:Ge,config:Oe}),Ux=u0({BigNumber:Ge,config:Oe}),xP=t0({}),yP=g0({BigNumber:Ge,config:Oe}),te=_m({BigNumber:Ge,Complex:pt,DenseMatrix:_r,Fraction:Uo}),Wx=bp({BigNumber:Ge,config:Oe,typed:te}),bP=V0({BigNumber:Ge,config:Oe}),Cn=wp({typed:te}),wP=Eh({Complex:pt,config:Oe,typed:te}),DP=Fh({BigNumber:Ge,typed:te}),SP=Oh({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),Qt=Sp({typed:te}),NP=Qp({typed:te}),AP=Ih({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),MP=qh({typed:te}),OD=kh({typed:te}),CP=zh({Complex:pt,config:Oe,typed:te}),ea=lp({BigNumber:Ge,typed:te}),EP=Vp({typed:te}),TP=cp({typed:te}),FP=Vm({typed:te}),kc=Tg({typed:te}),Lc=mp({Complex:pt,typed:te}),Wo=Xp({typed:te}),Yx=Uh({typed:te}),_P=Yh({BigNumber:Ge,typed:te}),OP=$h({BigNumber:Ge,typed:te}),BP=Cp({typed:te}),Ir=op({config:Oe,typed:te}),PP=Md({typed:te}),BD=Ep({typed:te}),IP=Tp({Complex:pt,typed:te}),RP=ad({typed:te}),qP=od({typed:te}),mf=Fd({typed:te}),Hx=sd({typed:te}),kP=Bd({format:mf,typed:te}),$x=Jp({typed:te}),kn=Xm({typed:te}),no=Km({typed:te}),Yo=rp({typed:te}),ka=tp({typed:te}),LP=d0({BigNumber:Ge,config:Oe}),zP=Og({Complex:pt,typed:te}),UP=Bp({Complex:pt,config:Oe,typed:te}),PD=Pp({Complex:pt,config:Oe,typed:te}),Ho=cd({typed:te}),Ot=Ip({typed:te}),zc=jp({typed:te}),_i=up({typed:te}),WP=Od({format:mf,typed:te}),YP=kg({config:Oe,typed:te}),HP=Qu({typed:te}),$P=Lg({config:Oe,typed:te}),Gx=Kp({typed:te}),GP=Vh({BigNumber:Ge,typed:te}),ID=kp({BigNumber:Ge,Fraction:Uo,complex:Lc,typed:te}),Uc=Qh({typed:te}),Oi=sp({Matrix:qc,equalScalar:Ir,typed:te}),VP=xp({typed:te}),ZP=zp({typed:te}),QP=fp({typed:te}),ga=Np({typed:te}),XP=Jh({typed:te}),RD=ap({typed:te}),JP=Th({Complex:pt,config:Oe,typed:te}),KP=Bh({BigNumber:Ge,typed:te}),Vx=ko({isInteger:kn,typed:te}),jP=Ph({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),e4=_d({format:mf,typed:te}),r4=Fg({typed:te}),t4=Wh({typed:te}),n4=Gh({BigNumber:Ge,typed:te}),pf=np({typed:te}),a4=Rd({typed:te}),i4=zg({config:Oe,typed:te}),o4=Zh({BigNumber:Ge,typed:te}),s4=Xh({typed:te}),u4=Mh({SparseMatrix:Oi,typed:te}),La=Lp({Complex:pt,config:Oe,typed:te}),f4=Kh({typed:te}),fi=yp({typed:te}),c4=_h({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),l4=Hh({BigNumber:Ge,typed:te}),Bs=pp({Fraction:Uo,typed:te}),$o=jm({typed:te}),$e=dp({DenseMatrix:_r,Matrix:qc,SparseMatrix:Oi,typed:te}),m4=hp({isZero:ka,matrix:$e,typed:te}),p4=Ed({isNaN:pf,isNumeric:$o,typed:te}),za=qd({bignumber:ea,fraction:Bs,number:_i}),qD=Td({config:Oe,multiplyScalar:Ot,numeric:za,typed:te}),kD=dd({isInteger:kn,matrix:$e,typed:te}),cn=xd({matrix:$e,config:Oe,typed:te}),d4=yd({matrix:$e,typed:te}),df=bd({matrix:$e,typed:te}),LD=Wp({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),ln=Dd({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),h4=Rh({Complex:pt,config:Oe,typed:te}),zD=Ap({BigNumber:Ge,Complex:pt,Fraction:Uo,config:Oe,isNegative:no,matrix:$e,typed:te,unaryMinus:fi}),Gr=Uu({isInteger:kn,matrix:$e,typed:te}),v4=rd({prod:qD,size:cn,typed:te}),Zx=wd({conj:Wo,transpose:df,typed:te}),UD=nd({DenseMatrix:_r,SparseMatrix:Oi,matrix:$e,typed:te}),Mt=kd({numeric:za,typed:te}),hf=$d({DenseMatrix:_r,concat:Gr,divideScalar:Mt,equalScalar:Ir,matrix:$e,typed:te}),xa=ah({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),vf=id({matrix:$e,typed:te}),g4=ep({isNumeric:$o,typed:te}),ao=ud({BigNumber:Ge,DenseMatrix:_r,SparseMatrix:Oi,config:Oe,matrix:$e,typed:te}),x4=fd({matrix:$e,multiplyScalar:Ot,typed:te}),Wc=ph({DenseMatrix:_r,concat:Gr,config:Oe,matrix:$e,typed:te}),y4=Xd({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),WD=Gd({DenseMatrix:_r,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:ga,typed:te}),Qx=gp({flatten:vf,matrix:$e,size:cn,typed:te}),b4=qp({BigNumber:Ge,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),w4=ld({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),Xx=ng({addScalar:Qt,complex:Lc,conj:Wo,divideScalar:Mt,equal:xa,identity:ao,isZero:ka,matrix:$e,multiplyScalar:Ot,sign:ID,sqrt:La,subtractScalar:ga,typed:te,unaryMinus:fi,zeros:ln}),D4=hd({config:Oe,matrix:$e}),S4=Jd({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),Ps=zd({BigNumber:Ge,DenseMatrix:_r,config:Oe,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),En=sh({DenseMatrix:_r,concat:Gr,config:Oe,matrix:$e,typed:te}),Bt=Up({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,subtractScalar:ga,typed:te,unaryMinus:fi}),N4=Id({concat:Gr,matrix:$e,typed:te}),A4=vh({DenseMatrix:_r,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,typed:te}),Jx=Vd({DenseMatrix:_r,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:ga,typed:te}),M4=ed({DenseMatrix:_r,concat:Gr,matrix:$e,typed:te}),Lr=fv({DenseMatrix:_r,SparseMatrix:Oi,addScalar:Qt,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),C4=Lh({BigNumber:Ge,DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),E4=ku({concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),T4=Lu({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),F4=Zp({DenseMatrix:_r,concat:Gr,matrix:$e,typed:te}),_4=Yg({addScalar:Qt,combinations:kc,divideScalar:Mt,isInteger:kn,isNegative:no,multiplyScalar:Ot,typed:te}),Go=eh({BigNumber:Ge,DenseMatrix:_r,Fraction:Uo,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,typed:te}),YD=th({concat:Gr,matrix:$e,typed:te}),O4=af({add:Lr,typed:te,unaryPlus:Wx}),Kx=dh({equal:xa,typed:te}),B4=Yu({matrix:$e,number:_i,subtract:Bt,typed:te}),P4=Sg({abs:Cn,addScalar:Qt,deepEqual:Kx,divideScalar:Mt,multiplyScalar:Ot,sqrt:La,subtractScalar:ga,typed:te}),Yc=mv({addScalar:Qt,conj:Wo,multiplyScalar:Ot,size:cn,typed:te}),I4=ih({compareText:YD,isZero:ka,typed:te}),HD=Pu({DenseMatrix:_r,config:Oe,equalScalar:Ir,matrix:$e,round:Ps,typed:te,zeros:ln}),R4=_p({BigNumber:Ge,DenseMatrix:_r,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,round:Ps,typed:te,zeros:ln}),q4=cv({abs:Cn,addScalar:Qt,divideScalar:Mt,isPositive:Yo,multiplyScalar:Ot,smaller:En,sqrt:La,typed:te}),$D=yh({DenseMatrix:_r,smaller:En}),yn=bh({ImmutableDenseMatrix:$D,getMatrixDataType:Hx}),Tn=lh({DenseMatrix:_r,concat:Gr,config:Oe,matrix:$e,typed:te}),jx=Ud({Complex:pt,config:Oe,divideScalar:Mt,typed:te}),k4=Zd({DenseMatrix:_r,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:ga,typed:te}),L4=vp({flatten:vf,matrix:$e,size:cn,typed:te}),z4=rf({config:Oe,numeric:za,smaller:En,typed:te}),GD=Iu({DenseMatrix:_r,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,round:Ps,typed:te,zeros:ln}),at=Rp({addScalar:Qt,dot:Yc,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,typed:te}),U4=Yd({Complex:pt,config:Oe,divideScalar:Mt,typed:te}),W4=zu({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),Hc=gh({compare:Go,isNaN:pf,isNumeric:$o,typed:te}),Y4=Kd({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),VD=og({SparseMatrix:Oi,abs:Cn,add:Lr,divideScalar:Mt,larger:Tn,largerEq:Wc,multiply:at,subtract:Bt,transpose:df,typed:te}),ra=Vu({add:Lr,matrix:$e,typed:te,zeros:ln}),ey=nf({add:Lr,config:Oe,numeric:za,typed:te}),H4=pv({add:Lr,matrix:$e,typed:te}),ZD=Qd({DenseMatrix:_r,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:ga,typed:te}),$4=jg({Complex:pt,add:Lr,multiply:at,number:_i,typed:te}),ry=Mp({DenseMatrix:_r,config:Oe,equalScalar:Ir,matrix:$e,round:Ps,typed:te,zeros:ln}),ci=rh({compare:Go,typed:te}),G4=Hg({addScalar:Qt,combinations:kc,isInteger:kn,isNegative:no,isPositive:Yo,larger:Tn,typed:te}),V4=td({matrix:$e,multiply:at,subtract:Bt,typed:te}),QD=pg({divideScalar:Mt,isZero:ka,matrix:$e,multiply:at,subtractScalar:ga,typed:te,unaryMinus:fi}),Z4=$p({concat:Gr,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,typed:te}),XD=wh({larger:Tn,smaller:En}),JD=Fp({Complex:pt,DenseMatrix:_r,ceil:ry,equalScalar:Ir,floor:HD,matrix:$e,typed:te,zeros:ln}),KD=dv({Index:yn,typed:te}),Q4=Ng({abs:Cn,add:Lr,addScalar:Qt,config:Oe,divideScalar:Mt,equalScalar:Ir,flatten:vf,isNumeric:$o,isZero:ka,matrix:$e,multiply:at,multiplyScalar:Ot,smaller:En,subtract:Bt,typed:te}),X4=Yp({BigNumber:Ge,add:Lr,config:Oe,equal:xa,isInteger:kn,mod:GD,smaller:En,typed:te,xgcd:LD}),J4=Op({concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),K4=Wd({Complex:pt,config:Oe,divideScalar:Mt,log:jx,typed:te}),ty=ef({config:Oe,larger:Tn,numeric:za,typed:te}),j4=jh({DenseMatrix:_r,Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),eI=rv({DenseMatrix:_r,Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),rI=nv({Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),tI=iv({Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),Is=fh({DenseMatrix:_r,concat:Gr,config:Oe,matrix:$e,typed:te}),nI=xh({compare:Go,compareNatural:ci,matrix:$e,typed:te}),aI=ju({concat:Gr,equalScalar:Ir,matrix:$e,not:zc,typed:te,zeros:ln}),Rs=$u({bignumber:ea,matrix:$e,add:Lr,config:Oe,isPositive:Yo,larger:Tn,largerEq:Wc,smaller:En,smallerEq:Is,typed:te}),iI=Gu({Index:yn,matrix:$e,range:Rs,typed:te}),jD=ev({DenseMatrix:_r,Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),oI=av({Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),eS=sv({Index:yn,concat:Gr,setDifference:jD,size:cn,subset:ra,typed:te}),rS=Dh({FibonacciHeap:XD,addScalar:Qt,equalScalar:Ir}),tS=Wu({Index:yn,matrix:$e,range:Rs,typed:te}),Vo=dg({abs:Cn,addScalar:Qt,det:QD,divideScalar:Mt,identity:ao,matrix:$e,multiply:at,typed:te,unaryMinus:fi}),nS=tg({DenseMatrix:_r,Spa:rS,SparseMatrix:Oi,abs:Cn,addScalar:Qt,divideScalar:Mt,equalScalar:Ir,larger:Tn,matrix:$e,multiplyScalar:Ot,subtractScalar:ga,typed:te,unaryMinus:fi}),sI=hg({Complex:pt,add:Lr,ctranspose:Zx,deepEqual:Kx,divideScalar:Mt,dot:Yc,dotDivide:hf,equal:xa,inv:Vo,matrix:$e,multiply:at,typed:te}),ya=Ld({Complex:pt,config:Oe,fraction:Bs,identity:ao,inv:Vo,matrix:$e,multiply:at,number:_i,typed:te}),aS=tv({DenseMatrix:_r,Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),uI=uv({Index:yn,concat:Gr,setIntersect:aS,setSymDifference:eS,size:cn,subset:ra,typed:te}),fI=xg({abs:Cn,add:Lr,identity:ao,inv:Vo,map:Ho,max:ty,multiply:at,size:cn,sqrt:La,subtract:Bt,typed:te}),wr=Nh({BigNumber:Ge,Complex:pt,Fraction:Uo,abs:Cn,addScalar:Qt,config:Oe,divideScalar:Mt,equal:xa,fix:JD,format:mf,isNumeric:$o,multiplyScalar:Ot,number:_i,pow:ya,round:Ps,subtractScalar:ga}),cI=M0({BigNumber:Ge,Unit:wr,config:Oe}),lI=sx({BigNumber:Ge,Unit:wr,config:Oe}),mI=Q0({BigNumber:Ge,Unit:wr,config:Oe}),pI=T0({BigNumber:Ge,Unit:wr,config:Oe}),dI=J0({BigNumber:Ge,Unit:wr,config:Oe}),hI=F0({BigNumber:Ge,Unit:wr,config:Oe}),vI=C0({BigNumber:Ge,Unit:wr,config:Oe}),gI=W0({BigNumber:Ge,Unit:wr,config:Oe}),xI=Hd({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,pow:ya,typed:te}),yI=A0({BigNumber:Ge,Unit:wr,config:Oe}),bI=E0({BigNumber:Ge,Unit:wr,config:Oe}),wI=gg({abs:Cn,add:Lr,identity:ao,inv:Vo,multiply:at,typed:te}),DI=K0({BigNumber:Ge,Unit:wr,config:Oe}),iS=Sd({addScalar:Qt,ceil:ry,conj:Wo,divideScalar:Mt,dotDivide:hf,exp:BD,i:TD,log2:PD,matrix:$e,multiplyScalar:Ot,pow:ya,tau:_D,typed:te}),ny=_g({BigNumber:Ge,Complex:pt,config:Oe,multiplyScalar:Ot,pow:ya,typed:te}),SI=w0({BigNumber:Ge,Unit:wr,config:Oe}),NI=z0({BigNumber:Ge,Unit:wr,config:Oe}),AI=Nd({conj:Wo,dotDivide:hf,fft:iS,typed:te}),MI=P0({BigNumber:Ge,Unit:wr,config:Oe}),CI=ex({BigNumber:Ge,Unit:wr,config:Oe}),EI=N0({BigNumber:Ge,Unit:wr,config:Oe}),TI=ux({BigNumber:Ge,Unit:wr,config:Oe}),FI=tx({BigNumber:Ge,Unit:wr,config:Oe}),_I=Y0({BigNumber:Ge,Unit:wr,config:Oe}),OI=B0({BigNumber:Ge,Unit:wr,config:Oe}),BI=dx({BigNumber:Ge,Unit:wr,config:Oe}),PI=lx({BigNumber:Ge,Unit:wr,config:Oe}),II=hx({BigNumber:Ge,Unit:wr,config:Oe}),RI=U0({BigNumber:Ge,Unit:wr,config:Oe}),qI=H0({BigNumber:Ge,Unit:wr,config:Oe}),kI=S0({BigNumber:Ge,Unit:wr,config:Oe}),LI=$0({BigNumber:Ge,Unit:wr,config:Oe}),zI=ix({BigNumber:Ge,Unit:wr,config:Oe}),UI=b0({BigNumber:Ge,Unit:wr,config:Oe}),WI=ox({BigNumber:Ge,Unit:wr,config:Oe}),YI=G0({BigNumber:Ge,Unit:wr,config:Oe}),HI=X0({BigNumber:Ge,Unit:wr,config:Oe}),$I=I0({BigNumber:Ge,Unit:wr,config:Oe}),GI=Ch({Unit:wr,typed:te}),an=Dg({divideScalar:Mt,equalScalar:Ir,inv:Vo,matrix:$e,multiply:at,typed:te}),VI=q0({BigNumber:Ge,Unit:wr,config:Oe}),gf=Bg({gamma:ny,typed:te}),ZI=j0({BigNumber:Ge,Unit:wr,config:Oe}),QI=cx({BigNumber:Ge,Unit:wr,config:Oe}),XI=_0({BigNumber:Ge,Unit:wr,config:Oe}),oS=sg({DenseMatrix:_r,lsolve:WD,lup:nS,matrix:$e,slu:VD,typed:te,usolve:Jx}),JI=O0({BigNumber:Ge,Unit:wr,config:Oe}),KI=fx({BigNumber:Ge,Unit:wr,config:Oe}),jI=Ig({add:Lr,divide:an,factorial:gf,isInteger:kn,isPositive:Yo,multiply:at,typed:te}),eR=Rg({factorial:gf,typed:te}),rR=mx({BigNumber:Ge,Unit:wr,config:Oe}),tR=ug({add:Lr,cbrt:zD,divide:an,equalScalar:Ir,im:$x,isZero:ka,multiply:at,re:Gx,sqrt:La,subtract:Bt,typeOf:RD,typed:te,unaryMinus:fi}),nR=ov({compareNatural:ci,typed:te}),aR=Ad({abs:Cn,add:Lr,bignumber:ea,divide:an,isNegative:no,isPositive:Yo,larger:Tn,map:Ho,matrix:$e,max:ty,multiply:at,smaller:En,subtract:Bt,typed:te,unaryMinus:fi}),sS=Ug({bignumber:ea,addScalar:Qt,combinations:kc,divideScalar:Mt,factorial:gf,isInteger:kn,isNegative:no,larger:Tn,multiplyScalar:Ot,number:_i,pow:ya,subtractScalar:ga,typed:te}),iR=Ah({Unit:wr,typed:te}),oR=Wg({addScalar:Qt,isInteger:kn,isNegative:no,stirlingS2:sS,typed:te}),uS=vg({abs:Cn,add:Lr,addScalar:Qt,atan:OD,bignumber:ea,column:tS,complex:Lc,config:Oe,cos:Yx,diag:UD,divideScalar:Mt,dot:Yc,equal:xa,flatten:vf,im:$x,inv:Vo,larger:Tn,matrix:$e,matrixFromColumns:Qx,multiply:at,multiplyScalar:Ot,number:_i,qr:Xx,re:Gx,reshape:kD,sin:Uc,size:cn,smaller:En,sqrt:La,subtract:Bt,typed:te,usolve:Jx,usolveAll:ZD}),sR=k0({BigNumber:Ge,Unit:wr,config:Oe}),uR=rx({BigNumber:Ge,Unit:wr,config:Oe}),fR=Pg({divide:an,dotDivide:hf,isNumeric:$o,log:jx,map:Ho,matrix:$e,multiply:at,sum:ey,typed:te}),fS=of({add:Lr,divide:an,typed:te}),cR=nx({BigNumber:Ge,Unit:wr,config:Oe}),lR=D0({BigNumber:Ge,Unit:wr,config:Oe}),mR=uf({bignumber:ea,add:Lr,compare:Go,divide:an,isInteger:kn,larger:Tn,multiply:at,partitionSelect:Hc,smaller:En,smallerEq:Is,subtract:Bt,typed:te}),ay=sf({add:Lr,apply:Vx,divide:an,isNaN:pf,multiply:at,subtract:Bt,typed:te}),pR=R0({BigNumber:Ge,Unit:wr,config:Oe}),cS=Mg({add:Lr,compare:Go,divide:an,partitionSelect:Hc,typed:te}),dR=Eg({add:Lr,divide:an,matrix:$e,mean:fS,multiply:at,pow:ya,sqrt:La,subtract:Bt,sum:ey,typed:te}),hR=e0({Complex:pt,add:Lr,divide:an,matrix:$e,multiply:at,typed:te}),vR=Cg({abs:Cn,map:Ho,median:cS,subtract:Bt,typed:te}),gR=ff({map:Ho,sqrt:La,typed:te,variance:ay}),xR=Cd({BigNumber:Ge,Complex:pt,add:Lr,config:Oe,divide:an,equal:xa,factorial:gf,gamma:ny,isNegative:no,multiply:at,pi:Ux,pow:ya,sin:Uc,smallerEq:Is,subtract:Bt,typed:te}),iy=lv({abs:Cn,add:Lr,conj:Wo,ctranspose:Zx,eigs:uS,equalScalar:Ir,larger:Tn,matrix:$e,multiply:at,pow:ya,smaller:En,sqrt:La,typed:te}),lS=gd({BigNumber:Ge,DenseMatrix:_r,SparseMatrix:Oi,addScalar:Qt,config:Oe,cos:Yx,matrix:$e,multiplyScalar:Ot,norm:iy,sin:Uc,typed:te,unaryMinus:fi}),yR=px({BigNumber:Ge,Unit:wr,config:Oe}),mS=bg({identity:ao,matrix:$e,multiply:at,norm:iy,qr:Xx,subtract:Bt,typed:te}),bR=vd({multiply:at,rotationMatrix:lS,typed:te}),pS=yg({abs:Cn,add:Lr,concat:Gr,identity:ao,index:KD,lusolve:oS,matrix:$e,matrixFromColumns:Qx,multiply:at,range:Rs,schur:mS,subset:ra,subtract:Bt,transpose:df,typed:te}),wR=wg({matrix:$e,multiply:at,sylvester:pS,transpose:df,typed:te});var xf={},yf={},DR={},Fn=vv({mathWithTransform:yf}),bf=Lv({Node:Fn}),io=Uv({Node:Fn}),qs=Yv({Node:Fn}),SR=Vv({Node:Fn}),wf=wv({Node:Fn}),NR=Cv({Node:Fn,ResultSet:FD}),AR=Tv({Node:Fn}),Zo=Bv({Node:Fn}),MR=$v({Node:Fn}),RV=r0({classes:DR}),dS=cg({math:xf,typed:te}),CR=Iv({Node:Fn,typed:te}),qV=mg({Chain:dS,typed:te}),Df=qv({Node:Fn,size:cn}),Sf=yv({Node:Fn,subset:ra}),ER=Av({matrix:$e,Node:Fn,subset:ra}),Qo=Zv({Unit:wr,Node:Fn,math:xf}),Xo=Xv({Node:Fn,SymbolNode:Qo,math:xf}),Ua=Jv({AccessorNode:Sf,ArrayNode:wf,AssignmentNode:ER,BlockNode:NR,ConditionalNode:AR,ConstantNode:Zo,FunctionAssignmentNode:CR,FunctionNode:Xo,IndexNode:Df,ObjectNode:bf,OperatorNode:io,ParenthesisNode:qs,RangeNode:MR,RelationalNode:SR,SymbolNode:Qo,config:Oe,numeric:za,typed:te}),TR=Qg({ConstantNode:Zo,FunctionNode:Xo,OperatorNode:io,ParenthesisNode:qs,parse:Ua,typed:te}),hS=Vg({bignumber:ea,fraction:Bs,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Zo,FunctionNode:Xo,IndexNode:Df,ObjectNode:bf,OperatorNode:io,SymbolNode:Qo,config:Oe,mathWithTransform:yf,matrix:$e,typed:te}),kV=Kv({parse:Ua,typed:te}),vS=Zg({AccessorNode:Sf,ArrayNode:wf,ConstantNode:Zo,FunctionNode:Xo,IndexNode:Df,ObjectNode:bf,OperatorNode:io,ParenthesisNode:qs,SymbolNode:Qo,add:Lr,divide:an,equal:xa,isZero:ka,multiply:at,parse:Ua,pow:ya,subtract:Bt,typed:te}),gS=jv({parse:Ua,typed:te}),FR=fg({evaluate:gS}),_R=eg({evaluate:gS}),oy=Gg({bignumber:ea,fraction:Bs,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Zo,FunctionNode:Xo,IndexNode:Df,ObjectNode:bf,OperatorNode:io,ParenthesisNode:qs,SymbolNode:Qo,add:Lr,config:Oe,divide:an,equal:xa,isZero:ka,mathWithTransform:yf,matrix:$e,multiply:at,parse:Ua,pow:ya,resolve:TR,simplifyConstant:hS,simplifyCore:vS,subtract:Bt,typed:te}),LV=Xg({OperatorNode:io,parse:Ua,simplify:oy,typed:te}),zV=$g({parse:Ua,typed:te}),UV=rg({Parser:_R,typed:te}),WV=Kg({bignumber:ea,fraction:Bs,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Zo,FunctionNode:Xo,IndexNode:Df,ObjectNode:bf,OperatorNode:io,ParenthesisNode:qs,SymbolNode:Qo,add:Lr,config:Oe,divide:an,equal:xa,isZero:ka,mathWithTransform:yf,matrix:$e,multiply:at,parse:Ua,pow:ya,simplify:oy,simplifyConstant:hS,simplifyCore:vS,subtract:Bt,typed:te}),YV=Jg({ConstantNode:Zo,FunctionNode:Xo,OperatorNode:io,ParenthesisNode:qs,SymbolNode:Qo,config:Oe,equal:xa,isZero:ka,numeric:za,parse:Ua,simplify:oy,typed:te}),HV=lg({Help:FR,mathWithTransform:yf,typed:te});ht(xf,{e:ED,false:nP,fineStructure:aP,i:TD,Infinity:iP,LN10:oP,LOG10E:sP,NaN:uP,null:fP,phi:cP,SQRT1_2:mP,sackurTetrode:pP,tau:_D,true:dP,E:ED,version:hP,efimovFactor:vP,LN2:gP,pi:Ux,replacer:xP,reviver:RV,SQRT2:yP,typed:te,unaryPlus:Wx,PI:Ux,weakMixingAngle:bP,abs:Cn,acos:wP,acot:DP,acsc:SP,addScalar:Qt,arg:NP,asech:AP,asinh:MP,atan:OD,atanh:CP,bignumber:ea,bitNot:EP,boolean:TP,clone:FP,combinations:kc,complex:Lc,conj:Wo,cos:Yx,cot:_P,csc:OP,cube:BP,equalScalar:Ir,erf:PP,exp:BD,expm1:IP,filter:RP,forEach:qP,format:mf,getMatrixDataType:Hx,hex:kP,im:$x,isInteger:kn,isNegative:no,isPositive:Yo,isZero:ka,LOG2E:LP,lgamma:zP,log10:UP,log2:PD,map:Ho,multiplyScalar:Ot,not:zc,number:_i,oct:WP,pickRandom:YP,print:HP,random:$P,re:Gx,sec:GP,sign:ID,sin:Uc,splitUnit:VP,square:ZP,string:QP,subtractScalar:ga,tan:XP,typeOf:RD,acosh:JP,acsch:KP,apply:Vx,asec:jP,bin:e4,chain:qV,combinationsWithRep:r4,cosh:t4,csch:n4,isNaN:pf,isPrime:a4,randomInt:i4,sech:o4,sinh:s4,sparse:u4,sqrt:La,tanh:f4,unaryMinus:fi,acoth:c4,coth:l4,fraction:Bs,isNumeric:$o,matrix:$e,matrixFromFunction:m4,mode:p4,numeric:za,prod:qD,reshape:kD,size:cn,squeeze:d4,transpose:df,xgcd:LD,zeros:ln,asin:h4,cbrt:zD,concat:Gr,count:v4,ctranspose:Zx,diag:UD,divideScalar:Mt,dotDivide:hf,equal:xa,flatten:vf,hasNumericValue:g4,identity:ao,kron:x4,largerEq:Wc,leftShift:y4,lsolve:WD,matrixFromColumns:Qx,nthRoot:b4,ones:w4,qr:Xx,resize:D4,rightArithShift:S4,round:Ps,smaller:En,subtract:Bt,to:N4,unequal:A4,usolve:Jx,xor:M4,add:Lr,atan2:C4,bitAnd:E4,bitOr:T4,bitXor:F4,catalan:_4,compare:Go,compareText:YD,cumsum:O4,deepEqual:Kx,diff:B4,distance:P4,dot:Yc,equalText:I4,floor:HD,gcd:R4,hypot:q4,larger:Tn,log:jx,lsolveAll:k4,matrixFromRows:L4,min:z4,mod:GD,multiply:at,nthRoots:U4,or:W4,partitionSelect:Hc,rightLogShift:Y4,slu:VD,subset:ra,sum:ey,trace:H4,usolveAll:ZD,zpk2tf:$4,ceil:ry,compareNatural:ci,composition:G4,cross:V4,det:QD,dotMultiply:Z4,fix:JD,index:KD,intersect:Q4,invmod:X4,lcm:J4,log1p:K4,max:ty,setCartesian:j4,setDistinct:eI,setIsSubset:rI,setPowerset:tI,smallerEq:Is,sort:nI,and:aI,range:Rs,row:iI,setDifference:jD,setMultiplicity:oI,setSymDifference:eS,column:tS,inv:Vo,lup:nS,pinv:sI,pow:ya,setIntersect:aS,setUnion:uI,sqrtm:fI,vacuumImpedance:cI,wienDisplacement:lI,atomicMass:mI,bohrMagneton:pI,boltzmann:dI,conductanceQuantum:hI,coulomb:vI,deuteronMass:gI,dotPow:xI,electricConstant:yI,elementaryCharge:bI,expm:wI,faraday:DI,fft:iS,gamma:ny,gravitationConstant:SI,hartreeEnergy:NI,ifft:AI,klitzing:MI,loschmidt:CI,magneticConstant:EI,molarMass:TI,molarPlanckConstant:FI,neutronMass:_I,nuclearMagneton:OI,planckCharge:BI,planckLength:PI,planckTemperature:II,protonMass:RI,quantumOfCirculation:qI,reducedPlanckConstant:kI,rydberg:LI,secondRadiation:zI,speedOfLight:UI,stefanBoltzmann:WI,thomsonCrossSection:YI,avogadro:HI,bohrRadius:$I,createUnit:GI,divide:an,electronMass:VI,factorial:gf,firstRadiation:ZI,gravity:QI,inverseConductanceQuantum:XI,lusolve:oS,magneticFluxQuantum:JI,molarMassC12:KI,multinomial:jI,parse:Ua,permutations:eR,planckMass:rR,polynomialRoot:tR,resolve:TR,setSize:nR,simplifyConstant:hS,solveODE:aR,stirlingS2:sS,unit:iR,bellNumbers:oR,compile:kV,eigs:uS,fermiCoupling:sR,gasConstant:uR,kldivergence:fR,mean:fS,molarVolume:cR,planckConstant:lR,quantileSeq:mR,simplifyCore:vS,variance:ay,classicalElectronRadius:pR,evaluate:gS,median:cS,simplify:oy,symbolicEqual:LV,corr:dR,freqz:hR,leafCount:zV,mad:vR,parser:UV,rationalize:WV,std:gR,zeta:xR,derivative:YV,norm:iy,rotationMatrix:lS,help:HV,planckTime:yR,schur:mS,rotate:bR,sylvester:pS,lyap:wR,config:Oe});ht(yf,xf,{filter:yx({typed:te}),forEach:bx({typed:te}),map:Dx({typed:te}),apply:gx({isInteger:kn,typed:te}),or:kx({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),and:qx({add:Lr,concat:Gr,equalScalar:Ir,matrix:$e,not:zc,typed:te,zeros:ln}),concat:Tx({isInteger:kn,matrix:$e,typed:te}),max:Sx({config:Oe,larger:Tn,numeric:za,typed:te}),print:Rx({add:Lr,matrix:$e,typed:te,zeros:ln}),bitAnd:Lx({add:Lr,concat:Gr,equalScalar:Ir,matrix:$e,not:zc,typed:te,zeros:ln}),diff:Fx({bignumber:ea,matrix:$e,number:_i,subtract:Bt,typed:te}),min:Ax({config:Oe,numeric:za,smaller:En,typed:te}),subset:Ex({add:Lr,matrix:$e,typed:te,zeros:ln}),bitOr:zx({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),cumsum:Px({add:Lr,typed:te,unaryPlus:Wx}),index:wx({Index:yn,getMatrixDataType:Hx}),sum:Ox({add:Lr,config:Oe,numeric:za,typed:te}),range:Mx({bignumber:ea,matrix:$e,add:Lr,config:Oe,isPositive:Yo,larger:Tn,largerEq:Wc,smaller:En,smallerEq:Is,typed:te}),row:Cx({Index:yn,matrix:$e,range:Rs,typed:te}),column:xx({Index:yn,matrix:$e,range:Rs,typed:te}),mean:Nx({add:Lr,divide:an,typed:te}),quantileSeq:Bx({add:Lr,bignumber:ea,compare:Go,divide:an,isInteger:kn,larger:Tn,multiply:at,partitionSelect:Hc,smaller:En,smallerEq:Is,subtract:Bt,typed:te}),variance:Ix({add:Lr,apply:Vx,divide:an,isNaN:pf,multiply:at,subtract:Bt,typed:te}),std:_x({map:Ho,sqrt:La,typed:te,variance:ay})});ht(DR,{BigNumber:Ge,Complex:pt,Fraction:Uo,Matrix:qc,Node:Fn,ObjectNode:bf,OperatorNode:io,ParenthesisNode:qs,Range:lP,RelationalNode:SR,ResultSet:FD,ArrayNode:wf,BlockNode:NR,ConditionalNode:AR,ConstantNode:Zo,DenseMatrix:_r,RangeNode:MR,Chain:dS,FunctionAssignmentNode:CR,SparseMatrix:Oi,IndexNode:Df,ImmutableDenseMatrix:$D,Index:yn,AccessorNode:Sf,AssignmentNode:ER,FibonacciHeap:XD,Spa:rS,Unit:wr,SymbolNode:Qo,FunctionNode:Xo,Help:FR,Parser:_R});dS.createProxy(xf);var xS=CD;var RR=ca(wm(),1);var BR=ca(OR(),1);function PR(e){var r=new BR.default;return e.on=r.on.bind(r),e.off=r.off.bind(r),e.once=r.once.bind(r),e.emit=r.emit.bind(r),e}function IR(e,r,t,a){function n(y,w){var C=arguments.length;if(C!==1&&C!==2)throw new ha("import",C,1,2);w||(w={});function b(O,_,E){if(Array.isArray(_))_.forEach(k=>b(O,k));else if(typeof _=="object")for(var T in _)Xe(_,T)&&b(O,_[T],T);else if(As(_)||E!==void 0){var R=As(_)?x(_)?_.fn+".transform":_.fn:E;if(Xe(O,R)&&O[R]!==_&&!w.silent)throw new Error('Cannot import "'+R+'" twice');O[R]=_}else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}var M={};b(M,y);for(var A in M)if(Xe(M,A)){var S=M[A];if(As(S))o(S,w);else if(s(S))i(A,S,w);else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}}function i(y,w,C){if(C.wrap&&typeof w=="function"&&(w=c(w)),m(w)&&(w=e(y,{[w.signature]:w})),e.isTypedFunction(t[y])&&e.isTypedFunction(w)){C.override?w=e(y,w.signatures):w=e(t[y],w),t[y]=w,delete a[y],u(y,w),t.emit("import",y,function(){return w});return}if(t[y]===void 0||C.override){t[y]=w,delete a[y],u(y,w),t.emit("import",y,function(){return w});return}if(!C.silent)throw new Error('Cannot import "'+y+'": already exists')}function u(y,w){w&&typeof w.transform=="function"?(t.expression.transform[y]=w.transform,d(y)&&(t.expression.mathWithTransform[y]=w.transform)):(delete t.expression.transform[y],d(y)&&(t.expression.mathWithTransform[y]=w))}function l(y){delete t.expression.transform[y],d(y)?t.expression.mathWithTransform[y]=t[y]:delete t.expression.mathWithTransform[y]}function c(y){var w=function(){for(var b=[],M=0,A=arguments.length;M2&&arguments[2]!==void 0?arguments[2]:y.fn;if(Hb(C,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(C));var b=x(y)?t.expression.transform:t,M=C in t.expression.transform,A=Xe(b,C)?b[C]:void 0,S=function(){var _={};y.dependencies.map(Vb).forEach(T=>{if(Hb(T,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(T));T==="math"?_.math=t:T==="mathWithTransform"?_.mathWithTransform=t.expression.mathWithTransform:T==="classes"?_.classes=t:_[T]=t[T]});var E=y(_);if(E&&typeof E.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(A===void 0||w.override)return E;if(e.isTypedFunction(A)&&e.isTypedFunction(E))return e(A,E);if(w.silent)return A;throw new Error('Cannot import "'+C+'": already exists')};!y.meta||y.meta.lazy!==!1?(Du(b,C,S),A&&M?l(C):(x(y)||h(y))&&Du(t.expression.mathWithTransform,C,()=>b[C])):(b[C]=S(),A&&M?l(C):(x(y)||h(y))&&Du(t.expression.mathWithTransform,C,()=>b[C])),a[C]=y,t.emit("import",C,S)}function s(y){return typeof y=="function"||typeof y=="number"||typeof y=="string"||typeof y=="boolean"||y===null||Ht(y)||Kt(y)||rr(y)||ma(y)||Qe(y)||Array.isArray(y)}function m(y){return typeof y=="function"&&typeof y.signature=="string"}function d(y){return!Xe(v,y)}function h(y){return y.fn.indexOf(".")===-1&&!Xe(v,y.fn)&&(!y.meta||!y.meta.isClass)}function x(y){return y!==void 0&&y.meta!==void 0&&y.meta.isTransformFunction===!0||!1}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return n}function sy(e,r){var t=ht({},Ds,r);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var a=PR({isNumber:sr,isComplex:Kt,isBigNumber:rr,isFraction:ma,isUnit:Ht,isString:St,isArray:Mr,isMatrix:Qe,isCollection:Nt,isDenseMatrix:Xi,isSparseMatrix:pa,isRange:To,isIndex:Ni,isBoolean:om,isResultSet:sm,isHelp:yu,isFunction:um,isDate:fm,isRegExp:cm,isObject:Ai,isNull:lm,isUndefined:mm,isAccessorNode:qn,isArrayNode:jt,isAssignmentNode:pm,isBlockNode:dm,isConditionalNode:hm,isConstantNode:yr,isFunctionAssignmentNode:_a,isFunctionNode:gn,isIndexNode:Qn,isNode:Nr,isObjectNode:Mi,isOperatorNode:ct,isParenthesisNode:en,isRangeNode:vm,isRelationalNode:gm,isSymbolNode:nt,isChain:bu});a.config=CA(t,a.emit),a.expression={transform:{},mathWithTransform:{config:a.config}};var n=[],i=[];function u(s){if(As(s))return s(a);var m=s[Object.keys(s)[0]];if(As(m))return m(a);if(!NA(s))throw console.warn("Factory object with properties \`type\`, \`name\`, and \`factory\` expected",s),new Error("Factory object with properties \`type\`, \`name\`, and \`factory\` expected");var d=n.indexOf(s),h;return d===-1?(s.math===!0?h=s.factory(a.type,t,u,a.typed,a):h=s.factory(a.type,t,u,a.typed),n.push(s),i.push(h)):h=i[d],h}var l={};function c(){for(var s=arguments.length,m=new Array(s),d=0;d{Pb(l).forEach(s=>{s&&s.meta&&s.meta.recreateOnConfigChange&&o(s,{override:!0})})}),a.create=sy.bind(null,e),a.factory=F,a.import(Pb(DA(e))),a.ArgumentsError=ha,a.DimensionError=pr,a.IndexError=tn,a}var my=ca(am());var kR=ca(qR()),DS=class{constructor(){this.lang="en";this.all={en:{hintText:{dragDropModifierKeys:"Hold \${1} to Pin and \${2} to Copy",createListItem:"Select/Create List Item Frame",dragDropProperties:"Drag and drop properties to link them into the list",newItem:"+ New",selectNote:"Select Note...",newFrame:"New"},defaults:{spaceNote:"Current Note",spaceContext:"Current Space"},commands:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",columns:"Columns",button:"Button",label:"Label",column:"Column",idea:"New",group:"Group",paragraph:"Text",card:"Card",progress:"Progress",rating:"Rating",circularProgress:"Circular Progress",list:"Bullet List","ordered-list":"Numbered List",todo:"To-do List",quote:"Quote",divider:"Divider",note:"Link to Note",link:"Link",callout:"Callout",bookmark:"Bookmark",table:"Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",flow:"Linked Note",newNote:"New Note",tag:"Tag",makeMenu:"Flow Menu",selectStyle:"Style",toggleKeyboard:"Toggle Keyboard",rows:"Rows",masonry:"Gallery"},styles:{bold:"Bold",italics:"Italics",strikethrough:"Strikethrough",code:"Code",link:"Web Link",blocklink:"Link to Note",textColor:"Text Color",highlight:"Highlight"},commandsSuggest:{noResult:"No result"},commandPalette:{enable:"Enable",disabled:"Disable",openFlow:"Open Flow Blocks in Selection",closeFlow:"Close Flow Blocks in Selection",toggleBold:"Toggle Bold",toggleItalics:"Toggle Italics",openSpaces:"Open Spaces",migrateData:"Migrate Spaces From 0.7",blink:"Blink",openFileContext:"Open Explorer",convertPathToSpace:"Convert to Space",revealFile:"Reveal File in Spaces",releaseNotes:"Release Notes",toggleBacklinks:"Toggle Backlinks",collapseAllFolders:"Collapse All Folders",addFileSpace:"Add File to Space",removeFileSpace:"Remove File from Space"},frames:{sections:{kit:"Kit",paths:"Paths"},label:{label:"Label",description:"Label"},note:{label:"Note",description:"Link to a note"},table:{label:"Table",description:"Table"},context:{label:"Context",description:"Display a context view from another space"},calendar:{label:"Calendar View"},field:{label:"Field",description:"Dynamic node that displays a value based on property type"},event:{label:"Event"},divider:{label:"Divider",description:"Divider to separate your content"},button:{label:"Button",description:"Buttons can perform actions and open links"},callout:{label:"Callout",description:"Callout to highlight important information"},toggle:{label:"Toggle",description:"Toggle to show/hide content"}},menu:{newView:"New View",closeSpace:"Close Space",customView:"Custom View",detailsView:"Details View",catalogView:"Catalog View",galleryView:"Gallery View",deleteContext:"Delete Context",openSpace:"Open Space",revealInDefault:"Reveal in Finder",setNone:"None",fileMetadataDescription:"This note only",openFilePane:"Open in a new pane",rename:"Rename",changeToFolderNote:"New Space from Note",moveFile:"Move file to...",moveFolder:"Move folder to...",duplicate:"Make a copy",edit:"Edit",delete:"Delete",getHelp:"Make.md Community",vault:"Vault",openVault:"Open Another Vault",openVaultInFolder:"Open Vault Folder",obSettings:"Obsidian Settings",commandPalette:"Command Palette",backToSpace:"Back to Spaces",collapseAllSections:"Collapse All Spaces",expandAllSections:"Expand All Spaces",collapseAllFolders:"Collapse All Folders",expandAllFolders:"Expand All Folders",spaceTitle:"Add/Remove in Space",home:"Home",waypoints:"Waypoints",none:"None",tableView:"Table View",cardView:"Card View",boardView:"Board View",listView:"List View",flowView:"Flow View",groupBy:"Group By",sortBy:"Sort By",newFilter:"New Filter",clearFilters:"Clear Filters",hide:"Hide",unhideFields:"Unhide All Properties",importDataview:"Import All Dataview Properties",saveAllProperties:"Save All Properties to Files",mergeProperties:"Merge Properties",removeFromSpace:"Unpin from Space",removeFromWaypoints:"Unpin from Waypoints",editCode:"Edit Code",deleteProperty:"Delete Property",hideProperty:"Hide Property",unhideProperty:"Unhide Property",saveProperty:"Save Property",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",deleteRow:"Delete Item",collapseAll:"Collapse All",customSort:"Custom Sort",groupSpaces:"Group Spaces",fileNameSortAlphaAsc:"File Name (A to Z)",fileNameSortAlphaDesc:"File Name (Z to A)",createdTimeSortAsc:"Created Time (new to old)",createdTimeSortDesc:"Created Time (old to new)",modifiedTimeSortAsc:"Modified Time (new to old)",modifiedTimeSortDesc:"Modified Time (old to new)",sizeSortAsc:"Size (smallest to largest)",sizeSortDesc:"Size (largest to smallest)",spaces:"Spaces",tags:"Tags",manageHiddenFiles:"Manage Hidden Files",manageActions:"Manage Actions",deleteSpace:"Delete",changeColor:"Change Color",changePropertyType:"Change Type",deleteFiles:"Delete Files",createFolderSpace:"Create Space from Folder",folder:"Folder",syncToContext:"Add Property to Context",setIcon:"Set Icon",copyEmbedLink:"Copy Embed Link",moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",groupNodes:"Group Nodes",moveFrame:"Move Frame",renameFrame:"Rename Frame",deleteFrame:"Delete Frame"},editor:{rows:"Rows",columns:"Columns",catalog:"Catalog",gallery:"Gallery",grid:"Grid",scaleToFit:"Change to Fit",scaleToFill:"Change to Fill",fit:"Fit",strokeNone:"None",strokeSolid:"Solid",strokeDotted:"Dotted",strokeDashed:"Dashed",size:"Size",gap:"Gap",marginLeft:"Left",marginTop:"Top",marginRight:"Right",marginBottom:"Bottom",minimize:"Minimize",paddingLeft:"Left",paddingTop:"Top",paddingRight:"Right",paddingBottom:"Bottom",unlinkProperty:"Unlink Property",linkedProperty:"Linked Property",linkProperty:"Link Property",currentSpace:"Current Space",linkName:"\${1} Link",linkThumbnail:"\${1} Thumbnail",linkSticker:"\${1} Sticker",opacity:"Opacity",shadowSpread:"Spread",shadowBlur:"Blur",width:"Width",height:"Height",margin:"Margin",padding:"Padding",bold:"Bold",italic:"Italic",underline:"Underline",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",numberOfLines:"Lines",createVerticalSection:"Create Vertical Section",createHorizontalSection:"Create Horizontal Section",themeColors:"Theme Colors",uiColors:"UI Colors",hex:"Hex"},buttons:{add:"Add",addFilter:"Add Filter",addCondition:"Add Condition",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",changeBanner:"Change Cover",changeBannerShort:"Cover",saveChanges:"Save Changes",removeBanner:"Remove Cover",rename:"Change Name",editFrame:"Edit Frame",saveSpace:"Save Space",createSpace:"New Space",createFolder:"New Folder",createNote:"New Note",createCanvas:"New Canvas",addIntoSpace:"New Pin",addSmartSearch:"Add Live Search",addItem:"Add Item",addProperty:"Add Property",addContext:"Add Context",cancel:"Cancel",search:"Search",delete:"Delete",toggleFlow:"Toggle Flow",openFlow:"Open Flow",hideFlow:"Hide Flow",openLink:"Open Link",addToSpace:"Add to Space",addToSpaceShort:"Pin",addTag:"Add Tag",tag:"Tag",syncFields:"Sync Properties",convertTable:"Convert to Markdown",cutTable:"Cut Table",deleteTable:"Delete Table",blink:"Blink",addFile:"Add Item",merge:"Merge",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",deleteView:"Delete View",renameTable:"Rename Table",renameTag:"Rename Tag",createTag:"Create Tag",currentFolder:"Current Folder",sync:"Sync",pasteCSS:"Paste CSS",save:"Save",run:"Run"},metadataTypes:{fileName:"File Name",contexts:"Contexts",path:"Path",folder:"Folder",sticker:"Sticker",color:"Color",created:"Created",lastModified:"Last Modified",extension:"Extension",size:"Size",tags:"Tags",inlinks:"Linked Mentions",outlinks:"Links",label:"Label",fileMetadata:"File Metadata",frontmatter:"Frontmatter"},filterTypes:{contains:"contains",notContains:"does not contain",is:"is",isNot:"is not",before:"before",after:"on or after",anyOf:"is any of",noneOf:"is none of",checked:"is checked",unchecked:"is unchecked",isEmpty:"is empty",isNotEmpty:"is not empty",isSameDate:"is same date",isSameDateAsToday:"today"},sortTypes:{alphaAsc:"A to Z",alphaDesc:"Z to A",earliest:"Earliest",latest:"Latest",checkAsc:"Checked \\u2192 Unchecked",checkDesc:"Unchecked \\u2192 Checked",itemsAsc:"Least Items",itemsDesc:"Most Items"},properties:{defaultField:"Name",audio:{label:"Audio",description:"Audio"},text:{label:"Text",description:"Text field"},number:{label:"Number",description:"Number field with optional unit"},boolean:{label:"Yes/No",description:"Yes or No toggle to indicate the status"},date:{label:"Date",description:"Select a date from a calendar"},option:{label:"Option",description:"Select one or multiple option from a list"},file:{label:"File"},link:{label:"Link",description:"Link to another note or a website"},tags:{label:"Tags",description:"Use tags to quickly organize your items"},object:{label:"Object",description:"Store any complex objects"},context:{label:"Relation",description:"Connect to another context property and create a relation"},image:{label:"Image",description:"Select any image from your system or from the internet"},color:{label:"Color",description:"Use colors to label your items or status"},space:{label:"Context",description:"Link to a context"},icon:{label:"Sticker",description:"Use stickers to uniquely label your items or status"},super:{label:"Super Property",links:"Open Link",properties:"Update Property",api:"API",obsidianCommands:"Run Command",runCommand:"Run Command",performAction:"Perform Action",whenClicked:"When Clicked"},fileProperty:{name:"Name",label:"Formula",createdTime:"Created",modifiedTime:"Last Edited",sticker:"Sticker",links:"Links",tags:"Tags",spaces:"Spaces",extension:"Extension",size:"Size",preview:"Note Preview",parentFolder:"Folder",description:"Use a formula to dynamically display a property"}},views:{navigator:"Navigator",explorer:"Explorer",space:"Space"},subViews:{spaceItems:"Items",spaceContext:"Context",spaceLists:"Lists",spaceActions:"Actions",spaceTemplates:"Templates",smartSearch:"Live Searches",filesAndFolders:"Files and Folders"},labels:{editFormula:"Edit Formula",properties:"Properties",newAction:"New Action",newTable:"New Table",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSection:"Edit Space",createSection:"New Folder",createNote:"New Note",contextMaker:"Context Maker",select:"Select",pinnedItems:"Pinned Items",collapse:"Collapse",expand:"Expand",all:"All",none:"None",view:"View",findStickers:"Find Sticker",mergeProperties:"Merge Properties",placeholder:"Type '\${1}' for commands",notePlaceholder:"New Note for \${1}",itemsSelected:"\${1} Selected",selectNote:"Select Note",selectIcon:"Select Icon",selectImage:"Select Image",selectSpace:"Select Space",styleSmall:"Small",styleMedium:"Medium",styleLarge:"Large",hiddenFilePattern:"Name, Suffixes and Extension",hiddenFileSpecific:"Exclude specific files and folders",textPlaceholder:"Enter Text",noFile:"is not created yet. Click to create.",navigatorSearchPlaceholder:"Search by Text or Filters",blinkPlaceholder:"Quickly Search a File, Folder, Tag... Press Tab to Edit",searchPlaceholder:"Type to search...",contextItemSelectPlaceholder:"Find Item",linkItemSelectPlaceholder:"Find or Create Note",pinNotePlaceholder:"Select a Note or Space to Pin",optionItemSelectPlaceholder:"Select Option",viewItemSelectPlaceholder:"Select View",tagItemSelectPlaceholder:"Find Tag",spaceSelectPlaceholder:"Select any Folder or Tag",propertyItemSelectPlaceholder:"Select Property",sortItemSelectPlaceholder:"Select Sort",filterItemSelectPlaceholder:"Select Filter",imageSelectPlaceholder:"Select an image or paste a URL",imageNotFoundPlaceholder:"No Images Found",syncFrontmatterProperty:"Sync Frontmatter Property",newProperty:"New Property",newPropertyShort:"New Property",propertyType:"Type",propertyDynamic:"Dyanmic",propertyValueSpace:"Space",propertyValueProperty:"Property",propertyLookup:"Edit Formula",dateFormat:"Date Format",propertyFileProp:"Property",multiple:"Multiple",filesCount:"{$1} Files",hiddenFiles:"Hidden Files",addExtension:"Add Rule",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",renameTable:"Rename Table",syncMetadata:"Sync Metadata",syncProperties:"Sync Properties",selectContext:"Select Context",metadata:"Metadata",backlinks:"Backlinks",spaces:"Spaces",context:"Context",content:"Content",deleteSpace:"Delete Space",deleteFiles:"Delete Files",outgoingLinks:"Outgoing Links",moveTo:"Move to",addTo:"Pin to",copyTo:"Copy to",reorderIn:"Reorder in",border:"Border",corners:"Corners",color:"Color",backgroundColor:"Background",cornerRadius:"Radius",onClick:"On Click",layout:"Layout",element:"Element",name:"Name",display:"Display",alignment:"Alignment",margin:"Margin",padding:"Padding",gap:"Gap",width:"Width",height:"Height",opacity:"Opacity",shadow:"Shadow",shadowBlur:"Blur",shadowSpread:"Spread",typography:"Typography",layers:"Layers",fontSize:"Size",props:"Props",styles:"Styles",events:"Events",code:"Code",selectedLayers:"\${1} Layers"},descriptions:{spaceActions:"Create actions that runs when you press a button",spaceLists:"Create lists to track data and organize them in your space",spaceItems:"Add new items to the space or pin items to the space",spaceTemplates:"Create templates to quickly add items to your space",smartSearch:"Automatically pin notes to this space based on a set of searches",hiddenFileOptions:"Exclude any files and folders by name, suffix or extension.",deleteSpace:"Deleting the space will also delete the folder and its contents.",deleteFiles:"Delete \${1} files/folders and their contents?",addContext:"Contexts lets you connect properties from your tags",spaceProperties:"Define Properties for your Space Items",syncMetadata:"Select which fields from your notes to start syncing with the context.",syncProperties:"Contexts defines and syncs the same fields across your notes depending on their folder or tag.",selectContext:"Select which folder or tag context you want to sync the fields."},flowView:{emptyDoc:"Empty Document",itemsCount:" Items",emptyFolder:"This Folder is Empty"},notice:{duplicateFile:"Folder already contains note with same name",addedToSection:"Added to Space",fileExists:"File Already Exists",folderExists:"Folder Already Exists",noPropertyName:"Property Name is Required",duplicatePropertyName:"Duplicate Property Name",newSpaceName:"Enter a name for your space",duplicateSpaceName:"Space name already exists",cantConvertNoteToSpace:"The view is not a note",templateSaved:"Template saved to space: "},settings:{layoutVertical:"Vertical",layoutHorizontal:"Horizontal",sectionSidebar:"Spaces",sectionEditor:"Maker Mode",sectionFlow:"Flow",sectionAdvanced:"Advanced",sectionDataview:"Dataview",sectionContext:"Context",sectionStickers:"Stickers",sectionNavigator:"Navigator",sectionDefault:"Default Spaces",sectionSpaceView:"Space View",sectionBlink:"Blink",sectionInlineContext:"Inline Context",sectionFlowBlock:"Flow Block",sectionFlowMenu:"Flow Menu",sectionFlowStyler:"Flow Styler",experimental:{name:"Experimental",desc:"Experimental features that are subject to change and may not be optimized for performance"},generateThumbnails:{name:"Generate Thumbnails",desc:"Create thumbnails for images to speed up performance"},minimalThemeFix:{name:"Minimal Theme Fix",description:"Apply fixes for the popular theme Minimal"},inlineStickerMenu:{name:"Inline Stickers",desc:"Add inline stickers by typing :"},openSpacesOnLaunch:{name:"Open Spaces as Default Tab",desc:"Open the Spaces tab when Obsidian launches"},defaultSpaceTemplate:{name:"Default Space Template",desc:"Select the default template for new spaces"},defaultDateFormat:{name:"Default Date Format",desc:"Set the default date format, example: yyyy-MM-dd (see https://date-fns.org/v2.30.0/docs/format)"},newNotePlaceholder:{name:"New Note Placeholder",desc:"Default name for new notes"},folderIndentationLines:{name:"Show Folder Indentation Lines",desc:"Turn on to show a line on the left of folders to indicate indentation"},folderNoteLocation:{name:"Folder Note Location Inside Folder",desc:"Turn on to have folder notes inside the folder, turn off to have it outside"},folderViewDefault:{name:"Show Folder Note by Default",desc:"Show the folder note by default when opening a folder"},internalLinkFlowEditor:{name:"Open Flow Blocks on Internal Link Click",desc:"Turn on to toggle Flow Blocks directly by clicking on internal links, otherwise a tooltip will be shown"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},inlineBacklinks:{name:"Show Inline Backlinks (Inline Context required)",desc:"Show editable backlinks at the bottom of your notes"},dataviewInlineContext:{name:"Show Dataview in Inline Context",desc:"Show dataview when inline context is enabled"},inlineContextExplorer:{name:"Inline Context",desc:"Display the context and a banner at the top of your notes"},inlineContextExpanded:{name:"Auto Expand Inline Context",desc:"Expand the inline context sections when opening a note"},inlineContextHorizontal:{name:"Inline Title and Sticker Layout",desc:"Layout for inline title and sticker in Inline Context"},hideFrontmatter:{name:"Hide Frontmatter Properties",desc:"Hide the frontmatter properties in inline context"},openFileContext:{name:"Auto Open Explorer",desc:"Automatically open explorer panel in the right panel"},folderNote:{name:"Enable Folder Note",desc:"Access the folder note in the folder page and hide the folder note from spaces"},expandFolder:{name:"Auto Expand Folder",desc:"Auto expand folders on click"},hoverPreview:{name:"Preview on Hover",desc:"Preview on Hover while holding Control/Command key"},activeFile:{name:"Reveal Active File",desc:"Automatically reveal the active file in Spaces"},contexts:{name:"Contexts",desc:"Contexts allows you to have full control over the metadata of your files"},spaces:{name:"Navigator",desc:"The navigator lets you create and organize your spaces"},spacesStickers:{name:"Stickers",desc:"Use Emojis to make it easier to find your notes"},spacesAlias:{name:"Alias",desc:"Use the alias metadata to show in Spaces"},spacesFileExplorerDual:{name:"Compatibility Mode",desc:"This will improve the compatibility of plugins while using Spaces"},spacesDeleteOption:{name:"Delete File Option",desc:"Select how you want files to be deleted"},spacesDeleteOptions:{permanant:"Delete Permanently",trash:"Move to Obsidian Trash","system-trash":"Move to System Trash"},hideRibbon:{name:"App Ribbon",desc:"Show/hide the left menu aka. ribbon"},spaceView:{name:"Space View",desc:"Open the space view when you click on a space"},defaultSpaces:{name:"Default Spaces",desc:"Recommended spaces for quickly organizing your vault"},homeSpace:{name:"Home Space",desc:"An easy-to-access space where you can add/organize your other spaces"},tagSpaces:{name:"Tag Spaces",desc:"Automatically create spaces for each of your tags"},readableLineWidth:{name:"Readable Line Width",desc:"Use Readable Line Width"},sidebarTabs:{name:"Sidebar Tabs",desc:"Show/hide other sidebar tabs"},spacesPerformance:{name:"Performance Mode",desc:"Turn on performance mode for Spaces, may affect scrolling appearance. Requires Restart"},indexSVG:{name:"Use SVGs as Stickers",desc:"Use any svg file in your vault as a sticker"},inlineStyler:{name:"Flow Styler",desc:"Select text to add styling"},inlineStylerColor:{name:"Text and Highlight Colors \\u{1F9EA}",desc:"Select text color and highlight color, (this may change in the future because of the limitations with HTML and Obsidian)"},spaceRowHeight:{name:"Row Height",desc:"The height for each row in spaces (in pixels), default is 28"},makeChar:{name:"Flow Menu Trigger",desc:"Character to open the Flow Menu"},mobileMakeBar:{name:"Flow Styler (Mobile)",desc:"Replaces the mobile toolbar"},editorMarkSans:{name:"Mark Sans \\u{1F9EA}",desc:"Use the editor without Markdown."},editorMakerMode:{name:"Flow (Beta)",desc:"An integrated and intuitive editor experience"},editorMakePlacholder:{name:"Flow Menu Hint Text",desc:"Show a hint text on how to open the Flow Menu Shortcut"},blink:{name:"Blink",desc:"A faster way to search and edit your notes"},editorMakeMenu:{name:"Flow Menu",desc:"Open the Flow menu to quickly add content"},editorMakeMenuTrigger:{name:"Flow Menu Shortcut",desc:"Trigger key to use flow menu"},editorFlowReplace:{name:"Flow Block",desc:"Open your internal links or toggle your embeds in the flow block."},editorFlowStyle:{name:"Flow Block Style",desc:"Select a theme for your flow block",seamless:"Seamless",classic:"Classic",minimal:"Minimal"}}}};this.lang="en";let r=kR.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},Tr=new DS().texts;var KV=ca(am());var VV=(e,r)=>{let t=a=>a=="builtin"?"Builtin":a=="api"?"Spaces":"Action";return[...(e.actionsIndex.get(r)??[]).map(a=>({name:a.schema.name,description:"Action",value:\`\${r}/#;\${a.schema.id}\`,section:"Action"}))??[],...[...e.cli.allCommands()].map(a=>({name:a.schema.name,description:t(a.schema.type),value:a.path,section:t(a.schema.type)}))]};var LR=({field:e,value:r})=>r=="ctime"?{value:\`parseDate(prop('\${e}')['metadata']['file']['\${r}'])\`,type:"date"}:{value:\`prop('\${e}')['metadata']['file']['\${r}']\`,type:"string"},uy=(e,r,t,a)=>{let n=im(e);if(n)return r=="fileprop"&&n.field?LR(n):(r=="option"&&n.source?.length>0&&(n.source=="$commands"?n.options=t.cli.allCommands():n.source=="$links"?n.options=t.spaceManager.allPaths().map(i=>({name:i,value:i})):n.source=="$super"?n.options=VV(t,a):n.source=="$properties"&&(n.options=t.contextsIndex.get(a)?.cols?.map(i=>({name:i.name,value:i.name}))??[])),[...zR(r).configKeys??[],"alias","default"].reduce((i,u)=>({...i,[u]:n[u]}),{}));if(!r)return{};if(!n)if(r=="context")e?.length>0?n={space:e}:n={};else if(r.startsWith("date"))e?.length>0?n={format:e}:n={};else if(r.startsWith("fileprop"))if(e?.length>0){let[i,u]=e.split(".");n=LR({field:i,value:u})}else n={};else r.startsWith("option")&&(e?.length>0?n={options:Dn(e).map(u=>({name:u,value:u}))}:n={});return n??{}};var zR=(e,r)=>r==Fa?Af.find(t=>t.type=="file"):r=="tags"?Af.find(t=>t.type=="tags"):r=="aliases"?Af.find(t=>t.type=="option-multi"):r=="sticker"?Af.find(t=>e=="icon"):Af.find(t=>e==t.type)||Af.find(t=>e==t.multiType),Af=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"text",label:Tr.properties.text.label,metadata:!0,icon:"ui//text",primative:!0,description:Tr.properties.text.description},{type:"number",label:Tr.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],primative:!0,description:Tr.properties.number.description},{type:"boolean",label:Tr.properties.boolean.label,metadata:!0,icon:"ui//check-square",primative:!0,description:Tr.properties.boolean.description},{type:"date",label:Tr.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],primative:!0,description:Tr.properties.date.description},{type:"option",label:Tr.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options","source"],description:Tr.properties.option.description},{type:"tags",label:Tr.properties.tags.label,icon:"ui//tags",description:Tr.properties.tags.description},{type:"file",label:Tr.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:Tr.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value","type"],description:Tr.properties.fileProperty.description},{type:"link",label:Tr.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",primative:!0,description:Tr.properties.link.description},{type:"context",label:Tr.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:Tr.properties.context.description},{type:"object",label:Tr.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type"],description:Tr.properties.object.description},{type:"icon",label:Tr.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",restricted:!0,primative:!0,description:Tr.properties.icon.description},{type:"image",label:Tr.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",primative:!0,description:Tr.properties.image.description},{type:"color",label:Tr.properties.color.label,icon:"ui//mk-make-image",restricted:!0,description:Tr.properties.color.description},{type:"space",label:Tr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Tr.properties.space.description},{type:"table",label:Tr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Tr.properties.space.description},{type:"super",label:Tr.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:Tr.properties.super.label,icon:"ui//input",restricted:!0}];var ks="files",ly={id:ks,name:"Files",type:"db",primary:"true"},ZV="filesView",QV={id:ZV,name:"All",type:"view",def:JSON.stringify({db:ks,icon:"ui//file-stack"})},XV="main",JV=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),E4e={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[JV(XV),QV]},fy={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[ly]},UR={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},cy={...UR,rows:[{name:Fa,schemaId:ks,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:Tr.properties.fileProperty.createdTime,schemaId:ks,type:"fileprop",value:Fa+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var T4e=[{name:Tr.properties.defaultField,schemaId:"",type:"text",primary:"true"}],SS={...UR,rows:[{name:Fa,schemaId:ks,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var F4e={schema:ly,cols:cy.rows,rows:[]},_4e={schema:ly,cols:cy.rows,rows:[]},O4e={schema:ly,cols:SS.rows,rows:[]},WR=(e,r)=>e.filter(t=>r.find(a=>a.id==t.schemaId&&a.type=="db")).reduce((t,a)=>({...t,...t[a.schemaId]?{[a.schemaId]:{uniques:a.unique=="true"?[...t[a.schemaId].uniques,a.name]:t[a.schemaId].uniques,cols:[...t[a.schemaId].cols,a.name],rows:[]}}:{[a.schemaId]:{uniques:a.unique=="true"?[a.name]:[],cols:[a.name],rows:[]}}}),{});var B4e={m_schema:fy,m_fields:cy,...WR(cy.rows,fy.rows)},P4e={m_schema:fy,m_fields:SS,...WR(SS.rows,fy.rows)};var NS="spaces://$tags";var pIe={name:Tr.menu.waypoints,displayName:Tr.menu.waypoints,path:"spaces://$waypoints",label:{name:Tr.menu.waypoints,thumbnail:"",sticker:"ui//tags",color:""},type:"default"},dIe={name:Tr.menu.tags,displayName:Tr.menu.tags,path:"spaces://$tags",label:{thumbnail:"",name:Tr.menu.tags,sticker:"ui//tags",color:""},type:"default"},hIe={name:Tr.menu.vault,displayName:Tr.menu.vault,path:"/",label:{thumbnail:"",name:Tr.menu.vault,sticker:"ui//vault",color:""},type:"default"};var YR=(e,r,t,a,n,i)=>{if(!t)return"";let u=new Map;Object.keys(n).forEach(c=>u.set(c,n[c])),u.set("$properties",a),u.set("$paths",r),i&&u.set("$current",i);let l;try{l=e.evaluate(t,u),l=ws("",l)}catch{}return l};var AS=e=>{let r=new Map;e.filter(u=>u.type=="fileprop"||u.name=="tags").forEach(u=>{let{value:l}=uy(u.value,u.type),c=[];try{let s=Ua(l).filter(m=>m.type=="FunctionNode").filter(m=>m.fn.name=="prop"&&m.args[0].type=="ConstantNode").map(m=>m.args[0]?.value);c.push(...s)}catch(s){console.log(s)}let o=u.name;r.has(o)||r.set(o,new Set);for(let s of c){let m=s;m!==o&&r.get(o).add(m)}});let t=new Set,a=[],n=new Set,i=u=>{if(n.has(u))throw new Error("Circular dependency detected");if(!t.has(u)){n.add(u);let l=r.get(u)||new Set;for(let c of l)i(c);t.add(u),n.delete(u),a.push(u)}};for(let u of e)t.has(u.name)||i(u.name);return a},HR=(e,r,t,a,n,i)=>{let u=i??AS(a),l=r.get(t[Fa])?.metadata?.property??{},c=Object.keys(l).filter(m=>a.some(d=>d.name==m)).reduce((m,d)=>({...m,[d]:ws(d,l[d])}),{}),o=u.map(m=>a.find(d=>d.name==m)).filter(m=>m&&(m.type=="fileprop"||m.name=="tags")),s=a.reduce((m,d)=>({...m,[d.name]:d}),{});return{...t,...c,...o.reduce((m,d)=>{let{value:h}=uy(d.value,d.type);return{...m,[d.name]:YR(e,r,h,s,{...t,...m},n)}},{})}};var $R=(e,r)=>{let t=e?Dn(e):[],a=r?Dn(r):[];return a.every(n=>t.some(i=>i==n))&&t.every(n=>a.some(i=>i==n))},Mf=(e,r)=>e==r,MS=(e,r)=>(e??"").length==0,CS=(e,r)=>(e??"").toLowerCase().includes((r??"").toLowerCase()),ES=(e,r)=>parseFloat(e)>parseFloat(r),TS=(e,r)=>parseInt(e){let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),a=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf()>=a.valueOf()},VR=(e,r)=>{let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),a=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf(){let t=e?Dn(e):[],a=r?Dn(r):[];return t.length==0?!1:a.some(n=>t.some(i=>i==n))},ZR=(e,r)=>{if(!e)return!1;let t=new Date(\`\${e.toString().replace(".",":")}\`),a=new Date(\`\${r}\`);return t.getMonth()===a.getMonth()&&t.getDate()===a.getDate()},QR=e=>{if(!e)return!1;let r=new Date(\`\${e.toString()}T00:00\`),t=new Date;return r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()};var Cf={isNotEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(e,r)=>!MS(e,""),valueType:"none"},isEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(e,r)=>MS(e,""),valueType:"none"},include:{fn:(e,r)=>CS(e,r),type:["text","file","link","image"],valueType:"text"},notInclude:{type:["text","file","link","image"],fn:(e,r)=>!CS(e,r),valueType:"text"},is:{type:["text"],fn:(e,r)=>Mf(e,r),valueType:"text"},isNot:{type:["text"],fn:(e,r)=>!Mf(e,r),valueType:"text"},equal:{type:["number"],fn:(e,r)=>Mf(e,r),valueType:"number"},isLink:{type:["link","context"],fn:(e,r)=>Mf(e,r),valueType:"link"},isNotLink:{type:["link","context"],fn:(e,r)=>!Mf(e,r),valueType:"link"},isGreatThan:{type:["number"],fn:(e,r)=>ES(e,r),valueType:"number"},isLessThan:{type:["number"],fn:(e,r)=>TS(e,r),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(e,r)=>!ES(e,r),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(e,r)=>!TS(e,r),valueType:"number"},dateBefore:{type:["date"],fn:(e,r)=>VR(e,r),valueType:"date"},dateAfter:{type:["date"],fn:(e,r)=>GR(e,r),valueType:"date"},isSameDate:{type:["date"],fn:(e,r)=>ZR(e,r),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(e,r)=>QR(e,r),valueType:"none"},isExactList:{type:["option","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(e,r)=>$R(e,r),valueType:"list"},isAnyInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(e,r)=>FS(e,r),valueType:"list"},isNoneInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(e,r)=>!FS(e,r),valueType:"list"},isTrue:{type:["boolean"],fn:(e,r)=>e=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(e,r)=>e!="true",valueType:"none"}};var eZ=(e,r,t)=>r.reduce((n,i)=>{let[u,l]=n,c=i.type=="context"?XR(l,i,t):i.type=="path"?KR(l,i,t):i.type=="frontmatter"?JR(l,i,t):jR(l,i,t),o=l.filter(s=>!c.includes(s));return[[...u,...c],o]},[[],e])[0],rZ=(e,r,t)=>r.reduce((a,n)=>n.type=="context"?XR(a,n,t):n.type=="path"?KR(a,n,t):n.type=="frontmatter"?JR(a,n,t):jR(a,n,t),e),XR=(e,r,t)=>{let a=Cf[r.fn];return!a||a.valueType!="none"&&r.value.length==0?[]:e.filter(n=>{let[i,u]=r.field.split("."),l=n.metadata?.property;if(!n.spaces?.includes(i)||!l||!l[u])return!1;let c=!0;if(a){let o=r.fType=="property"?t[r.value]:r.value;c=a.fn(ws(u,l[u]),o)}return c})},JR=(e,r,t)=>{let a=Cf[r.fn];return!a||a.valueType!="none"&&r.value.length==0?[]:e.filter(n=>{let i=n.metadata?.property;if(!i||!i[r.field])return!1;let u=!0;if(a){let l=r.fType=="property"?t[r.value]:r.value;u=a.fn(ws(r.field,i[r.field]),l)}return u})},KR=(e,r,t)=>{let a=Cf[r.fn];return!a||a.valueType!="none"&&r.value.length==0?[]:e.filter(n=>{let i="";r.field=="outlinks"?i=bs(n.outlinks??[]):r.field=="inlinks"?i=bs(n.inlinks??[]):r.field=="tags"&&(i=bs(n.tags??[]));let u=!0;if(a){let l=r.fType=="property"?t[r.value]:r.value;u=a.fn(i,l)}return u})},jR=(e,r,t)=>{let a=Cf[r.fn];return!a||a.valueType!="none"&&r.value.length==0?[]:e.filter(n=>{let i=!0;if(a){let u=r.fType=="property"?t[r.value]:r.value;i=a.fn(n.metadata?.[r.type]?.[r.field],u)}return i})},e5=(e,r,t)=>e.reduce((n,i)=>!n||i.filters.length==0?!1:i.type=="any"?eZ([r],i.filters,t).length>0:rZ([r],i.filters,t).length>0,!0);var r5=(e,r)=>e.hiddenExtensions.some(t=>r.endsWith(t))||r.startsWith(e.spacesFolder+"/#")||e.hiddenFiles.some(t=>t==r);var t5=(e,r,t)=>{if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{path:e.path,frames:{},schemas:[]}};let a=Object.values(r).map(l=>l.schema),n=a.filter(l=>l.type=="frame").reduce((l,c)=>({...l,[c.id]:r[c.id]}),{}),i={path:e.path,frames:n,schemas:a},u=!0;return t&&my.default.isEqual(i,t)&&(u=!1),{changed:u,cache:i}},n5=(e,r,t,a,n,i,u)=>{let l={};if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{cols:[],path:e.path,schemas:[],outlinks:[],contexts:[],paths:[],tables:{},space:e,spaceMap:l,dbExists:!1}};let c=Object.values(r).map(A=>A.schema),o=c.find(A=>A.primary=="true"),s=AS(r[o.id].cols),m={...r[o.id],rows:r[o.id].rows.map(A=>HR(u,i,A,r[o.id].cols,i.get(e.path),s))},d={...r,[o.id]:m},h=m.cols?.filter(A=>A.type.startsWith("context"))??[],x=m.cols?.filter(A=>A.type.startsWith("link"))??[],v=ti(h.map(A=>A.value));h.forEach(A=>{l[A.name]={},m.rows.forEach(S=>{Dn(S[A.name]).forEach(O=>l[A.name][O]=[...l[A.name][O]??[],S[Fa]])})});let y=d[ks]?.rows?.map(A=>A[Fa])??[],w=vA(t??[],y),C=ti(m.rows.reduce((A,S)=>ti([...A,...[...h,...x].flatMap(O=>Dn(S[O.name]).map(_=>wc(_)))]),[])),b={cols:m.cols,path:e.path,contexts:v,outlinks:C,paths:w,tables:d,schemas:c,space:e,spaceMap:l,dbExists:n},M=!0;return a&&my.default.isEqual(b,a)&&(M=!0),{changed:M,cache:b}},a5=(e,r,t,a)=>{let n={};for(let[i,u]of e){let l=t.get(i)?.defPath??i,c=e.get(l)??u,o=u?.parent??"",s=u?.type??"",m=u?.subtype??"",d=c?.label,h=a?.get(i),{changed:x,cache:v}=_S(i,r,t,c,d,s,m,o,h);n[i]={changed:x,cache:v}}return n},_S=(e,r,t,a,n,i,u,l,c)=>{let o=(W,G,H)=>W?.length>0||W?.length>0?W:G=="space"?H=="Spaces/Home"?"ui//home":H=="/"?"ui//vault":H.startsWith("spaces://")?"ui//tags":"ui//folder":"ui//file",s={label:a?.label,path:e,name:yc(e),displayName:yc(e)},m=[],d=a?.tags?.map(W=>W)??[],h=r5(r,e),x=(W,G,H=new Set)=>{let L=[];for(let q of G){let K=W.get(q)?.contexts??[];for(let z of K)H.has(z)||(L.push(z),H.add(z),L.push(...x(W,[bc(z)],H)))}return L};if(t.has(l))for(let W of t.get(l).contexts??[])m.push(W);m.push(...d);let v=n?.name,y=a?.properties?dA(a.properties[r.fmKeyAlias]):[],w=o(n?.sticker,i,e),C=n?.color??"",b=a?.inlinks??[],M=a?.links??[],A=r.spacesUseAlias?y[0]??v:v,S={...s,name:v,tags:ti(m),type:i,subtype:u,displayName:A,parent:l,label:{name:v,sticker:w,color:C,thumbnail:n?.thumbnail??"",preview:n?.preview??""},metadata:{...a},inlinks:b,outlinks:M},O=[];u=="tag"&&O.push(NS);for(let W of m)O.push(bc(W));let _=new Set,E=(W,G)=>{if(!_.has(W)){if(_.add(W),G.dependencies?.length>0)for(let H of G.dependencies)t.has(H)&&E(H,t.get(H));if(G.defPath==e&&(h=!0),u!="tag"&&u!="default"&&G.space&&G.space.path==l){O.push(W);return}if(G.metadata?.filters?.length>0&&e5(G.metadata.filters,{...S,spaces:O},G.properties)){O.push(W);return}if(G.metadata?.links?.length>0&&(G.metadata?.links??[]).find(L=>L==S.path)){O.push(W);return}}};for(let[W,G]of t)E(W,G);let T=x(t,O);O.push(...T.map(W=>bc(W))),S.tags.push(...T);let R=h?{...S,spaces:[],hidden:h}:{...S,spaces:ti(O),hidden:h},k=!0;return c&&my.default.isEqual(R,c)&&(k=!1),{changed:k,cache:R}};function i5(e){let{path:r,settings:t,spacesCache:a,pathMetadata:n,label:i,type:u,subtype:l,parent:c,oldMetadata:o}=e;return _S(r,t,a,n,i,u,l,c,o)}function OS(e,r){let{space:t,mdb:a,paths:n,oldCache:i,dbExists:u,pathsIndex:l}=e;return n5(t,a,n,i,u,l,r)}function o5(e,r){let{map:t,pathsIndex:a}=e,n=new Map;for(let[i,u]of t)n.set(i,OS({...u,pathsIndex:a},r));return n}function s5(e){let{pathCache:r,settings:t,spacesCache:a,oldMetadata:n}=e;return a5(r,t,a,n)}function u5(e){let{space:r,mdb:t,oldCache:a}=e;return t5(r,t,a)}var tZ=self,nZ={...xS,createAdd:F("add",[],()=>function(r,t){return r+t})},BS=sy(nZ);BS.import(Ob,{override:!0});tZ.onmessage=async e=>{let{payload:r,job:t}=e.data,a;t.type=="path"?a=i5(r):t.type=="context"?a=OS(r,BS):t.type=="contexts"?a=o5(r,BS):t.type=="frames"?a=u5(r):t.type=="paths"&&(a=s5(r));try{postMessage({job:t,result:a})}catch(n){console.log(n),postMessage({job:t,result:{$error:\`Failed to index \${t.type} \${t.path}: \${n}\`}})}}; +In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.\`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]};var WO={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]};var YO={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var HO={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var $O={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]};var GO={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]};var VO={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]};var ZO={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as \`acosh(x) = ln(sqrt(x^2 - 1) + x)\`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]};var QO={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]};var XO={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as \`acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2\`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]};var JO={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]};var KO={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as \`acsch(x) = ln(1/x + sqrt(1/x^2 + 1))\`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]};var jO={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]};var e3={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};var r3={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]};var t3={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as \`asinh(x) = ln(x + sqrt(x^2 + 1))\`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]};var n3={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]};var a3={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]};var i3={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as \`atanh(x) = ln((1 + x)/(1 - x)) / 2\`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]};var o3={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]};var s3={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};var u3={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]};var f3={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]};var c3={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]};var l3={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]};var m3={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]};var p3={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]};var d3={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]};var h3={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};var v3={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]};var g3={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]};var x3={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]};var y3={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};var b3={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]};var w3={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]};var D3={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]};var S3={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};var N3={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var A3={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var M3={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]};var C3={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]};var E3={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var T3={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var F3={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]};var _3={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]};var O3={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};var B3={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]};var P3={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]};var I3={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]};var R3={bignumber:MT,boolean:CT,complex:ET,createUnit:TT,fraction:FT,index:_T,matrix:OT,number:BT,sparse:PT,splitUnit:IT,string:RT,unit:qT,e:hD,E:hD,false:lT,i:mT,Infinity:pT,LN2:hT,LN10:dT,LOG2E:gT,LOG10E:vT,NaN:xT,null:yT,pi:vD,PI:vD,phi:bT,SQRT1_2:wT,SQRT2:DT,tau:ST,true:NT,version:AT,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:UT,lsolve:YT,lsolveAll:HT,lup:$T,lusolve:GT,leafCount:WT,polynomialRoot:VT,resolve:XT,simplify:JT,simplifyConstant:KT,simplifyCore:jT,symbolicEqual:rF,rationalize:QT,slu:eF,usolve:tF,usolveAll:nF,qr:ZT,abs:aF,add:iF,cbrt:oF,ceil:sF,cube:uF,divide:fF,dotDivide:cF,dotMultiply:lF,dotPow:mF,exp:pF,expm:dF,expm1:hF,fix:vF,floor:gF,gcd:xF,hypot:yF,lcm:wF,log:DF,log2:AF,log1p:NF,log10:SF,mod:MF,multiply:CF,norm:EF,nthRoot:TF,nthRoots:FF,pow:_F,round:OF,sign:BF,sqrt:PF,sqrtm:IF,square:LF,subtract:zF,unaryMinus:UF,unaryPlus:WF,xgcd:YF,invmod:bF,bitAnd:HF,bitNot:$F,bitOr:GF,bitXor:VF,leftShift:ZF,rightArithShift:QF,rightLogShift:XF,bellNumbers:JF,catalan:KF,composition:jF,stirlingS2:e_,config:kT,import:LT,typed:zT,arg:r_,conj:t_,re:a_,im:n_,evaluate:i_,help:o_,distance:s_,intersect:u_,and:f_,not:c_,or:l_,xor:m_,concat:d_,count:h_,cross:v_,column:p_,ctranspose:g_,det:x_,diag:y_,diff:b_,dot:w_,getMatrixDataType:M_,identity:C_,filter:S_,flatten:N_,forEach:A_,inv:E_,pinv:T_,eigs:D_,kron:F_,matrixFromFunction:B_,matrixFromRows:P_,matrixFromColumns:O_,map:__,ones:I_,partitionSelect:R_,range:q_,resize:L_,reshape:k_,rotate:z_,rotationMatrix:U_,row:W_,size:Y_,sort:H_,squeeze:$_,subset:G_,trace:V_,transpose:Z_,zeros:Q_,fft:X_,ifft:J_,sylvester:RF,schur:qF,lyap:kF,solveODE:I3,combinations:K_,combinationsWithRep:j_,factorial:eO,gamma:rO,kldivergence:nO,lgamma:tO,multinomial:aO,permutations:iO,pickRandom:oO,random:sO,randomInt:uO,compare:fO,compareNatural:cO,compareText:lO,deepEqual:mO,equal:pO,equalText:dO,larger:hO,largerEq:vO,smaller:gO,smallerEq:xO,unequal:yO,setCartesian:bO,setDifference:wO,setDistinct:DO,setIntersect:SO,setIsSubset:NO,setMultiplicity:AO,setPowerset:MO,setSize:CO,setSymDifference:EO,setUnion:TO,zpk2tf:FO,freqz:_O,erf:OO,zeta:BO,cumsum:YO,mad:PO,max:IO,mean:RO,median:qO,min:kO,mode:LO,prod:zO,quantileSeq:UO,std:WO,sum:HO,variance:$O,corr:GO,acos:VO,acosh:ZO,acot:QO,acoth:XO,acsc:JO,acsch:KO,asec:jO,asech:e3,asin:r3,asinh:t3,atan:n3,atanh:i3,atan2:a3,cos:o3,cosh:s3,cot:u3,coth:f3,csc:c3,csch:l3,sec:m3,sech:p3,sin:d3,sinh:h3,tan:v3,tanh:g3,to:x3,clone:b3,format:w3,bin:y3,oct:O3,hex:S3,isNaN:A3,isInteger:N3,isNegative:M3,isNumeric:C3,hasNumericValue:D3,isPositive:E3,isPrime:T3,isZero:F3,print:B3,typeOf:P3,numeric:_3};var q3="help",P$=["typed","mathWithTransform","Help"],lg=F(q3,P$,e=>{var{typed:r,mathWithTransform:t,Help:a}=e;return r(q3,{any:function(i){var u,l=i;if(typeof i!="string"){for(u in t)if(Xe(t,u)&&i===t[u]){l=u;break}}var c=wt(R3,l);if(!c){var o=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+o+'"')}return new a(c)}})});var k3="chain",I$=["typed","Chain"],mg=F(k3,I$,e=>{var{typed:r,Chain:t}=e;return r(k3,{"":function(){return new t},any:function(n){return new t(n)}})});var L3="det",R$=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],pg=F(L3,R$,e=>{var{typed:r,matrix:t,subtractScalar:a,multiply:n,divideScalar:i,isZero:u,unaryMinus:l}=e;return r(L3,{any:function(s){return ar(s)},"Array | Matrix":function(s){var m;switch(Qe(s)?m=s.size():Array.isArray(s)?(s=t(s),m=s.size()):m=[],m.length){case 0:return ar(s);case 1:if(m[0]===1)return ar(s.valueOf()[0]);if(m[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(m)+")");case 2:{var d=m[0],h=m[1];if(d===h)return c(s.clone().valueOf(),d,h);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+lr(m)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(m)+")")}}});function c(o,s,m){if(s===1)return ar(o[0][0]);if(s===2)return a(n(o[0][0],o[1][1]),n(o[1][0],o[0][1]));for(var d=!1,h=new Array(s).fill(0).map((O,_)=>_),x=0;x{var{typed:r,matrix:t,divideScalar:a,addScalar:n,multiply:i,unaryMinus:u,det:l,identity:c,abs:o}=e;return r(z3,{"Array | Matrix":function(d){var h=Qe(d)?d.size():ur(d);switch(h.length){case 1:if(h[0]===1)return Qe(d)?t([a(1,d.valueOf()[0])]):[a(1,d[0])];throw new RangeError("Matrix must be square (size: "+lr(h)+")");case 2:{var x=h[0],v=h[1];if(x===v)return Qe(d)?t(s(d.valueOf(),x,v),d.storage()):s(d,x,v);throw new RangeError("Matrix must be square (size: "+lr(h)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(h)+")")}},any:function(d){return a(1,d)}});function s(m,d,h){var x,v,y,w,C;if(d===1){if(w=m[0][0],w===0)throw Error("Cannot calculate inverse, determinant is zero");return[[a(1,w)]]}else if(d===2){var b=l(m);if(b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[a(m[1][1],b),a(u(m[0][1]),b)],[a(u(m[1][0]),b),a(m[0][0],b)]]}else{var M=m.concat();for(x=0;xO&&(O=o(M[x][S]),_=x),x++;if(O===0)throw Error("Cannot calculate inverse, determinant is zero");x=_,x!==S&&(C=M[S],M[S]=M[x],M[x]=C,C=A[S],A[S]=A[x],A[x]=C);var E=M[S],T=A[S];for(x=0;x{var{typed:r,matrix:t,inv:a,deepEqual:n,equal:i,dotDivide:u,dot:l,ctranspose:c,divideScalar:o,multiply:s,add:m,Complex:d}=e;return r(U3,{"Array | Matrix":function(b){var M=Qe(b)?b.size():ur(b);switch(M.length){case 1:return w(b)?c(b):M[0]===1?a(b):u(c(b),l(b,b));case 2:{if(w(b))return c(b);var A=M[0],S=M[1];if(A===S)try{return a(b)}catch(O){if(!(O instanceof Error&&O.message.match(/Cannot calculate inverse, determinant is zero/)))throw O}return Qe(b)?t(h(b.valueOf(),A,S),b.storage()):h(b,A,S)}default:throw new RangeError("Matrix must be two dimensional (size: "+lr(M)+")")}},any:function(b){return i(b,0)?ar(b):o(1,b)}});function h(C,b,M){var{C:A,F:S}=v(C,b,M),O=s(a(s(c(A),A)),c(A)),_=s(c(S),a(s(S,c(S))));return s(_,O)}function x(C,b,M){for(var A=ar(C),S=0,O=0;O_.filter((T,R)=>R!y(l(A[E],A[E])));return{C:S,F:O}}function y(C){return i(m(C,d(1,1)),m(0,d(1,1)))}function w(C){return n(m(C,d(1,1)),m(s(C,0),d(1,1)))}});function W3(e){var{addScalar:r,subtract:t,flatten:a,multiply:n,multiplyScalar:i,divideScalar:u,sqrt:l,abs:c,bignumber:o,diag:s,size:m,reshape:d,inv:h,qr:x,usolve:v,usolveAll:y,equal:w,complex:C,larger:b,smaller:M,matrixFromColumns:A,dot:S}=e;function O(ae,$,le,Ee){var me=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,ge=_(ae,$,le,Ee,me);E(ae,$,le,Ee,me,ge);var{values:Se,C:xe}=T(ae,$,le,Ee,me);if(me){var be=R(ae,$,xe,ge,Se,le,Ee);return{values:Se,eigenvectors:be}}return{values:Se}}function _(ae,$,le,Ee,me){var ge=Ee==="BigNumber",Se=Ee==="Complex",xe=ge?o(0):0,be=ge?o(1):Se?C(1):1,De=ge?o(1):1,Ae=ge?o(10):2,We=i(Ae,Ae),Je;me&&(Je=Array($).fill(be));for(var J=!1;!J;){J=!0;for(var re=0;re<$;re++){for(var ye=xe,j=xe,ne=0;ne<$;ne++)re!==ne&&(ye=r(ye,c(ae[ne][re])),j=r(j,c(ae[re][ne])));if(!w(ye,0)&&!w(j,0)){for(var ue=De,Me=ye,Ce=u(j,Ae),Le=i(j,Ae);M(Me,Ce);)Me=i(Me,We),ue=i(ue,Ae);for(;b(Me,Le);)Me=u(Me,We),ue=u(ue,Ae);var Ie=M(u(r(Me,j),ue),i(r(ye,j),.95));if(Ie){J=!1;for(var fr=u(1,ue),or=0;or<$;or++)re!==or&&(ae[re][or]=i(ae[re][or],fr),ae[or][re]=i(ae[or][re],ue));me&&(Je[re]=i(Je[re],fr))}}}}return me?s(Je):null}function E(ae,$,le,Ee,me,ge){var Se=Ee==="BigNumber",xe=Ee==="Complex",be=Se?o(0):xe?C(0):0;Se&&(le=o(le));for(var De=0;De<$-2;De++){for(var Ae=0,We=be,Je=De+1;Je<$;Je++){var J=ae[Je][De];M(c(We),c(J))&&(We=J,Ae=Je)}if(!M(c(We),le)){if(Ae!==De+1){var re=ae[Ae];ae[Ae]=ae[De+1],ae[De+1]=re;for(var ye=0;ye<$;ye++){var j=ae[ye][Ae];ae[ye][Ae]=ae[ye][De+1],ae[ye][De+1]=j}if(me){var ne=ge[Ae];ge[Ae]=ge[De+1],ge[De+1]=ne}}for(var ue=De+2;ue<$;ue++){var Me=u(ae[ue][De],We);if(Me!==0){for(var Ce=0;Ce<$;Ce++)ae[ue][Ce]=t(ae[ue][Ce],i(Me,ae[De+1][Ce]));for(var Le=0;Le<$;Le++)ae[Le][De+1]=r(ae[Le][De+1],i(Me,ae[Le][ue]));if(me)for(var Ie=0;Ie<$;Ie++)ge[ue][Ie]=t(ge[ue][Ie],i(Me,ge[De+1][Ie]))}}}}return ge}function T(ae,$,le,Ee,me){var ge=Ee==="BigNumber",Se=Ee==="Complex",xe=ge?o(1):Se?C(1):1;ge&&(le=o(le));for(var be=ar(ae),De=[],Ae=$,We=[],Je=me?s(Array($).fill(xe)):void 0,J=me?s(Array(Ae).fill(xe)):void 0,re=0;re<=100;){re+=1;for(var ye=be[Ae-1][Ae-1],j=0;j1&&(J=s(Array(Ae-1).fill(xe)))),Ae-=1,be.pop();for(var Ce=0;Ce2&&(J=s(Array(Ae-2).fill(xe)))),Ae-=2,be.pop(),be.pop();for(var Ie=0;Ie+t(c(Ke),c(Pr))),re>100){var fr=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+De.join(", "));throw fr.values=De,fr.vectors=[],fr}var or=me?n(Je,H(We,$)):void 0;return{values:De,C:or}}function R(ae,$,le,Ee,me,ge,Se){var xe=h(le),be=n(xe,ae,le),De=Se==="BigNumber",Ae=Se==="Complex",We=De?o(0):Ae?C(0):0,Je=De?o(1):Ae?C(1):1,J=[],re=[];for(var ye of me){var j=L(J,ye,w);j===-1?(J.push(ye),re.push(1)):re[j]+=1}for(var ne=[],ue=J.length,Me=Array($).fill(We),Ce=s(Array($).fill(Je)),Le=function(){var or=J[Ie],Ke=t(be,n(or,Ce)),Pr=y(Ke,Me);for(Pr.shift();Pr.lengthn(ce,we)),ne.push(...Pr.map(we=>({value:or,vector:a(we)})))},Ie=0;Ie=5)return null;for(xe=0;;){var be=v(ae,Se);if(M(oe(z(Se,[be])),Ee))break;if(++xe>=10)return null;Se=pe(be)}return Se}function K(ae,$,le){var Ee=le==="BigNumber",me=le==="Complex",ge=Array(ae).fill(0).map(Se=>2*Math.random()-1);return Ee&&(ge=ge.map(Se=>o(Se))),me&&(ge=ge.map(Se=>C(Se))),ge=z(ge,$),pe(ge,le)}function z(ae,$){var le=m(ae);for(var Ee of $)Ee=d(Ee,le),ae=t(ae,n(u(S(Ee,ae),S(Ee,Ee)),Ee));return ae}function oe(ae){return c(l(S(ae,ae)))}function pe(ae,$){var le=$==="BigNumber",Ee=$==="Complex",me=le?o(1):Ee?C(1):1;return n(u(me,oe(ae)),ae)}return O}function Y3(e){var{config:r,addScalar:t,subtract:a,abs:n,atan:i,cos:u,sin:l,multiplyScalar:c,inv:o,bignumber:s,multiply:m,add:d}=e;function h(E,T){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.epsilon,k=arguments.length>3?arguments[3]:void 0,W=arguments.length>4?arguments[4]:void 0;if(k==="number")return x(E,R,W);if(k==="BigNumber")return v(E,R,W);throw TypeError("Unsupported data type: "+k)}function x(E,T,R){var k=E.length,W=Math.abs(T/k),G,H;if(R){H=new Array(k);for(var L=0;L=Math.abs(W);){var K=q[0][0],z=q[0][1];G=y(E[K][K],E[z][z],E[K][z]),E=A(E,G,K,z),R&&(H=C(H,G,K,z)),q=S(E)}for(var oe=Array(k).fill(0),pe=0;pe=n(W);){var K=q[0][0],z=q[0][1];G=w(E[K][K],E[z][z],E[K][z]),E=M(E,G,K,z),R&&(H=b(H,G,K,z)),q=O(E)}for(var oe=Array(k).fill(0),pe=0;pe({value:W[$],vector:ae}));return{values:W,eigenvectors:pe}}return h}var L$="eigs",z$=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],vg=F(L$,z$,e=>{var{config:r,typed:t,matrix:a,addScalar:n,subtract:i,equal:u,abs:l,atan:c,cos:o,sin:s,multiplyScalar:m,divideScalar:d,inv:h,bignumber:x,multiply:v,add:y,larger:w,column:C,flatten:b,number:M,complex:A,sqrt:S,diag:O,size:_,reshape:E,qr:T,usolve:R,usolveAll:k,im:W,re:G,smaller:H,matrixFromColumns:L,dot:q}=e,K=Y3({config:r,addScalar:n,subtract:i,column:C,flatten:b,equal:u,abs:l,atan:c,cos:o,sin:s,multiplyScalar:m,inv:h,bignumber:x,complex:A,multiply:v,add:y}),z=W3({config:r,addScalar:n,subtract:i,multiply:v,multiplyScalar:m,flatten:b,divideScalar:d,sqrt:S,abs:l,bignumber:x,diag:O,size:_,reshape:E,qr:T,inv:h,usolve:R,usolveAll:k,equal:u,complex:A,larger:w,smaller:H,matrixFromColumns:L,dot:q});return t("eigs",{Array:function(ge){return oe(a(ge))},"Array, number|BigNumber":function(ge,Se){return oe(a(ge),{precision:Se})},"Array, Object"(me,ge){return oe(a(me),ge)},Matrix:function(ge){return oe(ge,{matricize:!0})},"Matrix, number|BigNumber":function(ge,Se){return oe(ge,{precision:Se,matricize:!0})},"Matrix, Object":function(ge,Se){var xe={matricize:!0};return ht(xe,Se),oe(ge,xe)}});function oe(me){var ge,Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},xe="eigenvectors"in Se?Se.eigenvectors:!0,be=(ge=Se.precision)!==null&&ge!==void 0?ge:r.epsilon,De=pe(me,be,xe);return Se.matricize&&(De.values=a(De.values),xe&&(De.eigenvectors=De.eigenvectors.map(Ae=>{var{value:We,vector:Je}=Ae;return{value:We,vector:a(Je)}}))),xe&&Object.defineProperty(De,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),De}function pe(me,ge,Se){var xe=me.toArray(),be=me.size();if(be.length!==2||be[0]!==be[1])throw new RangeError("Matrix must be square (size: ".concat(lr(be),")"));var De=be[0];if($(xe,De,ge)&&(le(xe,De),ae(xe,De,ge))){var Ae=Ee(me,xe,De);return K(xe,De,ge,Ae,Se)}var We=Ee(me,xe,De);return z(xe,De,ge,We,Se)}function ae(me,ge,Se){for(var xe=0;xe{var{typed:r,abs:t,add:a,identity:n,inv:i,multiply:u}=e;return r(H3,{Matrix:function(m){var d=m.size();if(d.length!==2||d[0]!==d[1])throw new RangeError("Matrix must be square (size: "+lr(d)+")");for(var h=d[0],x=1e-15,v=l(m),y=c(v,x),w=y.q,C=y.j,b=u(m,Math.pow(2,-C)),M=n(h),A=n(h),S=1,O=b,_=-1,E=1;E<=w;E++)E>1&&(O=u(O,b),_=-_),S=S*(w-E+1)/((2*w-E+1)*E),M=a(M,u(S,O)),A=a(A,u(S*_,O));for(var T=u(i(A),M),R=0;R{var{typed:r,abs:t,add:a,multiply:n,map:i,sqrt:u,subtract:l,inv:c,size:o,max:s,identity:m}=e,d=1e3,h=1e-6;function x(v){var y,w=0,C=v,b=m(o(v));do{var M=C;if(C=n(.5,a(M,c(b))),b=n(.5,a(b,c(M))),y=s(t(l(C,M))),y>h&&++w>d)throw new Error("computing square root of matrix: iterative method could not converge")}while(y>h);return C}return r($3,{"Array | Matrix":function(y){var w=Qe(y)?y.size():ur(y);switch(w.length){case 1:if(w[0]===1)return i(y,u);throw new RangeError("Matrix must be square (size: "+lr(w)+")");case 2:{var C=w[0],b=w[1];if(C===b)return x(y);throw new RangeError("Matrix must be square (size: "+lr(w)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+lr(w)+")")}}})});var G3="sylvester",Y$=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],yg=F(G3,Y$,e=>{var{typed:r,schur:t,matrixFromColumns:a,matrix:n,multiply:i,range:u,concat:l,transpose:c,index:o,subset:s,add:m,subtract:d,identity:h,lusolve:x,abs:v}=e;return r(G3,{"Matrix, Matrix, Matrix":y,"Array, Matrix, Matrix":function(C,b,M){return y(n(C),b,M)},"Array, Array, Matrix":function(C,b,M){return y(n(C),n(b),M)},"Array, Matrix, Array":function(C,b,M){return y(n(C),b,n(M))},"Matrix, Array, Matrix":function(C,b,M){return y(C,n(b),M)},"Matrix, Array, Array":function(C,b,M){return y(C,n(b),n(M))},"Matrix, Matrix, Array":function(C,b,M){return y(C,b,n(M))},"Array, Array, Array":function(C,b,M){return y(n(C),n(b),n(M)).toArray()}});function y(w,C,b){for(var M=C.size()[0],A=w.size()[0],S=t(w),O=S.T,_=S.U,E=t(i(-1,C)),T=E.T,R=E.U,k=i(i(c(_),b),R),W=u(0,A),G=[],H=(Ae,We)=>l(Ae,We,1),L=(Ae,We)=>l(Ae,We,0),q=0;q1e-5){for(var K=L(s(k,o(W,q)),s(k,o(W,q+1))),z=0;z{var{typed:r,matrix:t,identity:a,multiply:n,qr:i,norm:u,subtract:l}=e;return r(V3,{Array:function(s){var m=c(t(s));return{U:m.U.valueOf(),T:m.T.valueOf()}},Matrix:function(s){return c(s)}});function c(o){var s=o.size()[0],m=o,d=a(s),h=0,x;do{x=m;var v=i(m),y=v.Q,w=v.R;if(m=n(w,y),d=n(d,y),h++>100)break}while(u(l(m,x))>1e-4);return{U:d,T:m}}});var Z3="lyap",$$=["typed","matrix","sylvester","multiply","transpose"],wg=F(Z3,$$,e=>{var{typed:r,matrix:t,sylvester:a,multiply:n,transpose:i}=e;return r(Z3,{"Matrix, Matrix":function(l,c){return a(l,i(l),n(-1,c))},"Array, Matrix":function(l,c){return a(t(l),i(t(l)),n(-1,c))},"Matrix, Array":function(l,c){return a(l,i(t(l)),t(n(-1,c)))},"Array, Array":function(l,c){return a(t(l),i(t(l)),t(n(-1,c))).toArray()}})});var G$="divide",V$=["typed","matrix","multiply","equalScalar","divideScalar","inv"],Dg=F(G$,V$,e=>{var{typed:r,matrix:t,multiply:a,equalScalar:n,divideScalar:i,inv:u}=e,l=jr({typed:r,equalScalar:n}),c=kt({typed:r});return r("divide",xm({"Array | Matrix, Array | Matrix":function(s,m){return a(s,u(m))},"DenseMatrix, any":function(s,m){return c(s,m,i,!1)},"SparseMatrix, any":function(s,m){return l(s,m,i,!1)},"Array, any":function(s,m){return c(t(s),m,i,!1).valueOf()},"any, Array | Matrix":function(s,m){return a(s,u(m))}},i.signatures))});var Q3="distance",Z$=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],Sg=F(Q3,Z$,e=>{var{typed:r,addScalar:t,subtractScalar:a,multiplyScalar:n,divideScalar:i,deepEqual:u,sqrt:l,abs:c}=e;return r(Q3,{"Array, Array, Array":function(A,S,O){if(A.length===2&&S.length===2&&O.length===2){if(!s(A))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!s(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!s(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(u(S,O))throw new TypeError("LinePoint1 should not be same with LinePoint2");var _=a(O[1],S[1]),E=a(S[0],O[0]),T=a(n(O[0],S[1]),n(S[0],O[1]));return y(A[0],A[1],_,E,T)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(A,S,O){if(Object.keys(A).length===2&&Object.keys(S).length===2&&Object.keys(O).length===2){if(!s(A))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!s(S))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!s(O))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(u(x(S),x(O)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in A&&"pointY"in A&&"lineOnePtX"in S&&"lineOnePtY"in S&&"lineTwoPtX"in O&&"lineTwoPtY"in O){var _=a(O.lineTwoPtY,S.lineOnePtY),E=a(S.lineOnePtX,O.lineTwoPtX),T=a(n(O.lineTwoPtX,S.lineOnePtY),n(S.lineOnePtX,O.lineTwoPtY));return y(A.pointX,A.pointY,_,E,T)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(A,S){if(A.length===2&&S.length===3){if(!s(A))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!m(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return y(A[0],A[1],S[0],S[1],S[2])}else if(A.length===3&&S.length===6){if(!m(A))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!h(S))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return w(A[0],A[1],A[2],S[0],S[1],S[2],S[3],S[4],S[5])}else if(A.length===S.length&&A.length>0){if(!d(A))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!d(S))throw new TypeError("All values of an array should be numbers or BigNumbers");return C(A,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(A,S){if(Object.keys(A).length===2&&Object.keys(S).length===3){if(!s(A))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!m(S))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in A&&"pointY"in A&&"xCoeffLine"in S&&"yCoeffLine"in S&&"constant"in S)return y(A.pointX,A.pointY,S.xCoeffLine,S.yCoeffLine,S.constant);throw new TypeError("Key names do not match")}else if(Object.keys(A).length===3&&Object.keys(S).length===6){if(!m(A))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!h(S))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in A&&"pointY"in A&&"x0"in S&&"y0"in S&&"z0"in S&&"a"in S&&"b"in S&&"c"in S)return w(A.pointX,A.pointY,A.pointZ,S.x0,S.y0,S.z0,S.a,S.b,S.c);throw new TypeError("Key names do not match")}else if(Object.keys(A).length===2&&Object.keys(S).length===2){if(!s(A))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!s(S))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in A&&"pointOneY"in A&&"pointTwoX"in S&&"pointTwoY"in S)return C([A.pointOneX,A.pointOneY],[S.pointTwoX,S.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(A).length===3&&Object.keys(S).length===3){if(!m(A))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!m(S))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in A&&"pointOneY"in A&&"pointOneZ"in A&&"pointTwoX"in S&&"pointTwoY"in S&&"pointTwoZ"in S)return C([A.pointOneX,A.pointOneY,A.pointOneZ],[S.pointTwoX,S.pointTwoY,S.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(A){if(!v(A))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return b(A)}});function o(M){return typeof M=="number"||rr(M)}function s(M){return M.constructor!==Array&&(M=x(M)),o(M[0])&&o(M[1])}function m(M){return M.constructor!==Array&&(M=x(M)),o(M[0])&&o(M[1])&&o(M[2])}function d(M){return Array.isArray(M)||(M=x(M)),M.every(o)}function h(M){return M.constructor!==Array&&(M=x(M)),o(M[0])&&o(M[1])&&o(M[2])&&o(M[3])&&o(M[4])&&o(M[5])}function x(M){for(var A=Object.keys(M),S=[],O=0;OA.length!==2||!o(A[0])||!o(A[1])))return!1}else if(M[0].length===3&&o(M[0][0])&&o(M[0][1])&&o(M[0][2])){if(M.some(A=>A.length!==3||!o(A[0])||!o(A[1])||!o(A[2])))return!1}else return!1;return!0}function y(M,A,S,O,_){var E=c(t(t(n(S,M),n(O,A)),_)),T=l(t(n(S,S),n(O,O)));return i(E,T)}function w(M,A,S,O,_,E,T,R,k){var W=[a(n(a(_,A),k),n(a(E,S),R)),a(n(a(E,S),T),n(a(O,M),k)),a(n(a(O,M),R),n(a(_,A),T))];W=l(t(t(n(W[0],W[0]),n(W[1],W[1])),n(W[2],W[2])));var G=l(t(t(n(T,T),n(R,R)),n(k,k)));return i(W,G)}function C(M,A){for(var S=M.length,O=0,_=0,E=0;E{var{typed:r,config:t,abs:a,add:n,addScalar:i,matrix:u,multiply:l,multiplyScalar:c,divideScalar:o,subtract:s,smaller:m,equalScalar:d,flatten:h,isZero:x,isNumeric:v}=e;return r("intersect",{"Array, Array, Array":y,"Array, Array, Array, Array":w,"Matrix, Matrix, Matrix":function(R,k,W){var G=y(R.valueOf(),k.valueOf(),W.valueOf());return G===null?null:u(G)},"Matrix, Matrix, Matrix, Matrix":function(R,k,W,G){var H=w(R.valueOf(),k.valueOf(),W.valueOf(),G.valueOf());return H===null?null:u(H)}});function y(T,R,k){if(T=C(T),R=C(R),k=C(k),!M(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!M(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!A(k))throw new TypeError("Array with 4 numbers expected as third argument");return E(T[0],T[1],T[2],R[0],R[1],R[2],k[0],k[1],k[2],k[3])}function w(T,R,k,W){if(T=C(T),R=C(R),k=C(k),W=C(W),T.length===2){if(!b(T))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(R))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b(k))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(W))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return S(T,R,k,W)}else if(T.length===3){if(!M(T))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!M(R))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!M(k))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!M(W))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return _(T[0],T[1],T[2],R[0],R[1],R[2],k[0],k[1],k[2],W[0],W[1],W[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function C(T){return T.length===1?T[0]:T.length>1&&Array.isArray(T[0])&&T.every(R=>Array.isArray(R)&&R.length===1)?h(T):T}function b(T){return T.length===2&&v(T[0])&&v(T[1])}function M(T){return T.length===3&&v(T[0])&&v(T[1])&&v(T[2])}function A(T){return T.length===4&&v(T[0])&&v(T[1])&&v(T[2])&&v(T[3])}function S(T,R,k,W){var G=T,H=k,L=s(G,R),q=s(H,W),K=s(c(L[0],q[1]),c(q[0],L[1]));if(x(K)||m(a(K),t.epsilon))return null;var z=c(q[0],G[1]),oe=c(q[1],G[0]),pe=c(q[0],H[1]),ae=c(q[1],H[0]),$=o(i(s(s(z,oe),pe),ae),K);return n(l(L,$),G)}function O(T,R,k,W,G,H,L,q,K,z,oe,pe){var ae=c(s(T,R),s(k,W)),$=c(s(G,H),s(L,q)),le=c(s(K,z),s(oe,pe));return i(i(ae,$),le)}function _(T,R,k,W,G,H,L,q,K,z,oe,pe){var ae=O(T,L,z,L,R,q,oe,q,k,K,pe,K),$=O(z,L,W,T,oe,q,G,R,pe,K,H,k),le=O(T,L,W,T,R,q,G,R,k,K,H,k),Ee=O(z,L,z,L,oe,q,oe,q,pe,K,pe,K),me=O(W,T,W,T,G,R,G,R,H,k,H,k),ge=s(c(ae,$),c(le,Ee)),Se=s(c(me,Ee),c($,$));if(x(Se))return null;var xe=o(ge,Se),be=o(i(ae,c(xe,$)),Ee),De=i(T,c(xe,s(W,T))),Ae=i(R,c(xe,s(G,R))),We=i(k,c(xe,s(H,k))),Je=i(L,c(be,s(z,L))),J=i(q,c(be,s(oe,q))),re=i(K,c(be,s(pe,K)));return d(De,Je)&&d(Ae,J)&&d(We,re)?[De,Ae,We]:null}function E(T,R,k,W,G,H,L,q,K,z){var oe=c(T,L),pe=c(W,L),ae=c(R,q),$=c(G,q),le=c(k,K),Ee=c(H,K),me=s(s(s(z,oe),ae),le),ge=s(s(s(i(i(pe,$),Ee),oe),ae),le),Se=o(me,ge),xe=i(T,c(Se,s(W,T))),be=i(R,c(Se,s(G,R))),De=i(k,c(Se,s(H,k)));return[xe,be,De]}});var X3="sum",J$=["typed","config","add","numeric"],nf=F(X3,J$,e=>{var{typed:r,config:t,add:a,numeric:n}=e;return r(X3,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":u,"...":function(c){if(Ba(c))throw new TypeError("Scalar values expected in function sum");return i(c)}});function i(l){var c;return Nn(l,function(o){try{c=c===void 0?o:a(c,o)}catch(s){throw Et(s,"sum",o)}}),c===void 0&&(c=n(0,t.number)),typeof c=="string"&&(c=n(c,t.number)),c}function u(l,c){try{var o=qo(l,c,a);return o}catch(s){throw Et(s,"sum")}}});var Ag="cumsum",K$=["typed","add","unaryPlus"],af=F(Ag,K$,e=>{var{typed:r,add:t,unaryPlus:a}=e;return r(Ag,{Array:n,Matrix:function(o){return o.create(n(o.valueOf()))},"Array, number | BigNumber":u,"Matrix, number | BigNumber":function(o,s){return o.create(u(o.valueOf(),s))},"...":function(o){if(Ba(o))throw new TypeError("All values expected to be scalar in function cumsum");return n(o)}});function n(c){try{return i(c)}catch(o){throw Et(o,Ag)}}function i(c){if(c.length===0)return[];for(var o=[a(c[0])],s=1;s=s.length)throw new tn(o,s.length);try{return l(c,o)}catch(m){throw Et(m,Ag)}}function l(c,o){var s,m,d;if(o<=0){var h=c[0][0];if(Array.isArray(h)){for(d=Zm(c),m=[],s=0;s{var{typed:r,add:t,divide:a}=e;return r(J3,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":n,"...":function(l){if(Ba(l))throw new TypeError("Scalar values expected in function mean");return i(l)}});function n(u,l){try{var c=qo(u,l,t),o=Array.isArray(u)?ur(u):u.size();return a(c,o[l])}catch(s){throw Et(s,"mean")}}function i(u){var l,c=0;if(Nn(u,function(o){try{l=l===void 0?o:t(l,o),c++}catch(s){throw Et(s,"mean",o)}}),c===0)throw new Error("Cannot calculate the mean of an empty array");return a(l,c)}});var K3="median",eG=["typed","add","divide","compare","partitionSelect"],Mg=F(K3,eG,e=>{var{typed:r,add:t,divide:a,compare:n,partitionSelect:i}=e;function u(o){try{o=gr(o.valueOf());var s=o.length;if(s===0)throw new Error("Cannot calculate median of an empty array");if(s%2===0){for(var m=s/2-1,d=i(o,m+1),h=o[m],x=0;x0&&(h=o[x]);return c(h,d)}else{var v=i(o,(s-1)/2);return l(v)}}catch(y){throw Et(y,"median")}}var l=r({"number | BigNumber | Complex | Unit":function(s){return s}}),c=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(s,m){return a(t(s,m),2)}});return r(K3,{"Array | Matrix":u,"Array | Matrix, number | BigNumber":function(s,m){throw new Error("median(A, dim) is not yet supported")},"...":function(s){if(Ba(s))throw new TypeError("Scalar values expected in function median");return u(s)}})});var j3="mad",rG=["typed","abs","map","median","subtract"],Cg=F(j3,rG,e=>{var{typed:r,abs:t,map:a,median:n,subtract:i}=e;return r(j3,{"Array | Matrix":u,"...":function(c){return u(c)}});function u(l){if(l=gr(l.valueOf()),l.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var c=n(l);return n(a(l,function(o){return t(i(o,c))}))}catch(o){throw o instanceof TypeError&&o.message.indexOf("median")!==-1?new TypeError(o.message.replace("median","mad")):Et(o,"mad")}}});var gD="unbiased",eB="variance",tG=["typed","add","subtract","multiply","divide","apply","isNaN"],sf=F(eB,tG,e=>{var{typed:r,add:t,subtract:a,multiply:n,divide:i,apply:u,isNaN:l}=e;return r(eB,{"Array | Matrix":function(m){return c(m,gD)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(m,d){return o(m,d,gD)},"Array | Matrix, number | BigNumber, string":o,"...":function(m){return c(m,gD)}});function c(s,m){var d,h=0;if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Nn(s,function(y){try{d=d===void 0?y:t(d,y),h++}catch(w){throw Et(w,"variance",y)}}),h===0)throw new Error("Cannot calculate variance of an empty array");var x=i(d,h);if(d=void 0,Nn(s,function(y){var w=a(y,x);d=d===void 0?n(w,w):t(d,n(w,w))}),l(d))return d;switch(m){case"uncorrected":return i(d,h);case"biased":return i(d,h+1);case"unbiased":{var v=rr(d)?d.mul(0):0;return h===1?v:i(d,h-1)}default:throw new Error('Unknown normalization "'+m+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function o(s,m,d){try{if(s.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return u(s,m,h=>c(h,d))}catch(h){throw Et(h,"variance")}}});var rB="quantileSeq",nG=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],uf=F(rB,nG,e=>{var{typed:r,bignumber:t,add:a,subtract:n,divide:i,multiply:u,partitionSelect:l,compare:c,isInteger:o,smaller:s,smallerEq:m,larger:d}=e,h=ko({typed:r,isInteger:o});return r(rB,{"Array | Matrix, number | BigNumber":(C,b)=>v(C,b,!1),"Array | Matrix, number | BigNumber, number":(C,b,M)=>x(C,b,!1,M,v),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(C,b,M,A)=>x(C,b,M,A,v),"Array | Matrix, Array | Matrix":(C,b)=>y(C,b,!1),"Array | Matrix, Array | Matrix, number":(C,b,M)=>x(C,b,!1,M,y),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(C,b,M,A)=>x(C,b,M,A,y)});function x(C,b,M,A,S){return h(C,A,O=>S(O,b,M))}function v(C,b,M){var A,S=C.valueOf();if(s(b,0))throw new Error("N/prob must be non-negative");if(m(b,1))return sr(b)?w(S,b,M):t(w(S,b,M));if(d(b,1)){if(!o(b))throw new Error("N must be a positive integer");if(d(b,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var O=a(b,1);A=[];for(var _=0;s(_,b);_++){var E=i(_+1,O);A.push(w(S,E,M))}return sr(b)?A:t(A)}}function y(C,b,M){for(var A=C.valueOf(),S=b.valueOf(),O=[],_=0;_0&&(T=A[k])}return a(u(T,n(1,E)),u(R,E))}});var tB="std",aG=["typed","map","sqrt","variance"],ff=F(tB,aG,e=>{var{typed:r,map:t,sqrt:a,variance:n}=e;return r(tB,{"Array | Matrix":i,"Array | Matrix, string":i,"Array | Matrix, number | BigNumber":i,"Array | Matrix, number | BigNumber, string":i,"...":function(l){return i(l)}});function i(u,l){if(u.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var c=n.apply(null,arguments);return Nt(c)?t(c,a):a(c)}catch(o){throw o instanceof TypeError&&o.message.indexOf(" variance")!==-1?new TypeError(o.message.replace(" variance"," std")):o}}});var nB="corr",iG=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],Eg=F(nB,iG,e=>{var{typed:r,matrix:t,sqrt:a,sum:n,add:i,subtract:u,multiply:l,pow:c,divide:o}=e;return r(nB,{"Array, Array":function(h,x){return s(h,x)},"Matrix, Matrix":function(h,x){var v=s(h.toArray(),x.toArray());return Array.isArray(v)?t(v):v}});function s(d,h){var x=[];if(Array.isArray(d[0])&&Array.isArray(h[0])){if(d.length!==h.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var v=0;vi(S,l(O,h[_])),0),C=n(d.map(S=>c(S,2))),b=n(h.map(S=>c(S,2))),M=u(l(x,w),l(v,y)),A=a(l(u(l(x,C),c(v,2)),u(l(x,b),c(y,2))));return o(M,A)}});var aB="combinations",oG=["typed"],Tg=F(aB,oG,e=>{var{typed:r}=e;return r(aB,{"number, number":Fw,"BigNumber, BigNumber":function(a,n){var i=a.constructor,u,l,c=a.minus(n),o=new i(1);if(!iB(a)||!iB(n))throw new TypeError("Positive integer value expected in function combinations");if(n.gt(a))throw new TypeError("k must be less than n in function combinations");if(u=o,n.lt(c))for(l=o;l.lte(c);l=l.plus(o))u=u.times(n.plus(l)).dividedBy(l);else for(l=o;l.lte(n);l=l.plus(o))u=u.times(c.plus(l)).dividedBy(l);return u}})});function iB(e){return e.isInteger()&&e.gte(0)}var oB="combinationsWithRep",sG=["typed"],Fg=F(oB,sG,e=>{var{typed:r}=e;return r(oB,{"number, number":function(a,n){if(!Ze(a)||a<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Ze(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(a<1)throw new TypeError("k must be less than or equal to n + k - 1");if(n{var{typed:r,config:t,multiplyScalar:a,pow:n,BigNumber:i,Complex:u}=e;function l(o){if(o.im===0)return Tc(o.re);if(o.re<.5){var s=new u(1-o.re,-o.im),m=new u(Math.PI*o.re,Math.PI*o.im);return new u(Math.PI).div(m.sin()).div(l(s))}o=new u(o.re-1,o.im);for(var d=new u(Ts[0],0),h=1;h2;)d-=2,x+=d,h=h.times(x);return new i(h.toPrecision(i.precision))}});var fB="lgamma",fG=["Complex","typed"],Og=F(fB,fG,e=>{var{Complex:r,typed:t}=e,a=7,n=7,i=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(fB,{number:Fc,Complex:u,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function u(o){var s=6.283185307179586,m=1.1447298858494002,d=.1;if(o.isNaN())return new r(NaN,NaN);if(o.im===0)return new r(Fc(o.re),0);if(o.re>=a||Math.abs(o.im)>=n)return l(o);if(o.re<=d){var h=zA(s,o.im)*Math.floor(.5*o.re+.25),x=o.mul(Math.PI).sin().log(),v=u(new r(1-o.re,-o.im));return new r(m,h).sub(x).sub(v)}else return o.im>=0?c(o):c(o.conjugate()).conjugate()}function l(o){for(var s=o.sub(.5).mul(o.log()).sub(o).add(qw),m=new r(1,0).div(o),d=m.div(o),h=i[0],x=i[1],v=2*d.re,y=d.re*d.re+d.im*d.im,w=2;w<8;w++){var C=x;x=-y*h+i[w],h=v*h+C}var b=m.mul(d.mul(h).add(x));return s.add(b)}function c(o){var s=0,m=0,d=o;for(o=o.add(1);o.re<=a;){d=d.mul(o);var h=d.im<0?1:0;h!==0&&m===0&&s++,m=h,o=o.add(1)}return l(o).sub(d.log()).sub(new r(0,s*2*Math.PI*1))}});var cB="factorial",cG=["typed","gamma"],Bg=F(cB,cG,e=>{var{typed:r,gamma:t}=e;return r(cB,{number:function(n){if(n<0)throw new Error("Value must be non-negative");return t(n+1)},BigNumber:function(n){if(n.isNegative())throw new Error("Value must be non-negative");return t(n.plus(1))},"Array | Matrix":r.referToSelf(a=>n=>je(n,a))})});var lB="kldivergence",lG=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],Pg=F(lB,lG,e=>{var{typed:r,matrix:t,divide:a,sum:n,multiply:i,map:u,dotDivide:l,log:c,isNumeric:o}=e;return r(lB,{"Array, Array":function(d,h){return s(t(d),t(h))},"Matrix, Array":function(d,h){return s(d,t(h))},"Array, Matrix":function(d,h){return s(t(d),h)},"Matrix, Matrix":function(d,h){return s(d,h)}});function s(m,d){var h=d.size().length,x=m.size().length;if(h>1)throw new Error("first object must be one dimensional");if(x>1)throw new Error("second object must be one dimensional");if(h!==x)throw new Error("Length of two vectors must be equal");var v=n(m);if(v===0)throw new Error("Sum of elements in first object must be non zero");var y=n(d);if(y===0)throw new Error("Sum of elements in second object must be non zero");var w=a(m,n(m)),C=a(d,n(d)),b=n(i(w,u(l(w,C),M=>c(M))));return o(b)?b:Number.NaN}});var mB="multinomial",mG=["typed","add","divide","multiply","factorial","isInteger","isPositive"],Ig=F(mB,mG,e=>{var{typed:r,add:t,divide:a,multiply:n,factorial:i,isInteger:u,isPositive:l}=e;return r(mB,{"Array | Matrix":function(o){var s=0,m=1;return Nn(o,function(d){if(!u(d)||!l(d))throw new TypeError("Positive integer value expected in function multinomial");s=t(s,d),m=n(m,i(d))}),a(i(s),m)}})});var pB="permutations",pG=["typed","factorial"],Rg=F(pB,pG,e=>{var{typed:r,factorial:t}=e;return r(pB,{"number | BigNumber":t,"number, number":function(n,i){if(!Ze(n)||n<0)throw new TypeError("Positive integer value expected in function permutations");if(!Ze(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(i>n)throw new TypeError("second argument k must be less than or equal to first argument n");return da(n-i+1,n)},"BigNumber, BigNumber":function(n,i){var u,l;if(!dB(n)||!dB(i))throw new TypeError("Positive integer value expected in function permutations");if(i.gt(n))throw new TypeError("second argument k must be less than or equal to first argument n");var c=n.mul(0).add(1);for(u=c,l=n.minus(i).plus(1);l.lte(n);l=l.plus(1))u=u.times(l);return u}})});function dB(e){return e.isInteger()&&e.gte(0)}var ND=ca(_B(),1),bG=(0,ND.default)(Date.now());function to(e){var r;function t(n){r=n===null?bG:(0,ND.default)(String(n))}t(e);function a(){return r()}return a}var OB="pickRandom",wG=["typed","config","?on"],kg=F(OB,wG,e=>{var{typed:r,config:t,on:a}=e,n=to(t.randomSeed);return a&&a("config",function(u,l){u.randomSeed!==l.randomSeed&&(n=to(u.randomSeed))}),r(OB,{"Array | Matrix":function(l){return i(l,{})},"Array | Matrix, Object":function(l,c){return i(l,c)},"Array | Matrix, number":function(l,c){return i(l,{number:c})},"Array | Matrix, Array | Matrix":function(l,c){return i(l,{weights:c})},"Array | Matrix, Array | Matrix, number":function(l,c,o){return i(l,{number:o,weights:c})},"Array | Matrix, number, Array | Matrix":function(l,c,o){return i(l,{number:c,weights:o})}});function i(u,l){var{number:c,weights:o,elementWise:s=!0}=l,m=typeof c>"u";m&&(c=1);var d=Qe(u)?u.create:Qe(o)?o.create:null;u=u.valueOf(),o&&(o=o.valueOf()),s===!0&&(u=gr(u),o=gr(o));var h=0;if(typeof o<"u"){if(o.length!==u.length)throw new Error("Weights must have the same length as possibles");for(var x=0,v=o.length;x"u")C=u[Math.floor(n()*y)];else for(var b=n()*h,M=0,A=u.length;M1)for(var a=0,n=e.shift();a{var{typed:r,config:t,on:a}=e,n=to(t.randomSeed);return a&&a("config",function(l,c){l.randomSeed!==c.randomSeed&&(n=to(l.randomSeed))}),r(BB,{"":()=>u(0,1),number:l=>u(0,l),"number, number":(l,c)=>u(l,c),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,c)=>i(l,0,c),"Array | Matrix, number, number":(l,c,o)=>i(l,c,o)});function i(l,c,o){var s=Ic(l.valueOf(),()=>u(c,o));return Qe(l)?l.create(s):s}function u(l,c){return l+n()*(c-l)}});var PB="randomInt",SG=["typed","config","?on"],zg=F(PB,SG,e=>{var{typed:r,config:t,on:a}=e,n=to(t.randomSeed);return a&&a("config",function(l,c){l.randomSeed!==c.randomSeed&&(n=to(l.randomSeed))}),r(PB,{"":()=>u(0,1),number:l=>u(0,l),"number, number":(l,c)=>u(l,c),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,c)=>i(l,0,c),"Array | Matrix, number, number":(l,c,o)=>i(l,c,o)});function i(l,c,o){var s=Ic(l.valueOf(),()=>u(c,o));return Qe(l)?l.create(s):s}function u(l,c){return Math.floor(l+n()*(c-l))}});var IB="stirlingS2",NG=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],Ug=F(IB,NG,e=>{var{typed:r,addScalar:t,subtractScalar:a,multiplyScalar:n,divideScalar:i,pow:u,factorial:l,combinations:c,isNegative:o,isInteger:s,number:m,bignumber:d,larger:h}=e,x=[],v=[];return r(IB,{"number | BigNumber, number | BigNumber":function(w,C){if(!s(w)||o(w)||!s(C)||o(C))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(h(C,w))throw new TypeError("k must be less than or equal to n in function stirlingS2");var b=!(sr(w)&&sr(C)),M=b?v:x,A=b?d:m,S=m(w),O=m(C);if(M[S]&&M[S].length>O)return M[S][O];for(var _=0;_<=S;++_)if(M[_]||(M[_]=[A(_===0?1:0)]),_!==0)for(var E=M[_],T=M[_-1],R=E.length;R<=_&&R<=O;++R)R===_?E[R]=1:E[R]=t(n(A(R),T[R]),T[R-1]);return M[S][O]}})});var RB="bellNumbers",AG=["typed","addScalar","isNegative","isInteger","stirlingS2"],Wg=F(RB,AG,e=>{var{typed:r,addScalar:t,isNegative:a,isInteger:n,stirlingS2:i}=e;return r(RB,{"number | BigNumber":function(l){if(!n(l)||a(l))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var c=0,o=0;o<=l;o++)c=t(c,i(l,o));return c}})});var qB="catalan",MG=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],Yg=F(qB,MG,e=>{var{typed:r,addScalar:t,divideScalar:a,multiplyScalar:n,combinations:i,isNegative:u,isInteger:l}=e;return r(qB,{"number | BigNumber":function(o){if(!l(o)||u(o))throw new TypeError("Non-negative integer value expected in function catalan");return a(i(n(o,2),o),t(o,1))}})});var kB="composition",CG=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],Hg=F(kB,CG,e=>{var{typed:r,addScalar:t,combinations:a,isPositive:n,isNegative:i,isInteger:u,larger:l}=e;return r(kB,{"number | BigNumber, number | BigNumber":function(o,s){if(!u(o)||!n(o)||!u(s)||!n(s))throw new TypeError("Positive integer value expected in function composition");if(l(s,o))throw new TypeError("k must be less than or equal to n in function composition");return a(t(o,-1),t(s,-1))}})});var LB="leafCount",EG=["parse","typed"],$g=F(LB,EG,e=>{var{parse:r,typed:t}=e;function a(n){var i=0;return n.forEach(u=>{i+=a(u)}),i||1}return t(LB,{Node:function(i){return a(i)}})});function AD(e){return yr(e)||ct(e)&&e.isUnary()&&yr(e.args[0])}function Rc(e){return!!(yr(e)||(gn(e)||ct(e))&&e.args.every(Rc)||en(e)&&Rc(e.content))}function zB(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,a)}return t}function MD(e){for(var r=1;r{var{FunctionNode:r,OperatorNode:t,SymbolNode:a}=e,n=!0,i=!1,u="defaultF",l={add:{trivial:n,total:n,commutative:n,associative:n},unaryPlus:{trivial:n,total:n,commutative:n,associative:n},subtract:{trivial:i,total:n,commutative:i,associative:i},multiply:{trivial:n,total:n,commutative:n,associative:n},divide:{trivial:i,total:n,commutative:i,associative:i},paren:{trivial:n,total:n,commutative:n,associative:i},defaultF:{trivial:i,total:n,commutative:i,associative:i}},c={divide:{total:i},log:{total:i}},o={subtract:{total:i},abs:{trivial:n},log:{total:n}};function s(b,M){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l,S=u;if(typeof b=="string"?S=b:ct(b)?S=b.fn.toString():gn(b)?S=b.name:en(b)&&(S="paren"),Xe(A,S)){var O=A[S];if(Xe(O,M))return O[M];if(Xe(l,S))return l[S][M]}if(Xe(A,u)){var _=A[u];return Xe(_,M)?_[M]:l[u][M]}if(Xe(l,S)){var E=l[S];if(Xe(E,M))return E[M]}return l[u][M]}function m(b){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return s(b,"commutative",M)}function d(b){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return s(b,"associative",M)}function h(b,M){var A=MD({},b);for(var S in M)Xe(b,S)?A[S]=MD(MD({},M[S]),b[S]):A[S]=M[S];return A}function x(b,M){if(!b.args||b.args.length===0)return b;b.args=v(b,M);for(var A=0;A2&&d(b,M)){for(var _=b.args.pop();b.args.length>0;)_=A([b.args.pop(),_]);b.args=_.args}}}function w(b,M){if(!(!b.args||b.args.length===0)){for(var A=C(b),S=b.args.length,O=0;O2&&d(b,M)){for(var _=b.args.shift();b.args.length>0;)_=A([_,b.args.shift()]);b.args=_.args}}}function C(b){return ct(b)?function(M){try{return new t(b.op,b.fn,M,b.implicit)}catch(A){return console.error(A),[]}}:function(M){return new r(new a(b.name),M)}}return{createMakeNodeFunction:C,hasProperty:s,isCommutative:m,isAssociative:d,mergeContext:h,flatten:x,allChildren:v,unflattenr:y,unflattenl:w,defaultContext:l,realContext:c,positiveContext:o}});var _G="simplify",OG=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Gg=F(_G,OG,e=>{var{config:r,typed:t,parse:a,add:n,subtract:i,multiply:u,divide:l,pow:c,isZero:o,equal:s,resolve:m,simplifyConstant:d,simplifyCore:h,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:M,FunctionNode:A,IndexNode:S,ObjectNode:O,OperatorNode:_,ParenthesisNode:E,SymbolNode:T}=e,{hasProperty:R,isCommutative:k,isAssociative:W,mergeContext:G,flatten:H,unflattenr:L,unflattenl:q,createMakeNodeFunction:K,defaultContext:z,realContext:oe,positiveContext:pe}=cf({FunctionNode:A,OperatorNode:_,SymbolNode:T});t.addConversion({from:"Object",to:"Map",convert:Ki});var ae=t("simplify",{Node:xe,"Node, Map":(j,ne)=>xe(j,!1,ne),"Node, Map, Object":(j,ne,ue)=>xe(j,!1,ne,ue),"Node, Array":xe,"Node, Array, Map":xe,"Node, Array, Map, Object":xe});t.removeConversion({from:"Object",to:"Map",convert:Ki}),ae.defaultContext=z,ae.realContext=oe,ae.positiveContext=pe;function $(j){return j.transform(function(ne,ue,Me){return en(ne)?$(ne.content):ne})}var le={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};ae.rules=[h,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},d,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},d,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function Ee(j,ne){var ue={};if(j.s){var Me=j.s.split("->");if(Me.length===2)ue.l=Me[0],ue.r=Me[1];else throw SyntaxError("Could not parse rule: "+j.s)}else ue.l=j.l,ue.r=j.r;ue.l=$(a(ue.l)),ue.r=$(a(ue.r));for(var Ce of["imposeContext","repeat","assuming"])Ce in j&&(ue[Ce]=j[Ce]);if(j.evaluate&&(ue.evaluate=a(j.evaluate)),W(ue.l,ne)){var Le=!k(ue.l,ne),Ie;Le&&(Ie=Se());var fr=K(ue.l),or=Se();ue.expanded={},ue.expanded.l=fr([ue.l,or]),H(ue.expanded.l,ne),L(ue.expanded.l,ne),ue.expanded.r=fr([ue.r,or]),Le&&(ue.expandedNC1={},ue.expandedNC1.l=fr([Ie,ue.l]),ue.expandedNC1.r=fr([Ie,ue.r]),ue.expandedNC2={},ue.expandedNC2.l=fr([Ie,ue.expanded.l]),ue.expandedNC2.r=fr([Ie,ue.expanded.r]))}return ue}function me(j,ne){for(var ue=[],Me=0;Me2&&arguments[2]!==void 0?arguments[2]:Oo(),Me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Ce=Me.consoleDebug;ne=me(ne||ae.rules,Me.context);var Le=m(j,ue);Le=$(Le);for(var Ie={},fr=Le.toString({parenthesis:"all"});!Ie[fr];){Ie[fr]=!0,ge=0;var or=fr;Ce&&console.log("Working on: ",fr);for(var Ke=0;Ke ").concat(ne[Ke].r.toString()))),Ce){var ee=Le.toString({parenthesis:"all"});ee!==or&&(console.log("Applying",Pr,"produced",ee),or=ee)}q(Le,Me.context)}fr=Le.toString({parenthesis:"all"})}return Le}function be(j,ne,ue){var Me=j;if(j)for(var Ce=0;Ce1&&(or=Le(j.args.slice(0,fr))),Ce=j.args.slice(fr),Me=Ce.length===1?Ce[0]:Le(Ce),ue.push(Le([or,Me]))}return ue}function We(j,ne){var ue={placeholders:{}};if(!j.placeholders&&!ne.placeholders)return ue;if(j.placeholders){if(!ne.placeholders)return j}else return ne;for(var Me in j.placeholders)if(Xe(j.placeholders,Me)&&(ue.placeholders[Me]=j.placeholders[Me],Xe(ne.placeholders,Me)&&!ye(j.placeholders[Me],ne.placeholders[Me])))return null;for(var Ce in ne.placeholders)Xe(ne.placeholders,Ce)&&(ue.placeholders[Ce]=ne.placeholders[Ce]);return ue}function Je(j,ne){var ue=[];if(j.length===0||ne.length===0)return ue;for(var Me,Ce=0;Ce2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var or=re(j.args[0],ne.args[1],ue);if(or.length===0)return[];var Ke=re(j.args[1],ne.args[0],ue);if(Ke.length===0)return[];Le=[or,Ke]}Ce=J(Le)}else if(ne.args.length>=2&&j.args.length===2){for(var Pr=Ae(ne,ue),ee=[],ce=0;ce2)throw Error("Unexpected non-binary associative function: "+j.toString());return[]}}else if(j instanceof T){if(j.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(le[j.name]){if(j.name!==ne.name)return[]}else switch(j.name[1]>="a"&&j.name[1]<="z"?j.name.substring(0,2):j.name[0]){case"n":case"_p":Ce[0].placeholders[j.name]=ne;break;case"c":case"cl":if(yr(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"v":if(!yr(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"vl":if(nt(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"cd":if(AD(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"vd":if(!AD(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"ce":if(Rc(ne))Ce[0].placeholders[j.name]=ne;else return[];break;case"ve":if(!Rc(ne))Ce[0].placeholders[j.name]=ne;else return[];break;default:throw new Error("Invalid symbol in rule: "+j.name)}}else if(j instanceof M){if(!s(j.value,ne.value))return[]}else return[];return Ce}function ye(j,ne){if(j instanceof M&&ne instanceof M){if(!s(j.value,ne.value))return!1}else if(j instanceof T&&ne instanceof T){if(j.name!==ne.name)return!1}else if(j instanceof _&&ne instanceof _||j instanceof A&&ne instanceof A){if(j instanceof _){if(j.op!==ne.op||j.fn!==ne.fn)return!1}else if(j instanceof A&&j.name!==ne.name)return!1;if(j.args.length!==ne.args.length)return!1;for(var ue=0;ue{var{typed:r,config:t,mathWithTransform:a,matrix:n,fraction:i,bignumber:u,AccessorNode:l,ArrayNode:c,ConstantNode:o,FunctionNode:s,IndexNode:m,ObjectNode:d,OperatorNode:h,SymbolNode:x}=e,{isCommutative:v,isAssociative:y,allChildren:w,createMakeNodeFunction:C}=cf({FunctionNode:s,OperatorNode:h,SymbolNode:x}),b=r("simplifyConstant",{Node:H=>O(G(H,{})),"Node, Object":function(L,q){return O(G(L,q))}});function M(H){return ma(H)?H.valueOf():H instanceof Array?H.map(M):Qe(H)?n(M(H.valueOf())):H}function A(H,L,q){try{return a[H].apply(null,L)}catch{return L=L.map(M),E(a[H].apply(null,L),q)}}var S=r({Fraction:R,number:function(L){return L<0?T(new o(-L)):new o(L)},BigNumber:function(L){return L<0?T(new o(-L)):new o(L)},Complex:function(L){throw new Error("Cannot convert Complex number to Node")},string:function(L){return new o(L)},Matrix:function(L){return new c(L.valueOf().map(q=>S(q)))}});function O(H){return Nr(H)?H:S(H)}function _(H,L){var q=L&&L.exactFractions!==!1;if(q&&isFinite(H)&&i){var K=i(H),z=L&&typeof L.fractionsLimit=="number"?L.fractionsLimit:1/0;if(K.valueOf()===H&&K.n0;)if(yr(K[0])&&typeof K[0].value!="string"){var z=E(K.shift().value,q);jt(H)?H=H.items[z-1]:(H=H.valueOf()[z-1],H instanceof Array&&(H=n(H)))}else if(K.length>1&&yr(K[1])&&typeof K[1].value!="string"){var oe=E(K[1].value,q),pe=[],ae=jt(H)?H.items:H.valueOf();for(var $ of ae)if(jt($))pe.push($.items[oe-1]);else if(Qe(H))pe.push($[oe-1]);else break;if(pe.length===ae.length)jt(H)?H=new c(pe):H=n(pe),K.splice(1,1);else break}else break;return K.length===L.dimensions.length?new l(O(H),L):K.length>0?(L=new m(K),new l(O(H),L)):H}if(Mi(H)&&L.dimensions.length===1&&yr(L.dimensions[0])){var le=L.dimensions[0].value;return le in H.properties?H.properties[le]:new o}return new l(O(H),L)}function W(H,L,q,K){var z=L.shift(),oe=L.reduce((pe,ae)=>{if(!Nr(ae)){var $=pe.pop();if(Nr($))return[$,ae];try{return pe.push(A(H,[$,ae],K)),pe}catch{pe.push($)}}pe.push(O(pe.pop()));var le=pe.length===1?pe[0]:q(pe);return[q([le,O(ae)])]},[z]);return oe.length===1?oe[0]:q([oe[0],S(oe[1])])}function G(H,L){switch(H.type){case"SymbolNode":return H;case"ConstantNode":switch(typeof H.value){case"number":return E(H.value,L);case"string":return H.value;default:if(!isNaN(H.value))return E(H.value,L)}return H;case"FunctionNode":if(a[H.name]&&a[H.name].rawArgs)return H;{var q=["add","multiply"];if(q.indexOf(H.name)===-1){var K=H.args.map(De=>G(De,L));if(!K.some(Nr))try{return A(H.name,K,L)}catch{}if(H.name==="size"&&K.length===1&&jt(K[0])){for(var z=[],oe=K[0];jt(oe);)z.push(oe.items.length),oe=oe.items[0];return n(z)}return new s(H.name,K.map(O))}}case"OperatorNode":{var pe=H.fn.toString(),ae,$,le=C(H);if(ct(H)&&H.isUnary())ae=[G(H.args[0],L)],Nr(ae[0])?$=le(ae):$=A(pe,ae,L);else if(y(H,L.context))if(ae=w(H,L.context),ae=ae.map(De=>G(De,L)),v(pe,L.context)){for(var Ee=[],me=[],ge=0;ge1?($=W(pe,Ee,le,L),me.unshift($),$=W(pe,me,le,L)):$=W(pe,ae,le,L)}else $=W(pe,ae,le,L);else ae=H.args.map(De=>G(De,L)),$=W(pe,ae,le,L);return $}case"ParenthesisNode":return G(H.content,L);case"AccessorNode":return k(G(H.object,L),G(H.index,L),L);case"ArrayNode":{var Se=H.items.map(De=>G(De,L));return Se.some(Nr)?new c(Se.map(O)):n(Se)}case"IndexNode":return new m(H.dimensions.map(De=>b(De,L)));case"ObjectNode":{var xe={};for(var be in H.properties)xe[be]=b(H.properties[be],L);return new d(xe)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(H.type))}}return b});var UB="simplifyCore",IG=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],Zg=F(UB,IG,e=>{var{typed:r,parse:t,equal:a,isZero:n,add:i,subtract:u,multiply:l,divide:c,pow:o,AccessorNode:s,ArrayNode:m,ConstantNode:d,FunctionNode:h,IndexNode:x,ObjectNode:v,OperatorNode:y,ParenthesisNode:w,SymbolNode:C}=e,b=new d(0),M=new d(1),A=new d(!0),S=new d(!1);function O(R){return ct(R)&&["and","not","or"].includes(R.op)}var{hasProperty:_,isCommutative:E}=cf({FunctionNode:h,OperatorNode:y,SymbolNode:C});function T(R){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=k?k.context:void 0;if(_(R,"trivial",W)){if(gn(R)&&R.args.length===1)return T(R.args[0],k);var G=!1,H=0;if(R.forEach(me=>{++H,H===1&&(G=T(me,k))}),H===1)return G}var L=R;if(gn(L)){var q=kE(L.name);if(q){if(L.args.length>2&&_(L,"associative",W))for(;L.args.length>2;){var K=L.args.pop(),z=L.args.pop();L.args.push(new y(q,L.name,[K,z]))}L=new y(q,L.name,L.args)}else return new h(T(L.fn),L.args.map(me=>T(me,k)))}if(ct(L)&&L.isUnary()){var oe=T(L.args[0],k);if(L.op==="~"&&ct(oe)&&oe.isUnary()&&oe.op==="~"||L.op==="not"&&ct(oe)&&oe.isUnary()&&oe.op==="not"&&O(oe.args[0]))return oe.args[0];var pe=!0;if(L.op==="-"&&ct(oe)&&(oe.isBinary()&&oe.fn==="subtract"&&(L=new y("-","subtract",[oe.args[1],oe.args[0]]),pe=!1),oe.isUnary()&&oe.op==="-"))return oe.args[0];if(pe)return new y(L.op,L.fn,[oe])}if(ct(L)&&L.isBinary()){var ae=T(L.args[0],k),$=T(L.args[1],k);if(L.op==="+"){if(yr(ae)&&n(ae.value))return $;if(yr($)&&n($.value))return ae;ct($)&&$.isUnary()&&$.op==="-"&&($=$.args[0],L=new y("-","subtract",[ae,$]))}if(L.op==="-")return ct($)&&$.isUnary()&&$.op==="-"?T(new y("+","add",[ae,$.args[0]]),k):yr(ae)&&n(ae.value)?T(new y("-","unaryMinus",[$])):yr($)&&n($.value)?ae:new y(L.op,L.fn,[ae,$]);if(L.op==="*"){if(yr(ae)){if(n(ae.value))return b;if(a(ae.value,1))return $}if(yr($)){if(n($.value))return b;if(a($.value,1))return ae;if(E(L,W))return new y(L.op,L.fn,[$,ae],L.implicit)}return new y(L.op,L.fn,[ae,$],L.implicit)}if(L.op==="/")return yr(ae)&&n(ae.value)?b:yr($)&&a($.value,1)?ae:new y(L.op,L.fn,[ae,$]);if(L.op==="^"&&yr($)){if(n($.value))return M;if(a($.value,1))return ae}if(L.op==="and"){if(yr(ae))if(ae.value){if(O($))return $;if(yr($))return $.value?A:S}else return S;if(yr($))if($.value){if(O(ae))return ae}else return S}if(L.op==="or"){if(yr(ae)){if(ae.value)return A;if(O($))return $}if(yr($)){if($.value)return A;if(O(ae))return ae}}return new y(L.op,L.fn,[ae,$])}if(ct(L))return new y(L.op,L.fn,L.args.map(me=>T(me,k)));if(jt(L))return new m(L.items.map(me=>T(me,k)));if(qn(L))return new s(T(L.object,k),T(L.index,k));if(Qn(L))return new x(L.dimensions.map(me=>T(me,k)));if(Mi(L)){var le={};for(var Ee in L.properties)le[Ee]=T(L.properties[Ee],k);return new v(le)}return L}return r(UB,{Node:T,"Node,Object":T})});var RG="resolve",qG=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],Qg=F(RG,qG,e=>{var{typed:r,parse:t,ConstantNode:a,FunctionNode:n,OperatorNode:i,ParenthesisNode:u}=e;function l(c,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!o)return c;if(nt(c)){if(s.has(c.name)){var m=Array.from(s).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(m,"}"))}var d=o.get(c.name);if(Nr(d)){var h=new Set(s);return h.add(c.name),l(d,o,h)}else return typeof d=="number"?t(String(d)):d!==void 0?new a(d):c}else if(ct(c)){var x=c.args.map(function(y){return l(y,o,s)});return new i(c.op,c.fn,x,c.implicit)}else{if(en(c))return new u(l(c.content,o,s));if(gn(c)){var v=c.args.map(function(y){return l(y,o,s)});return new n(c.name,v)}}return c.map(y=>l(y,o,s))}return r("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(c,o)=>l(c,Ki(o)),"Array | Matrix":r.referToSelf(c=>o=>o.map(s=>c(s))),"Array | Matrix, null | undefined":r.referToSelf(c=>o=>o.map(s=>c(s))),"Array, Object":r.referTo("Array,Map",c=>(o,s)=>c(o,Ki(s))),"Matrix, Object":r.referTo("Matrix,Map",c=>(o,s)=>c(o,Ki(s))),"Array | Matrix, Map":r.referToSelf(c=>(o,s)=>o.map(m=>c(m,s)))})});var WB="symbolicEqual",kG=["parse","simplify","typed","OperatorNode"],Xg=F(WB,kG,e=>{var{parse:r,simplify:t,typed:a,OperatorNode:n}=e;function i(u,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=new n("-","subtract",[u,l]),s=t(o,{},c);return yr(s)&&!s.value}return a(WB,{"Node, Node":i,"Node, Node, Object":i})});var YB="derivative",LG=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],Jg=F(YB,LG,e=>{var{typed:r,config:t,parse:a,simplify:n,equal:i,isZero:u,numeric:l,ConstantNode:c,FunctionNode:o,OperatorNode:s,ParenthesisNode:m,SymbolNode:d}=e;function h(b,M){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},S={};y(S,b,M.name);var O=w(b,S);return A.simplify?n(O):O}r.addConversion({from:"identifier",to:"SymbolNode",convert:a});var x=r(YB,{"Node, SymbolNode":h,"Node, SymbolNode, Object":h});r.removeConversion({from:"identifier",to:"SymbolNode",convert:a}),x._simplify=!0,x.toTex=function(b){return v.apply(null,b.args)};var v=r("_derivTex",{"Node, SymbolNode":function(M,A){return yr(M)&&Fr(M.value)==="string"?v(a(M.value).toString(),A.toString(),1):v(M.toTex(),A.toString(),1)},"Node, ConstantNode":function(M,A){if(Fr(A.value)==="string")return v(M,a(A.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(M,A,S){return v(M.toString(),A.name,S.value)},"string, string, number":function(M,A,S){var O;return S===1?O="{d\\\\over d"+A+"}":O="{d^{"+S+"}\\\\over d"+A+"^{"+S+"}}",O+"\\\\left[".concat(M,"\\\\right]")}}),y=r("constTag",{"Object, ConstantNode, string":function(M,A){return M[A]=!0,!0},"Object, SymbolNode, string":function(M,A,S){return A.name!==S?(M[A]=!0,!0):!1},"Object, ParenthesisNode, string":function(M,A,S){return y(M,A.content,S)},"Object, FunctionAssignmentNode, string":function(M,A,S){return A.params.indexOf(S)===-1?(M[A]=!0,!0):y(M,A.expr,S)},"Object, FunctionNode | OperatorNode, string":function(M,A,S){if(A.args.length>0){for(var O=y(M,A.args[0],S),_=1;_0){var O=M.args.filter(function(H){return A[H]===void 0}),_=O.length===1?O[0]:new s("*","multiply",O),E=S.concat(w(_,A));return new s("*","multiply",E)}return new s("+","add",M.args.map(function(H){return new s("*","multiply",M.args.map(function(L){return L===H?w(L,A):L.clone()}))}))}if(M.op==="/"&&M.isBinary()){var T=M.args[0],R=M.args[1];return A[R]!==void 0?new s("/","divide",[w(T,A),R]):A[T]!==void 0?new s("*","multiply",[new s("-","unaryMinus",[T]),new s("/","divide",[w(R,A),new s("^","pow",[R.clone(),C(2)])])]):new s("/","divide",[new s("-","subtract",[new s("*","multiply",[w(T,A),R.clone()]),new s("*","multiply",[T.clone(),w(R,A)])]),new s("^","pow",[R.clone(),C(2)])])}if(M.op==="^"&&M.isBinary()){var k=M.args[0],W=M.args[1];if(A[k]!==void 0)return yr(k)&&(u(k.value)||i(k.value,1))?C(0):new s("*","multiply",[M,new s("*","multiply",[new o("log",[k.clone()]),w(W.clone(),A)])]);if(A[W]!==void 0){if(yr(W)){if(u(W.value))return C(0);if(i(W.value,1))return w(k,A)}var G=new s("^","pow",[k.clone(),new s("-","subtract",[W,C(1)])]);return new s("*","multiply",[W.clone(),new s("*","multiply",[w(k,A),G])])}return new s("*","multiply",[new s("^","pow",[k.clone(),W.clone()]),new s("+","add",[new s("*","multiply",[w(k,A),new s("/","divide",[W.clone(),k.clone()])]),new s("*","multiply",[w(W,A),new o("log",[k.clone()])])])])}throw new Error('Cannot process operator "'+M.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function C(b,M){return new c(l(b,M||t.number))}return x});var HB="rationalize",zG=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],Kg=F(HB,zG,e=>{var{config:r,typed:t,equal:a,isZero:n,add:i,subtract:u,multiply:l,divide:c,pow:o,parse:s,simplifyConstant:m,simplifyCore:d,simplify:h,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:C,ArrayNode:b,ConstantNode:M,FunctionNode:A,IndexNode:S,ObjectNode:O,OperatorNode:_,SymbolNode:E,ParenthesisNode:T}=e;function R(L){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,z=W(),oe=k(L,q,!0,z.firstRules),pe=oe.variables.length,ae={exactFractions:!1},$={exactFractions:!0};if(L=oe.expression,pe>=1){L=G(L);var le,Ee,me=!0,ge=!1;L=h(L,z.firstRules,{},ae);for(var Se;Ee=me?z.distrDivRules:z.sucDivRules,L=h(L,Ee,{},$),me=!me,Se=L.toString(),Se!==le;)ge=!0,le=Se;ge&&(L=h(L,z.firstRulesAgain,{},ae)),L=h(L,z.finalRules,{},ae)}var xe=[],be={};return L.type==="OperatorNode"&&L.isBinary()&&L.op==="/"?(pe===1&&(L.args[0]=H(L.args[0],xe),L.args[1]=H(L.args[1])),K&&(be.numerator=L.args[0],be.denominator=L.args[1])):(pe===1&&(L=H(L,xe)),K&&(be.numerator=L,be.denominator=null)),K?(be.coefficients=xe,be.variables=oe.variables,be.expression=L,be):L}return t(HB,{Node:R,"Node, boolean":(L,q)=>R(L,{},q),"Node, Object":R,"Node, Object, boolean":R});function k(L,q,K,z){var oe=[],pe=h(L,z,q,{exactFractions:!1});K=!!K;var ae="+-*"+(K?"/":"");le(pe);var $={};return $.expression=pe,$.variables=oe,$;function le(Ee){var me=Ee.type;if(me==="FunctionNode")throw new Error("There is an unsolved function call");if(me==="OperatorNode")if(Ee.op==="^"){if(Ee.args[1].type!=="ConstantNode"||!Ze(parseFloat(Ee.args[1].value)))throw new Error("There is a non-integer exponent");le(Ee.args[0])}else{if(ae.indexOf(Ee.op)===-1)throw new Error("Operator "+Ee.op+" invalid in polynomial expression");for(var ge=0;ge1;if(z==="OperatorNode"&&L.isBinary()){var pe=!1,ae;if(L.op==="^"&&(L.args[0].type==="ParenthesisNode"||L.args[0].type==="OperatorNode")&&L.args[1].type==="ConstantNode"&&(ae=parseFloat(L.args[1].value),pe=ae>=2&&Ze(ae)),pe){if(ae>2){var $=L.args[0],le=new _("^","pow",[L.args[0].cloneDeep(),new M(ae-1)]);L=new _("*","multiply",[$,le])}else L=new _("*","multiply",[L.args[0],L.args[0].cloneDeep()]);oe&&(K==="content"?q.content=L:q.args[K]=L)}}if(z==="ParenthesisNode")G(L.content,L,"content");else if(z!=="ConstantNode"&&z!=="SymbolNode")for(var Ee=0;Ee=0;$--)if(q[$]!==0){var le=new M(pe?q[$]:Math.abs(q[$])),Ee=q[$]<0?"-":"+";if($>0){var me=new E(oe);if($>1){var ge=new M($);me=new _("^","pow",[me,ge])}q[$]===-1&&pe?le=new _("-","unaryMinus",[me]):Math.abs(q[$])===1?le=me:le=new _("*","multiply",[le,me])}pe?ae=le:Ee==="+"?ae=new _("+","add",[ae,le]):ae=new _("-","subtract",[ae,le]),pe=!1}if(pe)return new M(0);return ae;function Se(xe,be,De){var Ae=xe.type;if(Ae==="FunctionNode")throw new Error("There is an unsolved function call");if(Ae==="OperatorNode"){if("+-*^".indexOf(xe.op)===-1)throw new Error("Operator "+xe.op+" invalid");if(be!==null){if((xe.fn==="unaryMinus"||xe.fn==="pow")&&be.fn!=="add"&&be.fn!=="subtract"&&be.fn!=="multiply")throw new Error("Invalid "+xe.op+" placing");if((xe.fn==="subtract"||xe.fn==="add"||xe.fn==="multiply")&&be.fn!=="add"&&be.fn!=="subtract")throw new Error("Invalid "+xe.op+" placing");if((xe.fn==="subtract"||xe.fn==="add"||xe.fn==="unaryMinus")&&De.noFil!==0)throw new Error("Invalid "+xe.op+" placing")}(xe.op==="^"||xe.op==="*")&&(De.fire=xe.op);for(var We=0;Wez&&(q[Je]=0),q[Je]+=De.cte*(De.oper==="+"?1:-1),z=Math.max(Je,z);return}De.cte=Je,De.fire===""&&(q[0]+=De.cte*(De.oper==="+"?1:-1))}else throw new Error("Type "+Ae+" is not allowed")}}});var $B="zpk2tf",UG=["typed","add","multiply","Complex","number"],jg=F($B,UG,e=>{var{typed:r,add:t,multiply:a,Complex:n,number:i}=e;return r($B,{"Array,Array,number":function(o,s,m){return u(o,s,m)},"Array,Array":function(o,s){return u(o,s,1)},"Matrix,Matrix,number":function(o,s,m){return u(o.valueOf(),s.valueOf(),m)},"Matrix,Matrix":function(o,s){return u(o.valueOf(),s.valueOf(),1)}});function u(c,o,s){c.some(C=>C.type==="BigNumber")&&(c=c.map(C=>i(C))),o.some(C=>C.type==="BigNumber")&&(o=o.map(C=>i(C)));for(var m=[n(1,0)],d=[n(1,0)],h=0;h=0&&m-d{var{typed:r,add:t,multiply:a,Complex:n,divide:i,matrix:u}=e;return r(GB,{"Array, Array":function(s,m){var d=c(512);return l(s,m,d)},"Array, Array, Array":function(s,m,d){return l(s,m,d)},"Array, Array, number":function(s,m,d){if(d<0)throw new Error("w must be a positive number");var h=c(d);return l(s,m,h)},"Matrix, Matrix":function(s,m){var d=c(512),{w:h,h:x}=l(s.valueOf(),m.valueOf(),d);return{w:u(h),h:u(x)}},"Matrix, Matrix, Matrix":function(s,m,d){var{h}=l(s.valueOf(),m.valueOf(),d.valueOf());return{h:u(h),w:u(d)}},"Matrix, Matrix, number":function(s,m,d){if(d<0)throw new Error("w must be a positive number");var h=c(d),{h:x}=l(s.valueOf(),m.valueOf(),h);return{h:u(x),w:u(h)}}});function l(o,s,m){for(var d=[],h=[],x=0;x{var{classes:r}=e;return function(a,n){var i=r[n&&n.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(n):n}});var $G="replacer",GG=[],t0=F($G,GG,()=>function(r,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t});var VB="12.4.1";var n0=F("true",[],()=>!0),a0=F("false",[],()=>!1),i0=F("null",[],()=>null),o0=va("Infinity",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1/0):1/0}),s0=va("NaN",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(NaN):NaN}),u0=va("pi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?Bc(t):CM}),f0=va("tau",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?QC(t):EM}),c0=va("e",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?VC(t):TM}),l0=va("phi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?ZC(t):FM}),m0=va("LN2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).ln():Math.LN2}),p0=va("LN10",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(10).ln():Math.LN10}),d0=va("LOG2E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),h0=va("LOG10E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),v0=va("SQRT1_2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),g0=va("SQRT2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),x0=va("i",["Complex"],e=>{var{Complex:r}=e;return r.I}),ZB=F("PI",["pi"],e=>{var{pi:r}=e;return r}),QB=F("E",["e"],e=>{var{e:r}=e;return r}),y0=F("version",[],()=>VB);function va(e,r,t){return F(e,r,t,{recreateOnConfigChange:!0})}var b0=Er("speedOfLight","299792458","m s^-1"),w0=Er("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),D0=Er("planckConstant","6.62607015e-34","J s"),S0=Er("reducedPlanckConstant","1.0545718176461565e-34","J s"),N0=Er("magneticConstant","1.25663706212e-6","N A^-2"),A0=Er("electricConstant","8.8541878128e-12","F m^-1"),M0=Er("vacuumImpedance","376.730313667","ohm"),C0=Er("coulomb","8.987551792261171e9","N m^2 C^-2"),E0=Er("elementaryCharge","1.602176634e-19","C"),T0=Er("bohrMagneton","9.2740100783e-24","J T^-1"),F0=Er("conductanceQuantum","7.748091729863649e-5","S"),_0=Er("inverseConductanceQuantum","12906.403729652257","ohm"),O0=Er("magneticFluxQuantum","2.0678338484619295e-15","Wb"),B0=Er("nuclearMagneton","5.0507837461e-27","J T^-1"),P0=Er("klitzing","25812.807459304513","ohm");var I0=Er("bohrRadius","5.29177210903e-11","m"),R0=Er("classicalElectronRadius","2.8179403262e-15","m"),q0=Er("electronMass","9.1093837015e-31","kg"),k0=Er("fermiCoupling","1.1663787e-5","GeV^-2"),L0=vx("fineStructure",.0072973525693),z0=Er("hartreeEnergy","4.3597447222071e-18","J"),U0=Er("protonMass","1.67262192369e-27","kg"),W0=Er("deuteronMass","3.3435830926e-27","kg"),Y0=Er("neutronMass","1.6749271613e-27","kg"),H0=Er("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),$0=Er("rydberg","10973731.568160","m^-1"),G0=Er("thomsonCrossSection","6.6524587321e-29","m^2"),V0=vx("weakMixingAngle",.2229),Z0=vx("efimovFactor",22.7),Q0=Er("atomicMass","1.66053906660e-27","kg"),X0=Er("avogadro","6.02214076e23","mol^-1"),J0=Er("boltzmann","1.380649e-23","J K^-1"),K0=Er("faraday","96485.33212331001","C mol^-1"),j0=Er("firstRadiation","3.7417718521927573e-16","W m^2"),ex=Er("loschmidt","2.686780111798444e25","m^-3"),rx=Er("gasConstant","8.31446261815324","J K^-1 mol^-1"),tx=Er("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),nx=Er("molarVolume","0.022413969545014137","m^3 mol^-1"),ax=vx("sackurTetrode",-1.16487052358),ix=Er("secondRadiation","0.014387768775039337","m K"),ox=Er("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),sx=Er("wienDisplacement","2.897771955e-3","m K"),ux=Er("molarMass","0.99999999965e-3","kg mol^-1"),fx=Er("molarMassC12","11.9999999958e-3","kg mol^-1"),cx=Er("gravity","9.80665","m s^-2"),lx=Er("planckLength","1.616255e-35","m"),mx=Er("planckMass","2.176435e-8","kg"),px=Er("planckTime","5.391245e-44","s"),dx=Er("planckCharge","1.87554603778e-18","C"),hx=Er("planckTemperature","1.416785e+32","K");function Er(e,r,t){var a=["config","Unit","BigNumber"];return F(e,a,n=>{var{config:i,Unit:u,BigNumber:l}=n,c=i.number==="BigNumber"?new l(r):parseFloat(r),o=new u(c,t);return o.fixPrefix=!0,o})}function vx(e,r){var t=["config","BigNumber"];return F(e,t,a=>{var{config:n,BigNumber:i}=a;return n.number==="BigNumber"?new i(r):r})}var VG="apply",ZG=["typed","isInteger"],gx=F(VG,ZG,e=>{var{typed:r,isInteger:t}=e,a=ko({typed:r,isInteger:t});return r("apply",{"...any":function(i){var u=i[1];sr(u)?i[1]=u-1:rr(u)&&(i[1]=u.minus(1));try{return a.apply(null,i)}catch(l){throw mt(l)}}})},{isTransformFunction:!0});var QG="column",XG=["typed","Index","matrix","range"],xx=F(QG,XG,e=>{var{typed:r,Index:t,matrix:a,range:n}=e,i=Wu({typed:r,Index:t,matrix:a,range:n});return r("column",{"...any":function(l){var c=l.length-1,o=l[c];sr(o)&&(l[c]=o-1);try{return i.apply(null,l)}catch(s){throw mt(s)}}})},{isTransformFunction:!0});function lf(e,r,t){var a=e.filter(function(c){return nt(c)&&!(c.name in r)&&!t.has(c.name)})[0];if(!a)throw new Error('No undefined variable found in inline expression "'+e+'"');var n=a.name,i=new Map,u=new Eu(t,i,new Set([n])),l=e.compile();return function(o){return i.set(n,o),l.evaluate(u)}}var JG="filter",KG=["typed"],yx=F(JG,KG,e=>{var{typed:r}=e;function t(n,i,u){var l,c;return n[0]&&(l=n[0].compile().evaluate(u)),n[1]&&(nt(n[1])||_a(n[1])?c=n[1].compile().evaluate(u):c=lf(n[1],i,u)),a(l,c)}t.rawArgs=!0;var a=r("filter",{"Array, function":XB,"Matrix, function":function(i,u){return i.create(XB(i.toArray(),u))},"Array, RegExp":Mu,"Matrix, RegExp":function(i,u){return i.create(Mu(i.toArray(),u))}});return t},{isTransformFunction:!0});function XB(e,r){return Em(e,function(t,a,n){return Ia(r,t,[a+1],n,"filter")})}var jG="forEach",eV=["typed"],bx=F(jG,eV,e=>{var{typed:r}=e;function t(n,i,u){var l,c;return n[0]&&(l=n[0].compile().evaluate(u)),n[1]&&(nt(n[1])||_a(n[1])?c=n[1].compile().evaluate(u):c=lf(n[1],i,u)),a(l,c)}t.rawArgs=!0;var a=r("forEach",{"Array | Matrix, function":function(i,u){var l=function c(o,s){if(Array.isArray(o))Fo(o,function(m,d){c(m,s.concat(d+1))});else return Ia(u,o,s,i,"forEach")};l(i.valueOf(),[])}});return t},{isTransformFunction:!0});var rV="index",tV=["Index","getMatrixDataType"],wx=F(rV,tV,e=>{var{Index:r,getMatrixDataType:t}=e;return function(){for(var n=[],i=0,u=arguments.length;i0?0:2;else if(l&&l.isSet===!0)l=l.map(function(o){return o-1});else if(Mr(l)||Qe(l))t(l)!=="boolean"&&(l=l.map(function(o){return o-1}));else if(sr(l))l--;else if(rr(l))l=l.toNumber()-1;else if(typeof l!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");n[i]=l}var c=new r;return r.apply(c,n),c}},{isTransformFunction:!0});var nV="map",aV=["typed"],Dx=F(nV,aV,e=>{var{typed:r}=e;function t(n,i,u){var l,c;return n[0]&&(l=n[0].compile().evaluate(u)),n[1]&&(nt(n[1])||_a(n[1])?c=n[1].compile().evaluate(u):c=lf(n[1],i,u)),a(l,c)}t.rawArgs=!0;var a=r("map",{"Array, function":function(i,u){return JB(i,u,i)},"Matrix, function":function(i,u){return i.create(JB(i.valueOf(),u,i))}});return t},{isTransformFunction:!0});function JB(e,r,t){function a(n,i){return Array.isArray(n)?Xn(n,function(u,l){return a(u,i.concat(l+1))}):Ia(r,n,i,t,"map")}return a(e,[])}function Mn(e){if(e.length===2&&Nt(e[0])){e=e.slice();var r=e[1];sr(r)?e[1]=r-1:rr(r)&&(e[1]=r.minus(1))}return e}var iV="max",oV=["typed","config","numeric","larger"],Sx=F(iV,oV,e=>{var{typed:r,config:t,numeric:a,larger:n}=e,i=ef({typed:r,config:t,numeric:a,larger:n});return r("max",{"...any":function(l){l=Mn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var sV="mean",uV=["typed","add","divide"],Nx=F(sV,uV,e=>{var{typed:r,add:t,divide:a}=e,n=of({typed:r,add:t,divide:a});return r("mean",{"...any":function(u){u=Mn(u);try{return n.apply(null,u)}catch(l){throw mt(l)}}})},{isTransformFunction:!0});var fV="min",cV=["typed","config","numeric","smaller"],Ax=F(fV,cV,e=>{var{typed:r,config:t,numeric:a,smaller:n}=e,i=rf({typed:r,config:t,numeric:a,smaller:n});return r("min",{"...any":function(l){l=Mn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var lV="range",mV=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Mx=F(lV,mV,e=>{var{typed:r,config:t,matrix:a,bignumber:n,smaller:i,smallerEq:u,larger:l,largerEq:c,add:o,isPositive:s}=e,m=$u({typed:r,config:t,matrix:a,bignumber:n,smaller:i,smallerEq:u,larger:l,largerEq:c,add:o,isPositive:s});return r("range",{"...any":function(h){var x=h.length-1,v=h[x];return typeof v!="boolean"&&h.push(!0),m.apply(null,h)}})},{isTransformFunction:!0});var pV="row",dV=["typed","Index","matrix","range"],Cx=F(pV,dV,e=>{var{typed:r,Index:t,matrix:a,range:n}=e,i=Gu({typed:r,Index:t,matrix:a,range:n});return r("row",{"...any":function(l){var c=l.length-1,o=l[c];sr(o)&&(l[c]=o-1);try{return i.apply(null,l)}catch(s){throw mt(s)}}})},{isTransformFunction:!0});var hV="subset",vV=["typed","matrix","zeros","add"],Ex=F(hV,vV,e=>{var{typed:r,matrix:t,zeros:a,add:n}=e,i=Vu({typed:r,matrix:t,zeros:a,add:n});return r("subset",{"...any":function(l){try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var gV="concat",xV=["typed","matrix","isInteger"],Tx=F(gV,xV,e=>{var{typed:r,matrix:t,isInteger:a}=e,n=Uu({typed:r,matrix:t,isInteger:a});return r("concat",{"...any":function(u){var l=u.length-1,c=u[l];sr(c)?u[l]=c-1:rr(c)&&(u[l]=c.minus(1));try{return n.apply(null,u)}catch(o){throw mt(o)}}})},{isTransformFunction:!0});var KB="diff",yV=["typed","matrix","subtract","number","bignumber"],Fx=F(KB,yV,e=>{var{typed:r,matrix:t,subtract:a,number:n,bignumber:i}=e,u=Yu({typed:r,matrix:t,subtract:a,number:n,bignumber:i});return r(KB,{"...any":function(c){c=Mn(c);try{return u.apply(null,c)}catch(o){throw mt(o)}}})},{isTransformFunction:!0});var bV="std",wV=["typed","map","sqrt","variance"],_x=F(bV,wV,e=>{var{typed:r,map:t,sqrt:a,variance:n}=e,i=ff({typed:r,map:t,sqrt:a,variance:n});return r("std",{"...any":function(l){l=Mn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var jB="sum",DV=["typed","config","add","numeric"],Ox=F(jB,DV,e=>{var{typed:r,config:t,add:a,numeric:n}=e,i=nf({typed:r,config:t,add:a,numeric:n});return r(jB,{"...any":function(l){l=Mn(l);try{return i.apply(null,l)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var SV="quantileSeq",NV=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Bx=F(SV,NV,e=>{var{typed:r,bignumber:t,add:a,subtract:n,divide:i,multiply:u,partitionSelect:l,compare:c,isInteger:o,smaller:s,smallerEq:m,larger:d}=e,h=uf({typed:r,bignumber:t,add:a,subtract:n,divide:i,multiply:u,partitionSelect:l,compare:c,isInteger:o,smaller:s,smallerEq:m,larger:d});return r("quantileSeq",{"Array | Matrix, number | BigNumber":h,"Array | Matrix, number | BigNumber, number":(v,y,w)=>h(v,y,x(w)),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(v,y,w,C)=>h(v,y,w,x(C)),"Array | Matrix, Array | Matrix":h,"Array | Matrix, Array | Matrix, number":(v,y,w)=>h(v,y,x(w)),"Array | Matrix, Array | Matrix, boolean":h,"Array | Matrix, Array | Matrix, boolean, number":(v,y,w,C)=>h(v,y,w,x(C))});function x(v){return Mn([[],v])[1]}},{isTransformFunction:!0});var eP="cumsum",AV=["typed","add","unaryPlus"],Px=F(eP,AV,e=>{var{typed:r,add:t,unaryPlus:a}=e,n=af({typed:r,add:t,unaryPlus:a});return r(eP,{"...any":function(u){if(u.length===2&&Nt(u[0])){var l=u[1];sr(l)?u[1]=l-1:rr(l)&&(u[1]=l.minus(1))}try{return n.apply(null,u)}catch(c){throw mt(c)}}})},{isTransformFunction:!0});var rP="variance",MV=["typed","add","subtract","multiply","divide","apply","isNaN"],Ix=F(rP,MV,e=>{var{typed:r,add:t,subtract:a,multiply:n,divide:i,apply:u,isNaN:l}=e,c=sf({typed:r,add:t,subtract:a,multiply:n,divide:i,apply:u,isNaN:l});return r(rP,{"...any":function(s){s=Mn(s);try{return c.apply(null,s)}catch(m){throw mt(m)}}})},{isTransformFunction:!0});var tP="print",CV=["typed","matrix","zeros","add"],Rx=F(tP,CV,e=>{var{typed:r,matrix:t,zeros:a,add:n}=e,i=Qu({typed:r,matrix:t,zeros:a,add:n});return r(tP,{"string, Object | Array":function(c,o){return i(u(c),o)},"string, Object | Array, number | Object":function(c,o,s){return i(u(c),o,s)}});function u(l){return l.replace(Pd,c=>{var o=c.slice(1).split("."),s=o.map(function(m){return!isNaN(m)&&m.length>0?parseInt(m)-1:m});return"$"+s.join(".")})}},{isTransformFunction:!0});var EV="and",TV=["typed","matrix","zeros","add","equalScalar","not","concat"],qx=F(EV,TV,e=>{var{typed:r,matrix:t,equalScalar:a,zeros:n,not:i,concat:u}=e,l=ju({typed:r,matrix:t,equalScalar:a,zeros:n,not:i,concat:u});function c(o,s,m){var d=o[0].compile().evaluate(m);if(!Nt(d)&&!l(d,!0))return!1;var h=o[1].compile().evaluate(m);return l(d,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var FV="or",_V=["typed","matrix","equalScalar","DenseMatrix","concat"],kx=F(FV,_V,e=>{var{typed:r,matrix:t,equalScalar:a,DenseMatrix:n,concat:i}=e,u=zu({typed:r,matrix:t,equalScalar:a,DenseMatrix:n,concat:i});function l(c,o,s){var m=c[0].compile().evaluate(s);if(!Nt(m)&&u(m,!1))return!0;var d=c[1].compile().evaluate(s);return u(m,d)}return l.rawArgs=!0,l},{isTransformFunction:!0});var OV="bitAnd",BV=["typed","matrix","zeros","add","equalScalar","not","concat"],Lx=F(OV,BV,e=>{var{typed:r,matrix:t,equalScalar:a,zeros:n,not:i,concat:u}=e,l=ku({typed:r,matrix:t,equalScalar:a,zeros:n,not:i,concat:u});function c(o,s,m){var d=o[0].compile().evaluate(m);if(!Nt(d)){if(isNaN(d))return NaN;if(d===0||d===!1)return 0}var h=o[1].compile().evaluate(m);return l(d,h)}return c.rawArgs=!0,c},{isTransformFunction:!0});var PV="bitOr",IV=["typed","matrix","equalScalar","DenseMatrix","concat"],zx=F(PV,IV,e=>{var{typed:r,matrix:t,equalScalar:a,DenseMatrix:n,concat:i}=e,u=Lu({typed:r,matrix:t,equalScalar:a,DenseMatrix:n,concat:i});function l(c,o,s){var m=c[0].compile().evaluate(s);if(!Nt(m)){if(isNaN(m))return NaN;if(m===-1)return-1;if(m===!0)return 1}var d=c[1].compile().evaluate(s);return u(m,d)}return l.rawArgs=!0,l},{isTransformFunction:!0});var Ge=zm({config:Oe}),pt=Um({}),ED=c0({BigNumber:Ge,config:Oe}),nP=a0({}),aP=L0({BigNumber:Ge,config:Oe}),Uo=Wm({}),TD=x0({Complex:pt}),iP=o0({BigNumber:Ge,config:Oe}),oP=p0({BigNumber:Ge,config:Oe}),sP=h0({BigNumber:Ge,config:Oe}),qc=Hm({}),uP=s0({BigNumber:Ge,config:Oe}),fP=i0({}),cP=l0({BigNumber:Ge,config:Oe}),lP=Ym({}),FD=Om({}),mP=v0({BigNumber:Ge,config:Oe}),pP=ax({BigNumber:Ge,config:Oe}),_D=f0({BigNumber:Ge,config:Oe}),dP=n0({}),hP=y0({}),_r=Gm({Matrix:qc}),vP=Z0({BigNumber:Ge,config:Oe}),gP=m0({BigNumber:Ge,config:Oe}),Ux=u0({BigNumber:Ge,config:Oe}),xP=t0({}),yP=g0({BigNumber:Ge,config:Oe}),te=_m({BigNumber:Ge,Complex:pt,DenseMatrix:_r,Fraction:Uo}),Wx=bp({BigNumber:Ge,config:Oe,typed:te}),bP=V0({BigNumber:Ge,config:Oe}),Cn=wp({typed:te}),wP=Eh({Complex:pt,config:Oe,typed:te}),DP=Fh({BigNumber:Ge,typed:te}),SP=Oh({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),Qt=Sp({typed:te}),NP=Qp({typed:te}),AP=Ih({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),MP=qh({typed:te}),OD=kh({typed:te}),CP=zh({Complex:pt,config:Oe,typed:te}),ea=lp({BigNumber:Ge,typed:te}),EP=Vp({typed:te}),TP=cp({typed:te}),FP=Vm({typed:te}),kc=Tg({typed:te}),Lc=mp({Complex:pt,typed:te}),Wo=Xp({typed:te}),Yx=Uh({typed:te}),_P=Yh({BigNumber:Ge,typed:te}),OP=$h({BigNumber:Ge,typed:te}),BP=Cp({typed:te}),Ir=op({config:Oe,typed:te}),PP=Md({typed:te}),BD=Ep({typed:te}),IP=Tp({Complex:pt,typed:te}),RP=ad({typed:te}),qP=od({typed:te}),mf=Fd({typed:te}),Hx=sd({typed:te}),kP=Bd({format:mf,typed:te}),$x=Jp({typed:te}),kn=Xm({typed:te}),no=Km({typed:te}),Yo=rp({typed:te}),ka=tp({typed:te}),LP=d0({BigNumber:Ge,config:Oe}),zP=Og({Complex:pt,typed:te}),UP=Bp({Complex:pt,config:Oe,typed:te}),PD=Pp({Complex:pt,config:Oe,typed:te}),Ho=cd({typed:te}),Ot=Ip({typed:te}),zc=jp({typed:te}),_i=up({typed:te}),WP=Od({format:mf,typed:te}),YP=kg({config:Oe,typed:te}),HP=Qu({typed:te}),$P=Lg({config:Oe,typed:te}),Gx=Kp({typed:te}),GP=Vh({BigNumber:Ge,typed:te}),ID=kp({BigNumber:Ge,Fraction:Uo,complex:Lc,typed:te}),Uc=Qh({typed:te}),Oi=sp({Matrix:qc,equalScalar:Ir,typed:te}),VP=xp({typed:te}),ZP=zp({typed:te}),QP=fp({typed:te}),ga=Np({typed:te}),XP=Jh({typed:te}),RD=ap({typed:te}),JP=Th({Complex:pt,config:Oe,typed:te}),KP=Bh({BigNumber:Ge,typed:te}),Vx=ko({isInteger:kn,typed:te}),jP=Ph({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),e4=_d({format:mf,typed:te}),r4=Fg({typed:te}),t4=Wh({typed:te}),n4=Gh({BigNumber:Ge,typed:te}),pf=np({typed:te}),a4=Rd({typed:te}),i4=zg({config:Oe,typed:te}),o4=Zh({BigNumber:Ge,typed:te}),s4=Xh({typed:te}),u4=Mh({SparseMatrix:Oi,typed:te}),La=Lp({Complex:pt,config:Oe,typed:te}),f4=Kh({typed:te}),fi=yp({typed:te}),c4=_h({BigNumber:Ge,Complex:pt,config:Oe,typed:te}),l4=Hh({BigNumber:Ge,typed:te}),Bs=pp({Fraction:Uo,typed:te}),$o=jm({typed:te}),$e=dp({DenseMatrix:_r,Matrix:qc,SparseMatrix:Oi,typed:te}),m4=hp({isZero:ka,matrix:$e,typed:te}),p4=Ed({isNaN:pf,isNumeric:$o,typed:te}),za=qd({bignumber:ea,fraction:Bs,number:_i}),qD=Td({config:Oe,multiplyScalar:Ot,numeric:za,typed:te}),kD=dd({isInteger:kn,matrix:$e,typed:te}),cn=xd({matrix:$e,config:Oe,typed:te}),d4=yd({matrix:$e,typed:te}),df=bd({matrix:$e,typed:te}),LD=Wp({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),ln=Dd({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),h4=Rh({Complex:pt,config:Oe,typed:te}),zD=Ap({BigNumber:Ge,Complex:pt,Fraction:Uo,config:Oe,isNegative:no,matrix:$e,typed:te,unaryMinus:fi}),Gr=Uu({isInteger:kn,matrix:$e,typed:te}),v4=rd({prod:qD,size:cn,typed:te}),Zx=wd({conj:Wo,transpose:df,typed:te}),UD=nd({DenseMatrix:_r,SparseMatrix:Oi,matrix:$e,typed:te}),Mt=kd({numeric:za,typed:te}),hf=$d({DenseMatrix:_r,concat:Gr,divideScalar:Mt,equalScalar:Ir,matrix:$e,typed:te}),xa=ah({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),vf=id({matrix:$e,typed:te}),g4=ep({isNumeric:$o,typed:te}),ao=ud({BigNumber:Ge,DenseMatrix:_r,SparseMatrix:Oi,config:Oe,matrix:$e,typed:te}),x4=fd({matrix:$e,multiplyScalar:Ot,typed:te}),Wc=ph({DenseMatrix:_r,concat:Gr,config:Oe,matrix:$e,typed:te}),y4=Xd({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),WD=Gd({DenseMatrix:_r,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:ga,typed:te}),Qx=gp({flatten:vf,matrix:$e,size:cn,typed:te}),b4=qp({BigNumber:Ge,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),w4=ld({BigNumber:Ge,config:Oe,matrix:$e,typed:te}),Xx=ng({addScalar:Qt,complex:Lc,conj:Wo,divideScalar:Mt,equal:xa,identity:ao,isZero:ka,matrix:$e,multiplyScalar:Ot,sign:ID,sqrt:La,subtractScalar:ga,typed:te,unaryMinus:fi,zeros:ln}),D4=hd({config:Oe,matrix:$e}),S4=Jd({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),Ps=zd({BigNumber:Ge,DenseMatrix:_r,config:Oe,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),En=sh({DenseMatrix:_r,concat:Gr,config:Oe,matrix:$e,typed:te}),Bt=Up({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,subtractScalar:ga,typed:te,unaryMinus:fi}),N4=Id({concat:Gr,matrix:$e,typed:te}),A4=vh({DenseMatrix:_r,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,typed:te}),Jx=Vd({DenseMatrix:_r,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:ga,typed:te}),M4=ed({DenseMatrix:_r,concat:Gr,matrix:$e,typed:te}),Lr=fv({DenseMatrix:_r,SparseMatrix:Oi,addScalar:Qt,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),C4=Lh({BigNumber:Ge,DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),E4=ku({concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),T4=Lu({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),F4=Zp({DenseMatrix:_r,concat:Gr,matrix:$e,typed:te}),_4=Yg({addScalar:Qt,combinations:kc,divideScalar:Mt,isInteger:kn,isNegative:no,multiplyScalar:Ot,typed:te}),Go=eh({BigNumber:Ge,DenseMatrix:_r,Fraction:Uo,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,typed:te}),YD=th({concat:Gr,matrix:$e,typed:te}),O4=af({add:Lr,typed:te,unaryPlus:Wx}),Kx=dh({equal:xa,typed:te}),B4=Yu({matrix:$e,number:_i,subtract:Bt,typed:te}),P4=Sg({abs:Cn,addScalar:Qt,deepEqual:Kx,divideScalar:Mt,multiplyScalar:Ot,sqrt:La,subtractScalar:ga,typed:te}),Yc=mv({addScalar:Qt,conj:Wo,multiplyScalar:Ot,size:cn,typed:te}),I4=ih({compareText:YD,isZero:ka,typed:te}),HD=Pu({DenseMatrix:_r,config:Oe,equalScalar:Ir,matrix:$e,round:Ps,typed:te,zeros:ln}),R4=_p({BigNumber:Ge,DenseMatrix:_r,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,round:Ps,typed:te,zeros:ln}),q4=cv({abs:Cn,addScalar:Qt,divideScalar:Mt,isPositive:Yo,multiplyScalar:Ot,smaller:En,sqrt:La,typed:te}),$D=yh({DenseMatrix:_r,smaller:En}),yn=bh({ImmutableDenseMatrix:$D,getMatrixDataType:Hx}),Tn=lh({DenseMatrix:_r,concat:Gr,config:Oe,matrix:$e,typed:te}),jx=Ud({Complex:pt,config:Oe,divideScalar:Mt,typed:te}),k4=Zd({DenseMatrix:_r,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:ga,typed:te}),L4=vp({flatten:vf,matrix:$e,size:cn,typed:te}),z4=rf({config:Oe,numeric:za,smaller:En,typed:te}),GD=Iu({DenseMatrix:_r,concat:Gr,config:Oe,equalScalar:Ir,matrix:$e,round:Ps,typed:te,zeros:ln}),at=Rp({addScalar:Qt,dot:Yc,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,typed:te}),U4=Yd({Complex:pt,config:Oe,divideScalar:Mt,typed:te}),W4=zu({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),Hc=gh({compare:Go,isNaN:pf,isNumeric:$o,typed:te}),Y4=Kd({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te,zeros:ln}),VD=og({SparseMatrix:Oi,abs:Cn,add:Lr,divideScalar:Mt,larger:Tn,largerEq:Wc,multiply:at,subtract:Bt,transpose:df,typed:te}),ra=Vu({add:Lr,matrix:$e,typed:te,zeros:ln}),ey=nf({add:Lr,config:Oe,numeric:za,typed:te}),H4=pv({add:Lr,matrix:$e,typed:te}),ZD=Qd({DenseMatrix:_r,divideScalar:Mt,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,subtractScalar:ga,typed:te}),$4=jg({Complex:pt,add:Lr,multiply:at,number:_i,typed:te}),ry=Mp({DenseMatrix:_r,config:Oe,equalScalar:Ir,matrix:$e,round:Ps,typed:te,zeros:ln}),ci=rh({compare:Go,typed:te}),G4=Hg({addScalar:Qt,combinations:kc,isInteger:kn,isNegative:no,isPositive:Yo,larger:Tn,typed:te}),V4=td({matrix:$e,multiply:at,subtract:Bt,typed:te}),QD=pg({divideScalar:Mt,isZero:ka,matrix:$e,multiply:at,subtractScalar:ga,typed:te,unaryMinus:fi}),Z4=$p({concat:Gr,equalScalar:Ir,matrix:$e,multiplyScalar:Ot,typed:te}),XD=wh({larger:Tn,smaller:En}),JD=Fp({Complex:pt,DenseMatrix:_r,ceil:ry,equalScalar:Ir,floor:HD,matrix:$e,typed:te,zeros:ln}),KD=dv({Index:yn,typed:te}),Q4=Ng({abs:Cn,add:Lr,addScalar:Qt,config:Oe,divideScalar:Mt,equalScalar:Ir,flatten:vf,isNumeric:$o,isZero:ka,matrix:$e,multiply:at,multiplyScalar:Ot,smaller:En,subtract:Bt,typed:te}),X4=Yp({BigNumber:Ge,add:Lr,config:Oe,equal:xa,isInteger:kn,mod:GD,smaller:En,typed:te,xgcd:LD}),J4=Op({concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),K4=Wd({Complex:pt,config:Oe,divideScalar:Mt,log:jx,typed:te}),ty=ef({config:Oe,larger:Tn,numeric:za,typed:te}),j4=jh({DenseMatrix:_r,Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),eI=rv({DenseMatrix:_r,Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),rI=nv({Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),tI=iv({Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),Is=fh({DenseMatrix:_r,concat:Gr,config:Oe,matrix:$e,typed:te}),nI=xh({compare:Go,compareNatural:ci,matrix:$e,typed:te}),aI=ju({concat:Gr,equalScalar:Ir,matrix:$e,not:zc,typed:te,zeros:ln}),Rs=$u({bignumber:ea,matrix:$e,add:Lr,config:Oe,isPositive:Yo,larger:Tn,largerEq:Wc,smaller:En,smallerEq:Is,typed:te}),iI=Gu({Index:yn,matrix:$e,range:Rs,typed:te}),jD=ev({DenseMatrix:_r,Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),oI=av({Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),eS=sv({Index:yn,concat:Gr,setDifference:jD,size:cn,subset:ra,typed:te}),rS=Dh({FibonacciHeap:XD,addScalar:Qt,equalScalar:Ir}),tS=Wu({Index:yn,matrix:$e,range:Rs,typed:te}),Vo=dg({abs:Cn,addScalar:Qt,det:QD,divideScalar:Mt,identity:ao,matrix:$e,multiply:at,typed:te,unaryMinus:fi}),nS=tg({DenseMatrix:_r,Spa:rS,SparseMatrix:Oi,abs:Cn,addScalar:Qt,divideScalar:Mt,equalScalar:Ir,larger:Tn,matrix:$e,multiplyScalar:Ot,subtractScalar:ga,typed:te,unaryMinus:fi}),sI=hg({Complex:pt,add:Lr,ctranspose:Zx,deepEqual:Kx,divideScalar:Mt,dot:Yc,dotDivide:hf,equal:xa,inv:Vo,matrix:$e,multiply:at,typed:te}),ya=Ld({Complex:pt,config:Oe,fraction:Bs,identity:ao,inv:Vo,matrix:$e,multiply:at,number:_i,typed:te}),aS=tv({DenseMatrix:_r,Index:yn,compareNatural:ci,size:cn,subset:ra,typed:te}),uI=uv({Index:yn,concat:Gr,setIntersect:aS,setSymDifference:eS,size:cn,subset:ra,typed:te}),fI=xg({abs:Cn,add:Lr,identity:ao,inv:Vo,map:Ho,max:ty,multiply:at,size:cn,sqrt:La,subtract:Bt,typed:te}),wr=Nh({BigNumber:Ge,Complex:pt,Fraction:Uo,abs:Cn,addScalar:Qt,config:Oe,divideScalar:Mt,equal:xa,fix:JD,format:mf,isNumeric:$o,multiplyScalar:Ot,number:_i,pow:ya,round:Ps,subtractScalar:ga}),cI=M0({BigNumber:Ge,Unit:wr,config:Oe}),lI=sx({BigNumber:Ge,Unit:wr,config:Oe}),mI=Q0({BigNumber:Ge,Unit:wr,config:Oe}),pI=T0({BigNumber:Ge,Unit:wr,config:Oe}),dI=J0({BigNumber:Ge,Unit:wr,config:Oe}),hI=F0({BigNumber:Ge,Unit:wr,config:Oe}),vI=C0({BigNumber:Ge,Unit:wr,config:Oe}),gI=W0({BigNumber:Ge,Unit:wr,config:Oe}),xI=Hd({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,pow:ya,typed:te}),yI=A0({BigNumber:Ge,Unit:wr,config:Oe}),bI=E0({BigNumber:Ge,Unit:wr,config:Oe}),wI=gg({abs:Cn,add:Lr,identity:ao,inv:Vo,multiply:at,typed:te}),DI=K0({BigNumber:Ge,Unit:wr,config:Oe}),iS=Sd({addScalar:Qt,ceil:ry,conj:Wo,divideScalar:Mt,dotDivide:hf,exp:BD,i:TD,log2:PD,matrix:$e,multiplyScalar:Ot,pow:ya,tau:_D,typed:te}),ny=_g({BigNumber:Ge,Complex:pt,config:Oe,multiplyScalar:Ot,pow:ya,typed:te}),SI=w0({BigNumber:Ge,Unit:wr,config:Oe}),NI=z0({BigNumber:Ge,Unit:wr,config:Oe}),AI=Nd({conj:Wo,dotDivide:hf,fft:iS,typed:te}),MI=P0({BigNumber:Ge,Unit:wr,config:Oe}),CI=ex({BigNumber:Ge,Unit:wr,config:Oe}),EI=N0({BigNumber:Ge,Unit:wr,config:Oe}),TI=ux({BigNumber:Ge,Unit:wr,config:Oe}),FI=tx({BigNumber:Ge,Unit:wr,config:Oe}),_I=Y0({BigNumber:Ge,Unit:wr,config:Oe}),OI=B0({BigNumber:Ge,Unit:wr,config:Oe}),BI=dx({BigNumber:Ge,Unit:wr,config:Oe}),PI=lx({BigNumber:Ge,Unit:wr,config:Oe}),II=hx({BigNumber:Ge,Unit:wr,config:Oe}),RI=U0({BigNumber:Ge,Unit:wr,config:Oe}),qI=H0({BigNumber:Ge,Unit:wr,config:Oe}),kI=S0({BigNumber:Ge,Unit:wr,config:Oe}),LI=$0({BigNumber:Ge,Unit:wr,config:Oe}),zI=ix({BigNumber:Ge,Unit:wr,config:Oe}),UI=b0({BigNumber:Ge,Unit:wr,config:Oe}),WI=ox({BigNumber:Ge,Unit:wr,config:Oe}),YI=G0({BigNumber:Ge,Unit:wr,config:Oe}),HI=X0({BigNumber:Ge,Unit:wr,config:Oe}),$I=I0({BigNumber:Ge,Unit:wr,config:Oe}),GI=Ch({Unit:wr,typed:te}),an=Dg({divideScalar:Mt,equalScalar:Ir,inv:Vo,matrix:$e,multiply:at,typed:te}),VI=q0({BigNumber:Ge,Unit:wr,config:Oe}),gf=Bg({gamma:ny,typed:te}),ZI=j0({BigNumber:Ge,Unit:wr,config:Oe}),QI=cx({BigNumber:Ge,Unit:wr,config:Oe}),XI=_0({BigNumber:Ge,Unit:wr,config:Oe}),oS=sg({DenseMatrix:_r,lsolve:WD,lup:nS,matrix:$e,slu:VD,typed:te,usolve:Jx}),JI=O0({BigNumber:Ge,Unit:wr,config:Oe}),KI=fx({BigNumber:Ge,Unit:wr,config:Oe}),jI=Ig({add:Lr,divide:an,factorial:gf,isInteger:kn,isPositive:Yo,multiply:at,typed:te}),eR=Rg({factorial:gf,typed:te}),rR=mx({BigNumber:Ge,Unit:wr,config:Oe}),tR=ug({add:Lr,cbrt:zD,divide:an,equalScalar:Ir,im:$x,isZero:ka,multiply:at,re:Gx,sqrt:La,subtract:Bt,typeOf:RD,typed:te,unaryMinus:fi}),nR=ov({compareNatural:ci,typed:te}),aR=Ad({abs:Cn,add:Lr,bignumber:ea,divide:an,isNegative:no,isPositive:Yo,larger:Tn,map:Ho,matrix:$e,max:ty,multiply:at,smaller:En,subtract:Bt,typed:te,unaryMinus:fi}),sS=Ug({bignumber:ea,addScalar:Qt,combinations:kc,divideScalar:Mt,factorial:gf,isInteger:kn,isNegative:no,larger:Tn,multiplyScalar:Ot,number:_i,pow:ya,subtractScalar:ga,typed:te}),iR=Ah({Unit:wr,typed:te}),oR=Wg({addScalar:Qt,isInteger:kn,isNegative:no,stirlingS2:sS,typed:te}),uS=vg({abs:Cn,add:Lr,addScalar:Qt,atan:OD,bignumber:ea,column:tS,complex:Lc,config:Oe,cos:Yx,diag:UD,divideScalar:Mt,dot:Yc,equal:xa,flatten:vf,im:$x,inv:Vo,larger:Tn,matrix:$e,matrixFromColumns:Qx,multiply:at,multiplyScalar:Ot,number:_i,qr:Xx,re:Gx,reshape:kD,sin:Uc,size:cn,smaller:En,sqrt:La,subtract:Bt,typed:te,usolve:Jx,usolveAll:ZD}),sR=k0({BigNumber:Ge,Unit:wr,config:Oe}),uR=rx({BigNumber:Ge,Unit:wr,config:Oe}),fR=Pg({divide:an,dotDivide:hf,isNumeric:$o,log:jx,map:Ho,matrix:$e,multiply:at,sum:ey,typed:te}),fS=of({add:Lr,divide:an,typed:te}),cR=nx({BigNumber:Ge,Unit:wr,config:Oe}),lR=D0({BigNumber:Ge,Unit:wr,config:Oe}),mR=uf({bignumber:ea,add:Lr,compare:Go,divide:an,isInteger:kn,larger:Tn,multiply:at,partitionSelect:Hc,smaller:En,smallerEq:Is,subtract:Bt,typed:te}),ay=sf({add:Lr,apply:Vx,divide:an,isNaN:pf,multiply:at,subtract:Bt,typed:te}),pR=R0({BigNumber:Ge,Unit:wr,config:Oe}),cS=Mg({add:Lr,compare:Go,divide:an,partitionSelect:Hc,typed:te}),dR=Eg({add:Lr,divide:an,matrix:$e,mean:fS,multiply:at,pow:ya,sqrt:La,subtract:Bt,sum:ey,typed:te}),hR=e0({Complex:pt,add:Lr,divide:an,matrix:$e,multiply:at,typed:te}),vR=Cg({abs:Cn,map:Ho,median:cS,subtract:Bt,typed:te}),gR=ff({map:Ho,sqrt:La,typed:te,variance:ay}),xR=Cd({BigNumber:Ge,Complex:pt,add:Lr,config:Oe,divide:an,equal:xa,factorial:gf,gamma:ny,isNegative:no,multiply:at,pi:Ux,pow:ya,sin:Uc,smallerEq:Is,subtract:Bt,typed:te}),iy=lv({abs:Cn,add:Lr,conj:Wo,ctranspose:Zx,eigs:uS,equalScalar:Ir,larger:Tn,matrix:$e,multiply:at,pow:ya,smaller:En,sqrt:La,typed:te}),lS=gd({BigNumber:Ge,DenseMatrix:_r,SparseMatrix:Oi,addScalar:Qt,config:Oe,cos:Yx,matrix:$e,multiplyScalar:Ot,norm:iy,sin:Uc,typed:te,unaryMinus:fi}),yR=px({BigNumber:Ge,Unit:wr,config:Oe}),mS=bg({identity:ao,matrix:$e,multiply:at,norm:iy,qr:Xx,subtract:Bt,typed:te}),bR=vd({multiply:at,rotationMatrix:lS,typed:te}),pS=yg({abs:Cn,add:Lr,concat:Gr,identity:ao,index:KD,lusolve:oS,matrix:$e,matrixFromColumns:Qx,multiply:at,range:Rs,schur:mS,subset:ra,subtract:Bt,transpose:df,typed:te}),wR=wg({matrix:$e,multiply:at,sylvester:pS,transpose:df,typed:te});var xf={},yf={},DR={},Fn=vv({mathWithTransform:yf}),bf=Lv({Node:Fn}),io=Uv({Node:Fn}),qs=Yv({Node:Fn}),SR=Vv({Node:Fn}),wf=wv({Node:Fn}),NR=Cv({Node:Fn,ResultSet:FD}),AR=Tv({Node:Fn}),Zo=Bv({Node:Fn}),MR=$v({Node:Fn}),RV=r0({classes:DR}),dS=cg({math:xf,typed:te}),CR=Iv({Node:Fn,typed:te}),qV=mg({Chain:dS,typed:te}),Df=qv({Node:Fn,size:cn}),Sf=yv({Node:Fn,subset:ra}),ER=Av({matrix:$e,Node:Fn,subset:ra}),Qo=Zv({Unit:wr,Node:Fn,math:xf}),Xo=Xv({Node:Fn,SymbolNode:Qo,math:xf}),Ua=Jv({AccessorNode:Sf,ArrayNode:wf,AssignmentNode:ER,BlockNode:NR,ConditionalNode:AR,ConstantNode:Zo,FunctionAssignmentNode:CR,FunctionNode:Xo,IndexNode:Df,ObjectNode:bf,OperatorNode:io,ParenthesisNode:qs,RangeNode:MR,RelationalNode:SR,SymbolNode:Qo,config:Oe,numeric:za,typed:te}),TR=Qg({ConstantNode:Zo,FunctionNode:Xo,OperatorNode:io,ParenthesisNode:qs,parse:Ua,typed:te}),hS=Vg({bignumber:ea,fraction:Bs,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Zo,FunctionNode:Xo,IndexNode:Df,ObjectNode:bf,OperatorNode:io,SymbolNode:Qo,config:Oe,mathWithTransform:yf,matrix:$e,typed:te}),kV=Kv({parse:Ua,typed:te}),vS=Zg({AccessorNode:Sf,ArrayNode:wf,ConstantNode:Zo,FunctionNode:Xo,IndexNode:Df,ObjectNode:bf,OperatorNode:io,ParenthesisNode:qs,SymbolNode:Qo,add:Lr,divide:an,equal:xa,isZero:ka,multiply:at,parse:Ua,pow:ya,subtract:Bt,typed:te}),gS=jv({parse:Ua,typed:te}),FR=fg({evaluate:gS}),_R=eg({evaluate:gS}),oy=Gg({bignumber:ea,fraction:Bs,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Zo,FunctionNode:Xo,IndexNode:Df,ObjectNode:bf,OperatorNode:io,ParenthesisNode:qs,SymbolNode:Qo,add:Lr,config:Oe,divide:an,equal:xa,isZero:ka,mathWithTransform:yf,matrix:$e,multiply:at,parse:Ua,pow:ya,resolve:TR,simplifyConstant:hS,simplifyCore:vS,subtract:Bt,typed:te}),LV=Xg({OperatorNode:io,parse:Ua,simplify:oy,typed:te}),zV=$g({parse:Ua,typed:te}),UV=rg({Parser:_R,typed:te}),WV=Kg({bignumber:ea,fraction:Bs,AccessorNode:Sf,ArrayNode:wf,ConstantNode:Zo,FunctionNode:Xo,IndexNode:Df,ObjectNode:bf,OperatorNode:io,ParenthesisNode:qs,SymbolNode:Qo,add:Lr,config:Oe,divide:an,equal:xa,isZero:ka,mathWithTransform:yf,matrix:$e,multiply:at,parse:Ua,pow:ya,simplify:oy,simplifyConstant:hS,simplifyCore:vS,subtract:Bt,typed:te}),YV=Jg({ConstantNode:Zo,FunctionNode:Xo,OperatorNode:io,ParenthesisNode:qs,SymbolNode:Qo,config:Oe,equal:xa,isZero:ka,numeric:za,parse:Ua,simplify:oy,typed:te}),HV=lg({Help:FR,mathWithTransform:yf,typed:te});ht(xf,{e:ED,false:nP,fineStructure:aP,i:TD,Infinity:iP,LN10:oP,LOG10E:sP,NaN:uP,null:fP,phi:cP,SQRT1_2:mP,sackurTetrode:pP,tau:_D,true:dP,E:ED,version:hP,efimovFactor:vP,LN2:gP,pi:Ux,replacer:xP,reviver:RV,SQRT2:yP,typed:te,unaryPlus:Wx,PI:Ux,weakMixingAngle:bP,abs:Cn,acos:wP,acot:DP,acsc:SP,addScalar:Qt,arg:NP,asech:AP,asinh:MP,atan:OD,atanh:CP,bignumber:ea,bitNot:EP,boolean:TP,clone:FP,combinations:kc,complex:Lc,conj:Wo,cos:Yx,cot:_P,csc:OP,cube:BP,equalScalar:Ir,erf:PP,exp:BD,expm1:IP,filter:RP,forEach:qP,format:mf,getMatrixDataType:Hx,hex:kP,im:$x,isInteger:kn,isNegative:no,isPositive:Yo,isZero:ka,LOG2E:LP,lgamma:zP,log10:UP,log2:PD,map:Ho,multiplyScalar:Ot,not:zc,number:_i,oct:WP,pickRandom:YP,print:HP,random:$P,re:Gx,sec:GP,sign:ID,sin:Uc,splitUnit:VP,square:ZP,string:QP,subtractScalar:ga,tan:XP,typeOf:RD,acosh:JP,acsch:KP,apply:Vx,asec:jP,bin:e4,chain:qV,combinationsWithRep:r4,cosh:t4,csch:n4,isNaN:pf,isPrime:a4,randomInt:i4,sech:o4,sinh:s4,sparse:u4,sqrt:La,tanh:f4,unaryMinus:fi,acoth:c4,coth:l4,fraction:Bs,isNumeric:$o,matrix:$e,matrixFromFunction:m4,mode:p4,numeric:za,prod:qD,reshape:kD,size:cn,squeeze:d4,transpose:df,xgcd:LD,zeros:ln,asin:h4,cbrt:zD,concat:Gr,count:v4,ctranspose:Zx,diag:UD,divideScalar:Mt,dotDivide:hf,equal:xa,flatten:vf,hasNumericValue:g4,identity:ao,kron:x4,largerEq:Wc,leftShift:y4,lsolve:WD,matrixFromColumns:Qx,nthRoot:b4,ones:w4,qr:Xx,resize:D4,rightArithShift:S4,round:Ps,smaller:En,subtract:Bt,to:N4,unequal:A4,usolve:Jx,xor:M4,add:Lr,atan2:C4,bitAnd:E4,bitOr:T4,bitXor:F4,catalan:_4,compare:Go,compareText:YD,cumsum:O4,deepEqual:Kx,diff:B4,distance:P4,dot:Yc,equalText:I4,floor:HD,gcd:R4,hypot:q4,larger:Tn,log:jx,lsolveAll:k4,matrixFromRows:L4,min:z4,mod:GD,multiply:at,nthRoots:U4,or:W4,partitionSelect:Hc,rightLogShift:Y4,slu:VD,subset:ra,sum:ey,trace:H4,usolveAll:ZD,zpk2tf:$4,ceil:ry,compareNatural:ci,composition:G4,cross:V4,det:QD,dotMultiply:Z4,fix:JD,index:KD,intersect:Q4,invmod:X4,lcm:J4,log1p:K4,max:ty,setCartesian:j4,setDistinct:eI,setIsSubset:rI,setPowerset:tI,smallerEq:Is,sort:nI,and:aI,range:Rs,row:iI,setDifference:jD,setMultiplicity:oI,setSymDifference:eS,column:tS,inv:Vo,lup:nS,pinv:sI,pow:ya,setIntersect:aS,setUnion:uI,sqrtm:fI,vacuumImpedance:cI,wienDisplacement:lI,atomicMass:mI,bohrMagneton:pI,boltzmann:dI,conductanceQuantum:hI,coulomb:vI,deuteronMass:gI,dotPow:xI,electricConstant:yI,elementaryCharge:bI,expm:wI,faraday:DI,fft:iS,gamma:ny,gravitationConstant:SI,hartreeEnergy:NI,ifft:AI,klitzing:MI,loschmidt:CI,magneticConstant:EI,molarMass:TI,molarPlanckConstant:FI,neutronMass:_I,nuclearMagneton:OI,planckCharge:BI,planckLength:PI,planckTemperature:II,protonMass:RI,quantumOfCirculation:qI,reducedPlanckConstant:kI,rydberg:LI,secondRadiation:zI,speedOfLight:UI,stefanBoltzmann:WI,thomsonCrossSection:YI,avogadro:HI,bohrRadius:$I,createUnit:GI,divide:an,electronMass:VI,factorial:gf,firstRadiation:ZI,gravity:QI,inverseConductanceQuantum:XI,lusolve:oS,magneticFluxQuantum:JI,molarMassC12:KI,multinomial:jI,parse:Ua,permutations:eR,planckMass:rR,polynomialRoot:tR,resolve:TR,setSize:nR,simplifyConstant:hS,solveODE:aR,stirlingS2:sS,unit:iR,bellNumbers:oR,compile:kV,eigs:uS,fermiCoupling:sR,gasConstant:uR,kldivergence:fR,mean:fS,molarVolume:cR,planckConstant:lR,quantileSeq:mR,simplifyCore:vS,variance:ay,classicalElectronRadius:pR,evaluate:gS,median:cS,simplify:oy,symbolicEqual:LV,corr:dR,freqz:hR,leafCount:zV,mad:vR,parser:UV,rationalize:WV,std:gR,zeta:xR,derivative:YV,norm:iy,rotationMatrix:lS,help:HV,planckTime:yR,schur:mS,rotate:bR,sylvester:pS,lyap:wR,config:Oe});ht(yf,xf,{filter:yx({typed:te}),forEach:bx({typed:te}),map:Dx({typed:te}),apply:gx({isInteger:kn,typed:te}),or:kx({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),and:qx({add:Lr,concat:Gr,equalScalar:Ir,matrix:$e,not:zc,typed:te,zeros:ln}),concat:Tx({isInteger:kn,matrix:$e,typed:te}),max:Sx({config:Oe,larger:Tn,numeric:za,typed:te}),print:Rx({add:Lr,matrix:$e,typed:te,zeros:ln}),bitAnd:Lx({add:Lr,concat:Gr,equalScalar:Ir,matrix:$e,not:zc,typed:te,zeros:ln}),diff:Fx({bignumber:ea,matrix:$e,number:_i,subtract:Bt,typed:te}),min:Ax({config:Oe,numeric:za,smaller:En,typed:te}),subset:Ex({add:Lr,matrix:$e,typed:te,zeros:ln}),bitOr:zx({DenseMatrix:_r,concat:Gr,equalScalar:Ir,matrix:$e,typed:te}),cumsum:Px({add:Lr,typed:te,unaryPlus:Wx}),index:wx({Index:yn,getMatrixDataType:Hx}),sum:Ox({add:Lr,config:Oe,numeric:za,typed:te}),range:Mx({bignumber:ea,matrix:$e,add:Lr,config:Oe,isPositive:Yo,larger:Tn,largerEq:Wc,smaller:En,smallerEq:Is,typed:te}),row:Cx({Index:yn,matrix:$e,range:Rs,typed:te}),column:xx({Index:yn,matrix:$e,range:Rs,typed:te}),mean:Nx({add:Lr,divide:an,typed:te}),quantileSeq:Bx({add:Lr,bignumber:ea,compare:Go,divide:an,isInteger:kn,larger:Tn,multiply:at,partitionSelect:Hc,smaller:En,smallerEq:Is,subtract:Bt,typed:te}),variance:Ix({add:Lr,apply:Vx,divide:an,isNaN:pf,multiply:at,subtract:Bt,typed:te}),std:_x({map:Ho,sqrt:La,typed:te,variance:ay})});ht(DR,{BigNumber:Ge,Complex:pt,Fraction:Uo,Matrix:qc,Node:Fn,ObjectNode:bf,OperatorNode:io,ParenthesisNode:qs,Range:lP,RelationalNode:SR,ResultSet:FD,ArrayNode:wf,BlockNode:NR,ConditionalNode:AR,ConstantNode:Zo,DenseMatrix:_r,RangeNode:MR,Chain:dS,FunctionAssignmentNode:CR,SparseMatrix:Oi,IndexNode:Df,ImmutableDenseMatrix:$D,Index:yn,AccessorNode:Sf,AssignmentNode:ER,FibonacciHeap:XD,Spa:rS,Unit:wr,SymbolNode:Qo,FunctionNode:Xo,Help:FR,Parser:_R});dS.createProxy(xf);var xS=CD;var RR=ca(wm(),1);var BR=ca(OR(),1);function PR(e){var r=new BR.default;return e.on=r.on.bind(r),e.off=r.off.bind(r),e.once=r.once.bind(r),e.emit=r.emit.bind(r),e}function IR(e,r,t,a){function n(y,w){var C=arguments.length;if(C!==1&&C!==2)throw new ha("import",C,1,2);w||(w={});function b(O,_,E){if(Array.isArray(_))_.forEach(k=>b(O,k));else if(typeof _=="object")for(var T in _)Xe(_,T)&&b(O,_[T],T);else if(As(_)||E!==void 0){var R=As(_)?x(_)?_.fn+".transform":_.fn:E;if(Xe(O,R)&&O[R]!==_&&!w.silent)throw new Error('Cannot import "'+R+'" twice');O[R]=_}else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}var M={};b(M,y);for(var A in M)if(Xe(M,A)){var S=M[A];if(As(S))o(S,w);else if(s(S))i(A,S,w);else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}}function i(y,w,C){if(C.wrap&&typeof w=="function"&&(w=c(w)),m(w)&&(w=e(y,{[w.signature]:w})),e.isTypedFunction(t[y])&&e.isTypedFunction(w)){C.override?w=e(y,w.signatures):w=e(t[y],w),t[y]=w,delete a[y],u(y,w),t.emit("import",y,function(){return w});return}if(t[y]===void 0||C.override){t[y]=w,delete a[y],u(y,w),t.emit("import",y,function(){return w});return}if(!C.silent)throw new Error('Cannot import "'+y+'": already exists')}function u(y,w){w&&typeof w.transform=="function"?(t.expression.transform[y]=w.transform,d(y)&&(t.expression.mathWithTransform[y]=w.transform)):(delete t.expression.transform[y],d(y)&&(t.expression.mathWithTransform[y]=w))}function l(y){delete t.expression.transform[y],d(y)?t.expression.mathWithTransform[y]=t[y]:delete t.expression.mathWithTransform[y]}function c(y){var w=function(){for(var b=[],M=0,A=arguments.length;M2&&arguments[2]!==void 0?arguments[2]:y.fn;if(Hb(C,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(C));var b=x(y)?t.expression.transform:t,M=C in t.expression.transform,A=Xe(b,C)?b[C]:void 0,S=function(){var _={};y.dependencies.map(Vb).forEach(T=>{if(Hb(T,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(T));T==="math"?_.math=t:T==="mathWithTransform"?_.mathWithTransform=t.expression.mathWithTransform:T==="classes"?_.classes=t:_[T]=t[T]});var E=y(_);if(E&&typeof E.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(A===void 0||w.override)return E;if(e.isTypedFunction(A)&&e.isTypedFunction(E))return e(A,E);if(w.silent)return A;throw new Error('Cannot import "'+C+'": already exists')};!y.meta||y.meta.lazy!==!1?(Du(b,C,S),A&&M?l(C):(x(y)||h(y))&&Du(t.expression.mathWithTransform,C,()=>b[C])):(b[C]=S(),A&&M?l(C):(x(y)||h(y))&&Du(t.expression.mathWithTransform,C,()=>b[C])),a[C]=y,t.emit("import",C,S)}function s(y){return typeof y=="function"||typeof y=="number"||typeof y=="string"||typeof y=="boolean"||y===null||Ht(y)||Kt(y)||rr(y)||ma(y)||Qe(y)||Array.isArray(y)}function m(y){return typeof y=="function"&&typeof y.signature=="string"}function d(y){return!Xe(v,y)}function h(y){return y.fn.indexOf(".")===-1&&!Xe(v,y.fn)&&(!y.meta||!y.meta.isClass)}function x(y){return y!==void 0&&y.meta!==void 0&&y.meta.isTransformFunction===!0||!1}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return n}function sy(e,r){var t=ht({},Ds,r);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var a=PR({isNumber:sr,isComplex:Kt,isBigNumber:rr,isFraction:ma,isUnit:Ht,isString:St,isArray:Mr,isMatrix:Qe,isCollection:Nt,isDenseMatrix:Xi,isSparseMatrix:pa,isRange:To,isIndex:Ni,isBoolean:om,isResultSet:sm,isHelp:yu,isFunction:um,isDate:fm,isRegExp:cm,isObject:Ai,isNull:lm,isUndefined:mm,isAccessorNode:qn,isArrayNode:jt,isAssignmentNode:pm,isBlockNode:dm,isConditionalNode:hm,isConstantNode:yr,isFunctionAssignmentNode:_a,isFunctionNode:gn,isIndexNode:Qn,isNode:Nr,isObjectNode:Mi,isOperatorNode:ct,isParenthesisNode:en,isRangeNode:vm,isRelationalNode:gm,isSymbolNode:nt,isChain:bu});a.config=CA(t,a.emit),a.expression={transform:{},mathWithTransform:{config:a.config}};var n=[],i=[];function u(s){if(As(s))return s(a);var m=s[Object.keys(s)[0]];if(As(m))return m(a);if(!NA(s))throw console.warn("Factory object with properties \`type\`, \`name\`, and \`factory\` expected",s),new Error("Factory object with properties \`type\`, \`name\`, and \`factory\` expected");var d=n.indexOf(s),h;return d===-1?(s.math===!0?h=s.factory(a.type,t,u,a.typed,a):h=s.factory(a.type,t,u,a.typed),n.push(s),i.push(h)):h=i[d],h}var l={};function c(){for(var s=arguments.length,m=new Array(s),d=0;d{Pb(l).forEach(s=>{s&&s.meta&&s.meta.recreateOnConfigChange&&o(s,{override:!0})})}),a.create=sy.bind(null,e),a.factory=F,a.import(Pb(DA(e))),a.ArgumentsError=ha,a.DimensionError=pr,a.IndexError=tn,a}var my=ca(am());var kR=ca(qR()),DS=class{constructor(){this.lang="en";this.all={en:{hintText:{dragDropModifierKeys:"Hold \${1} to Pin and \${2} to Copy",createListItem:"Select/Create List Item Frame",dragDropProperties:"Drag and drop properties to link them into the list",newItem:"+ New",selectNote:"Select Note...",newFrame:"New"},defaults:{spaceNote:"Current Note",spaceContext:"Current Space"},commands:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",columns:"Columns",button:"Button",label:"Label",column:"Column",idea:"New",group:"Group",paragraph:"Text",card:"Card",progress:"Progress",rating:"Rating",circularProgress:"Circular Progress",list:"Bullet List","ordered-list":"Numbered List",todo:"To-do List",quote:"Quote",divider:"Divider",note:"Link to Note",link:"Link",callout:"Callout",bookmark:"Bookmark",table:"Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",flow:"Linked Note",newNote:"New Note",tag:"Tag",makeMenu:"Flow Menu",selectStyle:"Style",toggleKeyboard:"Toggle Keyboard",rows:"Rows",masonry:"Gallery"},styles:{bold:"Bold",italics:"Italics",strikethrough:"Strikethrough",code:"Code",link:"Web Link",blocklink:"Link to Note",textColor:"Text Color",highlight:"Highlight"},commandsSuggest:{noResult:"No result"},commandPalette:{enable:"Enable",disabled:"Disable",openFlow:"Open Flow Blocks in Selection",closeFlow:"Close Flow Blocks in Selection",toggleBold:"Toggle Bold",toggleItalics:"Toggle Italics",openSpaces:"Open Spaces",migrateData:"Migrate Spaces From 0.7",blink:"Blink",openFileContext:"Open Explorer",convertPathToSpace:"Convert to Space",revealFile:"Reveal File in Spaces",releaseNotes:"Release Notes",toggleBacklinks:"Toggle Backlinks",collapseAllFolders:"Collapse All Folders",addFileSpace:"Add File to Space",removeFileSpace:"Remove File from Space"},frames:{sections:{kit:"Kit",paths:"Paths"},label:{label:"Label",description:"Label"},note:{label:"Note",description:"Link to a note"},table:{label:"Table",description:"Table"},context:{label:"Context",description:"Display a context view from another space"},calendar:{label:"Calendar View"},field:{label:"Field",description:"Dynamic node that displays a value based on property type"},event:{label:"Event"},divider:{label:"Divider",description:"Divider to separate your content"},button:{label:"Button",description:"Buttons can perform actions and open links"},callout:{label:"Callout",description:"Callout to highlight important information"},toggle:{label:"Toggle",description:"Toggle to show/hide content"}},menu:{newView:"New View",closeSpace:"Close Space",customView:"Custom View",detailsView:"Details View",catalogView:"Catalog View",galleryView:"Gallery View",deleteContext:"Delete Context",openSpace:"Open Space",revealInDefault:"Reveal in Finder",setNone:"None",fileMetadataDescription:"This note only",openFilePane:"Open in a new pane",rename:"Rename",changeToFolderNote:"New Space from Note",moveFile:"Move file to...",moveFolder:"Move folder to...",duplicate:"Make a copy",edit:"Edit",delete:"Delete",getHelp:"Make.md Community",vault:"Vault",openVault:"Open Another Vault",openVaultInFolder:"Open Vault Folder",obSettings:"Obsidian Settings",commandPalette:"Command Palette",backToSpace:"Back to Spaces",collapseAllSections:"Collapse All Spaces",expandAllSections:"Expand All Spaces",collapseAllFolders:"Collapse All Folders",expandAllFolders:"Expand All Folders",spaceTitle:"Add/Remove in Space",home:"Home",waypoints:"Waypoints",none:"None",tableView:"Table View",cardView:"Card View",boardView:"Board View",listView:"List View",flowView:"Flow View",groupBy:"Group By",sortBy:"Sort By",newFilter:"New Filter",clearFilters:"Clear Filters",hide:"Hide",unhideFields:"Unhide All Properties",importDataview:"Import All Dataview Properties",saveAllProperties:"Save All Properties to Files",mergeProperties:"Merge Properties",removeFromSpace:"Unpin from Space",removeFromWaypoints:"Unpin from Waypoints",editCode:"Edit Code",deleteProperty:"Delete Property",hideProperty:"Hide Property",unhideProperty:"Unhide Property",saveProperty:"Save Property",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",deleteRow:"Delete Item",collapseAll:"Collapse All",customSort:"Custom Sort",groupSpaces:"Group Spaces",fileNameSortAlphaAsc:"File Name (A to Z)",fileNameSortAlphaDesc:"File Name (Z to A)",createdTimeSortAsc:"Created Time (new to old)",createdTimeSortDesc:"Created Time (old to new)",modifiedTimeSortAsc:"Modified Time (new to old)",modifiedTimeSortDesc:"Modified Time (old to new)",sizeSortAsc:"Size (smallest to largest)",sizeSortDesc:"Size (largest to smallest)",spaces:"Spaces",tags:"Tags",manageHiddenFiles:"Manage Hidden Files",manageActions:"Manage Actions",deleteSpace:"Delete",changeColor:"Change Color",changePropertyType:"Change Type",deleteFiles:"Delete Files",createFolderSpace:"Create Space from Folder",folder:"Folder",syncToContext:"Add Property to Context",setIcon:"Set Icon",copyEmbedLink:"Copy Embed Link",moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",groupNodes:"Group Nodes",moveFrame:"Move Frame",renameFrame:"Rename Frame",deleteFrame:"Delete Frame"},editor:{rows:"Rows",columns:"Columns",catalog:"Catalog",gallery:"Gallery",grid:"Grid",scaleToFit:"Change to Fit",scaleToFill:"Change to Fill",fit:"Fit",strokeNone:"None",strokeSolid:"Solid",strokeDotted:"Dotted",strokeDashed:"Dashed",size:"Size",gap:"Gap",marginLeft:"Left",marginTop:"Top",marginRight:"Right",marginBottom:"Bottom",minimize:"Minimize",paddingLeft:"Left",paddingTop:"Top",paddingRight:"Right",paddingBottom:"Bottom",unlinkProperty:"Unlink Property",linkedProperty:"Linked Property",linkProperty:"Link Property",currentSpace:"Current Space",linkName:"\${1} Link",linkThumbnail:"\${1} Thumbnail",linkSticker:"\${1} Sticker",opacity:"Opacity",shadowSpread:"Spread",shadowBlur:"Blur",width:"Width",height:"Height",margin:"Margin",padding:"Padding",bold:"Bold",italic:"Italic",underline:"Underline",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",numberOfLines:"Lines",createVerticalSection:"Create Vertical Section",createHorizontalSection:"Create Horizontal Section",themeColors:"Theme Colors",uiColors:"UI Colors",hex:"Hex"},buttons:{add:"Add",addFilter:"Add Filter",addCondition:"Add Condition",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",changeBanner:"Change Cover",changeBannerShort:"Cover",saveChanges:"Save Changes",removeBanner:"Remove Cover",rename:"Change Name",editFrame:"Edit Frame",saveSpace:"Save Space",createSpace:"New Space",createFolder:"New Folder",createNote:"New Note",createCanvas:"New Canvas",addIntoSpace:"New Pin",addSmartSearch:"Add Live Search",addItem:"Add Item",addProperty:"Add Property",addContext:"Add Context",cancel:"Cancel",search:"Search",delete:"Delete",toggleFlow:"Toggle Flow",openFlow:"Open Flow",hideFlow:"Hide Flow",openLink:"Open Link",addToSpace:"Add to Space",addToSpaceShort:"Pin",addTag:"Add Tag",tag:"Tag",syncFields:"Sync Properties",convertTable:"Convert to Markdown",cutTable:"Cut Table",deleteTable:"Delete Table",blink:"Blink",addFile:"Add Item",merge:"Merge",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",deleteView:"Delete View",renameTable:"Rename Table",renameTag:"Rename Tag",createTag:"Create Tag",currentFolder:"Current Folder",sync:"Sync",pasteCSS:"Paste CSS",save:"Save",run:"Run"},metadataTypes:{fileName:"File Name",contexts:"Contexts",path:"Path",folder:"Folder",sticker:"Sticker",color:"Color",created:"Created",lastModified:"Last Modified",extension:"Extension",size:"Size",tags:"Tags",inlinks:"Linked Mentions",outlinks:"Links",label:"Label",fileMetadata:"File Metadata",frontmatter:"Frontmatter"},filterTypes:{contains:"contains",notContains:"does not contain",is:"is",isNot:"is not",before:"before",after:"on or after",anyOf:"is any of",noneOf:"is none of",checked:"is checked",unchecked:"is unchecked",isEmpty:"is empty",isNotEmpty:"is not empty",isSameDate:"is same date",isSameDateAsToday:"today"},sortTypes:{alphaAsc:"A to Z",alphaDesc:"Z to A",earliest:"Earliest",latest:"Latest",checkAsc:"Checked \\u2192 Unchecked",checkDesc:"Unchecked \\u2192 Checked",itemsAsc:"Least Items",itemsDesc:"Most Items"},properties:{defaultField:"Name",audio:{label:"Audio",description:"Audio"},text:{label:"Text",description:"Text field"},number:{label:"Number",description:"Number field with optional unit"},boolean:{label:"Yes/No",description:"Yes or No toggle to indicate the status"},date:{label:"Date",description:"Select a date from a calendar"},option:{label:"Option",description:"Select one or multiple option from a list"},file:{label:"File"},link:{label:"Link",description:"Link to another note or a website"},tags:{label:"Tags",description:"Use tags to quickly organize your items"},object:{label:"Object",description:"Store any complex objects"},context:{label:"Relation",description:"Connect to another context property and create a relation"},image:{label:"Image",description:"Select any image from your system or from the internet"},color:{label:"Color",description:"Use colors to label your items or status"},space:{label:"Context",description:"Link to a context"},icon:{label:"Sticker",description:"Use stickers to uniquely label your items or status"},super:{label:"Super Property",links:"Open Link",properties:"Update Property",api:"API",obsidianCommands:"Run Command",runCommand:"Run Command",performAction:"Perform Action",whenClicked:"When Clicked"},fileProperty:{name:"Name",label:"Formula",createdTime:"Created",modifiedTime:"Last Edited",sticker:"Sticker",links:"Links",tags:"Tags",spaces:"Spaces",extension:"Extension",size:"Size",preview:"Note Preview",parentFolder:"Folder",description:"Use a formula to dynamically display a property"}},views:{navigator:"Navigator",explorer:"Explorer",space:"Space"},subViews:{spaceItems:"Items",spaceContext:"Context",spaceLists:"Lists",spaceActions:"Actions",spaceTemplates:"Templates",smartSearch:"Live Searches",filesAndFolders:"Files and Folders"},labels:{editFormula:"Edit Formula",properties:"Properties",newAction:"New Action",newTable:"New Table",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSection:"Edit Space",createSection:"New Folder",createNote:"New Note",contextMaker:"Context Maker",select:"Select",pinnedItems:"Pinned Items",collapse:"Collapse",expand:"Expand",all:"All",none:"None",view:"View",findStickers:"Find Sticker",mergeProperties:"Merge Properties",placeholder:"Type '\${1}' for commands",notePlaceholder:"New Note for \${1}",itemsSelected:"\${1} Selected",selectNote:"Select Note",selectIcon:"Select Icon",selectImage:"Select Image",selectSpace:"Select Space",styleSmall:"Small",styleMedium:"Medium",styleLarge:"Large",hiddenFilePattern:"Name, Suffixes and Extension",hiddenFileSpecific:"Exclude specific files and folders",textPlaceholder:"Enter Text",noFile:"is not created yet. Click to create.",navigatorSearchPlaceholder:"Search by Text or Filters",blinkPlaceholder:"Quickly Search a File, Folder, Tag... Press Tab to Edit",searchPlaceholder:"Type to search...",contextItemSelectPlaceholder:"Find Item",linkItemSelectPlaceholder:"Find or Create Note",pinNotePlaceholder:"Select a Note or Space to Pin",optionItemSelectPlaceholder:"Select Option",viewItemSelectPlaceholder:"Select View",tagItemSelectPlaceholder:"Find Tag",spaceSelectPlaceholder:"Select any Folder or Tag",propertyItemSelectPlaceholder:"Select Property",sortItemSelectPlaceholder:"Select Sort",filterItemSelectPlaceholder:"Select Filter",imageSelectPlaceholder:"Select an image or paste a URL",imageNotFoundPlaceholder:"No Images Found",syncFrontmatterProperty:"Sync Frontmatter Property",newProperty:"New Property",newPropertyShort:"New Property",propertyType:"Type",propertyDynamic:"Dyanmic",propertyValueSpace:"Space",propertyValueProperty:"Property",propertyLookup:"Edit Formula",dateFormat:"Date Format",propertyFileProp:"Property",multiple:"Multiple",filesCount:"{$1} Files",hiddenFiles:"Hidden Files",addExtension:"Add Rule",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",renameTable:"Rename Table",syncMetadata:"Sync Metadata",syncProperties:"Sync Properties",selectContext:"Select Context",metadata:"Metadata",backlinks:"Backlinks",spaces:"Spaces",context:"Context",content:"Content",deleteSpace:"Delete Space",deleteFiles:"Delete Files",outgoingLinks:"Outgoing Links",moveTo:"Move to",addTo:"Pin to",copyTo:"Copy to",reorderIn:"Reorder in",border:"Border",corners:"Corners",color:"Color",backgroundColor:"Background",cornerRadius:"Radius",onClick:"On Click",layout:"Layout",element:"Element",name:"Name",display:"Display",alignment:"Alignment",margin:"Margin",padding:"Padding",gap:"Gap",width:"Width",height:"Height",opacity:"Opacity",shadow:"Shadow",shadowBlur:"Blur",shadowSpread:"Spread",typography:"Typography",layers:"Layers",fontSize:"Size",props:"Props",styles:"Styles",events:"Events",code:"Code",selectedLayers:"\${1} Layers"},descriptions:{spaceActions:"Create actions that runs when you press a button",spaceLists:"Create lists to track data and organize them in your space",spaceItems:"Add new items to the space or pin items to the space",spaceTemplates:"Create templates to quickly add items to your space",smartSearch:"Automatically pin notes to this space based on a set of searches",hiddenFileOptions:"Exclude any files and folders by name, suffix or extension.",deleteSpace:"Deleting the space will also delete the folder and its contents.",deleteFiles:"Delete \${1} files/folders and their contents?",addContext:"Contexts lets you connect properties from your tags",spaceProperties:"Define Properties for your Space Items",syncMetadata:"Select which fields from your notes to start syncing with the context.",syncProperties:"Contexts defines and syncs the same fields across your notes depending on their folder or tag.",selectContext:"Select which folder or tag context you want to sync the fields."},flowView:{emptyDoc:"Empty Document",itemsCount:" Items",emptyFolder:"This Folder is Empty"},notice:{duplicateFile:"Folder already contains note with same name",addedToSection:"Added to Space",fileExists:"File Already Exists",folderExists:"Folder Already Exists",noPropertyName:"Property Name is Required",duplicatePropertyName:"Duplicate Property Name",newSpaceName:"Enter a name for your space",duplicateSpaceName:"Space name already exists",cantConvertNoteToSpace:"The view is not a note",templateSaved:"Template saved to space: "},settings:{layoutVertical:"Vertical",layoutHorizontal:"Horizontal",sectionSidebar:"Spaces",sectionEditor:"Maker Mode",sectionFlow:"Flow",sectionAdvanced:"Advanced",sectionDataview:"Dataview",sectionContext:"Context",sectionStickers:"Stickers",sectionNavigator:"Navigator",sectionDefault:"Default Spaces",sectionSpaceView:"Space View",sectionBlink:"Blink",sectionInlineContext:"Inline Context",sectionFlowBlock:"Flow Block",sectionFlowMenu:"Flow Menu",sectionFlowStyler:"Flow Styler",experimental:{name:"Experimental",desc:"Experimental features that are subject to change and may not be optimized for performance"},generateThumbnails:{name:"Generate Thumbnails",desc:"Create thumbnails for images to speed up performance"},minimalThemeFix:{name:"Minimal Theme Fix",description:"Apply fixes for the popular theme Minimal"},inlineStickerMenu:{name:"Inline Stickers",desc:"Add inline stickers by typing :"},openSpacesOnLaunch:{name:"Open Spaces as Default Tab",desc:"Open the Spaces tab when Obsidian launches"},defaultSpaceTemplate:{name:"Default Space Template",desc:"Select the default template for new spaces"},defaultDateFormat:{name:"Default Date Format",desc:"Set the default date format, example: yyyy-MM-dd (see https://date-fns.org/v2.30.0/docs/format)"},newNotePlaceholder:{name:"New Note Placeholder",desc:"Default name for new notes"},folderIndentationLines:{name:"Show Folder Indentation Lines",desc:"Turn on to show a line on the left of folders to indicate indentation"},folderNoteLocation:{name:"Folder Note Location Inside Folder",desc:"Turn on to have folder notes inside the folder, turn off to have it outside"},folderViewDefault:{name:"Show Folder Note by Default",desc:"Show the folder note by default when opening a folder"},internalLinkFlowEditor:{name:"Open Flow Blocks on Internal Link Click",desc:"Turn on to toggle Flow Blocks directly by clicking on internal links, otherwise a tooltip will be shown"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},inlineBacklinks:{name:"Show Inline Backlinks (Inline Context required)",desc:"Show editable backlinks at the bottom of your notes"},dataviewInlineContext:{name:"Show Dataview in Inline Context",desc:"Show dataview when inline context is enabled"},inlineContextExplorer:{name:"Inline Context",desc:"Display the context and a banner at the top of your notes"},inlineContextExpanded:{name:"Auto Expand Inline Context",desc:"Expand the inline context sections when opening a note"},inlineContextHorizontal:{name:"Inline Title and Sticker Layout",desc:"Layout for inline title and sticker in Inline Context"},hideFrontmatter:{name:"Hide Frontmatter Properties",desc:"Hide the frontmatter properties in inline context"},openFileContext:{name:"Auto Open Explorer",desc:"Automatically open explorer panel in the right panel"},folderNote:{name:"Enable Folder Note",desc:"Access the folder note in the folder page and hide the folder note from spaces"},expandFolder:{name:"Auto Expand Folder",desc:"Auto expand folders on click"},hoverPreview:{name:"Preview on Hover",desc:"Preview on Hover while holding Control/Command key"},activeFile:{name:"Reveal Active File",desc:"Automatically reveal the active file in Spaces"},contexts:{name:"Contexts",desc:"Contexts allows you to have full control over the metadata of your files"},spaces:{name:"Navigator",desc:"The navigator lets you create and organize your spaces"},spacesStickers:{name:"Stickers",desc:"Use Emojis to make it easier to find your notes"},spacesAlias:{name:"Alias",desc:"Use the alias metadata to show in Spaces"},spacesFileExplorerDual:{name:"Compatibility Mode",desc:"This will improve the compatibility of plugins while using Spaces"},spacesDeleteOption:{name:"Delete File Option",desc:"Select how you want files to be deleted"},spacesDeleteOptions:{permanant:"Delete Permanently",trash:"Move to Obsidian Trash","system-trash":"Move to System Trash"},hideRibbon:{name:"App Ribbon",desc:"Show/hide the left menu aka. ribbon"},spaceView:{name:"Space View",desc:"Open the space view when you click on a space"},defaultSpaces:{name:"Default Spaces",desc:"Recommended spaces for quickly organizing your vault"},homeSpace:{name:"Home Space",desc:"An easy-to-access space where you can add/organize your other spaces"},tagSpaces:{name:"Tag Spaces",desc:"Automatically create spaces for each of your tags"},readableLineWidth:{name:"Readable Line Width",desc:"Use Readable Line Width"},sidebarTabs:{name:"Sidebar Tabs",desc:"Show/hide other sidebar tabs"},spacesPerformance:{name:"Performance Mode",desc:"Turn on performance mode for Spaces, may affect scrolling appearance. Requires Restart"},indexSVG:{name:"Use SVGs as Stickers",desc:"Use any svg file in your vault as a sticker"},inlineStyler:{name:"Flow Styler",desc:"Select text to add styling"},inlineStylerColor:{name:"Text and Highlight Colors \\u{1F9EA}",desc:"Select text color and highlight color, (this may change in the future because of the limitations with HTML and Obsidian)"},spaceRowHeight:{name:"Row Height",desc:"The height for each row in spaces (in pixels), default is 28"},coverHeight:{name:"Cover Height",desc:"The height for the cover of the note or space, default is 200"},makeChar:{name:"Flow Menu Trigger",desc:"Character to open the Flow Menu"},mobileMakeBar:{name:"Flow Styler (Mobile)",desc:"Replaces the mobile toolbar"},editorMarkSans:{name:"Mark Sans \\u{1F9EA}",desc:"Use the editor without Markdown."},editorMakerMode:{name:"Flow (Beta)",desc:"An integrated and intuitive editor experience"},editorMakePlacholder:{name:"Flow Menu Hint Text",desc:"Show a hint text on how to open the Flow Menu Shortcut"},blink:{name:"Blink",desc:"A faster way to search and edit your notes"},editorMakeMenu:{name:"Flow Menu",desc:"Open the Flow menu to quickly add content"},editorMakeMenuTrigger:{name:"Flow Menu Shortcut",desc:"Trigger key to use flow menu"},editorFlowReplace:{name:"Flow Block",desc:"Open your internal links or toggle your embeds in the flow block."},editorFlowStyle:{name:"Flow Block Style",desc:"Select a theme for your flow block",seamless:"Seamless",classic:"Classic",minimal:"Minimal"}}}};this.lang="en";let r=kR.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},Tr=new DS().texts;var KV=ca(am());var VV=(e,r)=>{let t=a=>a=="builtin"?"Builtin":a=="api"?"Spaces":"Action";return[...(e.actionsIndex.get(r)??[]).map(a=>({name:a.schema.name,description:"Action",value:\`\${r}/#;\${a.schema.id}\`,section:"Action"}))??[],...[...e.cli.allCommands()].map(a=>({name:a.schema.name,description:t(a.schema.type),value:a.path,section:t(a.schema.type)}))]};var LR=({field:e,value:r})=>r=="ctime"?{value:\`parseDate(prop('\${e}')['metadata']['file']['\${r}'])\`,type:"date"}:{value:\`prop('\${e}')['metadata']['file']['\${r}']\`,type:"string"},uy=(e,r,t,a)=>{let n=im(e);if(n)return r=="fileprop"&&n.field?LR(n):(r=="option"&&n.source?.length>0&&(n.source=="$commands"?n.options=t.cli.allCommands():n.source=="$links"?n.options=t.spaceManager.allPaths().map(i=>({name:i,value:i})):n.source=="$super"?n.options=VV(t,a):n.source=="$properties"&&(n.options=t.contextsIndex.get(a)?.cols?.map(i=>({name:i.name,value:i.name}))??[])),[...zR(r).configKeys??[],"alias","default"].reduce((i,u)=>({...i,[u]:n[u]}),{}));if(!r)return{};if(!n)if(r=="context")e?.length>0?n={space:e}:n={};else if(r.startsWith("date"))e?.length>0?n={format:e}:n={};else if(r.startsWith("fileprop"))if(e?.length>0){let[i,u]=e.split(".");n=LR({field:i,value:u})}else n={};else r.startsWith("option")&&(e?.length>0?n={options:Dn(e).map(u=>({name:u,value:u}))}:n={});return n??{}};var zR=(e,r)=>r==Fa?Af.find(t=>t.type=="file"):r=="tags"?Af.find(t=>t.type=="tags"):r=="aliases"?Af.find(t=>t.type=="option-multi"):r=="sticker"?Af.find(t=>e=="icon"):Af.find(t=>e==t.type)||Af.find(t=>e==t.multiType),Af=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"text",label:Tr.properties.text.label,metadata:!0,icon:"ui//text",primative:!0,description:Tr.properties.text.description},{type:"number",label:Tr.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],primative:!0,description:Tr.properties.number.description},{type:"boolean",label:Tr.properties.boolean.label,metadata:!0,icon:"ui//check-square",primative:!0,description:Tr.properties.boolean.description},{type:"date",label:Tr.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],primative:!0,description:Tr.properties.date.description},{type:"option",label:Tr.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options","source"],description:Tr.properties.option.description},{type:"tags",label:Tr.properties.tags.label,icon:"ui//tags",description:Tr.properties.tags.description},{type:"file",label:Tr.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:Tr.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value","type"],description:Tr.properties.fileProperty.description},{type:"link",label:Tr.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",primative:!0,description:Tr.properties.link.description},{type:"context",label:Tr.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:Tr.properties.context.description},{type:"object",label:Tr.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type"],description:Tr.properties.object.description},{type:"icon",label:Tr.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",restricted:!0,primative:!0,description:Tr.properties.icon.description},{type:"image",label:Tr.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",primative:!0,description:Tr.properties.image.description},{type:"color",label:Tr.properties.color.label,icon:"ui//mk-make-image",restricted:!0,description:Tr.properties.color.description},{type:"space",label:Tr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Tr.properties.space.description},{type:"table",label:Tr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Tr.properties.space.description},{type:"super",label:Tr.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:Tr.properties.super.label,icon:"ui//input",restricted:!0}];var ks="files",ly={id:ks,name:"Files",type:"db",primary:"true"},ZV="filesView",QV={id:ZV,name:"All",type:"view",def:JSON.stringify({db:ks,icon:"ui//file-stack"})},XV="main",JV=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),E4e={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[JV(XV),QV]},fy={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[ly]},UR={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},cy={...UR,rows:[{name:Fa,schemaId:ks,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:Tr.properties.fileProperty.createdTime,schemaId:ks,type:"fileprop",value:Fa+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var T4e=[{name:Tr.properties.defaultField,schemaId:"",type:"text",primary:"true"}],SS={...UR,rows:[{name:Fa,schemaId:ks,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var F4e={schema:ly,cols:cy.rows,rows:[]},_4e={schema:ly,cols:cy.rows,rows:[]},O4e={schema:ly,cols:SS.rows,rows:[]},WR=(e,r)=>e.filter(t=>r.find(a=>a.id==t.schemaId&&a.type=="db")).reduce((t,a)=>({...t,...t[a.schemaId]?{[a.schemaId]:{uniques:a.unique=="true"?[...t[a.schemaId].uniques,a.name]:t[a.schemaId].uniques,cols:[...t[a.schemaId].cols,a.name],rows:[]}}:{[a.schemaId]:{uniques:a.unique=="true"?[a.name]:[],cols:[a.name],rows:[]}}}),{});var B4e={m_schema:fy,m_fields:cy,...WR(cy.rows,fy.rows)},P4e={m_schema:fy,m_fields:SS,...WR(SS.rows,fy.rows)};var NS="spaces://$tags";var pIe={name:Tr.menu.waypoints,displayName:Tr.menu.waypoints,path:"spaces://$waypoints",label:{name:Tr.menu.waypoints,thumbnail:"",sticker:"ui//tags",color:""},type:"default"},dIe={name:Tr.menu.tags,displayName:Tr.menu.tags,path:"spaces://$tags",label:{thumbnail:"",name:Tr.menu.tags,sticker:"ui//tags",color:""},type:"default"},hIe={name:Tr.menu.vault,displayName:Tr.menu.vault,path:"/",label:{thumbnail:"",name:Tr.menu.vault,sticker:"ui//vault",color:""},type:"default"};var YR=(e,r,t,a,n,i)=>{if(!t)return"";let u=new Map;Object.keys(n).forEach(c=>u.set(c,n[c])),u.set("$properties",a),u.set("$paths",r),i&&u.set("$current",i);let l;try{l=e.evaluate(t,u),l=ws("",l)}catch{}return l};var AS=e=>{let r=new Map;e.filter(u=>u.type=="fileprop"||u.name=="tags").forEach(u=>{let{value:l}=uy(u.value,u.type),c=[];try{let s=Ua(l).filter(m=>m.type=="FunctionNode").filter(m=>m.fn.name=="prop"&&m.args[0].type=="ConstantNode").map(m=>m.args[0]?.value);c.push(...s)}catch{}let o=u.name;r.has(o)||r.set(o,new Set);for(let s of c){let m=s;m!==o&&r.get(o).add(m)}});let t=new Set,a=[],n=new Set,i=u=>{if(n.has(u))throw new Error("Circular dependency detected");if(!t.has(u)){n.add(u);let l=r.get(u)||new Set;for(let c of l)i(c);t.add(u),n.delete(u),a.push(u)}};for(let u of e)t.has(u.name)||i(u.name);return a},HR=(e,r,t,a,n,i)=>{let u=i??AS(a),l=r.get(t[Fa])?.metadata?.property??{},c=Object.keys(l).filter(m=>a.some(d=>d.name==m)).reduce((m,d)=>({...m,[d]:ws(d,l[d])}),{}),o=u.map(m=>a.find(d=>d.name==m)).filter(m=>m&&(m.type=="fileprop"||m.name=="tags")),s=a.reduce((m,d)=>({...m,[d.name]:d}),{});return{...t,...c,...o.reduce((m,d)=>{let{value:h}=uy(d.value,d.type);return{...m,[d.name]:YR(e,r,h,s,{...t,...m},n)}},{})}};var $R=(e,r)=>{let t=e?Dn(e):[],a=r?Dn(r):[];return a.every(n=>t.some(i=>i==n))&&t.every(n=>a.some(i=>i==n))},Mf=(e,r)=>e==r,MS=(e,r)=>(e??"").length==0,CS=(e,r)=>(e??"").toLowerCase().includes((r??"").toLowerCase()),ES=(e,r)=>parseFloat(e)>parseFloat(r),TS=(e,r)=>parseInt(e){let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),a=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf()>=a.valueOf()},VR=(e,r)=>{let t=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e),a=isNaN(Date.parse(r))?new Date(parseInt(r)):new Date(r);return t.valueOf(){let t=e?Dn(e):[],a=r?Dn(r):[];return t.length==0?!1:a.some(n=>t.some(i=>i==n))},ZR=(e,r)=>{if(!e)return!1;let t=new Date(\`\${e.toString().replace(".",":")}\`),a=new Date(\`\${r}\`);return t.getMonth()===a.getMonth()&&t.getDate()===a.getDate()},QR=e=>{if(!e)return!1;let r=new Date(\`\${e.toString()}T00:00\`),t=new Date;return r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()};var Cf={isNotEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(e,r)=>!MS(e,""),valueType:"none"},isEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(e,r)=>MS(e,""),valueType:"none"},include:{fn:(e,r)=>CS(e,r),type:["text","file","link","image"],valueType:"text"},notInclude:{type:["text","file","link","image"],fn:(e,r)=>!CS(e,r),valueType:"text"},is:{type:["text"],fn:(e,r)=>Mf(e,r),valueType:"text"},isNot:{type:["text"],fn:(e,r)=>!Mf(e,r),valueType:"text"},equal:{type:["number"],fn:(e,r)=>Mf(e,r),valueType:"number"},isLink:{type:["link","context"],fn:(e,r)=>Mf(e,r),valueType:"link"},isNotLink:{type:["link","context"],fn:(e,r)=>!Mf(e,r),valueType:"link"},isGreatThan:{type:["number"],fn:(e,r)=>ES(e,r),valueType:"number"},isLessThan:{type:["number"],fn:(e,r)=>TS(e,r),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(e,r)=>!ES(e,r),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(e,r)=>!TS(e,r),valueType:"number"},dateBefore:{type:["date"],fn:(e,r)=>VR(e,r),valueType:"date"},dateAfter:{type:["date"],fn:(e,r)=>GR(e,r),valueType:"date"},isSameDate:{type:["date"],fn:(e,r)=>ZR(e,r),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(e,r)=>QR(e,r),valueType:"none"},isExactList:{type:["option","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(e,r)=>$R(e,r),valueType:"list"},isAnyInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(e,r)=>FS(e,r),valueType:"list"},isNoneInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(e,r)=>!FS(e,r),valueType:"list"},isTrue:{type:["boolean"],fn:(e,r)=>e=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(e,r)=>e!="true",valueType:"none"}};var eZ=(e,r,t)=>r.reduce((n,i)=>{let[u,l]=n,c=i.type=="context"?XR(l,i,t):i.type=="path"?KR(l,i,t):i.type=="frontmatter"?JR(l,i,t):jR(l,i,t),o=l.filter(s=>!c.includes(s));return[[...u,...c],o]},[[],e])[0],rZ=(e,r,t)=>r.reduce((a,n)=>n.type=="context"?XR(a,n,t):n.type=="path"?KR(a,n,t):n.type=="frontmatter"?JR(a,n,t):jR(a,n,t),e),XR=(e,r,t)=>{let a=Cf[r.fn];return!a||a.valueType!="none"&&r.value.length==0?[]:e.filter(n=>{let[i,u]=r.field.split("."),l=n.metadata?.property;if(!n.spaces?.includes(i)||!l||!l[u])return!1;let c=!0;if(a){let o=r.fType=="property"?t[r.value]:r.value;c=a.fn(ws(u,l[u]),o)}return c})},JR=(e,r,t)=>{let a=Cf[r.fn];return!a||a.valueType!="none"&&r.value.length==0?[]:e.filter(n=>{let i=n.metadata?.property;if(!i||!i[r.field])return!1;let u=!0;if(a){let l=r.fType=="property"?t[r.value]:r.value;u=a.fn(ws(r.field,i[r.field]),l)}return u})},KR=(e,r,t)=>{let a=Cf[r.fn];return!a||a.valueType!="none"&&r.value.length==0?[]:e.filter(n=>{let i="";r.field=="outlinks"?i=bs(n.outlinks??[]):r.field=="inlinks"?i=bs(n.inlinks??[]):r.field=="tags"&&(i=bs(n.tags??[]));let u=!0;if(a){let l=r.fType=="property"?t[r.value]:r.value;u=a.fn(i,l)}return u})},jR=(e,r,t)=>{let a=Cf[r.fn];return!a||a.valueType!="none"&&r.value.length==0?[]:e.filter(n=>{let i=!0;if(a){let u=r.fType=="property"?t[r.value]:r.value;i=a.fn(n.metadata?.[r.type]?.[r.field],u)}return i})},e5=(e,r,t)=>e.reduce((n,i)=>!n||i.filters.length==0?!1:i.type=="any"?eZ([r],i.filters,t).length>0:rZ([r],i.filters,t).length>0,!0);var r5=(e,r)=>e.hiddenExtensions.some(t=>r.endsWith(t))||r.startsWith(e.spacesFolder+"/#")||e.hiddenFiles.some(t=>t==r);var t5=(e,r,t)=>{if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{path:e.path,frames:{},schemas:[]}};let a=Object.values(r).map(l=>l.schema),n=a.filter(l=>l.type=="frame").reduce((l,c)=>({...l,[c.id]:r[c.id]}),{}),i={path:e.path,frames:n,schemas:a},u=!0;return t&&my.default.isEqual(i,t)&&(u=!1),{changed:u,cache:i}},n5=(e,r,t,a,n,i,u)=>{let l={};if(!e)return{changed:!1,cache:null};if(!r)return{changed:!1,cache:{cols:[],path:e.path,schemas:[],outlinks:[],contexts:[],paths:[],tables:{},space:e,spaceMap:l,dbExists:!1}};let c=Object.values(r).map(A=>A.schema),o=c.find(A=>A.primary=="true"),s=AS(r[o.id].cols),m={...r[o.id],rows:r[o.id].rows.map(A=>HR(u,i,A,r[o.id].cols,i.get(e.path),s))},d={...r,[o.id]:m},h=m.cols?.filter(A=>A.type.startsWith("context"))??[],x=m.cols?.filter(A=>A.type.startsWith("link"))??[],v=ti(h.map(A=>A.value));h.forEach(A=>{l[A.name]={},m.rows.forEach(S=>{Dn(S[A.name]).forEach(O=>l[A.name][O]=[...l[A.name][O]??[],S[Fa]])})});let y=d[ks]?.rows?.map(A=>A[Fa])??[],w=vA(t??[],y),C=ti(m.rows.reduce((A,S)=>ti([...A,...[...h,...x].flatMap(O=>Dn(S[O.name]).map(_=>wc(_)))]),[])),b={cols:m.cols,path:e.path,contexts:v,outlinks:C,paths:w,tables:d,schemas:c,space:e,spaceMap:l,dbExists:n},M=!0;return a&&my.default.isEqual(b,a)&&(M=!0),{changed:M,cache:b}},a5=(e,r,t,a)=>{let n={};for(let[i,u]of e){let l=t.get(i)?.defPath??i,c=e.get(l)??u,o=u?.parent??"",s=u?.type??"",m=u?.subtype??"",d=c?.label,h=a?.get(i),{changed:x,cache:v}=_S(i,r,t,c,d,s,m,o,h);n[i]={changed:x,cache:v}}return n},_S=(e,r,t,a,n,i,u,l,c)=>{let o=(W,G,H)=>W?.length>0||W?.length>0?W:G=="space"?H=="Spaces/Home"?"ui//home":H=="/"?"ui//vault":H.startsWith("spaces://")?"ui//tags":"ui//folder":"ui//file",s={label:a?.label,path:e,name:yc(e),displayName:yc(e)},m=[],d=a?.tags?.map(W=>W)??[],h=r5(r,e),x=(W,G,H=new Set)=>{let L=[];for(let q of G){let K=W.get(q)?.contexts??[];for(let z of K)H.has(z)||(L.push(z),H.add(z),L.push(...x(W,[bc(z)],H)))}return L};if(t.has(l))for(let W of t.get(l).contexts??[])m.push(W);m.push(...d);let v=n?.name,y=a?.properties?dA(a.properties[r.fmKeyAlias]):[],w=o(n?.sticker,i,e),C=n?.color??"",b=a?.inlinks??[],M=a?.links??[],A=r.spacesUseAlias?y[0]??v:v,S={...s,name:v,tags:ti(m),type:i,subtype:u,displayName:A,parent:l,label:{name:v,sticker:w,color:C,thumbnail:n?.thumbnail??"",preview:n?.preview??""},metadata:{...a},inlinks:b,outlinks:M},O=[];u=="tag"&&O.push(NS);for(let W of m)O.push(bc(W));let _=new Set,E=(W,G)=>{if(!_.has(W)){if(_.add(W),G.dependencies?.length>0)for(let H of G.dependencies)t.has(H)&&E(H,t.get(H));if(G.defPath==e&&(h=!0),u!="tag"&&u!="default"&&G.space&&G.space.path==l){O.push(W);return}if(G.metadata?.filters?.length>0&&e5(G.metadata.filters,{...S,spaces:O},G.properties)){O.push(W);return}if(G.metadata?.links?.length>0&&(G.metadata?.links??[]).find(L=>L==S.path)){O.push(W);return}}};for(let[W,G]of t)E(W,G);let T=x(t,O);O.push(...T.map(W=>bc(W))),S.tags.push(...T);let R=h?{...S,spaces:[],hidden:h}:{...S,spaces:ti(O),hidden:h},k=!0;return c&&my.default.isEqual(R,c)&&(k=!1),{changed:k,cache:R}};function i5(e){let{path:r,settings:t,spacesCache:a,pathMetadata:n,label:i,type:u,subtype:l,parent:c,oldMetadata:o}=e;return _S(r,t,a,n,i,u,l,c,o)}function OS(e,r){let{space:t,mdb:a,paths:n,oldCache:i,dbExists:u,pathsIndex:l}=e;return n5(t,a,n,i,u,l,r)}function o5(e,r){let{map:t,pathsIndex:a}=e,n=new Map;for(let[i,u]of t)n.set(i,OS({...u,pathsIndex:a},r));return n}function s5(e){let{pathCache:r,settings:t,spacesCache:a,oldMetadata:n}=e;return a5(r,t,a,n)}function u5(e){let{space:r,mdb:t,oldCache:a}=e;return t5(r,t,a)}var tZ=self,nZ={...xS,createAdd:F("add",[],()=>function(r,t){return r+t})},BS=sy(nZ);BS.import(Ob,{override:!0});tZ.onmessage=async e=>{let{payload:r,job:t}=e.data,a;t.type=="path"?a=i5(r):t.type=="context"?a=OS(r,BS):t.type=="contexts"?a=o5(r,BS):t.type=="frames"?a=u5(r):t.type=="paths"&&(a=s5(r));try{postMessage({job:t,result:a})}catch(n){console.log(n),postMessage({job:t,result:{$error:\`Failed to index \${t.type} \${t.path}: \${n}\`}})}}; /*! * decimal.js v10.4.3 * An arbitrary-precision Decimal type for JavaScript. @@ -91343,10 +91341,10 @@ var Indexer = class { if (job !== void 0) this.send(job, index2); if ("$error" in data2) { - for (const [_18, reject] of calls) + for (const [_17, reject] of calls) reject(data2["$error"]); } else { - for (const [callback, _18] of calls) + for (const [callback, _17] of calls) callback(data2); } } @@ -91490,228 +91488,8 @@ var Indexer = class { } }; -// src/core/superstate/workers/runner/runner.worker.ts -function Worker3() { - return inlineWorker(`"use strict";var QL=Object.create;var ow=Object.defineProperty;var XL=Object.getOwnPropertyDescriptor;var JL=Object.getOwnPropertyNames;var KL=Object.getPrototypeOf,jL=Object.prototype.hasOwnProperty;var Cn=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),eq=(e,r)=>{for(var t in r)ow(e,t,{get:r[t],enumerable:!0})},rq=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of JL(r))!jL.call(e,i)&&i!==t&&ow(e,i,{get:()=>r[i],enumerable:!(n=XL(r,i))||n.enumerable});return e};var Ui=(e,r,t)=>(t=e!=null?QL(KL(e)):{},rq(r||!e||!e.__esModule?ow(t,"default",{value:e,enumerable:!0}):t,e));var ww=Cn((Vu,$c)=>{(function(){var e,r="4.17.21",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid \`variable\` option passed into \`_.template\`",s="__lodash_hash_undefined__",c=500,f="__lodash_placeholder__",o=1,u=2,p=4,d=1,h=2,x=1,v=2,y=4,w=8,E=16,b=32,A=64,C=128,S=256,O=512,F=30,M="...",_=800,k=16,L=1,Y=2,$=3,V=1/0,q=9007199254740991,R=17976931348623157e292,j=0/0,U=4294967295,se=U-1,de=U>>>1,ae=[["ary",C],["bind",x],["bindKey",v],["curry",w],["curryRight",E],["flip",O],["partial",b],["partialRight",A],["rearg",S]],H="[object Arguments]",pe="[object Array]",_e="[object AsyncFunction]",me="[object Boolean]",xe="[object Date]",Ne="[object DOMException]",ye="[object Error]",we="[object Function]",Se="[object GeneratorFunction]",Ce="[object Map]",Ve="[object Number]",Ke="[object Null]",K="[object Object]",te="[object Promise]",be="[object Proxy]",ee="[object RegExp]",ie="[object Set]",fe="[object String]",Ee="[object Symbol]",Me="[object Undefined]",Ue="[object WeakMap]",ke="[object WeakSet]",lr="[object ArrayBuffer]",ur="[object DataView]",er="[object Float32Array]",Lr="[object Float64Array]",re="[object Int8Array]",le="[object Int16Array]",De="[object Int32Array]",Ie="[object Uint8Array]",Le="[object Uint8ClampedArray]",Te="[object Uint16Array]",Re="[object Uint32Array]",Ye=/\\b__p \\+= '';/g,B=/\\b(__p \\+=) '' \\+/g,Q=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g,ge=/&(?:amp|lt|gt|quot|#39);/g,Pe=/[&<>"']/g,ir=RegExp(ge.source),mr=RegExp(Pe.source),nt=/<%-([\\s\\S]+?)%>/g,Vt=/<%([\\s\\S]+?)%>/g,on=/<%=([\\s\\S]+?)%>/g,_a=/\\.|\\[(?:[^[\\]]*|(["'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,aa=/^\\w*$/,nc=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,oa=/[\\\\^$.*+?()[\\]{}|]/g,Fo=RegExp(oa.source),ar=/^\\s+/,ic=/\\s/,ac=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,Dn=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,Ns=/,? & /,mt=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,eo=/[()=,{}\\[\\]\\/\\s]/,oc=/\\\\(\\\\)?/g,rn=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,Xn=/\\w*$/,Jn=/^[-+]0x[0-9a-f]+$/i,Lt=/^0b[01]+$/i,Un=/^\\[object .+?Constructor\\]$/,di=/^0o[0-7]+$/i,sa=/^(?:0|[1-9]\\d*)$/,sc=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,Oo=/($^)/,uc=/['\\n\\r\\u2028\\u2029\\\\]/g,Nt="\\\\ud800-\\\\udfff",Bo="\\\\u0300-\\\\u036f",fc="\\\\ufe20-\\\\ufe2f",lu="\\\\u20d0-\\\\u20ff",As=Bo+fc+lu,pu="\\\\u2700-\\\\u27bf",mu="a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff",ro="\\\\xac\\\\xb1\\\\xd7\\\\xf7",st="\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf",vn="\\\\u2000-\\\\u206f",cc=" \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000",Ta="A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde",ua="\\\\ufe0e\\\\ufe0f",du=ro+st+vn+cc,lc="['\\u2019]",n1="["+Nt+"]",pc="["+du+"]",Fa="["+As+"]",mc="\\\\d+",i1="["+pu+"]",Al="["+mu+"]",Io="[^"+Nt+du+mc+pu+mu+Ta+"]",Po="\\\\ud83c[\\\\udffb-\\\\udfff]",Cl="(?:"+Fa+"|"+Po+")",ko="[^"+Nt+"]",hi="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",dc="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",Ro="["+Ta+"]",El="\\\\u200d",Ml="(?:"+Al+"|"+Io+")",a1="(?:"+Ro+"|"+Io+")",_l="(?:"+lc+"(?:d|ll|m|re|s|t|ve))?",Tl="(?:"+lc+"(?:D|LL|M|RE|S|T|VE))?",Fl=Cl+"?",hu="["+ua+"]?",o1="(?:"+El+"(?:"+[ko,hi,dc].join("|")+")"+hu+Fl+")*",Ol="\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])",s1="\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])",Bl=hu+Fl+o1,u1="(?:"+[i1,hi,dc].join("|")+")"+Bl,f1="(?:"+[ko+Fa+"?",Fa,hi,dc,n1].join("|")+")",c1=RegExp(lc,"g"),l1=RegExp(Fa,"g"),hc=RegExp(Po+"(?="+Po+")|"+f1+Bl,"g"),p1=RegExp([Ro+"?"+Al+"+"+_l+"(?="+[pc,Ro,"$"].join("|")+")",a1+"+"+Tl+"(?="+[pc,Ro+Ml,"$"].join("|")+")",Ro+"?"+Ml+"+"+_l,Ro+"+"+Tl,s1,Ol,mc,u1].join("|"),"g"),m1=RegExp("["+El+Nt+As+ua+"]"),d1=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,h1=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],v1=-1,Et={};Et[er]=Et[Lr]=Et[re]=Et[le]=Et[De]=Et[Ie]=Et[Le]=Et[Te]=Et[Re]=!0,Et[H]=Et[pe]=Et[lr]=Et[me]=Et[ur]=Et[xe]=Et[ye]=Et[we]=Et[Ce]=Et[Ve]=Et[K]=Et[ee]=Et[ie]=Et[fe]=Et[Ue]=!1;var At={};At[H]=At[pe]=At[lr]=At[ur]=At[me]=At[xe]=At[er]=At[Lr]=At[re]=At[le]=At[De]=At[Ce]=At[Ve]=At[K]=At[ee]=At[ie]=At[fe]=At[Ee]=At[Ie]=At[Le]=At[Te]=At[Re]=!0,At[ye]=At[we]=At[Ue]=!1;var g1={\\u00C0:"A",\\u00C1:"A",\\u00C2:"A",\\u00C3:"A",\\u00C4:"A",\\u00C5:"A",\\u00E0:"a",\\u00E1:"a",\\u00E2:"a",\\u00E3:"a",\\u00E4:"a",\\u00E5:"a",\\u00C7:"C",\\u00E7:"c",\\u00D0:"D",\\u00F0:"d",\\u00C8:"E",\\u00C9:"E",\\u00CA:"E",\\u00CB:"E",\\u00E8:"e",\\u00E9:"e",\\u00EA:"e",\\u00EB:"e",\\u00CC:"I",\\u00CD:"I",\\u00CE:"I",\\u00CF:"I",\\u00EC:"i",\\u00ED:"i",\\u00EE:"i",\\u00EF:"i",\\u00D1:"N",\\u00F1:"n",\\u00D2:"O",\\u00D3:"O",\\u00D4:"O",\\u00D5:"O",\\u00D6:"O",\\u00D8:"O",\\u00F2:"o",\\u00F3:"o",\\u00F4:"o",\\u00F5:"o",\\u00F6:"o",\\u00F8:"o",\\u00D9:"U",\\u00DA:"U",\\u00DB:"U",\\u00DC:"U",\\u00F9:"u",\\u00FA:"u",\\u00FB:"u",\\u00FC:"u",\\u00DD:"Y",\\u00FD:"y",\\u00FF:"y",\\u00C6:"Ae",\\u00E6:"ae",\\u00DE:"Th",\\u00FE:"th",\\u00DF:"ss",\\u0100:"A",\\u0102:"A",\\u0104:"A",\\u0101:"a",\\u0103:"a",\\u0105:"a",\\u0106:"C",\\u0108:"C",\\u010A:"C",\\u010C:"C",\\u0107:"c",\\u0109:"c",\\u010B:"c",\\u010D:"c",\\u010E:"D",\\u0110:"D",\\u010F:"d",\\u0111:"d",\\u0112:"E",\\u0114:"E",\\u0116:"E",\\u0118:"E",\\u011A:"E",\\u0113:"e",\\u0115:"e",\\u0117:"e",\\u0119:"e",\\u011B:"e",\\u011C:"G",\\u011E:"G",\\u0120:"G",\\u0122:"G",\\u011D:"g",\\u011F:"g",\\u0121:"g",\\u0123:"g",\\u0124:"H",\\u0126:"H",\\u0125:"h",\\u0127:"h",\\u0128:"I",\\u012A:"I",\\u012C:"I",\\u012E:"I",\\u0130:"I",\\u0129:"i",\\u012B:"i",\\u012D:"i",\\u012F:"i",\\u0131:"i",\\u0134:"J",\\u0135:"j",\\u0136:"K",\\u0137:"k",\\u0138:"k",\\u0139:"L",\\u013B:"L",\\u013D:"L",\\u013F:"L",\\u0141:"L",\\u013A:"l",\\u013C:"l",\\u013E:"l",\\u0140:"l",\\u0142:"l",\\u0143:"N",\\u0145:"N",\\u0147:"N",\\u014A:"N",\\u0144:"n",\\u0146:"n",\\u0148:"n",\\u014B:"n",\\u014C:"O",\\u014E:"O",\\u0150:"O",\\u014D:"o",\\u014F:"o",\\u0151:"o",\\u0154:"R",\\u0156:"R",\\u0158:"R",\\u0155:"r",\\u0157:"r",\\u0159:"r",\\u015A:"S",\\u015C:"S",\\u015E:"S",\\u0160:"S",\\u015B:"s",\\u015D:"s",\\u015F:"s",\\u0161:"s",\\u0162:"T",\\u0164:"T",\\u0166:"T",\\u0163:"t",\\u0165:"t",\\u0167:"t",\\u0168:"U",\\u016A:"U",\\u016C:"U",\\u016E:"U",\\u0170:"U",\\u0172:"U",\\u0169:"u",\\u016B:"u",\\u016D:"u",\\u016F:"u",\\u0171:"u",\\u0173:"u",\\u0174:"W",\\u0175:"w",\\u0176:"Y",\\u0177:"y",\\u0178:"Y",\\u0179:"Z",\\u017B:"Z",\\u017D:"Z",\\u017A:"z",\\u017C:"z",\\u017E:"z",\\u0132:"IJ",\\u0133:"ij",\\u0152:"Oe",\\u0153:"oe",\\u0149:"'n",\\u017F:"s"},vc={"&":"&","<":"<",">":">",'"':""","'":"'"},gc={"&":"&","<":"<",">":">",""":'"',"'":"'"},x1={"\\\\":"\\\\","'":"'","\\n":"n","\\r":"r","\\u2028":"u2028","\\u2029":"u2029"},Il=parseFloat,Pl=parseInt,kl=typeof global=="object"&&global&&global.Object===Object&&global,y1=typeof self=="object"&&self&&self.Object===Object&&self,tn=kl||y1||Function("return this")(),xc=typeof Vu=="object"&&Vu&&!Vu.nodeType&&Vu,Oa=xc&&typeof $c=="object"&&$c&&!$c.nodeType&&$c,Mt=Oa&&Oa.exports===xc,to=Mt&&kl.process,gn=function(){try{var he=Oa&&Oa.require&&Oa.require("util").types;return he||to&&to.binding&&to.binding("util")}catch{}}(),Rl=gn&&gn.isArrayBuffer,yc=gn&&gn.isDate,Ll=gn&&gn.isMap,ql=gn&&gn.isRegExp,Cs=gn&&gn.isSet,fa=gn&&gn.isTypedArray;function Sn(he,Oe,Ae){switch(Ae.length){case 0:return he.call(Oe);case 1:return he.call(Oe,Ae[0]);case 2:return he.call(Oe,Ae[0],Ae[1]);case 3:return he.call(Oe,Ae[0],Ae[1],Ae[2])}return he.apply(Oe,Ae)}function b1(he,Oe,Ae,sr){for(var _r=-1,ut=he==null?0:he.length;++_r-1}function bc(he,Oe,Ae){for(var sr=-1,_r=he==null?0:he.length;++sr<_r;)if(Ae(Oe,he[sr]))return!0;return!1}function Dt(he,Oe){for(var Ae=-1,sr=he==null?0:he.length,_r=Array(sr);++Ae-1;);return Ae}function Gl(he,Oe){for(var Ae=he.length;Ae--&&Lo(Oe,he[Ae],0)>-1;);return Ae}function C1(he,Oe){for(var Ae=he.length,sr=0;Ae--;)he[Ae]===Oe&&++sr;return sr}var $l=Es(g1),E1=Es(vc);function M1(he){return"\\\\"+x1[he]}function _1(he,Oe){return he==null?e:he[Oe]}function Oi(he){return m1.test(he)}function T1(he){return d1.test(he)}function F1(he){for(var Oe,Ae=[];!(Oe=he.next()).done;)Ae.push(Oe.value);return Ae}function Mc(he){var Oe=-1,Ae=Array(he.size);return he.forEach(function(sr,_r){Ae[++Oe]=[_r,sr]}),Ae}function Ms(he,Oe){return function(Ae){return he(Oe(Ae))}}function vi(he,Oe){for(var Ae=-1,sr=he.length,_r=0,ut=[];++Ae-1}function up(l,m){var D=this.__data__,I=ei(D,l);return I<0?(++this.size,D.push([l,m])):D[I][1]=m,this}pa.prototype.clear=ab,pa.prototype.delete=sp,pa.prototype.get=ob,pa.prototype.has=sb,pa.prototype.set=up;function ma(l){var m=-1,D=l==null?0:l.length;for(this.clear();++m=m?l:m)),l}function Wn(l,m,D,I,W,J){var oe,ce=m&o,ve=m&u,qe=m&p;if(D&&(oe=W?D(l,I,W,J):D(l)),oe!==e)return oe;if(!Ut(l))return l;var ze=Rr(l);if(ze){if(oe=Nk(l),!ce)return ri(l,oe)}else{var He=Fn(l),tr=He==we||He==Se;if(Qo(l))return ZN(l,ce);if(He==K||He==H||tr&&!W){if(oe=ve||tr?{}:m2(l),!ce)return ve?mk(l,vb(oe,l)):pk(l,Oc(oe,l))}else{if(!At[He])return W?l:{};oe=Ak(l,He,ce)}}J||(J=new gi);var hr=J.get(l);if(hr)return hr;J.set(l,oe),W2(l)?l.forEach(function(Er){oe.add(Wn(Er,m,D,Er,l,J))}):U2(l)&&l.forEach(function(Er,$r){oe.set($r,Wn(Er,m,D,$r,l,J))});var Cr=qe?ve?Rb:kb:ve?ni:xn,Wr=ze?e:Cr(l);return Yt(Wr||l,function(Er,$r){Wr&&($r=Er,Er=l[$r]),Ls(oe,$r,Wn(Er,m,D,$r,l,J))}),oe}function Bc(l){var m=xn(l);return function(D){return mp(D,l,m)}}function mp(l,m,D){var I=D.length;if(l==null)return!I;for(l=Yr(l);I--;){var W=D[I],J=m[W],oe=l[W];if(oe===e&&!(W in l)||!J(oe))return!1}return!0}function dp(l,m,D){if(typeof l!="function")throw new Kn(i);return Wc(function(){l.apply(e,D)},m)}function Vn(l,m,D,I){var W=-1,J=gu,oe=!0,ce=l.length,ve=[],qe=m.length;if(!ce)return ve;D&&(m=Dt(m,Tn(D))),I?(J=bc,oe=!1):m.length>=t&&(J=qo,oe=!1,m=new oo(m));e:for(;++WW?0:W+D),I=I===e||I>W?W:Ur(I),I<0&&(I+=W),I=D>I?0:Y2(I);D0&&D(ce)?m>1?sn(ce,m-1,D,I,W):Fi(W,ce):I||(W[W.length]=ce)}return W}var Ic=e2(),gp=e2(!0);function Bi(l,m){return l&&Ic(l,m,xn)}function Pc(l,m){return l&&gp(l,m,xn)}function Ii(l,m){return Ba(m,function(D){return po(l[D])})}function uo(l,m){m=$o(m,l);for(var D=0,I=m.length;l!=null&&Dm}function yb(l,m){return l!=null&&ht.call(l,m)}function bb(l,m){return l!=null&&m in Yr(l)}function wb(l,m,D){return l>=qt(m,D)&&l=120&&ze.length>=120)?new oo(oe&&ze):e}ze=l[0];var He=-1,tr=ce[0];e:for(;++He-1;)ce!==l&&io.call(ce,ve,1),io.call(l,ve,1);return l}function UN(l,m){for(var D=l?m.length:0,I=D-1;D--;){var W=m[D];if(D==I||W!==J){var J=W;lo(W)?io.call(l,W,1):_b(l,W)}}return l}function Cb(l,m){return l+Os(ap()*(m-l+1))}function rk(l,m,D,I){for(var W=-1,J=Ht(Cu((m-l)/(D||1)),0),oe=Ae(J);J--;)oe[I?J:++W]=l,l+=D;return oe}function Eb(l,m){var D="";if(!l||m<1||m>q)return D;do m%2&&(D+=l),m=Os(m/2),m&&(l+=l);while(m);return D}function Hr(l,m){return Yb(v2(l,m,ii),l+"")}function tk(l){return pp(zu(l))}function nk(l,m){var D=zu(l);return _p(D,so(m,0,D.length))}function qc(l,m,D,I){if(!Ut(l))return l;m=$o(m,l);for(var W=-1,J=m.length,oe=J-1,ce=l;ce!=null&&++WW?0:W+m),D=D>W?W:D,D<0&&(D+=W),W=m>D?0:D-m>>>0,m>>>=0;for(var J=Ae(W);++I>>1,oe=l[J];oe!==null&&!yi(oe)&&(D?oe<=m:oe=t){var qe=m?null:gk(l);if(qe)return Uo(qe);oe=!1,W=qo,ve=new oo}else ve=m?[]:ce;e:for(;++I=I?l:Ri(l,m,D)}var $N=V1||function(l){return tn.clearTimeout(l)};function ZN(l,m){if(m)return l.slice();var D=l.length,I=Kl?Kl(D):new l.constructor(D);return l.copy(I),I}function Bb(l){var m=new l.constructor(l.byteLength);return new Su(m).set(new Su(l)),m}function uk(l,m){var D=m?Bb(l.buffer):l.buffer;return new l.constructor(D,l.byteOffset,l.byteLength)}function fk(l){var m=new l.constructor(l.source,Xn.exec(l));return m.lastIndex=l.lastIndex,m}function ck(l){return Rs?Yr(Rs.call(l)):{}}function QN(l,m){var D=m?Bb(l.buffer):l.buffer;return new l.constructor(D,l.byteOffset,l.length)}function XN(l,m){if(l!==m){var D=l!==e,I=l===null,W=l===l,J=yi(l),oe=m!==e,ce=m===null,ve=m===m,qe=yi(m);if(!ce&&!qe&&!J&&l>m||J&&oe&&ve&&!ce&&!qe||I&&oe&&ve||!D&&ve||!W)return 1;if(!I&&!J&&!qe&&l=ce)return ve;var qe=D[I];return ve*(qe=="desc"?-1:1)}}return l.index-m.index}function JN(l,m,D,I){for(var W=-1,J=l.length,oe=D.length,ce=-1,ve=m.length,qe=Ht(J-oe,0),ze=Ae(ve+qe),He=!I;++ce1?D[W-1]:e,oe=W>2?D[2]:e;for(J=l.length>3&&typeof J=="function"?(W--,J):e,oe&&Yn(D[0],D[1],oe)&&(J=W<3?e:J,W=1),m=Yr(m);++I-1?W[J?m[oe]:oe]:e}}function n2(l){return co(function(m){var D=m.length,I=D,W=jn.prototype.thru;for(l&&m.reverse();I--;){var J=m[I];if(typeof J!="function")throw new Kn(i);if(W&&!oe&&Ep(J)=="wrapper")var oe=new jn([],!0)}for(I=oe?I:D;++I1&&et.reverse(),ze&&ve<$r&&(et.length=ve),this&&this!==tn&&this instanceof Er&&(ho=Wr||Uc(ho)),ho.apply(xa,et)}return Er}function i2(l,m){return function(D,I){return ha(D,l,m(I),{})}}function Np(l,m){return function(D,I){var W;if(D===e&&I===e)return m;if(D!==e&&(W=D),I!==e){if(W===e)return I;typeof D=="string"||typeof I=="string"?(D=xi(D),I=xi(I)):(D=VN(D),I=VN(I)),W=l(D,I)}return W}}function Ib(l){return co(function(m){return m=Dt(m,Tn(Dr())),Hr(function(D){var I=this;return l(m,function(W){return Sn(W,I,D)})})})}function Ap(l,m){m=m===e?" ":xi(m);var D=m.length;if(D<2)return D?Eb(m,l):m;var I=Eb(m,Cu(l/Ia(m)));return Oi(m)?Zo(zn(I),0,l).join(""):I.slice(0,l)}function vk(l,m,D,I){var W=m&x,J=Uc(l);function oe(){for(var ce=-1,ve=arguments.length,qe=-1,ze=I.length,He=Ae(ze+ve),tr=this&&this!==tn&&this instanceof oe?J:l;++qece))return!1;var qe=J.get(l),ze=J.get(m);if(qe&&ze)return qe==m&&ze==l;var He=-1,tr=!0,hr=D&h?new oo:e;for(J.set(l,m),J.set(m,l);++He1?"& ":"")+m[I],m=m.join(D>2?", ":" "),l.replace(ac,\`{ -/* [wrapped with \`+m+\`] */ -\`)}function Ek(l){return Rr(l)||Vs(l)||!!(rp&&l&&l[rp])}function lo(l,m){var D=typeof l;return m=m??q,!!m&&(D=="number"||D!="symbol"&&sa.test(l))&&l>-1&&l%1==0&&l0){if(++m>=_)return arguments[0]}else m=0;return l.apply(e,arguments)}}function _p(l,m){var D=-1,I=l.length,W=I-1;for(m=m===e?I:m;++D1?l[m-1]:e;return D=typeof D=="function"?(l.pop(),D):e,M2(l,D)});function _2(l){var m=Z(l);return m.__chain__=!0,m}function LR(l,m){return m(l),l}function Tp(l,m){return m(l)}var qR=co(function(l){var m=l.length,D=m?l[0]:0,I=this.__wrapped__,W=function(J){return Pu(J,l)};return m>1||this.__actions__.length||!(I instanceof zr)||!lo(D)?this.thru(W):(I=I.slice(D,+D+(m?1:0)),I.__actions__.push({func:Tp,args:[W],thisArg:e}),new jn(I,this.__chain__).thru(function(J){return m&&!J.length&&J.push(e),J}))});function UR(){return _2(this)}function zR(){return new jn(this.value(),this.__chain__)}function WR(){this.__values__===e&&(this.__values__=V2(this.value()));var l=this.__index__>=this.__values__.length,m=l?e:this.__values__[this.__index__++];return{done:l,value:m}}function VR(){return this}function YR(l){for(var m,D=this;D instanceof Fu;){var I=D2(D);I.__index__=0,I.__values__=e,m?W.__wrapped__=I:m=I;var W=I;D=D.__wrapped__}return W.__wrapped__=l,m}function HR(){var l=this.__wrapped__;if(l instanceof zr){var m=l;return this.__actions__.length&&(m=new zr(this)),m=m.reverse(),m.__actions__.push({func:Tp,args:[Hb],thisArg:e}),new jn(m,this.__chain__)}return this.thru(Hb)}function GR(){return HN(this.__wrapped__,this.__actions__)}var $R=Dp(function(l,m,D){ht.call(l,D)?++l[D]:da(l,D,1)});function ZR(l,m,D){var I=Rr(l)?vu:gb;return D&&Yn(l,m,D)&&(m=e),I(l,Dr(m,3))}function QR(l,m){var D=Rr(l)?Ba:vp;return D(l,Dr(m,3))}var XR=t2(S2),JR=t2(N2);function KR(l,m){return sn(Fp(l,m),1)}function jR(l,m){return sn(Fp(l,m),V)}function e9(l,m,D){return D=D===e?1:Ur(D),sn(Fp(l,m),D)}function T2(l,m){var D=Rr(l)?Yt:La;return D(l,Dr(m,3))}function F2(l,m){var D=Rr(l)?w1:hp;return D(l,Dr(m,3))}var r9=Dp(function(l,m,D){ht.call(l,D)?l[D].push(m):da(l,D,[m])});function t9(l,m,D,I){l=ti(l)?l:zu(l),D=D&&!I?Ur(D):0;var W=l.length;return D<0&&(D=Ht(W+D,0)),kp(l)?D<=W&&l.indexOf(m,D)>-1:!!W&&Lo(l,m,D)>-1}var n9=Hr(function(l,m,D){var I=-1,W=typeof m=="function",J=ti(l)?Ae(l.length):[];return La(l,function(oe){J[++I]=W?Sn(m,oe,D):Pi(oe,m,D)}),J}),i9=Dp(function(l,m,D){da(l,D,m)});function Fp(l,m){var D=Rr(l)?Dt:Fe;return D(l,Dr(m,3))}function a9(l,m,D,I){return l==null?[]:(Rr(m)||(m=m==null?[]:[m]),D=I?e:D,Rr(D)||(D=D==null?[]:[D]),va(l,m,D))}var o9=Dp(function(l,m,D){l[D?0:1].push(m)},function(){return[[],[]]});function s9(l,m,D){var I=Rr(l)?wc:Yl,W=arguments.length<3;return I(l,Dr(m,4),D,W,La)}function u9(l,m,D){var I=Rr(l)?D1:Yl,W=arguments.length<3;return I(l,Dr(m,4),D,W,hp)}function f9(l,m){var D=Rr(l)?Ba:vp;return D(l,Ip(Dr(m,3)))}function c9(l){var m=Rr(l)?pp:tk;return m(l)}function l9(l,m,D){(D?Yn(l,m,D):m===e)?m=1:m=Ur(m);var I=Rr(l)?mb:nk;return I(l,m)}function p9(l){var m=Rr(l)?db:ak;return m(l)}function m9(l){if(l==null)return 0;if(ti(l))return kp(l)?Ia(l):l.length;var m=Fn(l);return m==Ce||m==ie?l.size:z(l).length}function d9(l,m,D){var I=Rr(l)?Dc:ok;return D&&Yn(l,m,D)&&(m=e),I(l,Dr(m,3))}var h9=Hr(function(l,m){if(l==null)return[];var D=m.length;return D>1&&Yn(l,m[0],m[1])?m=[]:D>2&&Yn(m[0],m[1],m[2])&&(m=[m[0]]),va(l,sn(m,1),[])}),Op=Y1||function(){return tn.Date.now()};function v9(l,m){if(typeof m!="function")throw new Kn(i);return l=Ur(l),function(){if(--l<1)return m.apply(this,arguments)}}function O2(l,m,D){return m=D?e:m,m=l&&m==null?l.length:m,fo(l,C,e,e,e,e,m)}function B2(l,m){var D;if(typeof m!="function")throw new Kn(i);return l=Ur(l),function(){return--l>0&&(D=m.apply(this,arguments)),l<=1&&(m=e),D}}var $b=Hr(function(l,m,D){var I=x;if(D.length){var W=vi(D,qu($b));I|=b}return fo(l,I,m,D,W)}),I2=Hr(function(l,m,D){var I=x|v;if(D.length){var W=vi(D,qu(I2));I|=b}return fo(m,I,l,D,W)});function P2(l,m,D){m=D?e:m;var I=fo(l,w,e,e,e,e,e,m);return I.placeholder=P2.placeholder,I}function k2(l,m,D){m=D?e:m;var I=fo(l,E,e,e,e,e,e,m);return I.placeholder=k2.placeholder,I}function R2(l,m,D){var I,W,J,oe,ce,ve,qe=0,ze=!1,He=!1,tr=!0;if(typeof l!="function")throw new Kn(i);m=qi(m)||0,Ut(D)&&(ze=!!D.leading,He="maxWait"in D,J=He?Ht(qi(D.maxWait)||0,m):J,tr="trailing"in D?!!D.trailing:tr);function hr(Jt){var xa=I,ho=W;return I=W=e,qe=Jt,oe=l.apply(ho,xa),oe}function Cr(Jt){return qe=Jt,ce=Wc($r,m),ze?hr(Jt):oe}function Wr(Jt){var xa=Jt-ve,ho=Jt-qe,tA=m-xa;return He?qt(tA,J-ho):tA}function Er(Jt){var xa=Jt-ve,ho=Jt-qe;return ve===e||xa>=m||xa<0||He&&ho>=J}function $r(){var Jt=Op();if(Er(Jt))return et(Jt);ce=Wc($r,Wr(Jt))}function et(Jt){return ce=e,tr&&I?hr(Jt):(I=W=e,oe)}function bi(){ce!==e&&$N(ce),qe=0,I=ve=W=ce=e}function Hn(){return ce===e?oe:et(Op())}function wi(){var Jt=Op(),xa=Er(Jt);if(I=arguments,W=this,ve=Jt,xa){if(ce===e)return Cr(ve);if(He)return $N(ce),ce=Wc($r,m),hr(ve)}return ce===e&&(ce=Wc($r,m)),oe}return wi.cancel=bi,wi.flush=Hn,wi}var g9=Hr(function(l,m){return dp(l,1,m)}),x9=Hr(function(l,m,D){return dp(l,qi(m)||0,D)});function y9(l){return fo(l,O)}function Bp(l,m){if(typeof l!="function"||m!=null&&typeof m!="function")throw new Kn(i);var D=function(){var I=arguments,W=m?m.apply(this,I):I[0],J=D.cache;if(J.has(W))return J.get(W);var oe=l.apply(this,I);return D.cache=J.set(W,oe)||J,oe};return D.cache=new(Bp.Cache||ma),D}Bp.Cache=ma;function Ip(l){if(typeof l!="function")throw new Kn(i);return function(){var m=arguments;switch(m.length){case 0:return!l.call(this);case 1:return!l.call(this,m[0]);case 2:return!l.call(this,m[0],m[1]);case 3:return!l.call(this,m[0],m[1],m[2])}return!l.apply(this,m)}}function b9(l){return B2(2,l)}var w9=sk(function(l,m){m=m.length==1&&Rr(m[0])?Dt(m[0],Tn(Dr())):Dt(sn(m,1),Tn(Dr()));var D=m.length;return Hr(function(I){for(var W=-1,J=qt(I.length,D);++W=m}),Vs=yp(function(){return arguments}())?yp:function(l){return Gt(l)&&ht.call(l,"callee")&&!ep.call(l,"callee")},Rr=Ae.isArray,k9=Rl?Tn(Rl):Db;function ti(l){return l!=null&&Pp(l.length)&&!po(l)}function Xt(l){return Gt(l)&&ti(l)}function R9(l){return l===!0||l===!1||Gt(l)&&Nn(l)==me}var Qo=tp||aw,L9=yc?Tn(yc):Sb;function q9(l){return Gt(l)&&l.nodeType===1&&!Vc(l)}function U9(l){if(l==null)return!0;if(ti(l)&&(Rr(l)||typeof l=="string"||typeof l.splice=="function"||Qo(l)||Uu(l)||Vs(l)))return!l.length;var m=Fn(l);if(m==Ce||m==ie)return!l.size;if(zc(l))return!z(l).length;for(var D in l)if(ht.call(l,D))return!1;return!0}function z9(l,m){return qs(l,m)}function W9(l,m,D){D=typeof D=="function"?D:e;var I=D?D(l,m):e;return I===e?qs(l,m,e,D):!!I}function Qb(l){if(!Gt(l))return!1;var m=Nn(l);return m==ye||m==Ne||typeof l.message=="string"&&typeof l.name=="string"&&!Vc(l)}function V9(l){return typeof l=="number"&&Bs(l)}function po(l){if(!Ut(l))return!1;var m=Nn(l);return m==we||m==Se||m==_e||m==be}function q2(l){return typeof l=="number"&&l==Ur(l)}function Pp(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=q}function Ut(l){var m=typeof l;return l!=null&&(m=="object"||m=="function")}function Gt(l){return l!=null&&typeof l=="object"}var U2=Ll?Tn(Ll):Lc;function Y9(l,m){return l===m||qa(l,m,qb(m))}function H9(l,m,D){return D=typeof D=="function"?D:e,qa(l,m,qb(m),D)}function G9(l){return z2(l)&&l!=+l}function $9(l){if(Tk(l))throw new _r(n);return Us(l)}function Z9(l){return l===null}function Q9(l){return l==null}function z2(l){return typeof l=="number"||Gt(l)&&Nn(l)==Ve}function Vc(l){if(!Gt(l)||Nn(l)!=K)return!1;var m=Nu(l);if(m===null)return!0;var D=ht.call(m,"constructor")&&m.constructor;return typeof D=="function"&&D instanceof D&&Ts.call(D)==U1}var Xb=ql?Tn(ql):Jr;function X9(l){return q2(l)&&l>=-q&&l<=q}var W2=Cs?Tn(Cs):g;function kp(l){return typeof l=="string"||!Rr(l)&&Gt(l)&&Nn(l)==fe}function yi(l){return typeof l=="symbol"||Gt(l)&&Nn(l)==Ee}var Uu=fa?Tn(fa):N;function J9(l){return l===e}function K9(l){return Gt(l)&&Fn(l)==Ue}function j9(l){return Gt(l)&&Nn(l)==ke}var e7=Cp(ue),r7=Cp(function(l,m){return l<=m});function V2(l){if(!l)return[];if(ti(l))return kp(l)?zn(l):ri(l);if(Fs&&l[Fs])return F1(l[Fs]());var m=Fn(l),D=m==Ce?Mc:m==ie?Uo:zu;return D(l)}function mo(l){if(!l)return l===0?l:0;if(l=qi(l),l===V||l===-V){var m=l<0?-1:1;return m*R}return l===l?l:0}function Ur(l){var m=mo(l),D=m%1;return m===m?D?m-D:m:0}function Y2(l){return l?so(Ur(l),0,U):0}function qi(l){if(typeof l=="number")return l;if(yi(l))return j;if(Ut(l)){var m=typeof l.valueOf=="function"?l.valueOf():l;l=Ut(m)?m+"":m}if(typeof l!="string")return l===0?l:+l;l=Hl(l);var D=Lt.test(l);return D||di.test(l)?Pl(l.slice(2),D?2:8):Jn.test(l)?j:+l}function H2(l){return Ua(l,ni(l))}function t7(l){return l?so(Ur(l),-q,q):l===0?l:0}function gt(l){return l==null?"":xi(l)}var n7=Ru(function(l,m){if(zc(m)||ti(m)){Ua(m,xn(m),l);return}for(var D in m)ht.call(m,D)&&Ls(l,D,m[D])}),G2=Ru(function(l,m){Ua(m,ni(m),l)}),Rp=Ru(function(l,m,D,I){Ua(m,ni(m),l,I)}),i7=Ru(function(l,m,D,I){Ua(m,xn(m),l,I)}),a7=co(Pu);function o7(l,m){var D=Ho(l);return m==null?D:Oc(D,m)}var s7=Hr(function(l,m){l=Yr(l);var D=-1,I=m.length,W=I>2?m[2]:e;for(W&&Yn(m[0],m[1],W)&&(I=1);++D1),J}),Ua(l,Rb(l),D),I&&(D=Wn(D,o|u|p,xk));for(var W=m.length;W--;)_b(D,m[W]);return D});function A7(l,m){return Z2(l,Ip(Dr(m)))}var C7=co(function(l,m){return l==null?{}:j8(l,m)});function Z2(l,m){if(l==null)return{};var D=Dt(Rb(l),function(I){return[I]});return m=Dr(m),qN(l,D,function(I,W){return m(I,W[0])})}function E7(l,m,D){m=$o(m,l);var I=-1,W=m.length;for(W||(W=1,l=e);++Im){var I=l;l=m,m=I}if(D||l%1||m%1){var W=ap();return qt(l+W*(m-l+Il("1e-"+((W+"").length-1))),m)}return Cb(l,m)}var L7=Lu(function(l,m,D){return m=m.toLowerCase(),l+(D?J2(m):m)});function J2(l){return jb(gt(l).toLowerCase())}function K2(l){return l=gt(l),l&&l.replace(sc,$l).replace(l1,"")}function q7(l,m,D){l=gt(l),m=xi(m);var I=l.length;D=D===e?I:so(Ur(D),0,I);var W=D;return D-=m.length,D>=0&&l.slice(D,W)==m}function U7(l){return l=gt(l),l&&mr.test(l)?l.replace(Pe,E1):l}function z7(l){return l=gt(l),l&&Fo.test(l)?l.replace(oa,"\\\\$&"):l}var W7=Lu(function(l,m,D){return l+(D?"-":"")+m.toLowerCase()}),V7=Lu(function(l,m,D){return l+(D?" ":"")+m.toLowerCase()}),Y7=r2("toLowerCase");function H7(l,m,D){l=gt(l),m=Ur(m);var I=m?Ia(l):0;if(!m||I>=m)return l;var W=(m-I)/2;return Ap(Os(W),D)+l+Ap(Cu(W),D)}function G7(l,m,D){l=gt(l),m=Ur(m);var I=m?Ia(l):0;return m&&I>>0,D?(l=gt(l),l&&(typeof m=="string"||m!=null&&!Xb(m))&&(m=xi(m),!m&&Oi(l))?Zo(zn(l),0,D):l.split(m,D)):[]}var j7=Lu(function(l,m,D){return l+(D?" ":"")+jb(m)});function eL(l,m,D){return l=gt(l),D=D==null?0:so(Ur(D),0,l.length),m=xi(m),l.slice(D,D+m.length)==m}function rL(l,m,D){var I=Z.templateSettings;D&&Yn(l,m,D)&&(m=e),l=gt(l),m=Rp({},m,I,u2);var W=Rp({},m.imports,I.imports,u2),J=xn(W),oe=Ec(W,J),ce,ve,qe=0,ze=m.interpolate||Oo,He="__p += '",tr=ca((m.escape||Oo).source+"|"+ze.source+"|"+(ze===on?rn:Oo).source+"|"+(m.evaluate||Oo).source+"|$","g"),hr="//# sourceURL="+(ht.call(m,"sourceURL")?(m.sourceURL+"").replace(/\\s/g," "):"lodash.templateSources["+ ++v1+"]")+\` -\`;l.replace(tr,function(Er,$r,et,bi,Hn,wi){return et||(et=bi),He+=l.slice(qe,wi).replace(uc,M1),$r&&(ce=!0,He+=\`' + -__e(\`+$r+\`) + -'\`),Hn&&(ve=!0,He+=\`'; -\`+Hn+\`; -__p += '\`),et&&(He+=\`' + -((__t = (\`+et+\`)) == null ? '' : __t) + -'\`),qe=wi+Er.length,Er}),He+=\`'; -\`;var Cr=ht.call(m,"variable")&&m.variable;if(!Cr)He=\`with (obj) { -\`+He+\` -} -\`;else if(eo.test(Cr))throw new _r(a);He=(ve?He.replace(Ye,""):He).replace(B,"$1").replace(Q,"$1;"),He="function("+(Cr||"obj")+\`) { -\`+(Cr?"":\`obj || (obj = {}); -\`)+"var __t, __p = ''"+(ce?", __e = _.escape":"")+(ve?\`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -\`:\`; -\`)+He+\`return __p -}\`;var Wr=eA(function(){return ut(J,hr+"return "+He).apply(e,oe)});if(Wr.source=He,Qb(Wr))throw Wr;return Wr}function tL(l){return gt(l).toLowerCase()}function nL(l){return gt(l).toUpperCase()}function iL(l,m,D){if(l=gt(l),l&&(D||m===e))return Hl(l);if(!l||!(m=xi(m)))return l;var I=zn(l),W=zn(m),J=Ct(I,W),oe=Gl(I,W)+1;return Zo(I,J,oe).join("")}function aL(l,m,D){if(l=gt(l),l&&(D||m===e))return l.slice(0,yu(l)+1);if(!l||!(m=xi(m)))return l;var I=zn(l),W=Gl(I,zn(m))+1;return Zo(I,0,W).join("")}function oL(l,m,D){if(l=gt(l),l&&(D||m===e))return l.replace(ar,"");if(!l||!(m=xi(m)))return l;var I=zn(l),W=Ct(I,zn(m));return Zo(I,W).join("")}function sL(l,m){var D=F,I=M;if(Ut(m)){var W="separator"in m?m.separator:W;D="length"in m?Ur(m.length):D,I="omission"in m?xi(m.omission):I}l=gt(l);var J=l.length;if(Oi(l)){var oe=zn(l);J=oe.length}if(D>=J)return l;var ce=D-Ia(I);if(ce<1)return I;var ve=oe?Zo(oe,0,ce).join(""):l.slice(0,ce);if(W===e)return ve+I;if(oe&&(ce+=ve.length-ce),Xb(W)){if(l.slice(ce).search(W)){var qe,ze=ve;for(W.global||(W=ca(W.source,gt(Xn.exec(W))+"g")),W.lastIndex=0;qe=W.exec(ze);)var He=qe.index;ve=ve.slice(0,He===e?ce:He)}}else if(l.indexOf(xi(W),ce)!=ce){var tr=ve.lastIndexOf(W);tr>-1&&(ve=ve.slice(0,tr))}return ve+I}function uL(l){return l=gt(l),l&&ir.test(l)?l.replace(ge,I1):l}var fL=Lu(function(l,m,D){return l+(D?" ":"")+m.toUpperCase()}),jb=r2("toUpperCase");function j2(l,m,D){return l=gt(l),m=D?e:m,m===e?T1(l)?R1(l):N1(l):l.match(m)||[]}var eA=Hr(function(l,m){try{return Sn(l,e,m)}catch(D){return Qb(D)?D:new _r(D)}}),cL=co(function(l,m){return Yt(m,function(D){D=za(D),da(l,D,$b(l[D],l))}),l});function lL(l){var m=l==null?0:l.length,D=Dr();return l=m?Dt(l,function(I){if(typeof I[1]!="function")throw new Kn(i);return[D(I[0]),I[1]]}):[],Hr(function(I){for(var W=-1;++Wq)return[];var D=U,I=qt(l,U);m=Dr(m),l-=U;for(var W=Cc(I,m);++D0||m<0)?new zr(D):(l<0?D=D.takeRight(-l):l&&(D=D.drop(l)),m!==e&&(m=Ur(m),D=m<0?D.dropRight(-m):D.take(m-l)),D)},zr.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},zr.prototype.toArray=function(){return this.take(U)},Bi(zr.prototype,function(l,m){var D=/^(?:filter|find|map|reject)|While$/.test(m),I=/^(?:head|last)$/.test(m),W=Z[I?"take"+(m=="last"?"Right":""):m],J=I||/^find/.test(m);!W||(Z.prototype[m]=function(){var oe=this.__wrapped__,ce=I?[1]:arguments,ve=oe instanceof zr,qe=ce[0],ze=ve||Rr(oe),He=function($r){var et=W.apply(Z,Fi([$r],ce));return I&&tr?et[0]:et};ze&&D&&typeof qe=="function"&&qe.length!=1&&(ve=ze=!1);var tr=this.__chain__,hr=!!this.__actions__.length,Cr=J&&!tr,Wr=ve&&!hr;if(!J&&ze){oe=Wr?oe:new zr(this);var Er=l.apply(oe,ce);return Er.__actions__.push({func:Tp,args:[He],thisArg:e}),new jn(Er,tr)}return Cr&&Wr?l.apply(this,ce):(Er=this.thru(He),Cr?I?Er.value()[0]:Er.value():Er)})}),Yt(["pop","push","shift","sort","splice","unshift"],function(l){var m=_s[l],D=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",I=/^(?:pop|shift)$/.test(l);Z.prototype[l]=function(){var W=arguments;if(I&&!this.__chain__){var J=this.value();return m.apply(Rr(J)?J:[],W)}return this[D](function(oe){return m.apply(Rr(oe)?oe:[],W)})}}),Bi(zr.prototype,function(l,m){var D=Z[m];if(D){var I=D.name+"";ht.call(Yo,I)||(Yo[I]=[]),Yo[I].push({name:m,func:D})}}),Yo[Sp(e,v).name]=[{name:"wrapper",func:e}],zr.prototype.clone=K1,zr.prototype.reverse=j1,zr.prototype.value=eb,Z.prototype.at=qR,Z.prototype.chain=UR,Z.prototype.commit=zR,Z.prototype.next=WR,Z.prototype.plant=YR,Z.prototype.reverse=HR,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=GR,Z.prototype.first=Z.prototype.head,Fs&&(Z.prototype[Fs]=VR),Z},Pa=L1();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(tn._=Pa,define(function(){return Pa})):Oa?((Oa.exports=Pa)._=Pa,xc._=Pa):tn._=Pa}).call(Vu)});var rm=Cn((_w,Tw)=>{(function(e,r){typeof _w=="object"&&typeof Tw<"u"?Tw.exports=r():typeof define=="function"&&define.amd?define(r):(e=typeof globalThis<"u"?globalThis:e||self,e["'typed'"]=r())})(_w,function(){"use strict";function e(){return!0}function r(){return!1}function t(){}let n="Argument is not a typed-function.";function i(){function s(re){return typeof re=="object"&&re!==null&&re.constructor===Object}let c=[{name:"number",test:function(re){return typeof re=="number"}},{name:"string",test:function(re){return typeof re=="string"}},{name:"boolean",test:function(re){return typeof re=="boolean"}},{name:"Function",test:function(re){return typeof re=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(re){return re instanceof Date}},{name:"RegExp",test:function(re){return re instanceof RegExp}},{name:"Object",test:s},{name:"null",test:function(re){return re===null}},{name:"undefined",test:function(re){return re===void 0}}],f={name:"any",test:e,isAny:!0},o,u,p=0,d={createCount:0};function h(re){let le=o.get(re);if(le)return le;let De='Unknown type "'+re+'"',Ie=re.toLowerCase(),Le;for(Le of u)if(Le.toLowerCase()===Ie){De+='. Did you mean "'+Le+'" ?';break}throw new TypeError(De)}function x(re){let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",De=le?h(le).index:u.length,Ie=[];for(let Te=0;Te{let Ie=o.get(De);return!Ie.isAny&&Ie.test(re)});return le.length?le:["any"]}function E(re){return re&&typeof re=="function"&&"_typedFunctionData"in re}function b(re,le,De){if(!E(re))throw new TypeError(n);let Ie=De&&De.exact,Le=Array.isArray(le)?le.join(","):le,Te=_(Le),Re=S(Te);if(!Ie||Re in re.signatures){let ge=re._typedFunctionData.signatureMap.get(Re);if(ge)return ge}let Ye=Te.length,B;if(Ie){B=[];let ge;for(ge in re.signatures)B.push(re._typedFunctionData.signatureMap.get(ge))}else B=re._typedFunctionData.signatures;for(let ge=0;ge!Vt.has(on.name)))continue}ir.push(mr)}}if(B=ir,B.length===0)break}let Q;for(Q of B)if(Q.params.length<=Ye)return Q;throw new TypeError("Signature not found (signature: "+(re.name||"unnamed")+"("+S(Te,", ")+"))")}function A(re,le,De){return b(re,le,De).implementation}function C(re,le){let De=h(le);if(De.test(re))return re;let Ie=De.conversionsTo;if(Ie.length===0)throw new Error("There are no conversions to "+le+" defined.");for(let Le=0;Le1&&arguments[1]!==void 0?arguments[1]:",";return re.map(De=>De.name).join(le)}function O(re){let le=re.indexOf("...")===0,Ie=(le?re.length>3?re.slice(3):"any":re).split("|").map(Ye=>h(Ye.trim())),Le=!1,Te=le?"...":"";return{types:Ie.map(function(Ye){return Le=Ye.isAny||Le,Te+=Ye.name+"|",{name:Ye.name,typeIndex:Ye.index,test:Ye.test,isAny:Ye.isAny,conversion:null,conversionIndex:-1}}),name:Te.slice(0,-1),hasAny:Le,hasConversion:!1,restParam:le}}function F(re){let le=re.types.map(Re=>Re.name),De=H(le),Ie=re.hasAny,Le=re.name,Te=De.map(function(Re){let Ye=h(Re.from);return Ie=Ye.isAny||Ie,Le+="|"+Re.from,{name:Re.from,typeIndex:Ye.index,test:Ye.test,isAny:Ye.isAny,conversion:Re,conversionIndex:Re.index}});return{types:re.types.concat(Te),name:Le,hasAny:Ie,hasConversion:Te.length>0,restParam:re.restParam}}function M(re){return re.typeSet||(re.typeSet=new Set,re.types.forEach(le=>re.typeSet.add(le.name))),re.typeSet}function _(re){let le=[];if(typeof re!="string")throw new TypeError("Signatures must be strings");let De=re.trim();if(De==="")return le;let Ie=De.split(",");for(let Le=0;Le=Le+1}}else return re.length===0?function(Te){return Te.length===0}:re.length===1?(De=L(re[0]),function(Te){return De(Te[0])&&Te.length===1}):re.length===2?(De=L(re[0]),Ie=L(re[1]),function(Te){return De(Te[0])&&Ie(Te[1])&&Te.length===2}):(le=re.map(L),function(Te){for(let Re=0;Re{let Le=V(Ie.params,le),Te;for(Te of Le)De.add(Te)}),De.has("any")?["any"]:Array.from(De)}function j(re,le,De){let Ie,Le,Te=re||"unnamed",Re=De,Ye;for(Ye=0;Ye{let mr=$(ir.params,Ye),nt=L(mr);(Ye0){let ir=w(le[Ye]);return Ie=new TypeError("Unexpected type of argument in function "+Te+" (expected: "+Le.join(" or ")+", actual: "+ir.join(" | ")+", index: "+Ye+")"),Ie.data={category:"wrongType",fn:Te,index:Ye,actual:ir,expected:Le},Ie}}else Re=Pe}let B=Re.map(function(Pe){return k(Pe.params)?1/0:Pe.params.length});if(le.lengthQ)return Ie=new TypeError("Too many arguments in function "+Te+" (expected: "+Q+", actual: "+le.length+")"),Ie.data={category:"tooManyArgs",fn:Te,index:le.length,expectedLength:Q},Ie;let ge=[];for(let Pe=0;Pe0)return 1;let Ie=se(re)-se(le);return Ie<0?-1:Ie>0?1:0}function ae(re,le){let De=re.params,Ie=le.params,Le=K(De),Te=K(Ie),Re=k(De),Ye=k(Ie);if(Re&&Le.hasAny){if(!Ye||!Te.hasAny)return 1}else if(Ye&&Te.hasAny)return-1;let B=0,Q=0,ge;for(ge of De)ge.hasAny&&++B,ge.hasConversion&&++Q;let Pe=0,ir=0;for(ge of Ie)ge.hasAny&&++Pe,ge.hasConversion&&++ir;if(B!==Pe)return B-Pe;if(Re&&Le.hasConversion){if(!Ye||!Te.hasConversion)return 1}else if(Ye&&Te.hasConversion)return-1;if(Q!==ir)return Q-ir;if(Re){if(!Ye)return 1}else if(Ye)return-1;let mr=(De.length-Ie.length)*(Re?-1:1);if(mr!==0)return mr;let nt=[],Vt=0;for(let _a=0;_a1&&le.sort((Le,Te)=>Le.index-Te.index);let De=le[0].conversionsTo;if(re.length===1)return De;De=De.concat([]);let Ie=new Set(re);for(let Le=1;LeLe.hasConversion)){let Le=k(re),Te=re.map(_e);De=function(){let Ye=[],B=Le?arguments.length-1:arguments.length;for(let Q=0;QB.name).join("|"),hasAny:Ye.some(B=>B.isAny),hasConversion:!1,restParam:!0}),Re.push(Te)}else Re=Te.types.map(function(Ye){return{types:[Ye],name:Ye.name,hasAny:Ye.isAny,hasConversion:Ye.conversion,restParam:!1}});return ee(Re,function(Ye){return le(De,Ie+1,Le.concat([Ye]))})}else return[Le]}return le(re,0,[])}function xe(re,le){let De=Math.max(re.length,le.length);for(let Ye=0;Ye=Ie:Re?Ie>=Le:Ie===Le}function Ne(re){return re.map(le=>Ue(le)?Ee(le.referToSelf.callback):Me(le)?fe(le.referTo.references,le.referTo.callback):le)}function ye(re,le,De){let Ie=[],Le;for(Le of re){let Te=De[Le];if(typeof Te!="number")throw new TypeError('No definition for referenced signature "'+Le+'"');if(Te=le[Te],typeof Te!="function")return!1;Ie.push(Te)}return Ie}function we(re,le,De){let Ie=Ne(re),Le=new Array(Ie.length).fill(!1),Te=!0;for(;Te;){Te=!1;let Re=!0;for(let Ye=0;Ye{let Ie=re[De];if(le.test(Ie.toString()))throw new SyntaxError("Using \`this\` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function Ce(re,le){if(d.createCount++,Object.keys(le).length===0)throw new SyntaxError("No signatures provided");d.warnAgainstDeprecatedThis&&Se(le);let De=[],Ie=[],Le={},Te=[],Re;for(Re in le){if(!Object.prototype.hasOwnProperty.call(le,Re))continue;let st=_(Re);if(!st)continue;De.forEach(function(ua){if(xe(ua,st))throw new TypeError('Conflicting signatures "'+S(ua)+'" and "'+S(st)+'".')}),De.push(st);let vn=Ie.length;Ie.push(le[Re]);let cc=st.map(F),Ta;for(Ta of me(cc)){let ua=S(Ta);Te.push({params:Ta,name:ua,fn:vn}),Ta.every(du=>!du.hasConversion)&&(Le[ua]=vn)}}Te.sort(ae);let Ye=we(Ie,Le,ro),B;for(B in Le)Object.prototype.hasOwnProperty.call(Le,B)&&(Le[B]=Ye[Le[B]]);let Q=[],ge=new Map;for(B of Te)ge.has(B.name)||(B.fn=Ye[B.fn],Q.push(B),ge.set(B.name,B));let Pe=Q[0]&&Q[0].params.length<=2&&!k(Q[0].params),ir=Q[1]&&Q[1].params.length<=2&&!k(Q[1].params),mr=Q[2]&&Q[2].params.length<=2&&!k(Q[2].params),nt=Q[3]&&Q[3].params.length<=2&&!k(Q[3].params),Vt=Q[4]&&Q[4].params.length<=2&&!k(Q[4].params),on=Q[5]&&Q[5].params.length<=2&&!k(Q[5].params),_a=Pe&&ir&&mr&&nt&&Vt&&on;for(let st=0;stst.test),pu=Q.map(st=>st.implementation),mu=function(){for(let vn=fc;vnS(_(De))),le=K(arguments);if(typeof le!="function")throw new TypeError("Callback function expected as last argument");return fe(re,le)}function fe(re,le){return{referTo:{references:re,callback:le}}}function Ee(re){if(typeof re!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:re}}}function Me(re){return re&&typeof re.referTo=="object"&&Array.isArray(re.referTo.references)&&typeof re.referTo.callback=="function"}function Ue(re){return re&&typeof re.referToSelf=="object"&&typeof re.referToSelf.callback=="function"}function ke(re,le){if(!re)return le;if(le&&le!==re){let De=new Error("Function names do not match (expected: "+re+", actual: "+le+")");throw De.data={actual:le,expected:re},De}return re}function lr(re){let le;for(let De in re)Object.prototype.hasOwnProperty.call(re,De)&&(E(re[De])||typeof re[De].signature=="string")&&(le=ke(le,re[De].name));return le}function ur(re,le){let De;for(De in le)if(Object.prototype.hasOwnProperty.call(le,De)){if(De in re&&le[De]!==re[De]){let Ie=new Error('Signature "'+De+'" is defined twice');throw Ie.data={signature:De,sourceFunction:le[De],destFunction:re[De]},Ie}re[De]=le[De]}}let er=d;d=function(re){let le=typeof re=="string",De=le?1:0,Ie=le?re:"",Le={};for(let Te=De;TeLe.from===re.from);if(!De)throw new Error("Attempt to remove nonexistent conversion from "+re.from+" to "+re.to);if(De.convert!==re.convert)throw new Error("Conversion to remove does not match existing conversion");let Ie=le.conversionsTo.indexOf(De);le.conversionsTo.splice(Ie,1)},d.resolve=function(re,le){if(!E(re))throw new TypeError(n);let De=re._typedFunctionData.signatures;for(let Ie=0;Ie{(function(e){"use strict";var r=Math.cosh||function(o){return Math.abs(o)<1e-9?1-o:(Math.exp(o)+Math.exp(-o))*.5},t=Math.sinh||function(o){return Math.abs(o)<1e-9?o:(Math.exp(o)-Math.exp(-o))*.5},n=function(o){var u=Math.PI/4;if(-u>o||o>u)return Math.cos(o)-1;var p=o*o;return p*(p*(p*(p*(p*(p*(p*(p/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},i=function(o,u){var p=Math.abs(o),d=Math.abs(u);return p<3e3&&d<3e3?Math.sqrt(p*p+d*d):(p0&&a();break;case"number":p.im=0,p.re=o;break;default:a()}return isNaN(p.re)||isNaN(p.im),p};function f(o,u){if(!(this instanceof f))return new f(o,u);var p=c(o,u);this.re=p.re,this.im=p.im}f.prototype={re:0,im:0,sign:function(){var o=this.abs();return new f(this.re/o,this.im/o)},add:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:new f(this.re+p.re,this.im+p.im)},sub:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:new f(this.re-p.re,this.im-p.im)},mul:function(o,u){var p=new f(o,u);return this.isInfinite()&&p.isZero()||this.isZero()&&p.isInfinite()?f.NAN:this.isInfinite()||p.isInfinite()?f.INFINITY:p.im===0&&this.im===0?new f(this.re*p.re,0):new f(this.re*p.re-this.im*p.im,this.re*p.im+this.im*p.re)},div:function(o,u){var p=new f(o,u);if(this.isZero()&&p.isZero()||this.isInfinite()&&p.isInfinite())return f.NAN;if(this.isInfinite()||p.isZero())return f.INFINITY;if(this.isZero()||p.isInfinite())return f.ZERO;o=this.re,u=this.im;var d=p.re,h=p.im,x,v;return h===0?new f(o/d,u/d):Math.abs(d)0)return new f(Math.pow(o,p.re),0);if(o===0)switch((p.re%4+4)%4){case 0:return new f(Math.pow(u,p.re),0);case 1:return new f(0,Math.pow(u,p.re));case 2:return new f(-Math.pow(u,p.re),0);case 3:return new f(0,-Math.pow(u,p.re))}}if(o===0&&u===0&&p.re>0&&p.im>=0)return f.ZERO;var d=Math.atan2(u,o),h=s(o,u);return o=Math.exp(p.re*h-p.im*d),u=p.im*h+p.re*d,new f(o*Math.cos(u),o*Math.sin(u))},sqrt:function(){var o=this.re,u=this.im,p=this.abs(),d,h;if(o>=0){if(u===0)return new f(Math.sqrt(o),0);d=.5*Math.sqrt(2*(p+o))}else d=Math.abs(u)/Math.sqrt(2*(p-o));return o<=0?h=.5*Math.sqrt(2*(p-o)):h=Math.abs(u)/Math.sqrt(2*(p+o)),new f(d,u<0?-h:h)},exp:function(){var o=Math.exp(this.re);return this.im,new f(o*Math.cos(this.im),o*Math.sin(this.im))},expm1:function(){var o=this.re,u=this.im;return new f(Math.expm1(o)*Math.cos(u)+n(u),Math.exp(o)*Math.sin(u))},log:function(){var o=this.re,u=this.im;return u===0&&o>0,new f(s(o,u),Math.atan2(u,o))},abs:function(){return i(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var o=this.re,u=this.im;return new f(Math.sin(o)*r(u),Math.cos(o)*t(u))},cos:function(){var o=this.re,u=this.im;return new f(Math.cos(o)*r(u),-Math.sin(o)*t(u))},tan:function(){var o=2*this.re,u=2*this.im,p=Math.cos(o)+r(u);return new f(Math.sin(o)/p,t(u)/p)},cot:function(){var o=2*this.re,u=2*this.im,p=Math.cos(o)-r(u);return new f(-Math.sin(o)/p,t(u)/p)},sec:function(){var o=this.re,u=this.im,p=.5*r(2*u)+.5*Math.cos(2*o);return new f(Math.cos(o)*r(u)/p,Math.sin(o)*t(u)/p)},csc:function(){var o=this.re,u=this.im,p=.5*r(2*u)-.5*Math.cos(2*o);return new f(Math.sin(o)*r(u)/p,-Math.cos(o)*t(u)/p)},asin:function(){var o=this.re,u=this.im,p=new f(u*u-o*o+1,-2*o*u).sqrt(),d=new f(p.re-u,p.im+o).log();return new f(d.im,-d.re)},acos:function(){var o=this.re,u=this.im,p=new f(u*u-o*o+1,-2*o*u).sqrt(),d=new f(p.re-u,p.im+o).log();return new f(Math.PI/2-d.im,d.re)},atan:function(){var o=this.re,u=this.im;if(o===0){if(u===1)return new f(0,1/0);if(u===-1)return new f(0,-1/0)}var p=o*o+(1-u)*(1-u),d=new f((1-u*u-o*o)/p,-2*o/p).log();return new f(-.5*d.im,.5*d.re)},acot:function(){var o=this.re,u=this.im;if(u===0)return new f(Math.atan2(1,o),0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).atan():new f(o!==0?o/0:0,u!==0?-u/0:0).atan()},asec:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(0,1/0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).acos():new f(o!==0?o/0:0,u!==0?-u/0:0).acos()},acsc:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(Math.PI/2,1/0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).asin():new f(o!==0?o/0:0,u!==0?-u/0:0).asin()},sinh:function(){var o=this.re,u=this.im;return new f(t(o)*Math.cos(u),r(o)*Math.sin(u))},cosh:function(){var o=this.re,u=this.im;return new f(r(o)*Math.cos(u),t(o)*Math.sin(u))},tanh:function(){var o=2*this.re,u=2*this.im,p=r(o)+Math.cos(u);return new f(t(o)/p,Math.sin(u)/p)},coth:function(){var o=2*this.re,u=2*this.im,p=r(o)-Math.cos(u);return new f(t(o)/p,-Math.sin(u)/p)},csch:function(){var o=this.re,u=this.im,p=Math.cos(2*u)-r(2*o);return new f(-2*t(o)*Math.cos(u)/p,2*r(o)*Math.sin(u)/p)},sech:function(){var o=this.re,u=this.im,p=Math.cos(2*u)+r(2*o);return new f(2*r(o)*Math.cos(u)/p,-2*t(o)*Math.sin(u)/p)},asinh:function(){var o=this.im;this.im=-this.re,this.re=o;var u=this.asin();return this.re=-this.im,this.im=o,o=u.re,u.re=-u.im,u.im=o,u},acosh:function(){var o=this.acos();if(o.im<=0){var u=o.re;o.re=-o.im,o.im=u}else{var u=o.im;o.im=-o.re,o.re=u}return o},atanh:function(){var o=this.re,u=this.im,p=o>1&&u===0,d=1-o,h=1+o,x=d*d+u*u,v=x!==0?new f((h*d-u*u)/x,(u*d+h*u)/x):new f(o!==-1?o/0:0,u!==0?u/0:0),y=v.re;return v.re=s(v.re,v.im)/2,v.im=Math.atan2(v.im,y)/2,p&&(v.im=-v.im),v},acoth:function(){var o=this.re,u=this.im;if(o===0&&u===0)return new f(0,Math.PI/2);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).atanh():new f(o!==0?o/0:0,u!==0?-u/0:0).atanh()},acsch:function(){var o=this.re,u=this.im;if(u===0)return new f(o!==0?Math.log(o+Math.sqrt(o*o+1)):1/0,0);var p=o*o+u*u;return p!==0?new f(o/p,-u/p).asinh():new f(o!==0?o/0:0,u!==0?-u/0:0).asinh()},asech:function(){var o=this.re,u=this.im;if(this.isZero())return f.INFINITY;var p=o*o+u*u;return p!==0?new f(o/p,-u/p).acosh():new f(o!==0?o/0:0,u!==0?-u/0:0).acosh()},inverse:function(){if(this.isZero())return f.INFINITY;if(this.isInfinite())return f.ZERO;var o=this.re,u=this.im,p=o*o+u*u;return new f(o/p,-u/p)},conjugate:function(){return new f(this.re,-this.im)},neg:function(){return new f(-this.re,-this.im)},ceil:function(o){return o=Math.pow(10,o||0),new f(Math.ceil(this.re*o)/o,Math.ceil(this.im*o)/o)},floor:function(o){return o=Math.pow(10,o||0),new f(Math.floor(this.re*o)/o,Math.floor(this.im*o)/o)},round:function(o){return o=Math.pow(10,o||0),new f(Math.round(this.re*o)/o,Math.round(this.im*o)/o)},equals:function(o,u){var p=new f(o,u);return Math.abs(p.re-this.re)<=f.EPSILON&&Math.abs(p.im-this.im)<=f.EPSILON},clone:function(){return new f(this.re,this.im)},toString:function(){var o=this.re,u=this.im,p="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(o){(function(e){"use strict";var r=2e3,t={s:1,n:0,d:1};function n(v,y){if(isNaN(v=parseInt(v,10)))throw h();return v*y}function i(v,y){if(y===0)throw d();var w=Object.create(p.prototype);w.s=v<0?-1:1,v=v<0?-v:v;var E=u(v,y);return w.n=v/E,w.d=y/E,w}function a(v){for(var y={},w=v,E=2,b=4;b<=w;){for(;w%E===0;)w/=E,y[E]=(y[E]||0)+1;b+=1+2*E++}return w!==v?w>1&&(y[w]=(y[w]||0)+1):y[v]=(y[v]||0)+1,y}var s=function(v,y){var w=0,E=1,b=1,A=0,C=0,S=0,O=1,F=1,M=0,_=1,k=1,L=1,Y=1e7,$;if(v!=null)if(y!==void 0){if(w=v,E=y,b=w*E,w%1!==0||E%1!==0)throw x()}else switch(typeof v){case"object":{if("d"in v&&"n"in v)w=v.n,E=v.d,"s"in v&&(w*=v.s);else if(0 in v)w=v[0],1 in v&&(E=v[1]);else throw h();b=w*E;break}case"number":{if(v<0&&(b=v,v=-v),v%1===0)w=v;else if(v>0){for(v>=1&&(F=Math.pow(10,Math.floor(1+Math.log(v)/Math.LN10)),v/=F);_<=Y&&L<=Y;)if($=(M+k)/(_+L),v===$){_+L<=Y?(w=M+k,E=_+L):L>_?(w=k,E=L):(w=M,E=_);break}else v>$?(M+=k,_+=L):(k+=M,L+=_),_>Y?(w=k,E=L):(w=M,E=_);w*=F}else(isNaN(v)||isNaN(y))&&(E=w=NaN);break}case"string":{if(_=v.match(/\\d+|./g),_===null)throw h();if(_[M]==="-"?(b=-1,M++):_[M]==="+"&&M++,_.length===M+1?C=n(_[M++],b):_[M+1]==="."||_[M]==="."?(_[M]!=="."&&(A=n(_[M++],b)),M++,(M+1===_.length||_[M+1]==="("&&_[M+3]===")"||_[M+1]==="'"&&_[M+3]==="'")&&(C=n(_[M],b),O=Math.pow(10,_[M].length),M++),(_[M]==="("&&_[M+2]===")"||_[M]==="'"&&_[M+2]==="'")&&(S=n(_[M+1],b),F=Math.pow(10,_[M+1].length)-1,M+=3)):_[M+1]==="/"||_[M+1]===":"?(C=n(_[M],b),O=n(_[M+2],1),M+=3):_[M+3]==="/"&&_[M+1]===" "&&(A=n(_[M],b),C=n(_[M+2],b),O=n(_[M+4],1),M+=5),_.length<=M){E=O*F,b=w=S+E*A+F*C;break}}default:throw h()}if(E===0)throw d();t.s=b<0?-1:1,t.n=Math.abs(w),t.d=Math.abs(E)};function c(v,y,w){for(var E=1;y>0;v=v*v%w,y>>=1)y&1&&(E=E*v%w);return E}function f(v,y){for(;y%2===0;y/=2);for(;y%5===0;y/=5);if(y===1)return 0;for(var w=10%y,E=1;w!==1;E++)if(w=w*10%y,E>r)return 0;return E}function o(v,y,w){for(var E=1,b=c(10,w,y),A=0;A<300;A++){if(E===b)return A;E=E*10%y,b=b*10%y}return 0}function u(v,y){if(!v)return y;if(!y)return v;for(;;){if(v%=y,!v)return y;if(y%=v,!y)return v}}function p(v,y){if(s(v,y),this instanceof p)v=u(t.d,t.n),this.s=t.s,this.n=t.n/v,this.d=t.d/v;else return i(t.s*t.n,t.d)}var d=function(){return new Error("Division by Zero")},h=function(){return new Error("Invalid argument")},x=function(){return new Error("Parameters must be integer")};p.prototype={s:1,n:0,d:1,abs:function(){return i(this.n,this.d)},neg:function(){return i(-this.s*this.n,this.d)},add:function(v,y){return s(v,y),i(this.s*this.n*t.d+t.s*this.d*t.n,this.d*t.d)},sub:function(v,y){return s(v,y),i(this.s*this.n*t.d-t.s*this.d*t.n,this.d*t.d)},mul:function(v,y){return s(v,y),i(this.s*t.s*this.n*t.n,this.d*t.d)},div:function(v,y){return s(v,y),i(this.s*t.s*this.n*t.d,this.d*t.n)},clone:function(){return i(this.s*this.n,this.d)},mod:function(v,y){if(isNaN(this.n)||isNaN(this.d))return new p(NaN);if(v===void 0)return i(this.s*this.n%this.d,1);if(s(v,y),t.n===0&&this.d===0)throw d();return i(this.s*(t.d*this.n)%(t.n*this.d),t.d*this.d)},gcd:function(v,y){return s(v,y),i(u(t.n,this.n)*u(t.d,this.d),t.d*this.d)},lcm:function(v,y){return s(v,y),t.n===0&&this.n===0?i(0,1):i(t.n*this.n,u(t.n,this.n)*u(t.d,this.d))},ceil:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.ceil(v*this.s*this.n/this.d),v)},floor:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.floor(v*this.s*this.n/this.d),v)},round:function(v){return v=Math.pow(10,v||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):i(Math.round(v*this.s*this.n/this.d),v)},inverse:function(){return i(this.s*this.d,this.n)},pow:function(v,y){if(s(v,y),t.d===1)return t.s<0?i(Math.pow(this.s*this.d,t.n),Math.pow(this.n,t.n)):i(Math.pow(this.s*this.n,t.n),Math.pow(this.d,t.n));if(this.s<0)return null;var w=a(this.n),E=a(this.d),b=1,A=1;for(var C in w)if(C!=="1"){if(C==="0"){b=0;break}if(w[C]*=t.n,w[C]%t.d===0)w[C]/=t.d;else return null;b*=Math.pow(C,w[C])}for(var C in E)if(C!=="1"){if(E[C]*=t.n,E[C]%t.d===0)E[C]/=t.d;else return null;A*=Math.pow(C,E[C])}return t.s<0?i(A,b):i(b,A)},equals:function(v,y){return s(v,y),this.s*this.n*t.d===t.s*t.n*this.d},compare:function(v,y){s(v,y);var w=this.s*this.n*t.d-t.s*t.n*this.d;return(0=0;A--)b=b.inverse().add(w[A]);if(Math.abs(b.sub(y).valueOf())0&&(w+=y,w+=" ",E%=b),w+=E,w+="/",w+=b),w},toLatex:function(v){var y,w="",E=this.n,b=this.d;return this.s<0&&(w+="-"),b===1?w+=E:(v&&(y=Math.floor(E/b))>0&&(w+=y,E%=b),w+="\\\\frac{",w+=E,w+="}{",w+=b,w+="}"),w},toContinued:function(){var v,y=this.n,w=this.d,E=[];if(isNaN(y)||isNaN(w))return E;do E.push(Math.floor(y/w)),v=y%w,y=w,w=v;while(y!==1);return E},toString:function(v){var y=this.n,w=this.d;if(isNaN(y)||isNaN(w))return"NaN";v=v||15;var E=f(y,w),b=o(y,w,E),A=this.s<0?"-":"";if(A+=y/w|0,y%=w,y*=10,y&&(A+="."),E){for(var C=b;C--;)A+=y/w|0,y%=w,y*=10;A+="(";for(var C=E;C--;)A+=y/w|0,y%=w,y*=10;A+=")"}else for(var C=v;y&&C--;)A+=y/w|0,y%=w,y*=10;return A}},typeof jw=="object"?(Object.defineProperty(p,"__esModule",{value:!0}),p.default=p,p.Fraction=p,AC.exports=p):e.Fraction=p})(jw)});var zM=Cn((ppe,UM)=>{UM.exports=function e(r,t){"use strict";var n=/(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,i=/(^[ ]*|[ ]*$)/g,a=/(^([\\w ]+,?[\\w ]+)?[\\w ]+,?[\\w ]+\\d+:\\d+(:\\d+)?[\\w ]?|^\\d{1,4}[\\/\\-]\\d{1,4}[\\/\\-]\\d{1,4}|^\\w+, \\w+ \\d+, \\d{4})/,s=/^0x[0-9a-f]+$/i,c=/^0/,f=function(b){return e.insensitive&&(""+b).toLowerCase()||""+b},o=f(r).replace(i,"")||"",u=f(t).replace(i,"")||"",p=o.replace(n,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0"),d=u.replace(n,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0"),h=parseInt(o.match(s),16)||p.length!==1&&o.match(a)&&Date.parse(o),x=parseInt(u.match(s),16)||h&&u.match(a)&&Date.parse(u)||null,v,y;if(x){if(hx)return 1}for(var w=0,E=Math.max(p.length,d.length);wy)return 1}return 0}});var Y_=Cn((_ge,V_)=>{"use strict";var iS=Object.assign||function(e){for(var r=1;r1&&arguments[1]!==void 0?arguments[1]:{},t=r.preserveFormatting,n=t===void 0?!1:t,i=r.escapeMapFn,a=i===void 0?zG:i,s=String(e),c="",f=a(iS({},qG),n?iS({},UG):{}),o=Object.keys(f),u=function(){var d=!1;o.forEach(function(h,x){d||s.length>=h.length&&s.slice(0,h.length)===h&&(c+=f[o[x]],s=s.slice(h.length,s.length),d=!0)}),d||(c+=s.slice(0,1),s=s.slice(1,s.length))};s;)u();return c}});var bI=Cn((yI,pS)=>{(function(e,r,t){function n(c){var f=this,o=s();f.next=function(){var u=2091639*f.s0+f.c*23283064365386963e-26;return f.s0=f.s1,f.s1=f.s2,f.s2=u-(f.c=u|0)},f.c=1,f.s0=o(" "),f.s1=o(" "),f.s2=o(" "),f.s0-=o(c),f.s0<0&&(f.s0+=1),f.s1-=o(c),f.s1<0&&(f.s1+=1),f.s2-=o(c),f.s2<0&&(f.s2+=1),o=null}function i(c,f){return f.c=c.c,f.s0=c.s0,f.s1=c.s1,f.s2=c.s2,f}function a(c,f){var o=new n(c),u=f&&f.state,p=o.next;return p.int32=function(){return o.next()*4294967296|0},p.double=function(){return p()+(p()*2097152|0)*11102230246251565e-32},p.quick=p,u&&(typeof u=="object"&&i(u,o),p.state=function(){return i(o,{})}),p}function s(){var c=4022871197,f=function(o){o=String(o);for(var u=0;u>>0,p-=c,p*=c,c=p>>>0,p-=c,c+=p*4294967296}return(c>>>0)*23283064365386963e-26};return f}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.alea=a})(yI,typeof pS=="object"&&pS,typeof define=="function"&&define)});var DI=Cn((wI,mS)=>{(function(e,r,t){function n(s){var c=this,f="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var u=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^u^u>>>8},s===(s|0)?c.x=s:f+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,d=(f.next()>>>0)/4294967296,h=(p+d)/(1<<21);while(h===0);return h},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xor128=a})(wI,typeof mS=="object"&&mS,typeof define=="function"&&define)});var NI=Cn((SI,dS)=>{(function(e,r,t){function n(s){var c=this,f="";c.next=function(){var u=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(u^u<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,s===(s|0)?c.x=s:f+=s;for(var o=0;o>>4),c.next()}function i(s,c){return c.x=s.x,c.y=s.y,c.z=s.z,c.w=s.w,c.v=s.v,c.d=s.d,c}function a(s,c){var f=new n(s),o=c&&c.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,d=(f.next()>>>0)/4294967296,h=(p+d)/(1<<21);while(h===0);return h},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xorwow=a})(SI,typeof dS=="object"&&dS,typeof define=="function"&&define)});var CI=Cn((AI,hS)=>{(function(e,r,t){function n(s){var c=this;c.next=function(){var o=c.x,u=c.i,p,d,h;return p=o[u],p^=p>>>7,d=p^p<<24,p=o[u+1&7],d^=p^p>>>10,p=o[u+3&7],d^=p^p>>>3,p=o[u+4&7],d^=p^p<<7,p=o[u+7&7],p=p^p<<13,d^=p^p<<9,o[u]=d,c.i=u+1&7,d};function f(o,u){var p,d,h=[];if(u===(u|0))d=h[0]=u;else for(u=""+u,p=0;p0;--p)o.next()}f(c,s)}function i(s,c){return c.x=s.x.slice(),c.i=s.i,c}function a(s,c){s==null&&(s=+new Date);var f=new n(s),o=c&&c.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,d=(f.next()>>>0)/4294967296,h=(p+d)/(1<<21);while(h===0);return h},u.int32=f.next,u.quick=u,o&&(o.x&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xorshift7=a})(AI,typeof hS=="object"&&hS,typeof define=="function"&&define)});var MI=Cn((EI,vS)=>{(function(e,r,t){function n(s){var c=this;c.next=function(){var o=c.w,u=c.X,p=c.i,d,h;return c.w=o=o+1640531527|0,h=u[p+34&127],d=u[p=p+1&127],h^=h<<13,d^=d<<17,h^=h>>>15,d^=d>>>12,h=u[p]=h^d,c.i=p,h+(o^o>>>16)|0};function f(o,u){var p,d,h,x,v,y=[],w=128;for(u===(u|0)?(d=u,u=null):(u=u+"\\0",d=0,w=Math.max(w,u.length)),h=0,x=-32;x>>15,d^=d<<4,d^=d>>>13,x>=0&&(v=v+1640531527|0,p=y[x&127]^=d+v,h=p==0?h+1:0);for(h>=128&&(y[(u&&u.length||0)&127]=-1),h=127,x=4*128;x>0;--x)d=y[h+34&127],p=y[h=h+1&127],d^=d<<13,p^=p<<17,d^=d>>>15,p^=p>>>12,y[h]=d^p;o.w=v,o.X=y,o.i=h}f(c,s)}function i(s,c){return c.i=s.i,c.w=s.w,c.X=s.X.slice(),c}function a(s,c){s==null&&(s=+new Date);var f=new n(s),o=c&&c.state,u=function(){return(f.next()>>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,d=(f.next()>>>0)/4294967296,h=(p+d)/(1<<21);while(h===0);return h},u.int32=f.next,u.quick=u,o&&(o.X&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.xor4096=a})(EI,typeof vS=="object"&&vS,typeof define=="function"&&define)});var TI=Cn((_I,gS)=>{(function(e,r,t){function n(s){var c=this,f="";c.next=function(){var u=c.b,p=c.c,d=c.d,h=c.a;return u=u<<25^u>>>7^p,p=p-d|0,d=d<<24^d>>>8^h,h=h-u|0,c.b=u=u<<20^u>>>12^p,c.c=p=p-d|0,c.d=d<<16^p>>>16^h,c.a=h-u|0},c.a=0,c.b=0,c.c=-1640531527,c.d=1367130551,s===Math.floor(s)?(c.a=s/4294967296|0,c.b=s|0):f+=s;for(var o=0;o>>0)/4294967296};return u.double=function(){do var p=f.next()>>>11,d=(f.next()>>>0)/4294967296,h=(p+d)/(1<<21);while(h===0);return h},u.int32=f.next,u.quick=u,o&&(typeof o=="object"&&i(o,f),u.state=function(){return i(f,{})}),u}r&&r.exports?r.exports=a:t&&t.amd?t(function(){return a}):this.tychei=a})(_I,typeof gS=="object"&&gS,typeof define=="function"&&define)});var FI=Cn(()=>{});var BI=Cn((OI,g0)=>{(function(e,r,t){var n=256,i=6,a=52,s="random",c=t.pow(n,i),f=t.pow(2,a),o=f*2,u=n-1,p;function d(b,A,C){var S=[];A=A==!0?{entropy:!0}:A||{};var O=y(v(A.entropy?[b,E(r)]:b??w(),3),S),F=new h(S),M=function(){for(var _=F.g(i),k=c,L=0;_=o;)_/=2,k/=2,L>>>=1;return(_+L)/k};return M.int32=function(){return F.g(4)|0},M.quick=function(){return F.g(4)/4294967296},M.double=M,y(E(F.S),r),(A.pass||C||function(_,k,L,Y){return Y&&(Y.S&&x(Y,F),_.state=function(){return x(F,{})}),L?(t[s]=_,k):_})(M,O,"global"in A?A.global:this==t,A.state)}function h(b){var A,C=b.length,S=this,O=0,F=S.i=S.j=0,M=S.S=[];for(C||(b=[C++]);O{var iZ=bI(),aZ=DI(),oZ=NI(),sZ=CI(),uZ=MI(),fZ=TI(),iu=BI();iu.alea=iZ;iu.xor128=aZ;iu.xorwow=oZ;iu.xorshift7=sZ;iu.xor4096=uZ;iu.tychei=fZ;II.exports=iu});var k6=Cn((h5e,dN)=>{function mN(){}mN.prototype={on:function(e,r,t){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:r,ctx:t}),this},once:function(e,r,t){var n=this;function i(){n.off(e,i),r.apply(t,arguments)}return i._=r,this.on(e,i,t)},emit:function(e){var r=[].slice.call(arguments,1),t=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=t.length;for(n;n{(function(e,r){typeof hN=="object"&&typeof Xf<"u"?Xf.exports=r():typeof define=="function"&&define.amd?define(r):e.moment=r()})(hN,function(){"use strict";var e;function r(){return e.apply(null,arguments)}function t(g){e=g}function n(g){return g instanceof Array||Object.prototype.toString.call(g)==="[object Array]"}function i(g){return g!=null&&Object.prototype.toString.call(g)==="[object Object]"}function a(g,N){return Object.prototype.hasOwnProperty.call(g,N)}function s(g){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(g).length===0;var N;for(N in g)if(a(g,N))return!1;return!0}function c(g){return g===void 0}function f(g){return typeof g=="number"||Object.prototype.toString.call(g)==="[object Number]"}function o(g){return g instanceof Date||Object.prototype.toString.call(g)==="[object Date]"}function u(g,N){var P=[],z,G=g.length;for(z=0;z>>0,z;for(z=0;z0)for(P=0;P=0;return(ue?P?"+":"":"-")+Math.pow(10,Math.max(0,G)).toString().substr(1)+z}var U=/(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,se=/(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g,de={},ae={};function H(g,N,P,z){var G=z;typeof z=="string"&&(G=function(){return this[z]()}),g&&(ae[g]=G),N&&(ae[N[0]]=function(){return j(G.apply(this,arguments),N[1],N[2])}),P&&(ae[P]=function(){return this.localeData().ordinal(G.apply(this,arguments),g)})}function pe(g){return g.match(/\\[[\\s\\S]/)?g.replace(/^\\[|\\]$/g,""):g.replace(/\\\\/g,"")}function _e(g){var N=g.match(U),P,z;for(P=0,z=N.length;P=0&&se.test(g);)g=g.replace(se,z),se.lastIndex=0,P-=1;return g}var Ne={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function ye(g){var N=this._longDateFormat[g],P=this._longDateFormat[g.toUpperCase()];return N||!P?N:(this._longDateFormat[g]=P.match(U).map(function(z){return z==="MMMM"||z==="MM"||z==="DD"||z==="dddd"?z.slice(1):z}).join(""),this._longDateFormat[g])}var we="Invalid date";function Se(){return this._invalidDate}var Ce="%d",Ve=/\\d{1,2}/;function Ke(g){return this._ordinal.replace("%d",g)}var K={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function te(g,N,P,z){var G=this._relativeTime[P];return k(G)?G(g,N,P,z):G.replace(/%d/i,g)}function be(g,N){var P=this._relativeTime[g>0?"future":"past"];return k(P)?P(N):P.replace(/%s/i,N)}var ee={};function ie(g,N){var P=g.toLowerCase();ee[P]=ee[P+"s"]=ee[N]=g}function fe(g){return typeof g=="string"?ee[g]||ee[g.toLowerCase()]:void 0}function Ee(g){var N={},P,z;for(z in g)a(g,z)&&(P=fe(z),P&&(N[P]=g[z]));return N}var Me={};function Ue(g,N){Me[g]=N}function ke(g){var N=[],P;for(P in g)a(g,P)&&N.push({unit:P,priority:Me[P]});return N.sort(function(z,G){return z.priority-G.priority}),N}function lr(g){return g%4===0&&g%100!==0||g%400===0}function ur(g){return g<0?Math.ceil(g)||0:Math.floor(g)}function er(g){var N=+g,P=0;return N!==0&&isFinite(N)&&(P=ur(N)),P}function Lr(g,N){return function(P){return P!=null?(le(this,g,P),r.updateOffset(this,N),this):re(this,g)}}function re(g,N){return g.isValid()?g._d["get"+(g._isUTC?"UTC":"")+N]():NaN}function le(g,N,P){g.isValid()&&!isNaN(P)&&(N==="FullYear"&&lr(g.year())&&g.month()===1&&g.date()===29?(P=er(P),g._d["set"+(g._isUTC?"UTC":"")+N](P,g.month(),Bo(P,g.month()))):g._d["set"+(g._isUTC?"UTC":"")+N](P))}function De(g){return g=fe(g),k(this[g])?this[g]():this}function Ie(g,N){if(typeof g=="object"){g=Ee(g);var P=ke(g),z,G=P.length;for(z=0;z68?1900:2e3)};var mc=Lr("FullYear",!0);function i1(){return lr(this.year())}function Al(g,N,P,z,G,ue,Fe){var gr;return g<100&&g>=0?(gr=new Date(g+400,N,P,z,G,ue,Fe),isFinite(gr.getFullYear())&&gr.setFullYear(g)):gr=new Date(g,N,P,z,G,ue,Fe),gr}function Io(g){var N,P;return g<100&&g>=0?(P=Array.prototype.slice.call(arguments),P[0]=g+400,N=new Date(Date.UTC.apply(null,P)),isFinite(N.getUTCFullYear())&&N.setUTCFullYear(g)):N=new Date(Date.UTC.apply(null,arguments)),N}function Po(g,N,P){var z=7+N-P,G=(7+Io(g,0,z).getUTCDay()-N)%7;return-G+z-1}function Cl(g,N,P,z,G){var ue=(7+P-z)%7,Fe=Po(g,z,G),gr=1+7*(N-1)+ue+Fe,kr,ft;return gr<=0?(kr=g-1,ft=Fa(kr)+gr):gr>Fa(g)?(kr=g+1,ft=gr-Fa(g)):(kr=g,ft=gr),{year:kr,dayOfYear:ft}}function ko(g,N,P){var z=Po(g.year(),N,P),G=Math.floor((g.dayOfYear()-z-1)/7)+1,ue,Fe;return G<1?(Fe=g.year()-1,ue=G+hi(Fe,N,P)):G>hi(g.year(),N,P)?(ue=G-hi(g.year(),N,P),Fe=g.year()+1):(Fe=g.year(),ue=G),{week:ue,year:Fe}}function hi(g,N,P){var z=Po(g,N,P),G=Po(g+1,N,P);return(Fa(g)-z+G)/7}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),ie("week","w"),ie("isoWeek","W"),Ue("week",5),Ue("isoWeek",5),ar("w",Q),ar("ww",Q,Te),ar("W",Q),ar("WW",Q,Te),eo(["w","ww","W","WW"],function(g,N,P,z){N[z.substr(0,1)]=er(g)});function dc(g){return ko(g,this._week.dow,this._week.doy).week}var Ro={dow:0,doy:6};function El(){return this._week.dow}function Ml(){return this._week.doy}function a1(g){var N=this.localeData().week(this);return g==null?N:this.add((g-N)*7,"d")}function _l(g){var N=ko(this,1,4).week;return g==null?N:this.add((g-N)*7,"d")}H("d",0,"do","day"),H("dd",0,0,function(g){return this.localeData().weekdaysMin(this,g)}),H("ddd",0,0,function(g){return this.localeData().weekdaysShort(this,g)}),H("dddd",0,0,function(g){return this.localeData().weekdays(this,g)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),ie("day","d"),ie("weekday","e"),ie("isoWeekday","E"),Ue("day",11),Ue("weekday",11),Ue("isoWeekday",11),ar("d",Q),ar("e",Q),ar("E",Q),ar("dd",function(g,N){return N.weekdaysMinRegex(g)}),ar("ddd",function(g,N){return N.weekdaysShortRegex(g)}),ar("dddd",function(g,N){return N.weekdaysRegex(g)}),eo(["dd","ddd","dddd"],function(g,N,P,z){var G=P._locale.weekdaysParse(g,z,P._strict);G!=null?N.d=G:x(P).invalidWeekday=g}),eo(["d","e","E"],function(g,N,P,z){N[z]=er(g)});function Tl(g,N){return typeof g!="string"?g:isNaN(g)?(g=N.weekdaysParse(g),typeof g=="number"?g:null):parseInt(g,10)}function Fl(g,N){return typeof g=="string"?N.weekdaysParse(g)%7||7:isNaN(g)?null:g}function hu(g,N){return g.slice(N,7).concat(g.slice(0,N))}var o1="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ol="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),s1="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Bl=oa,u1=oa,f1=oa;function c1(g,N){var P=n(this._weekdays)?this._weekdays:this._weekdays[g&&g!==!0&&this._weekdays.isFormat.test(N)?"format":"standalone"];return g===!0?hu(P,this._week.dow):g?P[g.day()]:P}function l1(g){return g===!0?hu(this._weekdaysShort,this._week.dow):g?this._weekdaysShort[g.day()]:this._weekdaysShort}function hc(g){return g===!0?hu(this._weekdaysMin,this._week.dow):g?this._weekdaysMin[g.day()]:this._weekdaysMin}function p1(g,N,P){var z,G,ue,Fe=g.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],z=0;z<7;++z)ue=d([2e3,1]).day(z),this._minWeekdaysParse[z]=this.weekdaysMin(ue,"").toLocaleLowerCase(),this._shortWeekdaysParse[z]=this.weekdaysShort(ue,"").toLocaleLowerCase(),this._weekdaysParse[z]=this.weekdays(ue,"").toLocaleLowerCase();return P?N==="dddd"?(G=Nt.call(this._weekdaysParse,Fe),G!==-1?G:null):N==="ddd"?(G=Nt.call(this._shortWeekdaysParse,Fe),G!==-1?G:null):(G=Nt.call(this._minWeekdaysParse,Fe),G!==-1?G:null):N==="dddd"?(G=Nt.call(this._weekdaysParse,Fe),G!==-1||(G=Nt.call(this._shortWeekdaysParse,Fe),G!==-1)?G:(G=Nt.call(this._minWeekdaysParse,Fe),G!==-1?G:null)):N==="ddd"?(G=Nt.call(this._shortWeekdaysParse,Fe),G!==-1||(G=Nt.call(this._weekdaysParse,Fe),G!==-1)?G:(G=Nt.call(this._minWeekdaysParse,Fe),G!==-1?G:null)):(G=Nt.call(this._minWeekdaysParse,Fe),G!==-1||(G=Nt.call(this._weekdaysParse,Fe),G!==-1)?G:(G=Nt.call(this._shortWeekdaysParse,Fe),G!==-1?G:null))}function m1(g,N,P){var z,G,ue;if(this._weekdaysParseExact)return p1.call(this,g,N,P);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),z=0;z<7;z++){if(G=d([2e3,1]).day(z),P&&!this._fullWeekdaysParse[z]&&(this._fullWeekdaysParse[z]=new RegExp("^"+this.weekdays(G,"").replace(".","\\\\.?")+"$","i"),this._shortWeekdaysParse[z]=new RegExp("^"+this.weekdaysShort(G,"").replace(".","\\\\.?")+"$","i"),this._minWeekdaysParse[z]=new RegExp("^"+this.weekdaysMin(G,"").replace(".","\\\\.?")+"$","i")),this._weekdaysParse[z]||(ue="^"+this.weekdays(G,"")+"|^"+this.weekdaysShort(G,"")+"|^"+this.weekdaysMin(G,""),this._weekdaysParse[z]=new RegExp(ue.replace(".",""),"i")),P&&N==="dddd"&&this._fullWeekdaysParse[z].test(g))return z;if(P&&N==="ddd"&&this._shortWeekdaysParse[z].test(g))return z;if(P&&N==="dd"&&this._minWeekdaysParse[z].test(g))return z;if(!P&&this._weekdaysParse[z].test(g))return z}}function d1(g){if(!this.isValid())return g!=null?this:NaN;var N=this._isUTC?this._d.getUTCDay():this._d.getDay();return g!=null?(g=Tl(g,this.localeData()),this.add(g-N,"d")):N}function h1(g){if(!this.isValid())return g!=null?this:NaN;var N=(this.day()+7-this.localeData()._week.dow)%7;return g==null?N:this.add(g-N,"d")}function v1(g){if(!this.isValid())return g!=null?this:NaN;if(g!=null){var N=Fl(g,this.localeData());return this.day(this.day()%7?N:N-7)}else return this.day()||7}function Et(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||vc.call(this),g?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Bl),this._weekdaysStrictRegex&&g?this._weekdaysStrictRegex:this._weekdaysRegex)}function At(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||vc.call(this),g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=u1),this._weekdaysShortStrictRegex&&g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function g1(g){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||vc.call(this),g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=f1),this._weekdaysMinStrictRegex&&g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function vc(){function g(An,ki){return ki.length-An.length}var N=[],P=[],z=[],G=[],ue,Fe,gr,kr,ft;for(ue=0;ue<7;ue++)Fe=d([2e3,1]).day(ue),gr=Dn(this.weekdaysMin(Fe,"")),kr=Dn(this.weekdaysShort(Fe,"")),ft=Dn(this.weekdays(Fe,"")),N.push(gr),P.push(kr),z.push(ft),G.push(gr),G.push(kr),G.push(ft);N.sort(g),P.sort(g),z.sort(g),G.sort(g),this._weekdaysRegex=new RegExp("^("+G.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+z.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+P.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+N.join("|")+")","i")}function gc(){return this.hours()%12||12}function x1(){return this.hours()||24}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,gc),H("k",["kk",2],0,x1),H("hmm",0,0,function(){return""+gc.apply(this)+j(this.minutes(),2)}),H("hmmss",0,0,function(){return""+gc.apply(this)+j(this.minutes(),2)+j(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+j(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+j(this.minutes(),2)+j(this.seconds(),2)});function Il(g,N){H(g,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),N)})}Il("a",!0),Il("A",!1),ie("hour","h"),Ue("hour",13);function Pl(g,N){return N._meridiemParse}ar("a",Pl),ar("A",Pl),ar("H",Q),ar("h",Q),ar("k",Q),ar("HH",Q,Te),ar("hh",Q,Te),ar("kk",Q,Te),ar("hmm",ge),ar("hmmss",Pe),ar("Hmm",ge),ar("Hmmss",Pe),mt(["H","HH"],Lt),mt(["k","kk"],function(g,N,P){var z=er(g);N[Lt]=z===24?0:z}),mt(["a","A"],function(g,N,P){P._isPm=P._locale.isPM(g),P._meridiem=g}),mt(["h","hh"],function(g,N,P){N[Lt]=er(g),x(P).bigHour=!0}),mt("hmm",function(g,N,P){var z=g.length-2;N[Lt]=er(g.substr(0,z)),N[Un]=er(g.substr(z)),x(P).bigHour=!0}),mt("hmmss",function(g,N,P){var z=g.length-4,G=g.length-2;N[Lt]=er(g.substr(0,z)),N[Un]=er(g.substr(z,2)),N[di]=er(g.substr(G)),x(P).bigHour=!0}),mt("Hmm",function(g,N,P){var z=g.length-2;N[Lt]=er(g.substr(0,z)),N[Un]=er(g.substr(z))}),mt("Hmmss",function(g,N,P){var z=g.length-4,G=g.length-2;N[Lt]=er(g.substr(0,z)),N[Un]=er(g.substr(z,2)),N[di]=er(g.substr(G))});function kl(g){return(g+"").toLowerCase().charAt(0)==="p"}var y1=/[ap]\\.?m?\\.?/i,tn=Lr("Hours",!0);function xc(g,N,P){return g>11?P?"pm":"PM":P?"am":"AM"}var Oa={calendar:q,longDateFormat:Ne,invalidDate:we,ordinal:Ce,dayOfMonthOrdinalParse:Ve,relativeTime:K,months:fc,monthsShort:lu,week:Ro,weekdays:o1,weekdaysMin:s1,weekdaysShort:Ol,meridiemParse:y1},Mt={},to={},gn;function Rl(g,N){var P,z=Math.min(g.length,N.length);for(P=0;P0;){if(G=Cs(ue.slice(0,P).join("-")),G)return G;if(z&&z.length>=P&&Rl(ue,z)>=P-1)break;P--}N++}return gn}function ql(g){return g.match("^[^/\\\\\\\\]*$")!=null}function Cs(g){var N=null,P;if(Mt[g]===void 0&&typeof Xf<"u"&&Xf&&Xf.exports&&ql(g))try{N=gn._abbr,P=require,P("./locale/"+g),fa(N)}catch{Mt[g]=null}return Mt[g]}function fa(g,N){var P;return g&&(c(N)?P=Yt(g):P=Sn(g,N),P?gn=P:typeof console<"u"&&console.warn&&console.warn("Locale "+g+" not found. Did you forget to load it?")),gn._abbr}function Sn(g,N){if(N!==null){var P,z=Oa;if(N.abbr=g,Mt[g]!=null)_("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),z=Mt[g]._config;else if(N.parentLocale!=null)if(Mt[N.parentLocale]!=null)z=Mt[N.parentLocale]._config;else if(P=Cs(N.parentLocale),P!=null)z=P._config;else return to[N.parentLocale]||(to[N.parentLocale]=[]),to[N.parentLocale].push({name:g,config:N}),null;return Mt[g]=new $(Y(z,N)),to[g]&&to[g].forEach(function(G){Sn(G.name,G.config)}),fa(g),Mt[g]}else return delete Mt[g],null}function b1(g,N){if(N!=null){var P,z,G=Oa;Mt[g]!=null&&Mt[g].parentLocale!=null?Mt[g].set(Y(Mt[g]._config,N)):(z=Cs(g),z!=null&&(G=z._config),N=Y(G,N),z==null&&(N.abbr=g),P=new $(N),P.parentLocale=Mt[g],Mt[g]=P),fa(g)}else Mt[g]!=null&&(Mt[g].parentLocale!=null?(Mt[g]=Mt[g].parentLocale,g===fa()&&fa(g)):Mt[g]!=null&&delete Mt[g]);return Mt[g]}function Yt(g){var N;if(g&&g._locale&&g._locale._abbr&&(g=g._locale._abbr),!g)return gn;if(!n(g)){if(N=Cs(g),N)return N;g=[g]}return Ll(g)}function w1(){return V(Mt)}function vu(g){var N,P=g._a;return P&&x(g).overflow===-2&&(N=P[Xn]<0||P[Xn]>11?Xn:P[Jn]<1||P[Jn]>Bo(P[rn],P[Xn])?Jn:P[Lt]<0||P[Lt]>24||P[Lt]===24&&(P[Un]!==0||P[di]!==0||P[sa]!==0)?Lt:P[Un]<0||P[Un]>59?Un:P[di]<0||P[di]>59?di:P[sa]<0||P[sa]>999?sa:-1,x(g)._overflowDayOfYear&&(NJn)&&(N=Jn),x(g)._overflowWeeks&&N===-1&&(N=sc),x(g)._overflowWeekday&&N===-1&&(N=Oo),x(g).overflow=N),g}var Ba=/^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,gu=/^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d|))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([+-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/,bc=/Z|[+-]\\d\\d(?::?\\d\\d)?/,Dt=[["YYYYYY-MM-DD",/[+-]\\d{6}-\\d\\d-\\d\\d/],["YYYY-MM-DD",/\\d{4}-\\d\\d-\\d\\d/],["GGGG-[W]WW-E",/\\d{4}-W\\d\\d-\\d/],["GGGG-[W]WW",/\\d{4}-W\\d\\d/,!1],["YYYY-DDD",/\\d{4}-\\d{3}/],["YYYY-MM",/\\d{4}-\\d\\d/,!1],["YYYYYYMMDD",/[+-]\\d{10}/],["YYYYMMDD",/\\d{8}/],["GGGG[W]WWE",/\\d{4}W\\d{3}/],["GGGG[W]WW",/\\d{4}W\\d{2}/,!1],["YYYYDDD",/\\d{7}/],["YYYYMM",/\\d{6}/,!1],["YYYY",/\\d{4}/,!1]],Fi=[["HH:mm:ss.SSSS",/\\d\\d:\\d\\d:\\d\\d\\.\\d+/],["HH:mm:ss,SSSS",/\\d\\d:\\d\\d:\\d\\d,\\d+/],["HH:mm:ss",/\\d\\d:\\d\\d:\\d\\d/],["HH:mm",/\\d\\d:\\d\\d/],["HHmmss.SSSS",/\\d\\d\\d\\d\\d\\d\\.\\d+/],["HHmmss,SSSS",/\\d\\d\\d\\d\\d\\d,\\d+/],["HHmmss",/\\d\\d\\d\\d\\d\\d/],["HHmm",/\\d\\d\\d\\d/],["HH",/\\d\\d/]],wc=/^\\/?Date\\((-?\\d+)/i,D1=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\\d{4}))$/,Dc={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ul(g){var N,P,z=g._i,G=Ba.exec(z)||gu.exec(z),ue,Fe,gr,kr,ft=Dt.length,An=Fi.length;if(G){for(x(g).iso=!0,N=0,P=ft;NFa(Fe)||g._dayOfYear===0)&&(x(g)._overflowDayOfYear=!0),P=Io(Fe,0,g._dayOfYear),g._a[Xn]=P.getUTCMonth(),g._a[Jn]=P.getUTCDate()),N=0;N<3&&g._a[N]==null;++N)g._a[N]=z[N]=G[N];for(;N<7;N++)g._a[N]=z[N]=g._a[N]==null?N===2?1:0:g._a[N];g._a[Lt]===24&&g._a[Un]===0&&g._a[di]===0&&g._a[sa]===0&&(g._nextDay=!0,g._a[Lt]=0),g._d=(g._useUTC?Io:Al).apply(null,z),ue=g._useUTC?g._d.getUTCDay():g._d.getDay(),g._tzm!=null&&g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),g._nextDay&&(g._a[Lt]=24),g._w&&typeof g._w.d<"u"&&g._w.d!==ue&&(x(g).weekdayMismatch=!0)}}function Yl(g){var N,P,z,G,ue,Fe,gr,kr,ft;N=g._w,N.GG!=null||N.W!=null||N.E!=null?(ue=1,Fe=4,P=no(N.GG,g._a[rn],ko(Ct(),1,4).year),z=no(N.W,1),G=no(N.E,1),(G<1||G>7)&&(kr=!0)):(ue=g._locale._week.dow,Fe=g._locale._week.doy,ft=ko(Ct(),ue,Fe),P=no(N.gg,g._a[rn],ft.year),z=no(N.w,ft.week),N.d!=null?(G=N.d,(G<0||G>6)&&(kr=!0)):N.e!=null?(G=N.e+ue,(N.e<0||N.e>6)&&(kr=!0)):G=ue),z<1||z>hi(P,ue,Fe)?x(g)._overflowWeeks=!0:kr!=null?x(g)._overflowWeekday=!0:(gr=Cl(P,z,G,ue,Fe),g._a[rn]=gr.year,g._dayOfYear=gr.dayOfYear)}r.ISO_8601=function(){},r.RFC_2822=function(){};function Nc(g){if(g._f===r.ISO_8601){Ul(g);return}if(g._f===r.RFC_2822){Wl(g);return}g._a=[],x(g).empty=!0;var N=""+g._i,P,z,G,ue,Fe,gr=N.length,kr=0,ft,An;for(G=xe(g._f,g._locale).match(U)||[],An=G.length,P=0;P0&&x(g).unusedInput.push(Fe),N=N.slice(N.indexOf(z)+z.length),kr+=z.length),ae[ue]?(z?x(g).empty=!1:x(g).unusedTokens.push(ue),oc(ue,z,g)):g._strict&&!z&&x(g).unusedTokens.push(ue);x(g).charsLeftOver=gr-kr,N.length>0&&x(g).unusedInput.push(N),g._a[Lt]<=12&&x(g).bigHour===!0&&g._a[Lt]>0&&(x(g).bigHour=void 0),x(g).parsedDateParts=g._a.slice(0),x(g).meridiem=g._meridiem,g._a[Lt]=Ac(g._locale,g._a[Lt],g._meridiem),ft=x(g).era,ft!==null&&(g._a[rn]=g._locale.erasConvertYear(ft,g._a[rn])),Es(g),vu(g)}function Ac(g,N,P){var z;return P==null?N:g.meridiemHour!=null?g.meridiemHour(N,P):(g.isPM!=null&&(z=g.isPM(P),z&&N<12&&(N+=12),!z&&N===12&&(N=0)),N)}function Cc(g){var N,P,z,G,ue,Fe,gr=!1,kr=g._f.length;if(kr===0){x(g).invalidFormat=!0,g._d=new Date(NaN);return}for(G=0;Gthis?this:g:w()});function $l(g,N){var P,z;if(N.length===1&&n(N[0])&&(N=N[0]),!N.length)return Ct();for(P=N[0],z=1;zthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Oe(){if(!c(this._isDSTShifted))return this._isDSTShifted;var g={},N;return A(g,this),g=Tn(g),g._a?(N=g._isUTC?d(g._a):Ct(g._a),this._isDSTShifted=this.isValid()&&O1(g._a,N.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Ae(){return this.isValid()?!this._isUTC:!1}function sr(){return this.isValid()?this._isUTC:!1}function _r(){return this.isValid()?this._isUTC&&this._offset===0:!1}var ut=/^(-|\\+)?(?:(\\d*)[. ])?(\\d+):(\\d+)(?::(\\d+)(\\.\\d*)?)?$/,Qt=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Yr(g,N){var P=g,z=null,G,ue,Fe;return vi(g)?P={ms:g._milliseconds,d:g._days,M:g._months}:f(g)||!isNaN(+g)?(P={},N?P[N]=+g:P.milliseconds=+g):(z=ut.exec(g))?(G=z[1]==="-"?-1:1,P={y:0,d:er(z[Jn])*G,h:er(z[Lt])*G,m:er(z[Un])*G,s:er(z[di])*G,ms:er(Uo(z[sa]*1e3))*G}):(z=Qt.exec(g))?(G=z[1]==="-"?-1:1,P={y:ca(z[2],G),M:ca(z[3],G),w:ca(z[4],G),d:ca(z[5],G),h:ca(z[6],G),m:ca(z[7],G),s:ca(z[8],G)}):P==null?P={}:typeof P=="object"&&("from"in P||"to"in P)&&(Fe=Kn(Ct(P.from),Ct(P.to)),P={},P.ms=Fe.milliseconds,P.M=Fe.months),ue=new Ms(P),vi(g)&&a(g,"_locale")&&(ue._locale=g._locale),vi(g)&&a(g,"_isValid")&&(ue._isValid=g._isValid),ue}Yr.fn=Ms.prototype,Yr.invalid=Mc;function ca(g,N){var P=g&&parseFloat(g.replace(",","."));return(isNaN(P)?0:P)*N}function Ql(g,N){var P={};return P.months=N.month()-g.month()+(N.year()-g.year())*12,g.clone().add(P.months,"M").isAfter(N)&&--P.months,P.milliseconds=+N-+g.clone().add(P.months,"M"),P}function Kn(g,N){var P;return g.isValid()&&N.isValid()?(N=zn(N,g),g.isBefore(N)?P=Ql(g,N):(P=Ql(N,g),P.milliseconds=-P.milliseconds,P.months=-P.months),P):{milliseconds:0,months:0}}function _s(g,N){return function(P,z){var G,ue;return z!==null&&!isNaN(+z)&&(_(N,"moment()."+N+"(period, number) is deprecated. Please use moment()."+N+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),ue=P,P=z,z=ue),G=Yr(P,z),Xl(this,G,g),this}}function Xl(g,N,P,z){var G=N._milliseconds,ue=Uo(N._days),Fe=Uo(N._months);!g.isValid()||(z=z??!0,Fe&&Ta(g,re(g,"Month")+Fe*P),ue&&le(g,"Date",re(g,"Date")+ue*P),G&&g._d.setTime(g._d.valueOf()+G*P),z&&r.updateOffset(g,ue||Fe))}var zo=_s(1,"add"),bu=_s(-1,"subtract");function Ts(g){return typeof g=="string"||g instanceof String}function ht(g){return S(g)||o(g)||Ts(g)||f(g)||Jl(g)||q1(g)||g===null||g===void 0}function q1(g){var N=i(g)&&!s(g),P=!1,z=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],G,ue,Fe=z.length;for(G=0;GP.valueOf():P.valueOf()9999?me(P,N?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):k(Date.prototype.toISOString)?N?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",me(P,"Z")):me(P,N?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ao(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var g="moment",N="",P,z,G,ue;return this.isLocal()||(g=this.utcOffset()===0?"moment.utc":"moment.parseZone",N="Z"),P="["+g+'("]',z=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",G="-MM-DD[T]HH:mm:ss.SSS",ue=N+'[")]',this.format(P+z+G+ue)}function Au(g){g||(g=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var N=me(this,g);return this.localeData().postformat(N)}function V1(g,N){return this.isValid()&&(S(g)&&g.isValid()||Ct(g).isValid())?Yr({to:this,from:g}).locale(this.locale()).humanize(!N):this.localeData().invalidDate()}function Y1(g){return this.from(Ct(),g)}function H1(g,N){return this.isValid()&&(S(g)&&g.isValid()||Ct(g).isValid())?Yr({from:this,to:g}).locale(this.locale()).humanize(!N):this.localeData().invalidDate()}function Cu(g){return this.to(Ct(),g)}function Os(g){var N;return g===void 0?this._locale._abbr:(N=Yt(g),N!=null&&(this._locale=N),this)}var Eu=F("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(g){return g===void 0?this.localeData():this.locale(g)});function tp(){return this._locale}var Bs=1e3,Wo=60*Bs,Mu=60*Wo,Ht=(365*400+97)*24*Mu;function qt(g,N){return(g%N+N)%N}function np(g,N,P){return g<100&&g>=0?new Date(g+400,N,P)-Ht:new Date(g,N,P).valueOf()}function ip(g,N,P){return g<100&&g>=0?Date.UTC(g+400,N,P)-Ht:Date.UTC(g,N,P)}function ap(g){var N,P;if(g=fe(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(P=this._isUTC?ip:np,g){case"year":N=P(this.year(),0,1);break;case"quarter":N=P(this.year(),this.month()-this.month()%3,1);break;case"month":N=P(this.year(),this.month(),1);break;case"week":N=P(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":N=P(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":N=P(this.year(),this.month(),this.date());break;case"hour":N=this._d.valueOf(),N-=qt(N+(this._isUTC?0:this.utcOffset()*Wo),Mu);break;case"minute":N=this._d.valueOf(),N-=qt(N,Wo);break;case"second":N=this._d.valueOf(),N-=qt(N,Bs);break}return this._d.setTime(N),r.updateOffset(this,!0),this}function G1(g){var N,P;if(g=fe(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(P=this._isUTC?ip:np,g){case"year":N=P(this.year()+1,0,1)-1;break;case"quarter":N=P(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":N=P(this.year(),this.month()+1,1)-1;break;case"week":N=P(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":N=P(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":N=P(this.year(),this.month(),this.date()+1)-1;break;case"hour":N=this._d.valueOf(),N+=Mu-qt(N+(this._isUTC?0:this.utcOffset()*Wo),Mu)-1;break;case"minute":N=this._d.valueOf(),N+=Wo-qt(N,Wo)-1;break;case"second":N=this._d.valueOf(),N+=Bs-qt(N,Bs)-1;break}return this._d.setTime(N),r.updateOffset(this,!0),this}function _c(){return this._d.valueOf()-(this._offset||0)*6e4}function Is(){return Math.floor(this.valueOf()/1e3)}function Tc(){return new Date(this.valueOf())}function Vo(){var g=this;return[g.year(),g.month(),g.date(),g.hour(),g.minute(),g.second(),g.millisecond()]}function Ps(){var g=this;return{years:g.year(),months:g.month(),date:g.date(),hours:g.hours(),minutes:g.minutes(),seconds:g.seconds(),milliseconds:g.milliseconds()}}function ks(){return this.isValid()?this.toISOString():null}function _u(){return y(this)}function Yo(){return p({},x(this))}function $1(){return x(this).overflow}function Z1(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),ar("N",zr),ar("NN",zr),ar("NNN",zr),ar("NNNN",K1),ar("NNNNN",j1),mt(["N","NN","NNN","NNNN","NNNNN"],function(g,N,P,z){var G=P._locale.erasParse(g,z,P._strict);G?x(P).era=G:x(P).invalidEra=g}),ar("y",Vt),ar("yy",Vt),ar("yyy",Vt),ar("yyyy",Vt),ar("yo",eb),mt(["y","yy","yyy","yyyy"],rn),mt(["yo"],function(g,N,P,z){var G;P._locale._eraYearOrdinalRegex&&(G=g.match(P._locale._eraYearOrdinalRegex)),P._locale.eraYearOrdinalParse?N[rn]=P._locale.eraYearOrdinalParse(g,G):N[rn]=parseInt(g,10)});function Q1(g,N){var P,z,G,ue=this._eras||Yt("en")._eras;for(P=0,z=ue.length;P=0)return ue[z]}function J1(g,N){var P=g.since<=g.until?1:-1;return N===void 0?r(g.since).year():r(g.since).year()+(N-g.offset)*P}function Tu(){var g,N,P,z=this.localeData().eras();for(g=0,N=z.length;gue&&(N=ue),ob.call(this,g,N,P,z,G))}function ob(g,N,P,z,G){var ue=Cl(g,N,P,z,G),Fe=Io(ue.year,0,ue.dayOfYear);return this.year(Fe.getUTCFullYear()),this.month(Fe.getUTCMonth()),this.date(Fe.getUTCDate()),this}H("Q",0,"Qo","quarter"),ie("quarter","Q"),Ue("quarter",7),ar("Q",Le),mt("Q",function(g,N){N[Xn]=(er(g)-1)*3});function sb(g){return g==null?Math.ceil((this.month()+1)/3):this.month((g-1)*3+this.month()%3)}H("D",["DD",2],"Do","date"),ie("date","D"),Ue("date",9),ar("D",Q),ar("DD",Q,Te),ar("Do",function(g,N){return g?N._dayOfMonthOrdinalParse||N._ordinalParse:N._dayOfMonthOrdinalParseLenient}),mt(["D","DD"],Jn),mt("Do",function(g,N){N[Jn]=er(g.match(Q)[0])});var up=Lr("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),ie("dayOfYear","DDD"),Ue("dayOfYear",4),ar("DDD",ir),ar("DDDD",Re),mt(["DDD","DDDD"],function(g,N,P){P._dayOfYear=er(g)});function ma(g){var N=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return g==null?N:this.add(g-N,"d")}H("m",["mm",2],0,"minute"),ie("minute","m"),Ue("minute",14),ar("m",Q),ar("mm",Q,Te),mt(["m","mm"],Un);var ub=Lr("Minutes",!1);H("s",["ss",2],0,"second"),ie("second","s"),Ue("second",15),ar("s",Q),ar("ss",Q,Te),mt(["s","ss"],di);var fb=Lr("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return this.millisecond()*10}),H(0,["SSSSS",5],0,function(){return this.millisecond()*100}),H(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),H(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),H(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),H(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ie("millisecond","ms"),Ue("millisecond",16),ar("S",ir,Le),ar("SS",ir,Te),ar("SSS",ir,Re);var Ra,fp;for(Ra="SSSS";Ra.length<=9;Ra+="S")ar(Ra,Vt);function cb(g,N){N[sa]=er(("0."+g)*1e3)}for(Ra="S";Ra.length<=9;Ra+="S")mt(Ra,cb);fp=Lr("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");function oo(){return this._isUTC?"UTC":""}function lb(){return this._isUTC?"Coordinated Universal Time":""}var Ze=C.prototype;Ze.add=zo,Ze.calendar=z1,Ze.clone=W1,Ze.diff=ep,Ze.endOf=G1,Ze.format=Au,Ze.from=V1,Ze.fromNow=Y1,Ze.to=H1,Ze.toNow=Cu,Ze.get=De,Ze.invalidAt=$1,Ze.isAfter=Du,Ze.isBefore=ka,Ze.isBetween=Su,Ze.isSame=Kl,Ze.isSameOrAfter=Nu,Ze.isSameOrBefore=jl,Ze.isValid=_u,Ze.lang=Eu,Ze.locale=Os,Ze.localeData=tp,Ze.max=C1,Ze.min=Gl,Ze.parsingFlags=Yo,Ze.set=Ie,Ze.startOf=ap,Ze.subtract=bu,Ze.toArray=Vo,Ze.toObject=Ps,Ze.toDate=Tc,Ze.toISOString=Fs,Ze.inspect=ao,typeof Symbol<"u"&&Symbol.for!=null&&(Ze[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Ze.toJSON=ks,Ze.toString=rp,Ze.unix=Is,Ze.valueOf=_c,Ze.creationData=Z1,Ze.eraName=Tu,Ze.eraNarrow=Rs,Ze.eraAbbr=op,Ze.eraYear=Z,Ze.year=mc,Ze.isLeapYear=i1,Ze.weekYear=rb,Ze.isoWeekYear=tb,Ze.quarter=Ze.quarters=sb,Ze.month=ua,Ze.daysInMonth=du,Ze.week=Ze.weeks=a1,Ze.isoWeek=Ze.isoWeeks=_l,Ze.weeksInYear=pa,Ze.weeksInWeekYear=ab,Ze.isoWeeksInYear=nb,Ze.isoWeeksInISOWeekYear=ib,Ze.date=up,Ze.day=Ze.days=d1,Ze.weekday=h1,Ze.isoWeekday=v1,Ze.dayOfYear=ma,Ze.hour=Ze.hours=tn,Ze.minute=Ze.minutes=ub,Ze.second=Ze.seconds=fb,Ze.millisecond=Ze.milliseconds=fp,Ze.utcOffset=I1,Ze.utc=k1,Ze.local=R1,Ze.parseZone=L1,Ze.hasAlignedHourOffset=Pa,Ze.isDST=he,Ze.isLocal=Ae,Ze.isUtcOffset=sr,Ze.isUtc=_r,Ze.isUTC=_r,Ze.zoneAbbr=oo,Ze.zoneName=lb,Ze.dates=F("dates accessor is deprecated. Use date instead.",up),Ze.months=F("months accessor is deprecated. Use month instead",ua),Ze.years=F("years accessor is deprecated. Use year instead",mc),Ze.zone=F("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",P1),Ze.isDSTShifted=F("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Oe);function gi(g){return Ct(g*1e3)}function pb(){return Ct.apply(null,arguments).parseZone()}function cp(g){return g}var it=$.prototype;it.calendar=R,it.longDateFormat=ye,it.invalidDate=Se,it.ordinal=Ke,it.preparse=cp,it.postformat=cp,it.relativeTime=te,it.pastFuture=be,it.set=L,it.eras=Q1,it.erasParse=X1,it.erasConvertYear=J1,it.erasAbbrRegex=Fu,it.erasNameRegex=Ho,it.erasNarrowRegex=jn,it.months=ro,it.monthsShort=st,it.monthsParse=cc,it.monthsRegex=n1,it.monthsShortRegex=lc,it.week=dc,it.firstDayOfYear=Ml,it.firstDayOfWeek=El,it.weekdays=c1,it.weekdaysMin=hc,it.weekdaysShort=l1,it.weekdaysParse=m1,it.weekdaysRegex=Et,it.weekdaysShortRegex=At,it.weekdaysMinRegex=g1,it.isPM=kl,it.meridiem=xc;function Bu(g,N,P,z){var G=Yt(),ue=d().set(z,N);return G[P](ue,g)}function lp(g,N,P){if(f(g)&&(N=g,g=void 0),g=g||"",N!=null)return Bu(g,N,P,"month");var z,G=[];for(z=0;z<12;z++)G[z]=Bu(g,z,P,"month");return G}function Iu(g,N,P,z){typeof g=="boolean"?(f(N)&&(P=N,N=void 0),N=N||""):(N=g,P=N,g=!1,f(N)&&(P=N,N=void 0),N=N||"");var G=Yt(),ue=g?G._week.dow:0,Fe,gr=[];if(P!=null)return Bu(N,(P+ue)%7,z,"day");for(Fe=0;Fe<7;Fe++)gr[Fe]=Bu(N,(Fe+ue)%7,z,"day");return gr}function pp(g,N){return lp(g,N,"months")}function mb(g,N){return lp(g,N,"monthsShort")}function db(g,N,P){return Iu(g,N,P,"weekdays")}function Fc(g,N,P){return Iu(g,N,P,"weekdaysShort")}function Ls(g,N,P){return Iu(g,N,P,"weekdaysMin")}fa("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\\d{1,2}(th|st|nd|rd)/,ordinal:function(g){var N=g%10,P=er(g%100/10)===1?"th":N===1?"st":N===2?"nd":N===3?"rd":"th";return g+P}}),r.lang=F("moment.lang is deprecated. Use moment.locale instead.",fa),r.langData=F("moment.langData is deprecated. Use moment.localeData instead.",Yt);var ei=Math.abs;function hb(){var g=this._data;return this._milliseconds=ei(this._milliseconds),this._days=ei(this._days),this._months=ei(this._months),g.milliseconds=ei(g.milliseconds),g.seconds=ei(g.seconds),g.minutes=ei(g.minutes),g.hours=ei(g.hours),g.months=ei(g.months),g.years=ei(g.years),this}function Oc(g,N,P,z){var G=Yr(N,P);return g._milliseconds+=z*G._milliseconds,g._days+=z*G._days,g._months+=z*G._months,g._bubble()}function vb(g,N){return Oc(this,g,N,1)}function da(g,N){return Oc(this,g,N,-1)}function Pu(g){return g<0?Math.floor(g):Math.ceil(g)}function so(){var g=this._milliseconds,N=this._days,P=this._months,z=this._data,G,ue,Fe,gr,kr;return g>=0&&N>=0&&P>=0||g<=0&&N<=0&&P<=0||(g+=Pu(Bc(P)+N)*864e5,N=0,P=0),z.milliseconds=g%1e3,G=ur(g/1e3),z.seconds=G%60,ue=ur(G/60),z.minutes=ue%60,Fe=ur(ue/60),z.hours=Fe%24,N+=ur(Fe/24),kr=ur(Wn(N)),P+=kr,N-=Pu(Bc(kr)),gr=ur(P/12),P%=12,z.days=N,z.months=P,z.years=gr,this}function Wn(g){return g*4800/146097}function Bc(g){return g*146097/4800}function mp(g){if(!this.isValid())return NaN;var N,P,z=this._milliseconds;if(g=fe(g),g==="month"||g==="quarter"||g==="year")switch(N=this._days+z/864e5,P=this._months+Wn(N),g){case"month":return P;case"quarter":return P/3;case"year":return P/12}else switch(N=this._days+Math.round(Bc(this._months)),g){case"week":return N/7+z/6048e5;case"day":return N+z/864e5;case"hour":return N*24+z/36e5;case"minute":return N*1440+z/6e4;case"second":return N*86400+z/1e3;case"millisecond":return Math.floor(N*864e5)+z;default:throw new Error("Unknown unit "+g)}}function dp(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+er(this._months/12)*31536e6:NaN}function Vn(g){return function(){return this.as(g)}}var La=Vn("ms"),hp=Vn("s"),gb=Vn("m"),ku=Vn("h"),xb=Vn("d"),vp=Vn("w"),sn=Vn("M"),Ic=Vn("Q"),gp=Vn("y");function Bi(){return Yr(this)}function Pc(g){return g=fe(g),this.isValid()?this[g+"s"]():NaN}function Ii(g){return function(){return this.isValid()?this._data[g]:NaN}}var uo=Ii("milliseconds"),xp=Ii("seconds"),Nn=Ii("minutes"),kc=Ii("hours"),yb=Ii("days"),bb=Ii("months"),wb=Ii("years");function Rc(){return ur(this.days()/7)}var ha=Math.round,Pi={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function yp(g,N,P,z,G){return G.relativeTime(N||1,!!P,g,z)}function Db(g,N,P,z){var G=Yr(g).abs(),ue=ha(G.as("s")),Fe=ha(G.as("m")),gr=ha(G.as("h")),kr=ha(G.as("d")),ft=ha(G.as("M")),An=ha(G.as("w")),ki=ha(G.as("y")),va=ue<=P.ss&&["s",ue]||ue0,va[4]=z,yp.apply(null,va)}function Sb(g){return g===void 0?ha:typeof g=="function"?(ha=g,!0):!1}function qs(g,N){return Pi[g]===void 0?!1:N===void 0?Pi[g]:(Pi[g]=N,g==="s"&&(Pi.ss=N-1),!0)}function Nb(g,N){if(!this.isValid())return this.localeData().invalidDate();var P=!1,z=Pi,G,ue;return typeof g=="object"&&(N=g,g=!1),typeof g=="boolean"&&(P=g),typeof N=="object"&&(z=Object.assign({},Pi,N),N.s!=null&&N.ss==null&&(z.ss=N.s-1)),G=this.localeData(),ue=Db(this,!P,z,G),P&&(ue=G.pastFuture(+this,ue)),G.postformat(ue)}var Lc=Math.abs;function qa(g){return(g>0)-(g<0)||+g}function Us(){if(!this.isValid())return this.localeData().invalidDate();var g=Lc(this._milliseconds)/1e3,N=Lc(this._days),P=Lc(this._months),z,G,ue,Fe,gr=this.asSeconds(),kr,ft,An,ki;return gr?(z=ur(g/60),G=ur(z/60),g%=60,z%=60,ue=ur(P/12),P%=12,Fe=g?g.toFixed(3).replace(/\\.?0+$/,""):"",kr=gr<0?"-":"",ft=qa(this._months)!==qa(gr)?"-":"",An=qa(this._days)!==qa(gr)?"-":"",ki=qa(this._milliseconds)!==qa(gr)?"-":"",kr+"P"+(ue?ft+ue+"Y":"")+(P?ft+P+"M":"")+(N?An+N+"D":"")+(G||z||g?"T":"")+(G?ki+G+"H":"")+(z?ki+z+"M":"")+(g?ki+Fe+"S":"")):"P0D"}var Jr=Ms.prototype;Jr.isValid=F1,Jr.abs=hb,Jr.add=vb,Jr.subtract=da,Jr.as=mp,Jr.asMilliseconds=La,Jr.asSeconds=hp,Jr.asMinutes=gb,Jr.asHours=ku,Jr.asDays=xb,Jr.asWeeks=vp,Jr.asMonths=sn,Jr.asQuarters=Ic,Jr.asYears=gp,Jr.valueOf=dp,Jr._bubble=so,Jr.clone=Bi,Jr.get=Pc,Jr.milliseconds=uo,Jr.seconds=xp,Jr.minutes=Nn,Jr.hours=kc,Jr.days=yb,Jr.weeks=Rc,Jr.months=bb,Jr.years=wb,Jr.humanize=Nb,Jr.toISOString=Us,Jr.toString=Us,Jr.toJSON=Us,Jr.locale=Os,Jr.localeData=tp,Jr.toIsoString=F("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Us),Jr.lang=Eu,H("X",0,0,"unix"),H("x",0,0,"valueOf"),ar("x",on),ar("X",nc),mt("X",function(g,N,P){P._d=new Date(parseFloat(g)*1e3)}),mt("x",function(g,N,P){P._d=new Date(er(g))});return r.version="2.29.4",t(Ct),r.fn=Ze,r.min=E1,r.max=M1,r.now=_1,r.utc=d,r.unix=gi,r.months=pp,r.isDate=o,r.locale=fa,r.invalid=w,r.duration=Yr,r.isMoment=S,r.weekdays=db,r.parseZone=pb,r.localeData=Yt,r.isDuration=vi,r.monthsShort=mb,r.weekdaysMin=Ls,r.defineLocale=Sn,r.updateLocale=b1,r.locales=w1,r.weekdaysShort=Fc,r.normalizeUnits=fe,r.relativeTimeRounding=Sb,r.relativeTimeThreshold=qs,r.calendarFormat=U1,r.prototype=Ze,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r})});function zi(e){return zi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},zi(e)}function ai(e){if(e===null||e===!0||e===!1)return NaN;var r=Number(e);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}function vt(e,r){if(r.length1?"s":"")+" required, but only "+r.length+" present")}function Kt(e){vt(1,arguments);var r=Object.prototype.toString.call(e);return e instanceof Date||zi(e)==="object"&&r==="[object Date]"?new Date(e.getTime()):typeof e=="number"||r==="[object Number]"?new Date(e):((typeof e=="string"||r==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function sw(e,r){vt(2,arguments);var t=Kt(e).getTime(),n=ai(r);return new Date(t+n)}var tq={};function Xo(){return tq}function uw(e){var r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),e.getTime()-r.getTime()}function fw(e){return vt(1,arguments),e instanceof Date||zi(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function cw(e){if(vt(1,arguments),!fw(e)&&typeof e!="number")return!1;var r=Kt(e);return!isNaN(Number(r))}function lw(e,r){vt(2,arguments);var t=ai(r);return sw(e,-t)}var nq=864e5;function pw(e){vt(1,arguments);var r=Kt(e),t=r.getTime();r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0);var n=r.getTime(),i=t-n;return Math.floor(i/nq)+1}function Jo(e){vt(1,arguments);var r=1,t=Kt(e),n=t.getUTCDay(),i=(n=i.getTime()?t+1:r.getTime()>=s.getTime()?t:t-1}function mw(e){vt(1,arguments);var r=Yc(e),t=new Date(0);t.setUTCFullYear(r,0,4),t.setUTCHours(0,0,0,0);var n=Jo(t);return n}var iq=6048e5;function dw(e){vt(1,arguments);var r=Kt(e),t=Jo(r).getTime()-mw(r).getTime();return Math.round(t/iq)+1}function Ko(e,r){var t,n,i,a,s,c,f,o;vt(1,arguments);var u=Xo(),p=ai((t=(n=(i=(a=r?.weekStartsOn)!==null&&a!==void 0?a:r==null||(s=r.locale)===null||s===void 0||(c=s.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&n!==void 0?n:(f=u.locale)===null||f===void 0||(o=f.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&t!==void 0?t:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=Kt(e),h=d.getUTCDay(),x=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=new Date(0);x.setUTCFullYear(p+1,0,h),x.setUTCHours(0,0,0,0);var v=Ko(x,r),y=new Date(0);y.setUTCFullYear(p,0,h),y.setUTCHours(0,0,0,0);var w=Ko(y,r);return u.getTime()>=v.getTime()?p+1:u.getTime()>=w.getTime()?p:p-1}function hw(e,r){var t,n,i,a,s,c,f,o;vt(1,arguments);var u=Xo(),p=ai((t=(n=(i=(a=r?.firstWeekContainsDate)!==null&&a!==void 0?a:r==null||(s=r.locale)===null||s===void 0||(c=s.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&n!==void 0?n:(f=u.locale)===null||f===void 0||(o=f.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&t!==void 0?t:1),d=Hc(e,r),h=new Date(0);h.setUTCFullYear(d,0,p),h.setUTCHours(0,0,0,0);var x=Ko(h,r);return x}var aq=6048e5;function vw(e,r){vt(1,arguments);var t=Kt(e),n=Ko(t,r).getTime()-hw(t,r).getTime();return Math.round(n/aq)+1}function dt(e,r){for(var t=e<0?"-":"",n=Math.abs(e).toString();n.length0?n:1-n;return dt(t==="yy"?i%100:i,t.length)},M:function(r,t){var n=r.getUTCMonth();return t==="M"?String(n+1):dt(n+1,2)},d:function(r,t){return dt(r.getUTCDate(),t.length)},a:function(r,t){var n=r.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(r,t){return dt(r.getUTCHours()%12||12,t.length)},H:function(r,t){return dt(r.getUTCHours(),t.length)},m:function(r,t){return dt(r.getUTCMinutes(),t.length)},s:function(r,t){return dt(r.getUTCSeconds(),t.length)},S:function(r,t){var n=t.length,i=r.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return dt(a,t.length)}},vo=oq;var Wu={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sq={G:function(r,t,n){var i=r.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(r,t,n){if(t==="yo"){var i=r.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return vo.y(r,t)},Y:function(r,t,n,i){var a=Hc(r,i),s=a>0?a:1-a;if(t==="YY"){var c=s%100;return dt(c,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):dt(s,t.length)},R:function(r,t){var n=Yc(r);return dt(n,t.length)},u:function(r,t){var n=r.getUTCFullYear();return dt(n,t.length)},Q:function(r,t,n){var i=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return dt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,t,n){var i=Math.ceil((r.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return dt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,t,n){var i=r.getUTCMonth();switch(t){case"M":case"MM":return vo.M(r,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(r,t,n){var i=r.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return dt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(r,t,n,i){var a=vw(r,i);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):dt(a,t.length)},I:function(r,t,n){var i=dw(r);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):dt(i,t.length)},d:function(r,t,n){return t==="do"?n.ordinalNumber(r.getUTCDate(),{unit:"date"}):vo.d(r,t)},D:function(r,t,n){var i=pw(r);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):dt(i,t.length)},E:function(r,t,n){var i=r.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(r,t,n,i){var a=r.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return dt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(r,t,n,i){var a=r.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return dt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(r,t,n){var i=r.getUTCDay(),a=i===0?7:i;switch(t){case"i":return String(a);case"ii":return dt(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(r,t,n){var i=r.getUTCHours(),a=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(r,t,n){var i=r.getUTCHours(),a;switch(i===12?a=Wu.noon:i===0?a=Wu.midnight:a=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(r,t,n){var i=r.getUTCHours(),a;switch(i>=17?a=Wu.evening:i>=12?a=Wu.afternoon:i>=4?a=Wu.morning:a=Wu.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(r,t,n){if(t==="ho"){var i=r.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return vo.h(r,t)},H:function(r,t,n){return t==="Ho"?n.ordinalNumber(r.getUTCHours(),{unit:"hour"}):vo.H(r,t)},K:function(r,t,n){var i=r.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):dt(i,t.length)},k:function(r,t,n){var i=r.getUTCHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):dt(i,t.length)},m:function(r,t,n){return t==="mo"?n.ordinalNumber(r.getUTCMinutes(),{unit:"minute"}):vo.m(r,t)},s:function(r,t,n){return t==="so"?n.ordinalNumber(r.getUTCSeconds(),{unit:"second"}):vo.s(r,t)},S:function(r,t){return vo.S(r,t)},X:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return iA(s);case"XXXX":case"XX":return Ys(s);case"XXXXX":case"XXX":default:return Ys(s,":")}},x:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"x":return iA(s);case"xxxx":case"xx":return Ys(s);case"xxxxx":case"xxx":default:return Ys(s,":")}},O:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+nA(s,":");case"OOOO":default:return"GMT"+Ys(s,":")}},z:function(r,t,n,i){var a=i._originalDate||r,s=a.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+nA(s,":");case"zzzz":default:return"GMT"+Ys(s,":")}},t:function(r,t,n,i){var a=i._originalDate||r,s=Math.floor(a.getTime()/1e3);return dt(s,t.length)},T:function(r,t,n,i){var a=i._originalDate||r,s=a.getTime();return dt(s,t.length)}};function nA(e,r){var t=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return t+String(i);var s=r||"";return t+String(i)+s+dt(a,2)}function iA(e,r){if(e%60===0){var t=e>0?"-":"+";return t+dt(Math.abs(e)/60,2)}return Ys(e,r)}function Ys(e,r){var t=r||"",n=e>0?"-":"+",i=Math.abs(e),a=dt(Math.floor(i/60),2),s=dt(i%60,2);return n+a+t+s}var aA=sq;var oA=function(r,t){switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},sA=function(r,t){switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},uq=function(r,t){var n=r.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return oA(r,t);var s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",oA(i,t)).replace("{{time}}",sA(a,t))},fq={p:sA,P:uq},uA=fq;var cq=["D","DD"],lq=["YY","YYYY"];function fA(e){return cq.indexOf(e)!==-1}function cA(e){return lq.indexOf(e)!==-1}function gw(e,r,t){if(e==="YYYY")throw new RangeError("Use \`yyyy\` instead of \`YYYY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use \`yy\` instead of \`YY\` (in \`".concat(r,"\`) for formatting years to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use \`d\` instead of \`D\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use \`dd\` instead of \`DD\` (in \`".concat(r,"\`) for formatting days of the month to the input \`").concat(t,"\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var pq={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},mq=function(r,t,n){var i,a=pq[r];return typeof a=="string"?i=a:t===1?i=a.one:i=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},lA=mq;function Gc(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.width?String(r.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var dq={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},hq={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},vq={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},gq={date:Gc({formats:dq,defaultWidth:"full"}),time:Gc({formats:hq,defaultWidth:"full"}),dateTime:Gc({formats:vq,defaultWidth:"full"})},pA=gq;var xq={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},yq=function(r,t,n,i){return xq[r]},mA=yq;function Hs(e){return function(r,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,s=t!=null&&t.width?String(t.width):a;i=e.formattingValues[s]||e.formattingValues[a]}else{var c=e.defaultWidth,f=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[f]||e.values[c]}var o=e.argumentCallback?e.argumentCallback(r):r;return i[o]}}var bq={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},wq={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Dq={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Sq={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Nq={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Aq={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Cq=function(r,t){var n=Number(r),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Eq={ordinalNumber:Cq,era:Hs({values:bq,defaultWidth:"wide"}),quarter:Hs({values:wq,defaultWidth:"wide",argumentCallback:function(r){return r-1}}),month:Hs({values:Dq,defaultWidth:"wide"}),day:Hs({values:Sq,defaultWidth:"wide"}),dayPeriod:Hs({values:Nq,defaultWidth:"wide",formattingValues:Aq,defaultFormattingWidth:"wide"})},dA=Eq;function Gs(e){return function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=r.match(i);if(!a)return null;var s=a[0],c=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],f=Array.isArray(c)?_q(c,function(p){return p.test(s)}):Mq(c,function(p){return p.test(s)}),o;o=e.valueCallback?e.valueCallback(f):f,o=t.valueCallback?t.valueCallback(o):o;var u=r.slice(s.length);return{value:o,rest:u}}}function Mq(e,r){for(var t in e)if(e.hasOwnProperty(t)&&r(e[t]))return t}function _q(e,r){for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:{},n=r.match(e.matchPattern);if(!n)return null;var i=n[0],a=r.match(e.parsePattern);if(!a)return null;var s=e.valueCallback?e.valueCallback(a[0]):a[0];s=t.valueCallback?t.valueCallback(s):s;var c=r.slice(i.length);return{value:s,rest:c}}}var Tq=/^(\\d+)(th|st|nd|rd)?/i,Fq=/\\d+/i,Oq={narrow:/^(b|a)/i,abbreviated:/^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Bq={any:[/^b/i,/^(a|c)/i]},Iq={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Pq={any:[/1/i,/2/i,/3/i,/4/i]},kq={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Rq={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Lq={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},qq={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Uq={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},zq={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Wq={ordinalNumber:xw({matchPattern:Tq,parsePattern:Fq,valueCallback:function(r){return parseInt(r,10)}}),era:Gs({matchPatterns:Oq,defaultMatchWidth:"wide",parsePatterns:Bq,defaultParseWidth:"any"}),quarter:Gs({matchPatterns:Iq,defaultMatchWidth:"wide",parsePatterns:Pq,defaultParseWidth:"any",valueCallback:function(r){return r+1}}),month:Gs({matchPatterns:kq,defaultMatchWidth:"wide",parsePatterns:Rq,defaultParseWidth:"any"}),day:Gs({matchPatterns:Lq,defaultMatchWidth:"wide",parsePatterns:qq,defaultParseWidth:"any"}),dayPeriod:Gs({matchPatterns:Uq,defaultMatchWidth:"any",parsePatterns:zq,defaultParseWidth:"any"})},hA=Wq;var Vq={code:"en-US",formatDistance:lA,formatLong:pA,formatRelative:mA,localize:dA,match:hA,options:{weekStartsOn:0,firstWeekContainsDate:1}},vA=Vq;var gA=vA;var Yq=/[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g,Hq=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Gq=/^'([^]*?)'?$/,$q=/''/g,Zq=/[a-zA-Z]/;function go(e,r,t){var n,i,a,s,c,f,o,u,p,d,h,x,v,y,w,E,b,A;vt(2,arguments);var C=String(r),S=Xo(),O=(n=(i=t?.locale)!==null&&i!==void 0?i:S.locale)!==null&&n!==void 0?n:gA,F=ai((a=(s=(c=(f=t?.firstWeekContainsDate)!==null&&f!==void 0?f:t==null||(o=t.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&c!==void 0?c:S.firstWeekContainsDate)!==null&&s!==void 0?s:(p=S.locale)===null||p===void 0||(d=p.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(F>=1&&F<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=ai((h=(x=(v=(y=t?.weekStartsOn)!==null&&y!==void 0?y:t==null||(w=t.locale)===null||w===void 0||(E=w.options)===null||E===void 0?void 0:E.weekStartsOn)!==null&&v!==void 0?v:S.weekStartsOn)!==null&&x!==void 0?x:(b=S.locale)===null||b===void 0||(A=b.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&h!==void 0?h:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!O.localize)throw new RangeError("locale must contain localize property");if(!O.formatLong)throw new RangeError("locale must contain formatLong property");var _=Kt(e);if(!cw(_))throw new RangeError("Invalid time value");var k=uw(_),L=lw(_,k),Y={firstWeekContainsDate:F,weekStartsOn:M,locale:O,_originalDate:_},$=C.match(Hq).map(function(V){var q=V[0];if(q==="p"||q==="P"){var R=uA[q];return R(V,O.formatLong)}return V}).join("").match(Yq).map(function(V){if(V==="''")return"'";var q=V[0];if(q==="'")return Qq(V);var R=aA[q];if(R)return!(t!=null&&t.useAdditionalWeekYearTokens)&&cA(V)&&gw(V,r,String(e)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&fA(V)&&gw(V,r,String(e)),R(L,V,O.localize,Y);if(q.match(Zq))throw new RangeError("Format string contains an unescaped latin alphabet character \`"+q+"\`");return V}).join("");return $}function Qq(e){var r=e.match(Gq);return r?r[1].replace($q,"'"):e}function yw(e,r){if(zi(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(zi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function bw(e){var r=yw(e,"string");return zi(r)=="symbol"?r:r+""}function Zr(e,r,t){return r=bw(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var Yu=Ui(ww());var Wa="File";function xA(e){return Array.isArray(e)?e:typeof e=="string"?[e]:[]}function yA(e){return e?typeof e!="string"?e.toString():e:""}var bA=(e,r)=>r.indexOf(e)>0?r.indexOf(e):r.length;var Dw=e=>[...new Set(e)];var Sw=(e,r)=>{if(e instanceof Date)return"date";if(typeof e=="string"){if(/\\/\\/(\\S+?(?:jpe?g|png|gif|svg))/gi.test(e)||e.includes("unsplash"))return"image";if(/^\\d{4}-\\d{2}-\\d{2}$/.test(e))return"date";if(r=="tag"||r=="tags")return"tag";if(/\\[\\[.*?\\]\\]/.test(e))return"link"}else{if(typeof e=="number")return"number";if(typeof e=="boolean")return"boolean";if(e)if(Array.isArray(e)||typeof e=="string"&&e.indexOf(",")>-1){let t=Array.isArray(e)?e:[];if(typeof e=="string"&&e.indexOf(",")>-1&&(t=$s(e)),r=="tag"||r=="tags")return"tag-multi";if(t.length==1&&Array.isArray(t[0])&&t[0].length==1&&typeof t[0][0]=="string")return"link";let n=Dw(t.map(i=>Sw(i,r)));return n.length==1&&n[0]=="link"?"link-multi":n.some(i=>i=="object")?"object-multi":"option-multi"}else{if(e.isLuxonDateTime)return"date";if(e.isLuxonDuration)return"duration";if(e.type=="file")return"link";if(typeof e=="object"&&!Array.isArray(e)&&e!==null)return"object"}else return"unknown"}return"text"};var wA=e=>e.map(r=>r.replace(",","\\\\,")).join(", "),Nw=e=>e?.map(r=>r.replace(",","\\\\,")).join(", ")??"";var $s=e=>(e?.replace("\\\\,",",")?.match(/(\\\\.|[^,])+/g)??[]).map(r=>r.trim()),qp=(e,r)=>{switch(Sw(r,e)){case"object":return JSON.stringify(r);case"number":return r.toString();case"boolean":return r?"true":"false";case"date":{if(r instanceof Date){let n=go(r,"yyyy-MM-dd");if(typeof n=="string")return n}return typeof r!="string"?"":r}break;case"duration":return wA(Object.keys(r.values).reduce((n,i)=>[...n,...r.values[i]>0?[r.values[i]+" "+i]:[]],[]));case"option-multi":case"link-multi":return typeof r=="string"?Aw(r):Nw(r.map(n=>n?typeof n=="string"?Aw(n):n.path?n.path:Array.isArray(r)&&n.length==1&&Array.isArray(n[0])&&n[0].length==1&&typeof n[0][0]=="string"?n[0][0]:JSON.stringify(n):""));case"link":return Array.isArray(r)&&r.length==1&&Array.isArray(r[0])&&r[0].length==1&&typeof r[0][0]=="string"?r[0][0]:typeof r=="string"?Aw(r):r.path;case"text":case"tag":case"image":return r}return""},Lp=e=>{let r;try{r=JSON.parse(e)}catch{}return r};var Aw=e=>{if(!e)return"";let r=/\\[\\[(.*?)\\]\\]/g.exec(e),t=r?.length>1?r[1].substring(0,bA("|",r[1])):e;return t||e};var DA=(e,r,t)=>t?.get("$current");DA.rawArgs=!0;var SA=(e,r,t)=>{if(e.length!==1)return"";let n=e.map(function(s){return s.compile().evaluate(t)}),i=t.get(n[0]),a=t.get("$properties")?.[n[0]]?.type;return(a=="file"||a=="link"||a=="context")&&(a.includes("multi")?i=$s(i).map(s=>t.get("$paths").get(s)??s):i=t.get("$paths").get(i)??i),i??""};SA.rawArgs=!0;var NA=(e,r,t)=>{if((e.length-1)%2!==0)return"";for(let n=0;n{if(e.length<1||e.length>2)return"";let n=e[0].compile().evaluate(t);n instanceof Date||(n=new Date(n));let i=e[1]?.compile().evaluate(t);return i?.length>0?go(n,i):go(n,t.get("$settings")?.dateFormat??"yyyy-MM-dd")};AA.rawArgs=!0;var Di=e=>typeof e=="string"||e instanceof String?e:e instanceof Date?go(e,"yyyy-MM-dd"):typeof e=="number"?e.toFixed(2):e.path?e.path:"",Cw={prop:SA,current:DA,slice:(e,r,t)=>(e=Di(e),e.slice(r,t)),if:(e,r,t)=>e===!0?r:t,ifs:NA,empty:e=>e.length!==1?"":e[0]===""?"true":"false",length:e=>e.length,substring:(e,r,t)=>(e=Di(e),t?e.substring(r,t):e.substring(r)),contains:(e,r)=>(e=Di(e),r=Di(r),e.includes(r)),test:(e,r)=>(e=Di(e),new RegExp(r).test(e)),match:(e,r)=>(e=Di(e),e.match(new RegExp(r))),replace:(e,r,t)=>(e=Di(e),e.replace(new RegExp(r),t)),replaceAll:(e,r,t)=>(e=Di(e),r=Di(r),t=Di(t),e.replace(new RegExp(r,"g"),t)),lower:e=>(e=Di(e),e.toLowerCase()),upper:e=>(e=Di(e),e.toUpperCase()),repeat:(e,r)=>e.repeat(r),format:Di,toNumber:e=>e instanceof Date?e.getTime():typeof e=="string"?parseFloat(e):e,now:()=>new Date,minute:e=>e.getMinutes(),hour:e=>e.getHours(),day:e=>e.getDay(),date:e=>e.getDate(),week:e=>go(e,"w"),month:e=>e.getMonth()+1,year:e=>e.getFullYear(),dateAdd:(e,r,t)=>(t==="day"&&e.setDate(e.getDate()+r),t==="month"&&e.setMonth(e.getMonth()+r),t==="year"&&e.setFullYear(e.getFullYear()+r),t==="quarter"&&e.setMonth(e.getMonth()+r*3),t==="week"&&e.setDate(e.getDate()+r*7),t==="hour"&&e.setHours(e.getHours()+r),t==="minute"&&e.setMinutes(e.getMinutes()+r),t==="second"&&e.setSeconds(e.getSeconds()+r),e),dateSubtract:(e,r,t)=>(t==="day"&&e.setDate(e.getDate()-r),t==="month"&&e.setMonth(e.getMonth()-r),t==="year"&&e.setFullYear(e.getFullYear()-r),t==="quarter"&&e.setMonth(e.getMonth()-r*3),t==="week"&&e.setDate(e.getDate()-r*7),t==="hour"&&e.setHours(e.getHours()-r),t==="minute"&&e.setMinutes(e.getMinutes()-r),t==="second"&&e.setSeconds(e.getSeconds()-r),e),dateBetween:(e,r,t)=>{let s=Math.abs(r.getTime()-e.getTime());switch(t){case"days":return Math.round(s/864e5);case"months":return Math.round(s/2592e6);case"years":return Math.round(s/31536e6);case"hours":return Math.round(s/(60*60*1e3));case"minutes":return Math.round(s/(60*1e3));case"seconds":return Math.round(s/1e3);case"weeks":return Math.round(s/(864e5*7));case"quarters":return Math.round(s/(2592e6*3));default:return Math.round(s/864e5)}},style:(e,r)=>e,timeStamp:e=>e.getTime(),formatDate:AA,parseDate:e=>{if((0,Yu.isNumber)(e))return new Date(e);if((0,Yu.isString)(e)){let r=new Date().getTimezoneOffset(),t=(r>=0?"-":"+")+String(Math.floor(Math.abs(r)/60)).padStart(2,"0")+":"+String(Math.abs(r)%60).padStart(2,"0");if(/^\\d{4}-\\d{2}-\\d{2}$/.test(e))return new Date(e+"T00:00:00"+t);if(/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?$/.test(e))return new Date(e+t);if(/^\\d{4}-W\\d{2}$/.test(e)){let n=Number(e.slice(0,4)),i=Number(e.slice(6,8)),a=new Date(n,0,1+(i-1)*7),s=a.getDay()||7;return a.setDate(a.getDate()+1-s),a}return new Date(e)}return(0,Yu.isDate)(e)?e:""}};function St(){return St=Object.assign?Object.assign.bind():function(e){for(var r=1;re[r])}var jp=["Matrix","Array"],em=["number","BigNumber","Fraction"];function FA(e,r){function t(n){if(n){var i=$u(e,or);TA(n,"matrix",jp),TA(n,"number",em),Ew(e,n);var a=$u(e,or),s=$u(n,or);return r("config",a,i,s),a}else return $u(e,or)}return t.MATRIX_OPTIONS=jp,t.NUMBER_OPTIONS=em,Object.keys(Zs).forEach(n=>{Object.defineProperty(t,n,{get:()=>e[n],enumerable:!0,configurable:!0})}),t}function Xq(e,r){return e.indexOf(r)!==-1}function TA(e,r,t){e[r]!==void 0&&!Xq(t,e[r])&&console.warn('Warning: Unknown value "'+e[r]+'" for configuration option "'+r+'". Available options: '+t.map(n=>JSON.stringify(n)).join(", ")+".")}var Be=function(r){if(r)throw new Error(\`The global config is readonly. -Please create a mathjs instance if you want to change the default configuration. -Example: - - import { create, all } from 'mathjs'; - const mathjs = create(all); - mathjs.config({ number: 'BigNumber' }); -\`);return Object.freeze(Zs)};St(Be,Zs,{MATRIX_OPTIONS:jp,NUMBER_OPTIONS:em});var wS={};eq(wS,{createAbs:()=>rd,createAccessorNode:()=>jv,createAcos:()=>uv,createAcosh:()=>fv,createAcot:()=>cv,createAcoth:()=>lv,createAcsc:()=>pv,createAcsch:()=>mv,createAdd:()=>Vv,createAddScalar:()=>nd,createAnd:()=>Cf,createAndTransform:()=>gy,createApply:()=>us,createApplyTransform:()=>Jx,createArg:()=>_d,createArrayNode:()=>rg,createAsec:()=>dv,createAsech:()=>hv,createAsin:()=>vv,createAsinh:()=>gv,createAssignmentNode:()=>ag,createAtan:()=>xv,createAtan2:()=>yv,createAtanh:()=>bv,createAtomicMass:()=>_x,createAvogadro:()=>Tx,createBellNumbers:()=>D0,createBigNumberClass:()=>bm,createBignumber:()=>Hm,createBin:()=>lh,createBitAnd:()=>lf,createBitAndTransform:()=>yy,createBitNot:()=>Ed,createBitOr:()=>pf,createBitOrTransform:()=>by,createBitXor:()=>Md,createBlockNode:()=>sg,createBohrMagneton:()=>fx,createBohrRadius:()=>hx,createBoltzmann:()=>Fx,createBoolean:()=>Ym,createCatalan:()=>S0,createCbrt:()=>ad,createCeil:()=>od,createChain:()=>Gg,createChainClass:()=>Yg,createClassicalElectronRadius:()=>vx,createClone:()=>Em,createColumn:()=>hf,createColumnTransform:()=>Kx,createCombinations:()=>f0,createCombinationsWithRep:()=>c0,createCompare:()=>Ih,createCompareNatural:()=>Ph,createCompareText:()=>kh,createCompile:()=>Og,createComplex:()=>Gm,createComplexClass:()=>wm,createComposition:()=>N0,createConcat:()=>df,createConcatTransform:()=>fy,createConditionalNode:()=>fg,createConductanceQuantum:()=>cx,createConj:()=>Td,createConstantNode:()=>mg,createCorr:()=>u0,createCos:()=>wv,createCosh:()=>Dv,createCot:()=>Sv,createCoth:()=>Nv,createCoulomb:()=>sx,createCount:()=>Pd,createCreateUnit:()=>sv,createCross:()=>kd,createCsc:()=>Av,createCsch:()=>Cv,createCtranspose:()=>rh,createCube:()=>sd,createCumSum:()=>Ff,createCumSumTransform:()=>dy,createDeepEqual:()=>Zh,createDenseMatrixClass:()=>Cm,createDerivative:()=>F0,createDet:()=>$g,createDeuteronMass:()=>Dx,createDiag:()=>Rd,createDiff:()=>vf,createDiffTransform:()=>cy,createDistance:()=>n0,createDivide:()=>t0,createDivideScalar:()=>xh,createDot:()=>Gv,createDotDivide:()=>Ah,createDotMultiply:()=>Ad,createDotPow:()=>Nh,createE:()=>Y0,createEfimovFactor:()=>Mx,createEigs:()=>Xg,createElectricConstant:()=>ax,createElectronMass:()=>gx,createElementaryCharge:()=>ux,createEqual:()=>Lh,createEqualScalar:()=>Um,createEqualText:()=>qh,createErf:()=>oh,createEvaluate:()=>Bg,createExp:()=>ud,createExpm:()=>Jg,createExpm1:()=>fd,createFactorial:()=>m0,createFalse:()=>L0,createFaraday:()=>Ox,createFermiCoupling:()=>xx,createFft:()=>nh,createFibonacciHeapClass:()=>rv,createFilter:()=>Ld,createFilterTransform:()=>jx,createFineStructure:()=>yx,createFirstRadiation:()=>Bx,createFix:()=>cd,createFlatten:()=>qd,createFloor:()=>sf,createForEach:()=>Ud,createForEachTransform:()=>ey,createFormat:()=>ch,createFraction:()=>$m,createFractionClass:()=>Dm,createFreqz:()=>I0,createFunctionAssignmentNode:()=>hg,createFunctionNode:()=>Tg,createGamma:()=>l0,createGasConstant:()=>Px,createGcd:()=>ld,createGetMatrixDataType:()=>zd,createGravitationConstant:()=>rx,createGravity:()=>Yx,createHartreeEnergy:()=>bx,createHasNumericValue:()=>Im,createHelp:()=>Hg,createHelpClass:()=>Vg,createHex:()=>mh,createHypot:()=>Yv,createI:()=>K0,createIdentity:()=>Wd,createIfft:()=>ih,createIm:()=>Fd,createImmutableDenseMatrixClass:()=>jh,createIndex:()=>Zv,createIndexClass:()=>ev,createIndexNode:()=>gg,createIndexTransform:()=>ry,createInfinity:()=>U0,createIntersect:()=>i0,createInv:()=>Zg,createInverseConductanceQuantum:()=>lx,createInvmod:()=>Sd,createIsInteger:()=>Tm,createIsNaN:()=>Rm,createIsNegative:()=>Om,createIsNumeric:()=>Bm,createIsPositive:()=>Pm,createIsPrime:()=>vh,createIsZero:()=>km,createKldivergence:()=>d0,createKlitzing:()=>dx,createKron:()=>Vd,createLN10:()=>$0,createLN2:()=>G0,createLOG10E:()=>Q0,createLOG2E:()=>Z0,createLarger:()=>Hh,createLargerEq:()=>$h,createLcm:()=>pd,createLeafCount:()=>A0,createLeftShift:()=>Th,createLgamma:()=>p0,createLog:()=>wh,createLog10:()=>md,createLog1p:()=>Dh,createLog2:()=>dd,createLoschmidt:()=>Ix,createLsolve:()=>Ch,createLsolveAll:()=>Mh,createLup:()=>kg,createLusolve:()=>zg,createLyap:()=>r0,createMad:()=>s0,createMagneticConstant:()=>ix,createMagneticFluxQuantum:()=>px,createMap:()=>Yd,createMapTransform:()=>ty,createMatrix:()=>Zm,createMatrixClass:()=>Nm,createMatrixFromColumns:()=>Jm,createMatrixFromFunction:()=>Qm,createMatrixFromRows:()=>Xm,createMax:()=>Ef,createMaxTransform:()=>ny,createMean:()=>Of,createMeanTransform:()=>iy,createMedian:()=>o0,createMin:()=>Mf,createMinTransform:()=>ay,createMod:()=>uf,createMode:()=>uh,createMolarMass:()=>Wx,createMolarMassC12:()=>Vx,createMolarPlanckConstant:()=>kx,createMolarVolume:()=>Rx,createMultinomial:()=>h0,createMultiply:()=>vd,createMultiplyScalar:()=>hd,createNaN:()=>z0,createNeutronMass:()=>Sx,createNode:()=>Xv,createNorm:()=>Hv,createNot:()=>Bd,createNthRoot:()=>gd,createNthRoots:()=>Sh,createNuclearMagneton:()=>mx,createNull:()=>q0,createNumber:()=>Wm,createNumeric:()=>gh,createObjectNode:()=>yg,createOct:()=>ph,createOnes:()=>Hd,createOperatorNode:()=>wg,createOr:()=>mf,createOrTransform:()=>xy,createParenthesisNode:()=>Sg,createParse:()=>Fg,createParser:()=>Pg,createParserClass:()=>Ig,createPartitionSelect:()=>Jh,createPermutations:()=>v0,createPhi:()=>H0,createPi:()=>W0,createPickRandom:()=>x0,createPinv:()=>Qg,createPlanckCharge:()=>Zx,createPlanckConstant:()=>tx,createPlanckLength:()=>Hx,createPlanckMass:()=>Gx,createPlanckTemperature:()=>Qx,createPlanckTime:()=>$x,createPolynomialRoot:()=>Wg,createPow:()=>yh,createPrint:()=>Df,createPrintTransform:()=>vy,createProd:()=>fh,createProtonMass:()=>wx,createQr:()=>Rg,createQuantileSeq:()=>If,createQuantileSeqTransform:()=>my,createQuantumOfCirculation:()=>Nx,createRandom:()=>y0,createRandomInt:()=>b0,createRange:()=>xf,createRangeClass:()=>Sm,createRangeNode:()=>Ag,createRangeTransform:()=>oy,createRationalize:()=>O0,createRe:()=>Od,createReducedPlanckConstant:()=>nx,createRelationalNode:()=>Eg,createReplacer:()=>k0,createReshape:()=>Zd,createResize:()=>Qd,createResolve:()=>_0,createResultSet:()=>pm,createReviver:()=>P0,createRightArithShift:()=>Fh,createRightLogShift:()=>Oh,createRotate:()=>Xd,createRotationMatrix:()=>Jd,createRound:()=>bh,createRow:()=>yf,createRowTransform:()=>sy,createRydberg:()=>Ax,createSQRT1_2:()=>X0,createSQRT2:()=>J0,createSackurTetrode:()=>Lx,createSchur:()=>e0,createSec:()=>Ev,createSech:()=>Mv,createSecondRadiation:()=>qx,createSetCartesian:()=>Bv,createSetDifference:()=>Iv,createSetDistinct:()=>Pv,createSetIntersect:()=>kv,createSetIsSubset:()=>Rv,createSetMultiplicity:()=>Lv,createSetPowerset:()=>qv,createSetSize:()=>Uv,createSetSymDifference:()=>zv,createSetUnion:()=>Wv,createSign:()=>xd,createSimplify:()=>C0,createSimplifyConstant:()=>E0,createSimplifyCore:()=>M0,createSin:()=>_v,createSinh:()=>Tv,createSize:()=>Kd,createSlu:()=>Ug,createSmaller:()=>zh,createSmallerEq:()=>Vh,createSolveODE:()=>ah,createSort:()=>Kh,createSpaClass:()=>tv,createSparse:()=>ov,createSparseMatrixClass:()=>zm,createSpeedOfLight:()=>ex,createSplitUnit:()=>Km,createSqrt:()=>yd,createSqrtm:()=>Kg,createSquare:()=>bd,createSqueeze:()=>jd,createStd:()=>Pf,createStdTransform:()=>ly,createStefanBoltzmann:()=>Ux,createStirlingS2:()=>w0,createString:()=>Vm,createSubset:()=>bf,createSubsetTransform:()=>uy,createSubtract:()=>wd,createSubtractScalar:()=>id,createSum:()=>Tf,createSumTransform:()=>py,createSylvester:()=>jg,createSymbolNode:()=>Mg,createSymbolicEqual:()=>T0,createTan:()=>Fv,createTanh:()=>Ov,createTau:()=>V0,createThomsonCrossSection:()=>Cx,createTo:()=>hh,createTrace:()=>$v,createTranspose:()=>eh,createTrue:()=>R0,createTypeOf:()=>Lm,createTyped:()=>lm,createUnaryMinus:()=>jm,createUnaryPlus:()=>ed,createUnequal:()=>Xh,createUnitClass:()=>iv,createUnitFunction:()=>av,createUppercaseE:()=>jI,createUppercasePi:()=>KI,createUsolve:()=>Eh,createUsolveAll:()=>_h,createVacuumImpedance:()=>ox,createVariance:()=>Bf,createVarianceTransform:()=>hy,createVersion:()=>j0,createWeakMixingAngle:()=>Ex,createWienDisplacement:()=>zx,createXgcd:()=>Dd,createXor:()=>Id,createZeros:()=>th,createZeta:()=>sh,createZpk2tf:()=>B0});var Hw=Ui(rm(),1);function Qe(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}var Vi=Math.sign||function(e){return e>0?1:e<0?-1:0},IA=Math.log2||function(r){return Math.log(r)/Math.LN2},PA=Math.log10||function(r){return Math.log(r)/Math.LN10},tm=Math.log1p||function(e){return Math.log(e+1)},kA=Math.cbrt||function(r){if(r===0)return r;var t=r<0,n;return t&&(r=-r),isFinite(r)?(n=Math.exp(Math.log(r)/3),n=(r/(n*n)+2*n)/3):n=r,t?-n:n},RA=Math.expm1||function(r){return r>=2e-4||r<=-2e-4?Math.exp(r)-1:r+r*r/2+r*r*r/6};function Fw(e,r,t){var n={2:"0b",8:"0o",16:"0x"},i=n[r],a="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!Qe(t))throw new Error("size must be an integer");if(e>2**(t-1)-1||e<-(2**(t-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!Qe(e))throw new Error("Value must be an integer");e<0&&(e=e+2**t),a="i".concat(t)}var s="";return e<0&&(e=-e,s="-"),"".concat(s).concat(i).concat(e.toString(r)).concat(a)}function ba(e,r){if(typeof r=="function")return r(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:t,precision:n,wordSize:i}=Ow(r);switch(t){case"fixed":return Bw(e,n);case"exponential":return LA(e,n);case"engineering":return Jq(e,n);case"bin":return Fw(e,2,i);case"oct":return Fw(e,8,i);case"hex":return Fw(e,16,i);case"auto":return Kq(e,n,r).replace(/((\\.\\d*?)(0+))($|e)/,function(){var a=arguments[2],s=arguments[4];return a!=="."?a+s:s});default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Ow(e){var r="auto",t,n;if(e!==void 0)if(fr(e))t=e;else if(nr(e))t=e.toNumber();else if(Ya(e))e.precision!==void 0&&(t=OA(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=OA(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(r=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:r,precision:t,wordSize:n}}function Xu(e){var r=String(e).toLowerCase().match(/^(-?)(\\d+\\.?\\d*)(e([+-]?\\d+))?$/);if(!r)throw new SyntaxError("Invalid number "+e);var t=r[1],n=r[2],i=parseFloat(r[4]||"0"),a=n.indexOf(".");i+=a!==-1?a-1:n.length-1;var s=n.replace(".","").replace(/^0*/,function(c){return i-=c.length,""}).replace(/0*$/,"").split("").map(function(c){return parseInt(c)});return s.length===0&&(s.push(0),i++),{sign:t,coefficients:s,exponent:i}}function Jq(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Xu(e),n=nm(t,r),i=n.exponent,a=n.coefficients,s=i%3===0?i:i<0?i-3-i%3:i-i%3;if(fr(r))for(;r>a.length||i-s+1>a.length;)a.push(0);else for(var c=Math.abs(i-s)-(a.length-1),f=0;f0;)u++,o--;var p=a.slice(u).join(""),d=fr(r)&&p.length||p.match(/[1-9]/)?"."+p:"",h=a.slice(0,u).join("")+d+"e"+(i>=0?"+":"")+s.toString();return n.sign+h}function Bw(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=Xu(e),n=typeof r=="number"?nm(t,t.exponent+1+r):t,i=n.coefficients,a=n.exponent+1,s=a+(r||0);return i.length0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function Kq(e,r,t){if(isNaN(e)||!isFinite(e))return String(e);var n=BA(t?.lowerExp,-3),i=BA(t?.upperExp,5),a=Xu(e),s=r?nm(a,r):a;if(s.exponent=i)return LA(e,r);var c=s.coefficients,f=s.exponent;c.length0?f:0;return or){var i=n.splice(r,n.length-r);if(i[0]>=5){var a=r-1;for(n[a]++;n[a]===10;)n.pop(),a===0&&(n.unshift(0),t.exponent++,a++),a--,n[a]++}}return t}function Qu(e){for(var r=[],t=0;t0?!0:e<0?!1:1/e===1/0,n=r>0?!0:r<0?!1:1/r===1/0;return t^n?-e:e}function OA(e,r){if(fr(e))return e;if(nr(e))return e.toNumber();r()}function BA(e,r){return fr(e)?e:nr(e)?e.toNumber():r}function Iw(e,r,t){var n=e.constructor,i=new n(2),a="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!Qe(t))throw new Error("size must be an integer");if(e.greaterThan(i.pow(t-1).sub(1))||e.lessThan(i.pow(t-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(i.pow(t))),a="i".concat(t)}switch(r){case 2:return"".concat(e.toBinary()).concat(a);case 8:return"".concat(e.toOctal()).concat(a);case 16:return"".concat(e.toHexadecimal()).concat(a);default:throw new Error("Base ".concat(r," not supported "))}}function $A(e,r){if(typeof r=="function")return r(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:t,precision:n,wordSize:i}=Ow(r);switch(t){case"fixed":return rU(e,n);case"exponential":return HA(e,n);case"engineering":return eU(e,n);case"bin":return Iw(e,2,i);case"oct":return Iw(e,8,i);case"hex":return Iw(e,16,i);case"auto":{var a=GA(r?.lowerExp,-3),s=GA(r?.upperExp,5);if(e.isZero())return"0";var c,f=e.toSignificantDigits(n),o=f.e;return o>=a&&o=0?"+":"")+n.toString()}function HA(e,r){return r!==void 0?e.toExponential(r-1):e.toExponential()}function rU(e,r){return e.toFixed(r)}function GA(e,r){return fr(e)?e:nr(e)?e.toNumber():r}function QA(e,r){var t=e.length-r.length,n=e.length;return e.substring(t,n)===r}function dr(e,r){var t=tU(e,r);return r&&typeof r=="object"&&"truncate"in r&&t.length>r.truncate?t.substring(0,r.truncate-3)+"...":t}function tU(e,r){if(typeof e=="number")return ba(e,r);if(nr(e))return $A(e,r);if(nU(e))return!r||r.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return XA(e,r);if(Ft(e))return Qs(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(r);if(e&&e.toString(r)!=={}.toString())return e.toString(r);var t=Object.keys(e).map(n=>Qs(n)+": "+dr(e[n],r));return"{"+t.join(", ")+"}"}return String(e)}function Qs(e){for(var r=String(e),t="",n=0;n/g,">"),r}function XA(e,r){if(Array.isArray(e)){for(var t="[",n=e.length,i=0;ir?1:-1}function vr(e,r,t){if(!(this instanceof vr))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=r,this.relation=t,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(r)?"["+r.join(", ")+"]":r)+")",this.stack=new Error().stack}vr.prototype=new RangeError;vr.prototype.constructor=RangeError;vr.prototype.name="DimensionError";vr.prototype.isDimensionError=!0;function pn(e,r,t){if(!(this instanceof pn))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=r):(this.min=r,this.max=t),this.min!==void 0&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}pn.prototype=new RangeError;pn.prototype.constructor=RangeError;pn.prototype.name="IndexError";pn.prototype.isIndexError=!0;function cr(e){for(var r=[];Array.isArray(e);)r.push(e.length),e=e[0];return r}function JA(e,r,t){var n,i=e.length;if(i!==r[t])throw new vr(i,r[t]);if(t")}function kw(e,r){var t=r.length===0;if(t){if(Array.isArray(e))throw new vr(e.length,0)}else JA(e,r,0)}function Qc(e,r){var t=e.isMatrix?e._size:cr(e),n=r._sourceSize;n.forEach((i,a)=>{if(i!==null&&i!==t[a])throw new vr(i,t[a])})}function at(e,r){if(e!==void 0){if(!fr(e)||!Qe(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof r=="number"&&e>=r)throw new pn(e,r)}}function Xs(e){for(var r=0;r=0,f=r%t===0;if(c)if(f)n[a]=-r/t;else throw new Error("Could not replace wildcard, since "+r+" is no multiple of "+-t);return n}function KA(e){return e.reduce((r,t)=>r*t,1)}function iU(e,r){for(var t=e,n,i=r.length-1;i>0;i--){var a=r[i];n=[];for(var s=t.length/a,c=0;cr.test(t))}function Rw(e,r){return Array.prototype.join.call(e,r)}function yo(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var r=[],t=0;r[0]={value:e[0],identifier:0};for(var n=1;n1)return e.slice(1).reduce(function(t,n){return rC(t,n,r,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function aU(){for(var e=arguments.length,r=new Array(e),t=0;td.length),i=Math.max(...n),a=new Array(i).fill(null),s=0;sa[u]&&(a[u]=c[o])}for(var p=0;p1||e[i]>r[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(r[a]))}}function Uw(e,r){var t=cr(e);if(ya(t,r))return e;Kc(t,r);var n=aU(t,r),i=n.length,a=[...Array(i-t.length).fill(1),...t],s=sU(e);t.length!fU(a)).every(a=>t[a]!==void 0);if(!n){var i=r.filter(a=>t[a]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(a=>'"'.concat(a,'"')).join(", "),"."))}}function fU(e){return e&&e[0]==="?"}function zw(e){return e&&e[0]==="?"?e.slice(1):e}function _t(e,r){if(aC(e)&&nC(e,r))return e[r];throw typeof e[r]=="function"&&fm(e,r)?new Error('Cannot access method "'+r+'" as a property'):new Error('No access to property "'+r+'"')}function Ga(e,r,t){if(aC(e)&&nC(e,r))return e[r]=t,t;throw new Error('No access to property "'+r+'"')}function tC(e,r){return r in e}function nC(e,r){return!e||typeof e!="object"?!1:Je(cU,r)?!0:!(r in Object.prototype||r in Function.prototype)}function iC(e,r){if(!fm(e,r))throw new Error('No access to method "'+r+'"');return e[r]}function fm(e,r){return e==null||typeof e[r]!="function"||Je(e,r)&&Object.getPrototypeOf&&r in Object.getPrototypeOf(e)?!1:Je(lU,r)?!0:!(r in Object.prototype||r in Function.prototype)}function aC(e){return typeof e=="object"&&e&&e.constructor===Object}var cU={length:!0,name:!0},lU={toString:!0,valueOf:!0,toLocaleString:!0};var Ks=class{constructor(r){this.wrappedObject=r,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(r){return _t(this.wrappedObject,r)}set(r,t){return Ga(this.wrappedObject,r,t),this}has(r){return tC(this.wrappedObject,r)}entries(){return oC(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){delete this.wrappedObject[r]}clear(){for(var r of this.keys())this.delete(r)}get size(){return Object.keys(this.wrappedObject).length}},ef=class{constructor(r,t,n){this.a=r,this.b=t,this.bKeys=n,this[Symbol.iterator]=this.entries}get(r){return this.bKeys.has(r)?this.b.get(r):this.a.get(r)}set(r,t){return this.bKeys.has(r)?this.b.set(r,t):this.a.set(r,t),this}has(r){return this.b.has(r)||this.a.has(r)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return oC(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){return this.bKeys.has(r)?this.b.delete(r):this.a.delete(r)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}};function oC(e,r){return{next:()=>{var t=e.next();return t.done?t:{value:r(t.value),done:!1}}}}function ts(){return new Map}function bo(e){if(!e)return ts();if(Ww(e))return e;if(Ya(e))return new Ks(e);throw new Error("createMap can create maps from objects or Maps")}function sC(e){if(e instanceof Ks)return e.wrappedObject;var r={};for(var t of e.keys()){var n=e.get(t);Ga(r,t,n)}return r}function Ww(e){return e?e instanceof Map||e instanceof Ks||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}var uC=function(){return uC=Hw.default.create,Hw.default},pU=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],lm=T("typed",pU,function(r){var{BigNumber:t,Complex:n,DenseMatrix:i,Fraction:a}=r,s=uC();return s.clear(),s.addTypes([{name:"number",test:fr},{name:"Complex",test:un},{name:"BigNumber",test:nr},{name:"Fraction",test:Si},{name:"Unit",test:jt},{name:"identifier",test:c=>Ft&&/^(?:[A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF40\\uDF42-\\uDF49\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDE80-\\uDEA9\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45\\uDF70-\\uDF81\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC03-\\uDC37\\uDC71\\uDC72\\uDC75\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD47\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE3F\\uDE40\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E\\uDF25-\\uDF2A]|\\uD838[\\uDC30-\\uDC6D\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])(?:[0-9A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF40\\uDF42-\\uDF49\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDE80-\\uDEA9\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45\\uDF70-\\uDF81\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC03-\\uDC37\\uDC71\\uDC72\\uDC75\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD47\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE3F\\uDE40\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDF02\\uDF04-\\uDF10\\uDF12-\\uDF33\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD887][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2F\\uDC41-\\uDC46]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD32\\uDD50-\\uDD52\\uDD55\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E\\uDF25-\\uDF2A]|\\uD838[\\uDC30-\\uDC6D\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDCD0-\\uDCEB\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF39\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD888[\\uDC00-\\uDFAF])*$/.test(c)},{name:"string",test:Ft},{name:"Chain",test:Gu},{name:"Array",test:Tr},{name:"Matrix",test:Xe},{name:"DenseMatrix",test:xo},{name:"SparseMatrix",test:Ni},{name:"Range",test:jo},{name:"Index",test:Va},{name:"boolean",test:Up},{name:"ResultSet",test:zp},{name:"Help",test:Hu},{name:"function",test:Wp},{name:"Date",test:Vp},{name:"RegExp",test:Yp},{name:"null",test:Hp},{name:"undefined",test:Gp},{name:"AccessorNode",test:Gn},{name:"ArrayNode",test:fn},{name:"AssignmentNode",test:$p},{name:"BlockNode",test:Zp},{name:"ConditionalNode",test:Qp},{name:"ConstantNode",test:Sr},{name:"FunctionNode",test:En},{name:"FunctionAssignmentNode",test:Wi},{name:"IndexNode",test:oi},{name:"Node",test:Mr},{name:"ObjectNode",test:Ha},{name:"OperatorNode",test:xt},{name:"ParenthesisNode",test:cn},{name:"RangeNode",test:Xp},{name:"RelationalNode",test:Jp},{name:"SymbolNode",test:ct},{name:"Map",test:Ww},{name:"Object",test:Ya}]),s.addConversions([{from:"number",to:"BigNumber",convert:function(f){if(t||Vw(f),qA(f)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+f+"). Use function bignumber(x) to convert to BigNumber.");return new t(f)}},{from:"number",to:"Complex",convert:function(f){return n||cm(f),new n(f,0)}},{from:"BigNumber",to:"Complex",convert:function(f){return n||cm(f),new n(f.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(f){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(f){return n||cm(f),new n(f.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(f){a||Yw(f);var o=new a(f);if(o.valueOf()!==f)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+f+"). Use function fraction(x) to convert to Fraction.");return o}},{from:"string",to:"number",convert:function(f){var o=Number(f);if(isNaN(o))throw new Error('Cannot convert "'+f+'" to a number');return o}},{from:"string",to:"BigNumber",convert:function(f){t||Vw(f);try{return new t(f)}catch{throw new Error('Cannot convert "'+f+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(f){a||Yw(f);try{return new a(f)}catch{throw new Error('Cannot convert "'+f+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(f){n||cm(f);try{return new n(f)}catch{throw new Error('Cannot convert "'+f+'" to Complex')}}},{from:"boolean",to:"number",convert:function(f){return+f}},{from:"boolean",to:"BigNumber",convert:function(f){return t||Vw(f),new t(+f)}},{from:"boolean",to:"Fraction",convert:function(f){return a||Yw(f),new a(+f)}},{from:"boolean",to:"string",convert:function(f){return String(f)}},{from:"Array",to:"Matrix",convert:function(f){return i||mU(),new i(f)}},{from:"Matrix",to:"Array",convert:function(f){return f.valueOf()}}]),s.onMismatch=(c,f,o)=>{var u=s.createError(c,f,o);if(["wrongType","mismatch"].includes(u.data.category)&&f.length===1&&Ot(f[0])&&o.some(d=>!d.params.includes(","))){var p=new TypeError("Function '".concat(c,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(c,")'."));throw p.data=u.data,p}throw u},s.onMismatch=(c,f,o)=>{var u=s.createError(c,f,o);if(["wrongType","mismatch"].includes(u.data.category)&&f.length===1&&Ot(f[0])&&o.some(d=>!d.params.includes(","))){var p=new TypeError("Function '".concat(c,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(c,")'."));throw p.data=u.data,p}throw u},s});function Vw(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function cm(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function mU(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Yw(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var dU="ResultSet",hU=[],pm=T(dU,hU,()=>{function e(r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=r||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(r){return new e(r.entries)},e},{isClass:!0});var rf=9e15,os=1e9,Gw="0123456789abcdef",dm="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",hm="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",$w={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-rf,maxE:rf,crypto:!1},pC,wo,Fr=!0,gm="[DecimalError] ",as=gm+"Invalid argument: ",mC=gm+"Precision limit exceeded",dC=gm+"crypto unavailable",hC="[object Decimal]",On=Math.floor,mn=Math.pow,vU=/^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,gU=/^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,xU=/^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,vC=/^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,Sa=1e7,Nr=7,yU=9007199254740991,bU=dm.length-1,Zw=hm.length-1,We={toStringTag:hC};We.absoluteValue=We.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),yr(e)};We.ceil=function(){return yr(new this.constructor(this),this.e+1,2)};We.clampedTo=We.clamp=function(e,r){var t,n=this,i=n.constructor;if(e=new i(e),r=new i(r),!e.s||!r.s)return new i(NaN);if(e.gt(r))throw Error(as+r);return t=n.cmp(e),t<0?e:n.cmp(r)>0?r:new i(n)};We.comparedTo=We.cmp=function(e){var r,t,n,i,a=this,s=a.d,c=(e=new a.constructor(e)).d,f=a.s,o=e.s;if(!s||!c)return!f||!o?NaN:f!==o?f:s===c?0:!s^f<0?1:-1;if(!s[0]||!c[0])return s[0]?f:c[0]?-o:0;if(f!==o)return f;if(a.e!==e.e)return a.e>e.e^f<0?1:-1;for(n=s.length,i=c.length,r=0,t=nc[r]^f<0?1:-1;return n===i?0:n>i^f<0?1:-1};We.cosine=We.cos=function(){var e,r,t=this,n=t.constructor;return t.d?t.d[0]?(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+Nr,n.rounding=1,t=wU(n,wC(n,t)),n.precision=e,n.rounding=r,yr(wo==2||wo==3?t.neg():t,e,r,!0)):new n(1):new n(NaN)};We.cubeRoot=We.cbrt=function(){var e,r,t,n,i,a,s,c,f,o,u=this,p=u.constructor;if(!u.isFinite()||u.isZero())return new p(u);for(Fr=!1,a=u.s*mn(u.s*u,1/3),!a||Math.abs(a)==1/0?(t=Mn(u.d),e=u.e,(a=(e-t.length+1)%3)&&(t+=a==1||a==-2?"0":"00"),a=mn(t,1/3),e=On((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new p(t),n.s=u.s):n=new p(a.toString()),s=(e=p.precision)+3;;)if(c=n,f=c.times(c).times(c),o=f.plus(u),n=Tt(o.plus(u).times(c),o.plus(f),s+2,1),Mn(c.d).slice(0,s)===(t=Mn(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!i&&t=="4999"){if(!i&&(yr(c,e+1,0),c.times(c).times(c).eq(u))){n=c;break}s+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(yr(n,e+1,1),r=!n.times(n).times(n).eq(u));break}return Fr=!0,yr(n,e,p.rounding,r)};We.decimalPlaces=We.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-On(this.e/Nr))*Nr,e=r[e],e)for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t};We.dividedBy=We.div=function(e){return Tt(this,new this.constructor(e))};We.dividedToIntegerBy=We.divToInt=function(e){var r=this,t=r.constructor;return yr(Tt(r,new t(e),0,1,1),t.precision,t.rounding)};We.equals=We.eq=function(e){return this.cmp(e)===0};We.floor=function(){return yr(new this.constructor(this),this.e+1,3)};We.greaterThan=We.gt=function(e){return this.cmp(e)>0};We.greaterThanOrEqualTo=We.gte=function(e){var r=this.cmp(e);return r==1||r===0};We.hyperbolicCosine=We.cosh=function(){var e,r,t,n,i,a=this,s=a.constructor,c=new s(1);if(!a.isFinite())return new s(a.s?1/0:NaN);if(a.isZero())return c;t=s.precision,n=s.rounding,s.precision=t+Math.max(a.e,a.sd())+4,s.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),r=(1/ym(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),a=tf(s,1,a.times(r),new s(1),!0);for(var f,o=e,u=new s(8);o--;)f=a.times(a),a=c.minus(f.times(u.minus(f.times(u))));return yr(a,s.precision=t,s.rounding=n,!0)};We.hyperbolicSine=We.sinh=function(){var e,r,t,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(r=a.precision,t=a.rounding,a.precision=r+Math.max(i.e,i.sd())+4,a.rounding=1,n=i.d.length,n<3)i=tf(a,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/ym(5,e)),i=tf(a,2,i,i,!0);for(var s,c=new a(5),f=new a(16),o=new a(20);e--;)s=i.times(i),i=i.times(c.plus(s.times(f.times(s).plus(o))))}return a.precision=r,a.rounding=t,yr(i,r,t,!0)};We.hyperbolicTangent=We.tanh=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+7,n.rounding=1,Tt(t.sinh(),t.cosh(),n.precision=e,n.rounding=r)):new n(t.s)};We.inverseCosine=We.acos=function(){var e,r=this,t=r.constructor,n=r.abs().cmp(1),i=t.precision,a=t.rounding;return n!==-1?n===0?r.isNeg()?Da(t,i,a):new t(0):new t(NaN):r.isZero()?Da(t,i+4,a).times(.5):(t.precision=i+6,t.rounding=1,r=r.asin(),e=Da(t,i+4,a).times(.5),t.precision=i,t.rounding=a,e.minus(r))};We.inverseHyperbolicCosine=We.acosh=function(){var e,r,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(e=n.precision,r=n.rounding,n.precision=e+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,Fr=!1,t=t.times(t).minus(1).sqrt().plus(t),Fr=!0,n.precision=e,n.rounding=r,t.ln()):new n(t)};We.inverseHyperbolicSine=We.asinh=function(){var e,r,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,Fr=!1,t=t.times(t).plus(1).sqrt().plus(t),Fr=!0,n.precision=e,n.rounding=r,t.ln())};We.inverseHyperbolicTangent=We.atanh=function(){var e,r,t,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,r=a.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?yr(new a(i),e,r,!0):(a.precision=t=n-i.e,i=Tt(i.plus(1),new a(1).minus(i),t+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=r,i.times(.5))):new a(NaN)};We.inverseSine=We.asin=function(){var e,r,t,n,i=this,a=i.constructor;return i.isZero()?new a(i):(r=i.abs().cmp(1),t=a.precision,n=a.rounding,r!==-1?r===0?(e=Da(a,t+4,n).times(.5),e.s=i.s,e):new a(NaN):(a.precision=t+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=t,a.rounding=n,i.times(2)))};We.inverseTangent=We.atan=function(){var e,r,t,n,i,a,s,c,f,o=this,u=o.constructor,p=u.precision,d=u.rounding;if(o.isFinite()){if(o.isZero())return new u(o);if(o.abs().eq(1)&&p+4<=Zw)return s=Da(u,p+4,d).times(.25),s.s=o.s,s}else{if(!o.s)return new u(NaN);if(p+4<=Zw)return s=Da(u,p+4,d).times(.5),s.s=o.s,s}for(u.precision=c=p+10,u.rounding=1,t=Math.min(28,c/Nr+2|0),e=t;e;--e)o=o.div(o.times(o).plus(1).sqrt().plus(1));for(Fr=!1,r=Math.ceil(c/Nr),n=1,f=o.times(o),s=new u(o),i=o;e!==-1;)if(i=i.times(f),a=s.minus(i.div(n+=2)),i=i.times(f),s=a.plus(i.div(n+=2)),s.d[r]!==void 0)for(e=r;s.d[e]===a.d[e]&&e--;);return t&&(s=s.times(2<this.d.length-2};We.isNaN=function(){return!this.s};We.isNegative=We.isNeg=function(){return this.s<0};We.isPositive=We.isPos=function(){return this.s>0};We.isZero=function(){return!!this.d&&this.d[0]===0};We.lessThan=We.lt=function(e){return this.cmp(e)<0};We.lessThanOrEqualTo=We.lte=function(e){return this.cmp(e)<1};We.logarithm=We.log=function(e){var r,t,n,i,a,s,c,f,o=this,u=o.constructor,p=u.precision,d=u.rounding,h=5;if(e==null)e=new u(10),r=!0;else{if(e=new u(e),t=e.d,e.s<0||!t||!t[0]||e.eq(1))return new u(NaN);r=e.eq(10)}if(t=o.d,o.s<0||!t||!t[0]||o.eq(1))return new u(t&&!t[0]?-1/0:o.s!=1?NaN:t?0:1/0);if(r)if(t.length>1)a=!0;else{for(i=t[0];i%10===0;)i/=10;a=i!==1}if(Fr=!1,c=p+h,s=is(o,c),n=r?vm(u,c+10):is(e,c),f=Tt(s,n,c,1),jc(f.d,i=p,d))do if(c+=10,s=is(o,c),n=r?vm(u,c+10):is(e,c),f=Tt(s,n,c,1),!a){+Mn(f.d).slice(i+1,i+15)+1==1e14&&(f=yr(f,p+1,0));break}while(jc(f.d,i+=10,d));return Fr=!0,yr(f,p,d)};We.minus=We.sub=function(e){var r,t,n,i,a,s,c,f,o,u,p,d,h=this,x=h.constructor;if(e=new x(e),!h.d||!e.d)return!h.s||!e.s?e=new x(NaN):h.d?e.s=-e.s:e=new x(e.d||h.s!==e.s?h:NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(o=h.d,d=e.d,c=x.precision,f=x.rounding,!o[0]||!d[0]){if(d[0])e.s=-e.s;else if(o[0])e=new x(h);else return new x(f===3?-0:0);return Fr?yr(e,c,f):e}if(t=On(e.e/Nr),u=On(h.e/Nr),o=o.slice(),a=u-t,a){for(p=a<0,p?(r=o,a=-a,s=d.length):(r=d,t=u,s=o.length),n=Math.max(Math.ceil(c/Nr),s)+2,a>n&&(a=n,r.length=1),r.reverse(),n=a;n--;)r.push(0);r.reverse()}else{for(n=o.length,s=d.length,p=n0;--n)o[s++]=0;for(n=d.length;n>a;){if(o[--n]s?a+1:s+1,i>s&&(i=s,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(s=o.length,i=u.length,s-i<0&&(i=s,t=u,u=o,o=t),r=0;i;)r=(o[--i]=o[i]+u[i]+r)/Sa|0,o[i]%=Sa;for(r&&(o.unshift(r),++n),s=o.length;o[--s]==0;)o.pop();return e.d=o,e.e=xm(o,n),Fr?yr(e,c,f):e};We.precision=We.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(as+e);return t.d?(r=gC(t.d),e&&t.e+1>r&&(r=t.e+1)):r=NaN,r};We.round=function(){var e=this,r=e.constructor;return yr(new r(e),e.e+1,r.rounding)};We.sine=We.sin=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+Nr,n.rounding=1,t=SU(n,wC(n,t)),n.precision=e,n.rounding=r,yr(wo>2?t.neg():t,e,r,!0)):new n(NaN)};We.squareRoot=We.sqrt=function(){var e,r,t,n,i,a,s=this,c=s.d,f=s.e,o=s.s,u=s.constructor;if(o!==1||!c||!c[0])return new u(!o||o<0&&(!c||c[0])?NaN:c?s:1/0);for(Fr=!1,o=Math.sqrt(+s),o==0||o==1/0?(r=Mn(c),(r.length+f)%2==0&&(r+="0"),o=Math.sqrt(r),f=On((f+1)/2)-(f<0||f%2),o==1/0?r="5e"+f:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+f),n=new u(r)):n=new u(o.toString()),t=(f=u.precision)+3;;)if(a=n,n=a.plus(Tt(s,a,t+2,1)).times(.5),Mn(a.d).slice(0,t)===(r=Mn(n.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!i&&r=="4999"){if(!i&&(yr(a,f+1,0),a.times(a).eq(s))){n=a;break}t+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(yr(n,f+1,1),e=!n.times(n).eq(s));break}return Fr=!0,yr(n,f,u.rounding,e)};We.tangent=We.tan=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+10,n.rounding=1,t=t.sin(),t.s=1,t=Tt(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,yr(wo==2||wo==4?t.neg():t,e,r,!0)):new n(NaN)};We.times=We.mul=function(e){var r,t,n,i,a,s,c,f,o,u=this,p=u.constructor,d=u.d,h=(e=new p(e)).d;if(e.s*=u.s,!d||!d[0]||!h||!h[0])return new p(!e.s||d&&!d[0]&&!h||h&&!h[0]&&!d?NaN:!d||!h?e.s/0:e.s*0);for(t=On(u.e/Nr)+On(e.e/Nr),f=d.length,o=h.length,f=0;){for(r=0,i=f+n;i>n;)c=a[i]+h[n]*d[i-n-1]+r,a[i--]=c%Sa|0,r=c/Sa|0;a[i]=(a[i]+r)%Sa|0}for(;!a[--s];)a.pop();return r?++t:a.shift(),e.d=a,e.e=xm(a,t),Fr?yr(e,p.precision,p.rounding):e};We.toBinary=function(e,r){return Jw(this,2,e,r)};We.toDecimalPlaces=We.toDP=function(e,r){var t=this,n=t.constructor;return t=new n(t),e===void 0?t:(ui(e,0,os),r===void 0?r=n.rounding:ui(r,0,8),yr(t,e+t.e+1,r))};We.toExponential=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=$a(n,!0):(ui(e,0,os),r===void 0?r=i.rounding:ui(r,0,8),n=yr(new i(n),e+1,r),t=$a(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t};We.toFixed=function(e,r){var t,n,i=this,a=i.constructor;return e===void 0?t=$a(i):(ui(e,0,os),r===void 0?r=a.rounding:ui(r,0,8),n=yr(new a(i),e+i.e+1,r),t=$a(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};We.toFraction=function(e){var r,t,n,i,a,s,c,f,o,u,p,d,h=this,x=h.d,v=h.constructor;if(!x)return new v(h);if(o=t=new v(1),n=f=new v(0),r=new v(n),a=r.e=gC(x)-h.e-1,s=a%Nr,r.d[0]=mn(10,s<0?Nr+s:s),e==null)e=a>0?r:o;else{if(c=new v(e),!c.isInt()||c.lt(o))throw Error(as+c);e=c.gt(r)?a>0?r:o:c}for(Fr=!1,c=new v(Mn(x)),u=v.precision,v.precision=a=x.length*Nr*2;p=Tt(c,r,0,1,1),i=t.plus(p.times(n)),i.cmp(e)!=1;)t=n,n=i,i=o,o=f.plus(p.times(i)),f=i,i=r,r=c.minus(p.times(i)),c=i;return i=Tt(e.minus(t),n,0,1,1),f=f.plus(i.times(o)),t=t.plus(i.times(n)),f.s=o.s=h.s,d=Tt(o,n,a,1).minus(h).abs().cmp(Tt(f,t,a,1).minus(h).abs())<1?[o,n]:[f,t],v.precision=u,Fr=!0,d};We.toHexadecimal=We.toHex=function(e,r){return Jw(this,16,e,r)};We.toNearest=function(e,r){var t=this,n=t.constructor;if(t=new n(t),e==null){if(!t.d)return t;e=new n(1),r=n.rounding}else{if(e=new n(e),r===void 0?r=n.rounding:ui(r,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(Fr=!1,t=Tt(t,e,0,r,1).times(e),Fr=!0,yr(t)):(e.s=t.s,t=e),t};We.toNumber=function(){return+this};We.toOctal=function(e,r){return Jw(this,8,e,r)};We.toPower=We.pow=function(e){var r,t,n,i,a,s,c=this,f=c.constructor,o=+(e=new f(e));if(!c.d||!e.d||!c.d[0]||!e.d[0])return new f(mn(+c,o));if(c=new f(c),c.eq(1))return c;if(n=f.precision,a=f.rounding,e.eq(1))return yr(c,n,a);if(r=On(e.e/Nr),r>=e.d.length-1&&(t=o<0?-o:o)<=yU)return i=xC(f,c,t,n),e.s<0?new f(1).div(i):yr(i,n,a);if(s=c.s,s<0){if(rf.maxE+1||r0?s/0:0):(Fr=!1,f.rounding=c.s=1,t=Math.min(12,(r+"").length),i=Qw(e.times(is(c,n+t)),n),i.d&&(i=yr(i,n+5,1),jc(i.d,n,a)&&(r=n+10,i=yr(Qw(e.times(is(c,r+t)),r),r+5,1),+Mn(i.d).slice(n+1,n+15)+1==1e14&&(i=yr(i,n+1,0)))),i.s=s,Fr=!0,f.rounding=a,yr(i,n,a))};We.toPrecision=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=$a(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ui(e,1,os),r===void 0?r=i.rounding:ui(r,0,8),n=yr(new i(n),e,r),t=$a(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+t:t};We.toSignificantDigits=We.toSD=function(e,r){var t=this,n=t.constructor;return e===void 0?(e=n.precision,r=n.rounding):(ui(e,1,os),r===void 0?r=n.rounding:ui(r,0,8)),yr(new n(t),e,r)};We.toString=function(){var e=this,r=e.constructor,t=$a(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t};We.truncated=We.trunc=function(){return yr(new this.constructor(this),this.e+1,1)};We.valueOf=We.toJSON=function(){var e=this,r=e.constructor,t=$a(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};function Mn(e){var r,t,n,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,r=1;rt)throw Error(as+e)}function jc(e,r,t,n){var i,a,s,c;for(a=e[0];a>=10;a/=10)--r;return--r<0?(r+=Nr,i=0):(i=Math.ceil((r+1)/Nr),r%=Nr),a=mn(10,Nr-r),c=e[i]%a|0,n==null?r<3?(r==0?c=c/100|0:r==1&&(c=c/10|0),s=t<4&&c==99999||t>3&&c==49999||c==5e4||c==0):s=(t<4&&c+1==a||t>3&&c+1==a/2)&&(e[i+1]/a/100|0)==mn(10,r-2)-1||(c==a/2||c==0)&&(e[i+1]/a/100|0)==0:r<4?(r==0?c=c/1e3|0:r==1?c=c/100|0:r==2&&(c=c/10|0),s=(n||t<4)&&c==9999||!n&&t>3&&c==4999):s=((n||t<4)&&c+1==a||!n&&t>3&&c+1==a/2)&&(e[i+1]/a/1e3|0)==mn(10,r-3)-1,s}function mm(e,r,t){for(var n,i=[0],a,s=0,c=e.length;st-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}function wU(e,r){var t,n,i;if(r.isZero())return r;n=r.d.length,n<32?(t=Math.ceil(n/3),i=(1/ym(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),e.precision+=t,r=tf(e,1,r.times(i),new e(1));for(var a=t;a--;){var s=r.times(r);r=s.times(s).minus(s).times(8).plus(1)}return e.precision-=t,r}var Tt=function(){function e(n,i,a){var s,c=0,f=n.length;for(n=n.slice();f--;)s=n[f]*i+c,n[f]=s%a|0,c=s/a|0;return c&&n.unshift(c),n}function r(n,i,a,s){var c,f;if(a!=s)f=a>s?1:-1;else for(c=f=0;ci[c]?1:-1;break}return f}function t(n,i,a,s){for(var c=0;a--;)n[a]-=c,c=n[a]1;)n.shift()}return function(n,i,a,s,c,f){var o,u,p,d,h,x,v,y,w,E,b,A,C,S,O,F,M,_,k,L,Y=n.constructor,$=n.s==i.s?1:-1,V=n.d,q=i.d;if(!V||!V[0]||!q||!q[0])return new Y(!n.s||!i.s||(V?q&&V[0]==q[0]:!q)?NaN:V&&V[0]==0||!q?$*0:$/0);for(f?(h=1,u=n.e-i.e):(f=Sa,h=Nr,u=On(n.e/h)-On(i.e/h)),k=q.length,M=V.length,w=new Y($),E=w.d=[],p=0;q[p]==(V[p]||0);p++);if(q[p]>(V[p]||0)&&u--,a==null?(S=a=Y.precision,s=Y.rounding):c?S=a+(n.e-i.e)+1:S=a,S<0)E.push(1),x=!0;else{if(S=S/h+2|0,p=0,k==1){for(d=0,q=q[0],S++;(p1&&(q=e(q,d,f),V=e(V,d,f),k=q.length,M=V.length),F=k,b=V.slice(0,k),A=b.length;A=f/2&&++_;do d=0,o=r(q,b,k,A),o<0?(C=b[0],k!=A&&(C=C*f+(b[1]||0)),d=C/_|0,d>1?(d>=f&&(d=f-1),v=e(q,d,f),y=v.length,A=b.length,o=r(v,b,y,A),o==1&&(d--,t(v,k=10;d/=10)p++;w.e=p+u*h-1,yr(w,c?a+w.e+1:a,s,x)}return w}}();function yr(e,r,t,n){var i,a,s,c,f,o,u,p,d,h=e.constructor;e:if(r!=null){if(p=e.d,!p)return e;for(i=1,c=p[0];c>=10;c/=10)i++;if(a=r-i,a<0)a+=Nr,s=r,u=p[d=0],f=u/mn(10,i-s-1)%10|0;else if(d=Math.ceil((a+1)/Nr),c=p.length,d>=c)if(n){for(;c++<=d;)p.push(0);u=f=0,i=1,a%=Nr,s=a-Nr+1}else break e;else{for(u=c=p[d],i=1;c>=10;c/=10)i++;a%=Nr,s=a-Nr+i,f=s<0?0:u/mn(10,i-s-1)%10|0}if(n=n||r<0||p[d+1]!==void 0||(s<0?u:u%mn(10,i-s-1)),o=t<4?(f||n)&&(t==0||t==(e.s<0?3:2)):f>5||f==5&&(t==4||n||t==6&&(a>0?s>0?u/mn(10,i-s):0:p[d-1])%10&1||t==(e.s<0?8:7)),r<1||!p[0])return p.length=0,o?(r-=e.e+1,p[0]=mn(10,(Nr-r%Nr)%Nr),e.e=-r||0):p[0]=e.e=0,e;if(a==0?(p.length=d,c=1,d--):(p.length=d+1,c=mn(10,Nr-a),p[d]=s>0?(u/mn(10,i-s)%mn(10,s)|0)*c:0),o)for(;;)if(d==0){for(a=1,s=p[0];s>=10;s/=10)a++;for(s=p[0]+=c,c=1;s>=10;s/=10)c++;a!=c&&(e.e++,p[0]==Sa&&(p[0]=1));break}else{if(p[d]+=c,p[d]!=Sa)break;p[d--]=0,c=1}for(a=p.length;p[--a]===0;)p.pop()}return Fr&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e0?a=a.charAt(0)+"."+a.slice(1)+ns(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+ns(-i-1)+a,t&&(n=t-s)>0&&(a+=ns(n))):i>=s?(a+=ns(i+1-s),t&&(n=t-i-1)>0&&(a=a+"."+ns(n))):((n=i+1)0&&(i+1===s&&(a+="."),a+=ns(n))),a}function xm(e,r){var t=e[0];for(r*=Nr;t>=10;t/=10)r++;return r}function vm(e,r,t){if(r>bU)throw Fr=!0,t&&(e.precision=t),Error(mC);return yr(new e(dm),r,1,!0)}function Da(e,r,t){if(r>Zw)throw Error(mC);return yr(new e(hm),r,t,!0)}function gC(e){var r=e.length-1,t=r*Nr+1;if(r=e[r],r){for(;r%10==0;r/=10)t--;for(r=e[0];r>=10;r/=10)t++}return t}function ns(e){for(var r="";e--;)r+="0";return r}function xC(e,r,t,n){var i,a=new e(1),s=Math.ceil(n/Nr+4);for(Fr=!1;;){if(t%2&&(a=a.times(r),cC(a.d,s)&&(i=!0)),t=On(t/2),t===0){t=a.d.length-1,i&&a.d[t]===0&&++a.d[t];break}r=r.times(r),cC(r.d,s)}return Fr=!0,a}function fC(e){return e.d[e.d.length-1]&1}function yC(e,r,t){for(var n,i=new e(r[0]),a=0;++a17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(r==null?(Fr=!1,f=x):f=r,c=new d(.03125);e.e>-2;)e=e.times(c),p+=5;for(n=Math.log(mn(2,p))/Math.LN10*2+5|0,f+=n,t=a=s=new d(1),d.precision=f;;){if(a=yr(a.times(e),f,1),t=t.times(++u),c=s.plus(Tt(a,t,f,1)),Mn(c.d).slice(0,f)===Mn(s.d).slice(0,f)){for(i=p;i--;)s=yr(s.times(s),f,1);if(r==null)if(o<3&&jc(s.d,f-n,h,o))d.precision=f+=10,t=a=c=new d(1),u=0,o++;else return yr(s,d.precision=x,h,Fr=!0);else return d.precision=x,s}s=c}}function is(e,r){var t,n,i,a,s,c,f,o,u,p,d,h=1,x=10,v=e,y=v.d,w=v.constructor,E=w.rounding,b=w.precision;if(v.s<0||!y||!y[0]||!v.e&&y[0]==1&&y.length==1)return new w(y&&!y[0]?-1/0:v.s!=1?NaN:y?0:v);if(r==null?(Fr=!1,u=b):u=r,w.precision=u+=x,t=Mn(y),n=t.charAt(0),Math.abs(a=v.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)v=v.times(e),t=Mn(v.d),n=t.charAt(0),h++;a=v.e,n>1?(v=new w("0."+t),a++):v=new w(n+"."+t.slice(1))}else return o=vm(w,u+2,b).times(a+""),v=is(new w(n+"."+t.slice(1)),u-x).plus(o),w.precision=b,r==null?yr(v,b,E,Fr=!0):v;for(p=v,f=s=v=Tt(v.minus(1),v.plus(1),u,1),d=yr(v.times(v),u,1),i=3;;){if(s=yr(s.times(d),u,1),o=f.plus(Tt(s,new w(i),u,1)),Mn(o.d).slice(0,u)===Mn(f.d).slice(0,u))if(f=f.times(2),a!==0&&(f=f.plus(vm(w,u+2,b).times(a+""))),f=Tt(f,new w(h),u,1),r==null)if(jc(f.d,u-x,E,c))w.precision=u+=x,o=s=v=Tt(p.minus(1),p.plus(1),u,1),d=yr(v.times(v),u,1),i=c=1;else return yr(f,w.precision=b,E,Fr=!0);else return w.precision=b,f;f=o,i+=2}}function bC(e){return String(e.s*e.s/0)}function Xw(e,r){var t,n,i;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(t<0&&(t=n),t+=+r.slice(n+1),r=r.substring(0,n)):t<0&&(t=r.length),n=0;r.charCodeAt(n)===48;n++);for(i=r.length;r.charCodeAt(i-1)===48;--i);if(r=r.slice(n,i),r){if(i-=n,e.e=t=t-n-1,e.d=[],n=(t+1)%Nr,t<0&&(n+=Nr),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(r=r.replace(/(\\d)_(?=\\d)/g,"$1"),vC.test(r))return Xw(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(gU.test(r))t=16,r=r.toLowerCase();else if(vU.test(r))t=2;else if(xU.test(r))t=8;else throw Error(as+r);for(a=r.search(/p/i),a>0?(f=+r.slice(a+1),r=r.substring(2,a)):r=r.slice(2),a=r.indexOf("."),s=a>=0,n=e.constructor,s&&(r=r.replace(".",""),c=r.length,a=c-a,i=xC(n,new n(t),a,a*2)),o=mm(r,t,Sa),u=o.length-1,a=u;o[a]===0;--a)o.pop();return a<0?new n(e.s*0):(e.e=xm(o,u),e.d=o,Fr=!1,s&&(e=Tt(e,i,c*4)),f&&(e=e.times(Math.abs(f)<54?mn(2,f):el.pow(2,f))),Fr=!0,e)}function SU(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:tf(e,2,r,r);t=1.4*Math.sqrt(n),t=t>16?16:t|0,r=r.times(1/ym(5,t)),r=tf(e,2,r,r);for(var i,a=new e(5),s=new e(16),c=new e(20);t--;)i=r.times(r),r=r.times(a.plus(i.times(s.times(i).minus(c))));return r}function tf(e,r,t,n,i){var a,s,c,f,o=1,u=e.precision,p=Math.ceil(u/Nr);for(Fr=!1,f=t.times(t),c=new e(n);;){if(s=Tt(c.times(f),new e(r++*r++),u,1),c=i?n.plus(s):n.minus(s),n=Tt(s.times(f),new e(r++*r++),u,1),s=c.plus(n),s.d[p]!==void 0){for(a=p;s.d[a]===c.d[a]&&a--;);if(a==-1)break}a=c,c=n,n=s,s=a,o++}return Fr=!0,s.d.length=p+1,s}function ym(e,r){for(var t=e;--r;)t*=e;return t}function wC(e,r){var t,n=r.s<0,i=Da(e,e.precision,1),a=i.times(.5);if(r=r.abs(),r.lte(a))return wo=n?4:1,r;if(t=r.divToInt(i),t.isZero())wo=n?3:2;else{if(r=r.minus(t.times(i)),r.lte(a))return wo=fC(t)?n?2:3:n?4:1,r;wo=fC(t)?n?1:4:n?3:2}return r.minus(i).abs()}function Jw(e,r,t,n){var i,a,s,c,f,o,u,p,d,h=e.constructor,x=t!==void 0;if(x?(ui(t,1,os),n===void 0?n=h.rounding:ui(n,0,8)):(t=h.precision,n=h.rounding),!e.isFinite())u=bC(e);else{for(u=$a(e),s=u.indexOf("."),x?(i=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):i=r,s>=0&&(u=u.replace(".",""),d=new h(1),d.e=u.length-s,d.d=mm($a(d),10,i),d.e=d.d.length),p=mm(u,10,i),a=f=p.length;p[--f]==0;)p.pop();if(!p[0])u=x?"0p+0":"0";else{if(s<0?a--:(e=new h(e),e.d=p,e.e=a,e=Tt(e,d,t,n,0,i),p=e.d,a=e.e,o=pC),s=p[t],c=i/2,o=o||p[t+1]!==void 0,o=n<4?(s!==void 0||o)&&(n===0||n===(e.s<0?3:2)):s>c||s===c&&(n===4||o||n===6&&p[t-1]&1||n===(e.s<0?8:7)),p.length=t,o)for(;++p[--t]>i-1;)p[t]=0,t||(++a,p.unshift(1));for(f=p.length;!p[f-1];--f);for(s=0,u="";s1)if(r==16||r==8){for(s=r==16?4:3,--f;f%s;f++)u+="0";for(p=mm(u,i,r),f=p.length;!p[f-1];--f);for(s=1,u="1.";sf)for(a-=f;a--;)u+="0";else ar)return e.length=r,!0}function NU(e){return new this(e).abs()}function AU(e){return new this(e).acos()}function CU(e){return new this(e).acosh()}function EU(e,r){return new this(e).plus(r)}function MU(e){return new this(e).asin()}function _U(e){return new this(e).asinh()}function TU(e){return new this(e).atan()}function FU(e){return new this(e).atanh()}function OU(e,r){e=new this(e),r=new this(r);var t,n=this.precision,i=this.rounding,a=n+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=Da(this,a,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?Da(this,n,i):new this(0),t.s=e.s):!e.d||r.isZero()?(t=Da(this,a,1).times(.5),t.s=e.s):r.s<0?(this.precision=a,this.rounding=1,t=this.atan(Tt(e,r,a,1)),r=Da(this,a,1),this.precision=n,this.rounding=i,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(Tt(e,r,a,1)),t}function BU(e){return new this(e).cbrt()}function IU(e){return yr(e=new this(e),e.e+1,2)}function PU(e,r,t){return new this(e).clamp(r,t)}function kU(e){if(!e||typeof e!="object")throw Error(gm+"Object expected");var r,t,n,i=e.defaults===!0,a=["precision",1,os,"rounding",0,8,"toExpNeg",-rf,0,"toExpPos",0,rf,"maxE",0,rf,"minE",-rf,0,"modulo",0,9];for(r=0;r=a[r+1]&&n<=a[r+2])this[t]=n;else throw Error(as+t+": "+n);if(t="crypto",i&&(this[t]=$w[t]),(n=e[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(dC);else this[t]=!1;else throw Error(as+t+": "+n);return this}function RU(e){return new this(e).cos()}function LU(e){return new this(e).cosh()}function DC(e){var r,t,n;function i(a){var s,c,f,o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,lC(a)){o.s=a.s,Fr?!a.d||a.e>i.maxE?(o.e=NaN,o.d=null):a.e=10;c/=10)s++;Fr?s>i.maxE?(o.e=NaN,o.d=null):s=429e7?r[a]=crypto.getRandomValues(new Uint32Array(1))[0]:c[a++]=i%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);a=214e7?crypto.randomBytes(4).copy(r,a):(c.push(i%1e7),a+=4);a=n/4}else throw Error(dC);else for(;a=10;i/=10)n++;n{var{on:r,config:t}=e,n=js.clone({precision:t.precision,modulo:js.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(i){return new n(i.value)},r&&r("config",function(i,a){i.precision!==a.precision&&n.config({precision:i.precision})}),n},{isClass:!0});var yn=Ui(NC(),1);var lz="Complex",pz=[],wm=T(lz,pz,()=>(Object.defineProperty(yn.default,"name",{value:"Complex"}),yn.default.prototype.constructor=yn.default,yn.default.prototype.type="Complex",yn.default.prototype.isComplex=!0,yn.default.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},yn.default.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},yn.default.prototype.format=function(e){var r="",t=this.im,n=this.re,i=ba(this.re,e),a=ba(this.im,e),s=fr(e)?e:e?e.precision:null;if(s!==null){var c=Math.pow(10,-s);Math.abs(n/t)r.re?1:e.rer.im?1:e.im(Object.defineProperty(Za.default,"name",{value:"Fraction"}),Za.default.prototype.constructor=Za.default,Za.default.prototype.type="Fraction",Za.default.prototype.isFraction=!0,Za.default.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Za.default.fromJSON=function(e){return new Za.default(e)},Za.default),{isClass:!0});var hz="Range",vz=[],Sm=T(hz,vz,()=>{function e(r,t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=r!=null,a=t!=null,s=n!=null;if(i){if(nr(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter start must be a number")}if(a){if(nr(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter end must be a number")}if(s){if(nr(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=i?parseFloat(r):0,this.end=a?parseFloat(t):0,this.step=s?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(r){if(typeof r!="string")return null;var t=r.split(":"),n=t.map(function(a){return parseFloat(a)}),i=n.some(function(a){return isNaN(a)});if(i)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var r=0,t=this.start,n=this.step,i=this.end,a=i-t;return Vi(n)===Vi(a)?r=Math.ceil(a/n):a===0&&(r=0),isNaN(r)&&(r=0),[r]},e.prototype.min=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start:this.start+(r-1)*this.step},e.prototype.max=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start+(r-1)*this.step:this.start},e.prototype.forEach=function(r){var t=this.start,n=this.step,i=this.end,a=0;if(n>0)for(;ti;)r(t,[a],this),t+=n,a++},e.prototype.map=function(r){var t=[];return this.forEach(function(n,i,a){t[i[0]]=r(n,i,a)}),t},e.prototype.toArray=function(){var r=[];return this.forEach(function(t,n){r[n[0]]=t}),r},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(r){var t=ba(this.start,r);return this.step!==1&&(t+=":"+ba(this.step,r)),t+=":"+ba(this.end,r),t},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(r){return new e(r.start,r.end,r.step)},e},{isClass:!0});var gz="Matrix",xz=[],Nm=T(gz,xz,()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(r,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(r,t,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(r){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(r,t,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(r,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(r,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(r,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(r){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(r){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function EC(e){var r=0,t=1,n=Object.create(null),i=Object.create(null),a=0,s=function(f){var o=i[f];if(!!o&&(delete n[o],delete i[f],--r,t===o)){if(!r){a=0,t=1;return}for(;!Object.prototype.hasOwnProperty.call(n,++t););}};return e=Math.abs(e),{hit:function(f){var o=i[f],u=++a;if(n[u]=f,i[f]=u,!o)return++r,r<=e?void 0:(f=n[t],s(f),f);if(delete n[o],t===o)for(;!Object.prototype.hasOwnProperty.call(n,++t););},delete:s,clear:function(){r=a=0,t=1,n=Object.create(null),i=Object.create(null)}}}function eu(e){var{hasher:r,limit:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t=t??Number.POSITIVE_INFINITY,r=r??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:EC(t||Number.POSITIVE_INFINITY)});for(var i=[],a=0;a{var{Matrix:r}=e;function t(u,p){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(p&&!Ft(p))throw new Error("Invalid datatype: "+p);if(Xe(u))u.type==="DenseMatrix"?(this._data=or(u._data),this._size=or(u._size),this._datatype=p||u._datatype):(this._data=u.toArray(),this._size=u.size(),this._datatype=p||u._datatype);else if(u&&Tr(u.data)&&Tr(u.size))this._data=u.data,this._size=u.size,kw(this._data,this._size),this._datatype=p||u.datatype;else if(Tr(u))this._data=o(u),this._size=cr(this._data),kw(this._data,this._size),this._datatype=p;else{if(u)throw new TypeError("Unsupported type of data ("+Ir(u)+")");this._data=[],this._size=[0],this._datatype=p}}t.prototype=new r,t.prototype.createDenseMatrix=function(u,p){return new t(u,p)},Object.defineProperty(t,"name",{value:"DenseMatrix"}),t.prototype.constructor=t,t.prototype.type="DenseMatrix",t.prototype.isDenseMatrix=!0,t.prototype.getDataType=function(){return rs(this._data,Ir)},t.prototype.storage=function(){return"dense"},t.prototype.datatype=function(){return this._datatype},t.prototype.create=function(u,p){return new t(u,p)},t.prototype.subset=function(u,p,d){switch(arguments.length){case 1:return n(this,u);case 2:case 3:return a(this,u,p,d);default:throw new SyntaxError("Wrong number of arguments")}},t.prototype.get=function(u){if(!Tr(u))throw new TypeError("Array expected");if(u.length!==this._size.length)throw new vr(u.length,this._size.length);for(var p=0;p");var b=p.max().map(function(S){return S+1});f(u,b,h);var A=x.length,C=0;s(u._data,p,d,A,C)}return u}function s(u,p,d,h,x){var v=x===h-1,y=p.dimension(x);v?y.forEach(function(w,E){at(w),u[w]=d[E[0]]}):y.forEach(function(w,E){at(w),s(u[w],p,d[E[0]],h,x+1)})}t.prototype.resize=function(u,p,d){if(!Ot(u))throw new TypeError("Array or Matrix expected");var h=u.valueOf().map(v=>Array.isArray(v)&&v.length===1?v[0]:v),x=d?this.clone():this;return c(x,h,p)};function c(u,p,d){if(p.length===0){for(var h=u._data;Tr(h);)h=h[0];return h}return u._size=p.slice(0),u._data=wa(u._data,u._size,d),u}t.prototype.reshape=function(u,p){var d=p?this.clone():this;d._data=Xc(d._data,u);var h=d._size.reduce((x,v)=>x*v);return d._size=Jc(u,h),d};function f(u,p,d){for(var h=u._size.slice(0),x=!1;h.lengthh[v]&&(h[v]=p[v],x=!0);x&&c(u,h,d)}t.prototype.clone=function(){var u=new t({data:or(this._data),size:or(this._size),datatype:this._datatype});return u},t.prototype.size=function(){return this._size.slice(0)},t.prototype.map=function(u){var p=this,d=Am(u),h=function y(w,E){return Tr(w)?w.map(function(b,A){return y(b,E.concat(A))}):d===1?u(w):d===2?u(w,E):u(w,E,p)},x=h(this._data,[]),v=this._datatype!==void 0?rs(x,Ir):void 0;return new t(x,v)},t.prototype.forEach=function(u){var p=this,d=function h(x,v){Tr(x)?x.forEach(function(y,w){h(y,v.concat(w))}):u(x,v,p)};d(this._data,[])},t.prototype[Symbol.iterator]=function*(){var u=function*p(d,h){if(Tr(d))for(var x=0;x[b[w]]);p.push(new t(E,u._datatype))},v=0;v0?u:0,d=u<0?-u:0,h=this._size[0],x=this._size[1],v=Math.min(h-d,x-p),y=[],w=0;w0?d:0,v=d<0?-d:0,y=u[0],w=u[1],E=Math.min(y-v,w-x),b;if(Tr(p)){if(p.length!==E)throw new Error("Invalid value array length");b=function(F){return p[F]}}else if(Xe(p)){var A=p.size();if(A.length!==1||A[0]!==E)throw new Error("Invalid matrix length");b=function(F){return p.get([F])}}else b=function(){return p};h||(h=nr(b(0))?b(0).mul(0):0);var C=[];if(u.length>0){C=wa(C,u,h);for(var S=0;S{var{typed:r}=e;return r(MC,{any:or})});function Mm(e){var r=e.length,t=e[0].length,n,i,a=[];for(i=0;i=n.length)throw new pn(r,n.length);return Xe(e)?e.create(_m(e.valueOf(),r,t)):_m(e,r,t)}function _m(e,r,t){var n,i,a,s;if(r<=0)if(Array.isArray(e[0])){for(s=Mm(e),i=[],n=0;n{var{typed:r}=e;return r(_C,{number:Qe,BigNumber:function(n){return n.isInt()},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":r.referToSelf(t=>n=>rr(n,t))})});var fi="number",Do="number, number";function rD(e){return Math.abs(e)}rD.signature=fi;function tD(e,r){return e+r}tD.signature=Do;function nD(e,r){return e-r}nD.signature=Do;function iD(e,r){return e*r}iD.signature=Do;function Sz(e,r){return e/r}Sz.signature=Do;function aD(e){return-e}aD.signature=fi;function oD(e){return e}oD.signature=fi;function nf(e){return kA(e)}nf.signature=fi;function sD(e){return e*e*e}sD.signature=fi;function uD(e){return Math.exp(e)}uD.signature=fi;function fD(e){return RA(e)}fD.signature=fi;function Nz(e,r){if(!Qe(e)||!Qe(r))throw new Error("Parameters in function gcd must be integer numbers");for(var t;r!==0;)t=e%r,e=r,r=t;return e<0?-e:e}Nz.signature=Do;function cD(e,r){if(!Qe(e)||!Qe(r))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||r===0)return 0;for(var t,n=e*r;r!==0;)t=r,r=e%t,e=t;return Math.abs(n/e)}cD.signature=Do;function TC(e,r){return r?Math.log(e)/Math.log(r):Math.log(e)}function lD(e){return PA(e)}lD.signature=fi;function pD(e){return IA(e)}pD.signature=fi;function Az(e){return tm(e)}Az.signature=fi;function Cz(e,r){return r===0?e:e-r*Math.floor(e/r)}Cz.signature=Do;function mD(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,t=r<0;if(t&&(r=-r),r===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(r)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return t?1/0:0;if(!isFinite(e))return t?0:e;var n=Math.pow(Math.abs(e),1/r);return n=e<0?-n:n,t?1/n:n}function Fm(e){return Vi(e)}Fm.signature=fi;function Ez(e){return Math.sqrt(e)}Ez.signature=fi;function dD(e){return e*e}dD.signature=fi;function hD(e,r){var t,n,i,a=0,s=1,c=1,f=0;if(!Qe(e)||!Qe(r))throw new Error("Parameters in function xgcd must be integer numbers");for(;r;)n=Math.floor(e/r),i=e-n*r,t=a,a=s-n*a,s=t,t=c,c=f-n*c,f=t,e=r,r=i;var o;return e<0?o=[-e,-s,-f]:o=[e,e?s:0,f],o}hD.signature=Do;function vD(e,r){return e*e<1&&r===1/0||e*e>1&&r===-1/0?0:Math.pow(e,r)}vD.signature=Do;function af(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!Qe(r)||r<0||r>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(Bw(e,r))}function Mz(e){return Math.abs(e)}Mz.signature=fi;var _z="number",of="number, number";function gD(e,r){if(!Qe(e)||!Qe(r))throw new Error("Integers expected in function bitAnd");return e&r}gD.signature=of;function xD(e){if(!Qe(e))throw new Error("Integer expected in function bitNot");return~e}xD.signature=_z;function yD(e,r){if(!Qe(e)||!Qe(r))throw new Error("Integers expected in function bitOr");return e|r}yD.signature=of;function bD(e,r){if(!Qe(e)||!Qe(r))throw new Error("Integers expected in function bitXor");return e^r}bD.signature=of;function wD(e,r){if(!Qe(e)||!Qe(r))throw new Error("Integers expected in function leftShift");return e<>r}DD.signature=of;function SD(e,r){if(!Qe(e)||!Qe(r))throw new Error("Integers expected in function rightLogShift");return e>>>r}SD.signature=of;function Ai(e,r){if(r>1;return Ai(e,t)*Ai(t+1,r)}function ND(e,r){if(!Qe(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!Qe(r)||r<0)throw new TypeError("Positive integer value expected in function combinations");if(r>e)throw new TypeError("k must be less than or equal to n");for(var t=e-r,n=1,i=r171?1/0:Ai(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*rl(1-e));if(e>=171.35)return 1/0;if(e>85){var t=e*e,n=t*e,i=n*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*t)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,r=ru[0];for(var s=1;s=1;n--)t+=PC[n]/(e+n);return FD+(e+.5)*Math.log(r)-r+Math.log(t)}tl.signature="number";var Pt="number",Bz="number, number";function Iz(e){return Math.acos(e)}Iz.signature=Pt;function OD(e){return UA(e)}OD.signature=Pt;function BD(e){return Math.atan(1/e)}BD.signature=Pt;function ID(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}ID.signature=Pt;function PD(e){return Math.asin(1/e)}PD.signature=Pt;function kD(e){var r=1/e;return Math.log(r+Math.sqrt(r*r+1))}kD.signature=Pt;function RD(e){return Math.acos(1/e)}RD.signature=Pt;function LD(e){var r=1/e,t=Math.sqrt(r*r-1);return Math.log(t+r)}LD.signature=Pt;function Pz(e){return Math.asin(e)}Pz.signature=Pt;function qD(e){return zA(e)}qD.signature=Pt;function kz(e){return Math.atan(e)}kz.signature=Pt;function Rz(e,r){return Math.atan2(e,r)}Rz.signature=Bz;function UD(e){return WA(e)}UD.signature=Pt;function Lz(e){return Math.cos(e)}Lz.signature=Pt;function qz(e){return im(e)}qz.signature=Pt;function zD(e){return 1/Math.tan(e)}zD.signature=Pt;function WD(e){var r=Math.exp(2*e);return(r+1)/(r-1)}WD.signature=Pt;function VD(e){return 1/Math.sin(e)}VD.signature=Pt;function YD(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Vi(e)}YD.signature=Pt;function HD(e){return 1/Math.cos(e)}HD.signature=Pt;function GD(e){return 2/(Math.exp(e)+Math.exp(-e))}GD.signature=Pt;function Uz(e){return Math.sin(e)}Uz.signature=Pt;function $D(e){return VA(e)}$D.signature=Pt;function zz(e){return Math.tan(e)}zz.signature=Pt;function Wz(e){return am(e)}Wz.signature=Pt;var nl="number";function Vz(e){return Qe(e)}Vz.signature=nl;function ZD(e){return e<0}ZD.signature=nl;function QD(e){return e>0}QD.signature=nl;function XD(e){return e===0}XD.signature=nl;function JD(e){return Number.isNaN(e)}JD.signature=nl;var kC="isNegative",Yz=["typed"],Om=T(kC,Yz,e=>{var{typed:r}=e;return r(kC,{number:ZD,BigNumber:function(n){return n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s<0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>rr(n,t))})});var RC="isNumeric",Hz=["typed"],Bm=T(RC,Hz,e=>{var{typed:r}=e;return r(RC,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":r.referToSelf(t=>n=>rr(n,t))})});var LC="hasNumericValue",Gz=["typed","isNumeric"],Im=T(LC,Gz,e=>{var{typed:r,isNumeric:t}=e;return r(LC,{boolean:()=>!0,string:function(i){return i.trim().length>0&&!isNaN(Number(i))},any:function(i){return t(i)}})});var qC="isPositive",$z=["typed"],Pm=T(qC,$z,e=>{var{typed:r}=e;return r(qC,{number:QD,BigNumber:function(n){return!n.isNeg()&&!n.isZero()&&!n.isNaN()},Fraction:function(n){return n.s>0&&n.n>0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>rr(n,t))})});var UC="isZero",Zz=["typed"],km=T(UC,Zz,e=>{var{typed:r}=e;return r(UC,{number:XD,BigNumber:function(n){return n.isZero()},Complex:function(n){return n.re===0&&n.im===0},Fraction:function(n){return n.d===1&&n.n===0},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>rr(n,t))})});var zC="isNaN",Qz=["typed"],Rm=T(zC,Qz,e=>{var{typed:r}=e;return r(zC,{number:JD,BigNumber:function(n){return n.isNaN()},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":function(n){return rr(n,Number.isNaN)}})});var WC="typeOf",Xz=["typed"],Lm=T(WC,Xz,e=>{var{typed:r}=e;return r(WC,{any:Ir})});function en(e,r,t){if(t==null)return e.eq(r);if(e.eq(r))return!0;if(e.isNaN()||r.isNaN())return!1;if(e.isFinite()&&r.isFinite()){var n=e.minus(r).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),r.abs());return n.lte(i.times(t))}return!1}function VC(e,r,t){return Bt(e.re,r.re,t)&&Bt(e.im,r.im,t)}var Hi=T("compareUnits",["typed"],e=>{var{typed:r}=e;return{"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(!n.equalBase(i))throw new Error("Cannot compare units with different base");return r.find(t,[n.valueType(),i.valueType()])(n.value,i.value)})}});var qm="equalScalar",Jz=["typed","config"],Um=T(qm,Jz,e=>{var{typed:r,config:t}=e,n=Hi({typed:r});return r(qm,{"boolean, boolean":function(a,s){return a===s},"number, number":function(a,s){return Bt(a,s,t.epsilon)},"BigNumber, BigNumber":function(a,s){return a.eq(s)||en(a,s,t.epsilon)},"Fraction, Fraction":function(a,s){return a.equals(s)},"Complex, Complex":function(a,s){return VC(a,s,t.epsilon)}},n)}),Gre=T(qm,["typed","config"],e=>{var{typed:r,config:t}=e;return r(qm,{"number, number":function(i,a){return Bt(i,a,t.epsilon)}})});var Kz="SparseMatrix",jz=["typed","equalScalar","Matrix"],zm=T(Kz,jz,e=>{var{typed:r,equalScalar:t,Matrix:n}=e;function i(v,y){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(y&&!Ft(y))throw new Error("Invalid datatype: "+y);if(Xe(v))a(this,v,y);else if(v&&Tr(v.index)&&Tr(v.ptr)&&Tr(v.size))this._values=v.values,this._index=v.index,this._ptr=v.ptr,this._size=v.size,this._datatype=y||v.datatype;else if(Tr(v))s(this,v,y);else{if(v)throw new TypeError("Unsupported type of data ("+Ir(v)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=y}}function a(v,y,w){y.type==="SparseMatrix"?(v._values=y._values?or(y._values):void 0,v._index=or(y._index),v._ptr=or(y._ptr),v._size=or(y._size),v._datatype=w||y._datatype):s(v,y.valueOf(),w||y._datatype)}function s(v,y,w){v._values=[],v._index=[],v._ptr=[],v._datatype=w;var E=y.length,b=0,A=t,C=0;if(Ft(w)&&(A=r.find(t,[w,w])||t,C=r.convert(0,w)),E>0){var S=0;do{v._ptr.push(v._index.length);for(var O=0;O");if(b.length===1){var F=y.dimension(0);F.forEach(function(k,L){at(k),v.set([k,0],w[L[0]],E)})}else{var M=y.dimension(0),_=y.dimension(1);M.forEach(function(k,L){at(k),_.forEach(function(Y,$){at(Y),v.set([k,Y],w[L[0]][$[0]],E)})})}}return v}i.prototype.get=function(v){if(!Tr(v))throw new TypeError("Array expected");if(v.length!==this._size.length)throw new vr(v.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var y=v[0],w=v[1];at(y,this._size[0]),at(w,this._size[1]);var E=o(y,this._ptr[w],this._ptr[w+1],this._index);return EA-1||b>C-1)&&(d(this,Math.max(E+1,A),Math.max(b+1,C),w),A=this._size[0],C=this._size[1]),at(E,A),at(b,C);var F=o(E,this._ptr[b],this._ptr[b+1],this._index);return FArray.isArray(A)&&A.length===1?A[0]:A);if(E.length!==2)throw new Error("Only two dimensions matrix are supported");E.forEach(function(A){if(!fr(A)||!Qe(A)||A<0)throw new TypeError("Invalid size, must contain positive integers (size: "+dr(E)+")")});var b=w?this.clone():this;return d(b,E[0],E[1],y)};function d(v,y,w,E){var b=E||0,A=t,C=0;Ft(v._datatype)&&(A=r.find(t,[v._datatype,v._datatype])||t,C=r.convert(0,v._datatype),b=r.convert(b,v._datatype));var S=!A(b,C),O=v._size[0],F=v._size[1],M,_,k;if(w>F){for(_=F;_O){if(S){var L=0;for(_=0;_y-1&&(v._values.splice(k,1),v._index.splice(k,1),$++)}v._ptr[_]=v._values.length}return v._size[0]=y,v._size[1]=w,v}i.prototype.reshape=function(v,y){if(!Tr(v))throw new TypeError("Array expected");if(v.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");v.forEach(function(U){if(!fr(U)||!Qe(U)||U<=-2||U===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+dr(v)+")")});var w=this._size[0]*this._size[1];v=Jc(v,w);var E=v[0]*v[1];if(w!==E)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var b=y?this.clone():this;if(this._size[0]===v[0]&&this._size[1]===v[1])return b;for(var A=[],C=0;C=y&&q<=w&&k(v._values[V],q-y,L-E)}else{for(var R={},j=Y;j<$;j++){var U=v._index[j];R[U]=v._values[j]}for(var se=y;se<=w;se++){var de=se in R?R[se]:0;k(de,se-y,L-E)}}}return F.push(S.length),new i({values:S,index:O,ptr:F,size:[w-y+1,b-E+1]})}i.prototype.forEach=function(v,y){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var w=this,E=this._size[0],b=this._size[1],A=0;A "+(this._values?dr(this._values[O],v):"X")}return b},i.prototype.toString=function(){return dr(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(v){if(v){if(nr(v)&&(v=v.toNumber()),!fr(v)||!Qe(v))throw new TypeError("The parameter k must be an integer number")}else v=0;var y=v>0?v:0,w=v<0?-v:0,E=this._size[0],b=this._size[1],A=Math.min(E-w,b-y),C=[],S=[],O=[];O[0]=0;for(var F=y;F0?w:0,O=w<0?-w:0,F=v[0],M=v[1],_=Math.min(F-O,M-S),k;if(Tr(y)){if(y.length!==_)throw new Error("Invalid value array length");k=function(se){return y[se]}}else if(Xe(y)){var L=y.size();if(L.length!==1||L[0]!==_)throw new Error("Invalid matrix length");k=function(se){return y.get([se])}}else k=function(){return y};for(var Y=[],$=[],V=[],q=0;q=0&&R<_){var j=k(R);A(j,C)||($.push(R+O),Y.push(j))}}return V.push(Y.length),new i({values:Y,index:$,ptr:V,size:[F,M]})},i.prototype.swapRows=function(v,y){if(!fr(v)||!Qe(v)||!fr(y)||!Qe(y))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return at(v,this._size[0]),at(y,this._size[0]),i._swapRows(v,y,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(v,y,w,E,b){for(var A=E[v],C=E[v+1],S=A;S=O||b[M]!==y)){var k=E?E[F]:void 0;b.splice(M,0,y),E&&E.splice(M,0,k),b.splice(M<=F?F+1:F,1),E&&E.splice(M<=F?F+1:F,1);continue}if(M=O||b[F]!==v)){var L=E?E[M]:void 0;b.splice(F,0,v),E&&E.splice(F,0,L),b.splice(F<=M?M+1:M,1),E&&E.splice(F<=M?M+1:M,1)}}},i},{isClass:!0});var eW="number",rW=["typed"];function tW(e){var r=e.match(/(0[box])([0-9a-fA-F]*)\\.([0-9a-fA-F]*)/);if(r){var t={"0b":2,"0o":8,"0x":16}[r[1]],n=r[2],i=r[3];return{input:e,radix:t,integerPart:n,fractionalPart:i}}else return null}function nW(e){for(var r=parseInt(e.integerPart,e.radix),t=0,n=0;n{var{typed:r}=e,t=r("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var a=tW(i);if(a)return nW(a);var s=0,c=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);c&&(s=Number(c[2]),i=c[1]);var f=Number(i);if(isNaN(f))throw new SyntaxError('String "'+i+'" is not a valid number');if(c){if(f>2**s-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));f>=2**(s-1)&&(f=f-2**s)}return f},BigNumber:function(i){return i.toNumber()},Fraction:function(i){return i.valueOf()},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),null:function(i){return 0},"Unit, string | Unit":function(i,a){return i.toNumber(a)},"Array | Matrix":r.referToSelf(n=>i=>rr(i,n))});return t.fromJSON=function(n){return parseFloat(n.value)},t});var YC="string",iW=["typed"],Vm=T(YC,iW,e=>{var{typed:r}=e;return r(YC,{"":function(){return""},number:ba,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":r.referToSelf(t=>n=>rr(n,t)),any:function(n){return String(n)}})});var HC="boolean",aW=["typed"],Ym=T(HC,aW,e=>{var{typed:r}=e;return r(HC,{"":function(){return!1},boolean:function(n){return n},number:function(n){return!!n},null:function(n){return!1},BigNumber:function(n){return!n.isZero()},string:function(n){var i=n.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;var a=Number(n);if(n!==""&&!isNaN(a))return!!a;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":r.referToSelf(t=>n=>rr(n,t))})});var oW="bignumber",sW=["typed","BigNumber"],Hm=T(oW,sW,e=>{var{typed:r,BigNumber:t}=e;return r("bignumber",{"":function(){return new t(0)},number:function(i){return new t(i+"")},string:function(i){var a=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(a){var s=a[2],c=t(a[1]),f=new t(2).pow(Number(s));if(c.gt(f.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var o=new t(2).pow(Number(s)-1);return c.gte(o)?c.sub(f):c}return new t(i)},BigNumber:function(i){return i},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Fraction:function(i){return new t(i.n).div(i.d).times(i.s)},null:function(i){return new t(0)},"Array | Matrix":r.referToSelf(n=>i=>rr(i,n))})});var uW="complex",fW=["typed","Complex"],Gm=T(uW,fW,e=>{var{typed:r,Complex:t}=e;return r("complex",{"":function(){return t.ZERO},number:function(i){return new t(i,0)},"number, number":function(i,a){return new t(i,a)},"BigNumber, BigNumber":function(i,a){return new t(i.toNumber(),a.toNumber())},Fraction:function(i){return new t(i.valueOf(),0)},Complex:function(i){return i.clone()},string:function(i){return t(i)},null:function(i){return t(0)},Object:function(i){if("re"in i&&"im"in i)return new t(i.re,i.im);if("r"in i&&"phi"in i||"abs"in i&&"arg"in i)return new t(i);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":r.referToSelf(n=>i=>rr(i,n))})});var cW="fraction",lW=["typed","Fraction"],$m=T(cW,lW,e=>{var{typed:r,Fraction:t}=e;return r("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new t(i)},string:function(i){return new t(i)},"number, number":function(i,a){return new t(i,a)},null:function(i){return new t(0)},BigNumber:function(i){return new t(i.toString())},Fraction:function(i){return i},Unit:r.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),Object:function(i){return new t(i)},"Array | Matrix":r.referToSelf(n=>i=>rr(i,n))})});var GC="matrix",pW=["typed","Matrix","DenseMatrix","SparseMatrix"],Zm=T(GC,pW,e=>{var{typed:r,Matrix:t,DenseMatrix:n,SparseMatrix:i}=e;return r(GC,{"":function(){return a([])},string:function(c){return a([],c)},"string, string":function(c,f){return a([],c,f)},Array:function(c){return a(c)},Matrix:function(c){return a(c,c.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(s,c,f){if(c==="dense"||c==="default"||c===void 0)return new n(s,f);if(c==="sparse")return new i(s,f);throw new TypeError("Unknown matrix type "+JSON.stringify(c)+".")}});var $C="matrixFromFunction",mW=["typed","matrix","isZero"],Qm=T($C,mW,e=>{var{typed:r,matrix:t,isZero:n}=e;return r($C,{"Array | Matrix, function, string, string":function(s,c,f,o){return i(s,c,f,o)},"Array | Matrix, function, string":function(s,c,f){return i(s,c,f)},"Matrix, function":function(s,c){return i(s,c,"dense")},"Array, function":function(s,c){return i(s,c,"dense").toArray()},"Array | Matrix, string, function":function(s,c,f){return i(s,f,c)},"Array | Matrix, string, string, function":function(s,c,f,o){return i(s,o,c,f)}});function i(a,s,c,f){var o;return f!==void 0?o=t(c,f):o=t(c),o.resize(a),o.forEach(function(u,p){var d=s(p);n(d)||o.set(p,d)}),o}});var ZC="matrixFromRows",dW=["typed","matrix","flatten","size"],Xm=T(ZC,dW,e=>{var{typed:r,matrix:t,flatten:n,size:i}=e;return r(ZC,{"...Array":function(f){return a(f)},"...Matrix":function(f){return t(a(f.map(o=>o.toArray())))}});function a(c){if(c.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var f=s(c[0]),o=[];for(var u of c){var p=s(u);if(p!==f)throw new TypeError("The vectors had different length: "+(f|0)+" \\u2260 "+(p|0));o.push(n(u))}return o}function s(c){var f=i(c);if(f.length===1)return f[0];if(f.length===2){if(f[0]===1)return f[1];if(f[1]===1)return f[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}});var QC="matrixFromColumns",hW=["typed","matrix","flatten","size"],Jm=T(QC,hW,e=>{var{typed:r,matrix:t,flatten:n,size:i}=e;return r(QC,{"...Array":function(f){return a(f)},"...Matrix":function(f){return t(a(f.map(o=>o.toArray())))}});function a(c){if(c.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var f=s(c[0]),o=[],u=0;u{var{typed:r}=e;return r(XC,{"Unit, Array":function(n,i){return n.splitUnit(i)}})});var JC="unaryMinus",gW=["typed"],jm=T(JC,gW,e=>{var{typed:r}=e;return r(JC,{number:aD,"Complex | BigNumber | Fraction":t=>t.neg(),Unit:r.referToSelf(t=>n=>{var i=n.clone();return i.value=r.find(t,i.valueType())(n.value),i}),"Array | Matrix":r.referToSelf(t=>n=>rr(n,t,!0))})});var KC="unaryPlus",xW=["typed","config","BigNumber"],ed=T(KC,xW,e=>{var{typed:r,config:t,BigNumber:n}=e;return r(KC,{number:oD,Complex:function(a){return a},BigNumber:function(a){return a},Fraction:function(a){return a},Unit:function(a){return a.clone()},"Array | Matrix":r.referToSelf(i=>a=>rr(a,i,!0)),"boolean | string":function(a){return t.number==="BigNumber"?new n(+a):+a}})});var jC="abs",yW=["typed"],rd=T(jC,yW,e=>{var{typed:r}=e;return r(jC,{number:rD,"Complex | BigNumber | Fraction | Unit":t=>t.abs(),"Array | Matrix":r.referToSelf(t=>n=>rr(n,t,!0))})});var eE="apply",bW=["typed","isInteger"],us=T(eE,bW,e=>{var{typed:r,isInteger:t}=e;return r(eE,{"Array | Matrix, number | BigNumber, function":function(i,a,s){if(!t(a))throw new TypeError("Integer number expected for dimension");var c=Array.isArray(i)?cr(i):i.size();if(a<0||a>=c.length)throw new pn(a,c.length);return Xe(i)?i.create(td(i.valueOf(),a,s)):td(i,a,s)}})});function td(e,r,t){var n,i,a;if(r<=0)if(Array.isArray(e[0])){for(a=wW(e),i=[],n=0;n{var{typed:r}=e;return r(rE,{"number, number":tD,"Complex, Complex":function(n,i){return n.add(i)},"BigNumber, BigNumber":function(n,i){return n.plus(i)},"Fraction, Fraction":function(n,i){return n.add(i)},"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=r.find(t,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})});var tE="subtractScalar",SW=["typed"],id=T(tE,SW,e=>{var{typed:r}=e;return r(tE,{"number, number":nD,"Complex, Complex":function(n,i){return n.sub(i)},"BigNumber, BigNumber":function(n,i){return n.minus(i)},"Fraction, Fraction":function(n,i){return n.sub(i)},"Unit, Unit":r.referToSelf(t=>(n,i)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(i))throw new Error("Units do not match");var a=n.clone();return a.value=r.find(t,[a.valueType(),i.valueType()])(a.value,i.value),a.fixPrefix=!1,a})})});var nE="cbrt",NW=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],ad=T(nE,NW,e=>{var{config:r,typed:t,isNegative:n,unaryMinus:i,matrix:a,Complex:s,BigNumber:c,Fraction:f}=e;return t(nE,{number:nf,Complex:o,"Complex, boolean":o,BigNumber:function(d){return d.cbrt()},Unit:u});function o(p,d){var h=p.arg()/3,x=p.abs(),v=new s(nf(x),0).mul(new s(0,h).exp());if(d){var y=[v,new s(nf(x),0).mul(new s(0,h+Math.PI*2/3).exp()),new s(nf(x),0).mul(new s(0,h-Math.PI*2/3).exp())];return r.matrix==="Array"?y:a(y)}else return v}function u(p){if(p.value&&un(p.value)){var d=p.clone();return d.value=1,d=d.pow(1/3),d.value=o(p.value),d}else{var h=n(p.value);h&&(p.value=i(p.value));var x;nr(p.value)?x=new c(1).div(3):Si(p.value)?x=new f(1,3):x=1/3;var v=p.pow(x);return h&&(v.value=i(v.value)),v}}});var AW="matAlgo11xS0s",CW=["typed","equalScalar"],ot=T(AW,CW,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s,c){var f=i._values,o=i._index,u=i._ptr,p=i._size,d=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=p[0],x=p[1],v,y=t,w=0,E=s;typeof d=="string"&&(v=d,y=r.find(t,[v,v]),w=r.convert(0,v),a=r.convert(a,v),E=r.find(s,[v,v]));for(var b=[],A=[],C=[],S=0;S{var{typed:r,DenseMatrix:t}=e;return function(i,a,s,c){var f=i._values,o=i._index,u=i._ptr,p=i._size,d=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=p[0],x=p[1],v,y=s;typeof d=="string"&&(v=d,a=r.convert(a,v),y=r.find(s,[v,v]));for(var w=[],E=[],b=[],A=0;A{var{typed:r}=e;return function(i,a,s,c){var f=i._data,o=i._size,u=i._datatype,p,d=s;typeof u=="string"&&(p=u,a=r.convert(a,p),d=r.find(s,[p,p]));var h=o.length>0?t(d,0,o,o[0],f,a,c):[];return i.createDenseMatrix({data:h,size:or(o),datatype:p})};function t(n,i,a,s,c,f,o){var u=[];if(i===a.length-1)for(var p=0;p{var{typed:r,config:t,round:n}=e;return r(KD,{number:function(a){return Bt(a,n(a),t.epsilon)?n(a):Math.ceil(a)},"number, number":function(a,s){if(Bt(a,n(a,s),t.epsilon))return n(a,s);var[c,f]="".concat(a,"e").split("e"),o=Math.ceil(Number("".concat(c,"e").concat(Number(f)+s)));return[c,f]="".concat(o,"e").split("e"),Number("".concat(c,"e").concat(Number(f)-s))}})}),od=T(KD,FW,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:c}=e,f=ot({typed:r,equalScalar:a}),o=Gr({typed:r,DenseMatrix:c}),u=$t({typed:r}),p=OW({typed:r,config:t,round:n});return r("ceil",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(h){return h.ceil()},"Complex, number":function(h,x){return h.ceil(x)},"Complex, BigNumber":function(h,x){return h.ceil(x.toNumber())},BigNumber:function(h){return en(h,n(h),t.epsilon)?n(h):h.ceil()},"BigNumber, BigNumber":function(h,x){return en(h,n(h,x),t.epsilon)?n(h,x):h.toDecimalPlaces(x.toNumber(),js.ROUND_CEIL)},Fraction:function(h){return h.ceil()},"Fraction, number":function(h,x){return h.ceil(x)},"Fraction, BigNumber":function(h,x){return h.ceil(x.toNumber())},"Array | Matrix":r.referToSelf(d=>h=>rr(h,d,!0)),"Array, number | BigNumber":r.referToSelf(d=>(h,x)=>rr(h,v=>d(v,x),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(d=>(h,x)=>f(h,x,d,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(d=>(h,x)=>u(h,x,d,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(d=>(h,x)=>u(i(x),h,d,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(d=>(h,x)=>a(h,0)?s(x.size(),x.storage()):x.storage()==="dense"?u(x,h,d,!0):o(x,h,d,!0))})});var iE="cube",BW=["typed"],sd=T(iE,BW,e=>{var{typed:r}=e;return r(iE,{number:sD,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})});var aE="exp",IW=["typed"],ud=T(aE,IW,e=>{var{typed:r}=e;return r(aE,{number:uD,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})});var oE="expm1",PW=["typed","Complex"],fd=T(oE,PW,e=>{var{typed:r,Complex:t}=e;return r(oE,{number:fD,Complex:function(i){var a=Math.exp(i.re);return new t(a*Math.cos(i.im)-1,a*Math.sin(i.im))},BigNumber:function(i){return i.exp().minus(1)}})});var jD="fix",kW=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],RW=T(jD,["typed","ceil","floor"],e=>{var{typed:r,ceil:t,floor:n}=e;return r(jD,{number:function(a){return a>0?n(a):t(a)},"number, number":function(a,s){return a>0?n(a,s):t(a,s)}})}),cd=T(jD,kW,e=>{var{typed:r,Complex:t,matrix:n,ceil:i,floor:a,equalScalar:s,zeros:c,DenseMatrix:f}=e,o=Gr({typed:r,DenseMatrix:f}),u=$t({typed:r}),p=RW({typed:r,ceil:i,floor:a});return r("fix",{number:p.signatures.number,"number, number | BigNumber":p.signatures["number,number"],Complex:function(h){return new t(h.re>0?Math.floor(h.re):Math.ceil(h.re),h.im>0?Math.floor(h.im):Math.ceil(h.im))},"Complex, number":function(h,x){return new t(h.re>0?a(h.re,x):i(h.re,x),h.im>0?a(h.im,x):i(h.im,x))},"Complex, BigNumber":function(h,x){var v=x.toNumber();return new t(h.re>0?a(h.re,v):i(h.re,v),h.im>0?a(h.im,v):i(h.im,v))},BigNumber:function(h){return h.isNegative()?i(h):a(h)},"BigNumber, number | BigNumber":function(h,x){return h.isNegative()?i(h,x):a(h,x)},Fraction:function(h){return h.s<0?h.ceil():h.floor()},"Fraction, number | BigNumber":function(h,x){return h.s<0?i(h,x):a(h,x)},"Array | Matrix":r.referToSelf(d=>h=>rr(h,d,!0)),"Array | Matrix, number | BigNumber":r.referToSelf(d=>(h,x)=>rr(h,v=>d(v,x),!0)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(d=>(h,x)=>u(n(x),h,d,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(d=>(h,x)=>s(h,0)?c(x.size(),x.storage()):x.storage()==="dense"?u(x,h,d,!0):o(x,h,d,!0))})});var eS="floor",LW=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],qW=T(eS,["typed","config","round"],e=>{var{typed:r,config:t,round:n}=e;return r(eS,{number:function(a){return Bt(a,n(a),t.epsilon)?n(a):Math.floor(a)},"number, number":function(a,s){if(Bt(a,n(a,s),t.epsilon))return n(a,s);var[c,f]="".concat(a,"e").split("e"),o=Math.floor(Number("".concat(c,"e").concat(Number(f)+s)));return[c,f]="".concat(o,"e").split("e"),Number("".concat(c,"e").concat(Number(f)-s))}})}),sf=T(eS,LW,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:c}=e,f=ot({typed:r,equalScalar:a}),o=Gr({typed:r,DenseMatrix:c}),u=$t({typed:r}),p=qW({typed:r,config:t,round:n});return r("floor",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(h){return h.floor()},"Complex, number":function(h,x){return h.floor(x)},"Complex, BigNumber":function(h,x){return h.floor(x.toNumber())},BigNumber:function(h){return en(h,n(h),t.epsilon)?n(h):h.floor()},"BigNumber, BigNumber":function(h,x){return en(h,n(h,x),t.epsilon)?n(h,x):h.toDecimalPlaces(x.toNumber(),js.ROUND_FLOOR)},Fraction:function(h){return h.floor()},"Fraction, number":function(h,x){return h.floor(x)},"Fraction, BigNumber":function(h,x){return h.floor(x.toNumber())},"Array | Matrix":r.referToSelf(d=>h=>rr(h,d,!0)),"Array, number | BigNumber":r.referToSelf(d=>(h,x)=>rr(h,v=>d(v,x),!0)),"SparseMatrix, number | BigNumber":r.referToSelf(d=>(h,x)=>f(h,x,d,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(d=>(h,x)=>u(h,x,d,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(d=>(h,x)=>u(i(x),h,d,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(d=>(h,x)=>a(h,0)?s(x.size(),x.storage()):x.storage()==="dense"?u(x,h,d,!0):o(x,h,d,!0))})});var UW="matAlgo02xDS0",zW=["typed","equalScalar"],Zt=T(UW,zW,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s,c){var f=i._data,o=i._size,u=i._datatype||i.getDataType(),p=a._values,d=a._index,h=a._ptr,x=a._size,v=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(o.length!==x.length)throw new vr(o.length,x.length);if(o[0]!==x[0]||o[1]!==x[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+x+")");if(!p)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var y=o[0],w=o[1],E,b=t,A=0,C=s;typeof u=="string"&&u===v&&u!=="mixed"&&(E=u,b=r.find(t,[E,E]),A=r.convert(0,E),C=r.find(s,[E,E]));for(var S=[],O=[],F=[],M=0;M{var{typed:r}=e;return function(n,i,a,s){var c=n._data,f=n._size,o=n._datatype||n.getDataType(),u=i._values,p=i._index,d=i._ptr,h=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(f.length!==h.length)throw new vr(f.length,h.length);if(f[0]!==h[0]||f[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+h+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=f[0],y=f[1],w,E=0,b=a;typeof o=="string"&&o===x&&o!=="mixed"&&(w=o,E=r.convert(0,w),b=r.find(a,[w,w]));for(var A=[],C=0;C{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new vr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],E=u[1],b,A=t,C=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),C=r.convert(0,b),S=r.find(s,[b,b]));var O=c&&d?[]:void 0,F=[],M=[],_=O?[]:void 0,k=O?[]:void 0,L=[],Y=[],$,V,q,R;for(V=0;V{var{typed:r}=e;return function(i,a,s){var c=i._data,f=i._size,o=i._datatype,u=a._data,p=a._size,d=a._datatype,h=[];if(f.length!==p.length)throw new vr(f.length,p.length);for(var x=0;x0?t(y,0,h,h[0],c,u):[];return i.createDenseMatrix({data:w,size:h,datatype:v})};function t(n,i,a,s,c,f){var o=[];if(i===a.length-1)for(var u=0;u{var{concat:r}=e;return function(i,a){var s=Math.max(i._size.length,a._size.length);if(i._size.length===a._size.length&&i._size.every((x,v)=>x===a._size[v]))return[i,a];for(var c=t(i._size,s,0),f=t(a._size,s,0),o=[],u=0;u{var{typed:r,matrix:t,concat:n}=e,i=sE({typed:r}),a=$t({typed:r}),s=uE({concat:n});return function(f){var o=f.elop,u=f.SD||f.DS,p;o?(p={"DenseMatrix, DenseMatrix":(v,y)=>i(...s(v,y),o),"Array, Array":(v,y)=>i(...s(t(v),t(y)),o).valueOf(),"Array, DenseMatrix":(v,y)=>i(...s(t(v),y),o),"DenseMatrix, Array":(v,y)=>i(...s(v,t(y)),o)},f.SS&&(p["SparseMatrix, SparseMatrix"]=(v,y)=>f.SS(...s(v,y),o,!1)),f.DS&&(p["DenseMatrix, SparseMatrix"]=(v,y)=>f.DS(...s(v,y),o,!1),p["Array, SparseMatrix"]=(v,y)=>f.DS(...s(t(v),y),o,!1)),u&&(p["SparseMatrix, DenseMatrix"]=(v,y)=>u(...s(y,v),o,!0),p["SparseMatrix, Array"]=(v,y)=>u(...s(t(y),v),o,!0))):(p={"DenseMatrix, DenseMatrix":r.referToSelf(v=>(y,w)=>i(...s(y,w),v)),"Array, Array":r.referToSelf(v=>(y,w)=>i(...s(t(y),t(w)),v).valueOf()),"Array, DenseMatrix":r.referToSelf(v=>(y,w)=>i(...s(t(y),w),v)),"DenseMatrix, Array":r.referToSelf(v=>(y,w)=>i(...s(y,t(w)),v))},f.SS&&(p["SparseMatrix, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.SS(...s(y,w),v,!1))),f.DS&&(p["DenseMatrix, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.DS(...s(y,w),v,!1)),p["Array, SparseMatrix"]=r.referToSelf(v=>(y,w)=>f.DS(...s(t(y),w),v,!1))),u&&(p["SparseMatrix, DenseMatrix"]=r.referToSelf(v=>(y,w)=>u(...s(w,y),v,!0)),p["SparseMatrix, Array"]=r.referToSelf(v=>(y,w)=>u(...s(t(w),y),v,!0))));var d=f.scalar||"any",h=f.Ds||f.Ss;h&&(o?(p["DenseMatrix,"+d]=(v,y)=>a(v,y,o,!1),p[d+", DenseMatrix"]=(v,y)=>a(y,v,o,!0),p["Array,"+d]=(v,y)=>a(t(v),y,o,!1).valueOf(),p[d+", Array"]=(v,y)=>a(t(y),v,o,!0).valueOf()):(p["DenseMatrix,"+d]=r.referToSelf(v=>(y,w)=>a(y,w,v,!1)),p[d+", DenseMatrix"]=r.referToSelf(v=>(y,w)=>a(w,y,v,!0)),p["Array,"+d]=r.referToSelf(v=>(y,w)=>a(t(y),w,v,!1).valueOf()),p[d+", Array"]=r.referToSelf(v=>(y,w)=>a(t(w),y,v,!0).valueOf())));var x=f.sS!==void 0?f.sS:f.Ss;return o?(f.Ss&&(p["SparseMatrix,"+d]=(v,y)=>f.Ss(v,y,o,!1)),x&&(p[d+", SparseMatrix"]=(v,y)=>x(y,v,o,!0))):(f.Ss&&(p["SparseMatrix,"+d]=r.referToSelf(v=>(y,w)=>f.Ss(y,w,v,!1))),x&&(p[d+", SparseMatrix"]=r.referToSelf(v=>(y,w)=>x(w,y,v,!0)))),o&&o.signatures&&Kp(p,o.signatures),p}});var fE="mod",KW=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],uf=T(fE,KW,e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:c,concat:f}=e,o=sf({typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:s,DenseMatrix:c}),u=Zt({typed:r,equalScalar:a}),p=yt({typed:r}),d=fs({typed:r,equalScalar:a}),h=ot({typed:r,equalScalar:a}),x=Gr({typed:r,DenseMatrix:c}),v=br({typed:r,matrix:i,concat:f});return r(fE,{"number, number":y,"BigNumber, BigNumber":function(E,b){return b.isZero()?E:E.sub(b.mul(o(E.div(b))))},"Fraction, Fraction":function(E,b){return b.equals(0)?E:E.sub(b.mul(o(E.div(b))))}},v({SS:d,DS:p,SD:u,Ss:h,sS:x}));function y(w,E){return E===0?w:w-E*o(w/E)}});var jW="matAlgo01xDSid",eV=["typed"],In=T(jW,eV,e=>{var{typed:r}=e;return function(n,i,a,s){var c=n._data,f=n._size,o=n._datatype||n.getDataType(),u=i._values,p=i._index,d=i._ptr,h=i._size,x=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(f.length!==h.length)throw new vr(f.length,h.length);if(f[0]!==h[0]||f[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+h+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=f[0],y=f[1],w=typeof o=="string"&&o!=="mixed"&&o===x?o:void 0,E=w?r.find(a,[w,w]):a,b,A,C=[];for(b=0;b{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new vr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],E=u[1],b,A=t,C=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),C=r.convert(0,b),S=r.find(s,[b,b]));var O=c&&d?[]:void 0,F=[],M=[],_=c&&d?[]:void 0,k=c&&d?[]:void 0,L=[],Y=[],$,V,q,R,j;for(V=0;V{var{typed:r,DenseMatrix:t}=e;return function(i,a,s,c){var f=i._values,o=i._index,u=i._ptr,p=i._size,d=i._datatype;if(!f)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=p[0],x=p[1],v,y=s;typeof d=="string"&&(v=d,a=r.convert(a,v),y=r.find(s,[v,v]));for(var w=[],E=[],b=[],A=0;AArray.isArray(r))}var ld=T(cE,aV,e=>{var{typed:r,matrix:t,config:n,round:i,equalScalar:a,zeros:s,BigNumber:c,DenseMatrix:f,concat:o}=e,u=uf({typed:r,config:n,round:i,matrix:t,equalScalar:a,zeros:s,DenseMatrix:f,concat:o}),p=In({typed:r}),d=ff({typed:r,equalScalar:a}),h=ci({typed:r,DenseMatrix:f}),x=br({typed:r,matrix:t,concat:o});return r(cE,{"number, number":v,"BigNumber, BigNumber":y,"Fraction, Fraction":(w,E)=>w.gcd(E)},x({SS:d,DS:p,Ss:h}),{[oV]:r.referToSelf(w=>(E,b,A)=>{for(var C=w(E,b),S=0;SE=>{if(E.length===1&&Array.isArray(E[0])&&lE(E[0]))return w(...E[0]);if(lE(E))return w(...E);throw new Ci("gcd() supports only 1d matrices!")}),Matrix:r.referToSelf(w=>E=>w(E.toArray()))});function v(w,E){if(!Qe(w)||!Qe(E))throw new Error("Parameters in function gcd must be integer numbers");for(var b;E!==0;)b=u(w,E),w=E,E=b;return w<0?-w:w}function y(w,E){if(!w.isInt()||!E.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var b=new c(0);!E.isZero();){var A=u(w,E);w=E,E=A}return w.lt(b)?w.neg():w}});var sV="matAlgo06xS0S0",uV=["typed","equalScalar"],cs=T(sV,uV,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._size,o=i._datatype||i._data===void 0?i._datatype:i.getDataType(),u=a._values,p=a._size,d=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(f.length!==p.length)throw new vr(f.length,p.length);if(f[0]!==p[0]||f[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+p+")");var h=f[0],x=f[1],v,y=t,w=0,E=s;typeof o=="string"&&o===d&&o!=="mixed"&&(v=o,y=r.find(t,[v,v]),w=r.convert(0,v),E=r.find(s,[v,v]));for(var b=c&&u?[]:void 0,A=[],C=[],S=b?[]:void 0,O=[],F=[],M=0;M{var{typed:r,matrix:t,equalScalar:n,concat:i}=e,a=Zt({typed:r,equalScalar:n}),s=cs({typed:r,equalScalar:n}),c=ot({typed:r,equalScalar:n}),f=br({typed:r,matrix:t,concat:i}),o="number | BigNumber | Fraction | Matrix | Array",u={};return u["".concat(o,", ").concat(o,", ...").concat(o)]=r.referToSelf(d=>(h,x,v)=>{for(var y=d(h,x),w=0;wd.lcm(h)},f({SS:s,DS:a,Ss:c}),u);function p(d,h){if(!d.isInt()||!h.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(d.isZero())return d;if(h.isZero())return h;for(var x=d.times(h);!h.isZero();){var v=h;h=d.mod(v),d=v}return x.div(d).abs()}});var mE="log10",cV=["typed","config","Complex"],md=T(mE,cV,e=>{var{typed:r,config:t,Complex:n}=e;return r(mE,{number:function(a){return a>=0||t.predictable?lD(a):new n(a,0).log().div(Math.LN10)},Complex:function(a){return new n(a).log().div(Math.LN10)},BigNumber:function(a){return!a.isNegative()||t.predictable?a.log():new n(a.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":r.referToSelf(i=>a=>rr(a,i))})});var dE="log2",lV=["typed","config","Complex"],dd=T(dE,lV,e=>{var{typed:r,config:t,Complex:n}=e;return r(dE,{number:function(s){return s>=0||t.predictable?pD(s):i(new n(s,0))},Complex:i,BigNumber:function(s){return!s.isNegative()||t.predictable?s.log(2):i(new n(s.toNumber(),0))},"Array | Matrix":r.referToSelf(a=>s=>rr(s,a))});function i(a){var s=Math.sqrt(a.re*a.re+a.im*a.im);return new n(Math.log2?Math.log2(s):Math.log(s)/Math.LN2,Math.atan2(a.im,a.re)/Math.LN2)}});var pV="multiplyScalar",mV=["typed"],hd=T(pV,mV,e=>{var{typed:r}=e;return r("multiplyScalar",{"number, number":iD,"Complex, Complex":function(n,i){return n.mul(i)},"BigNumber, BigNumber":function(n,i){return n.times(i)},"Fraction, Fraction":function(n,i){return n.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(t,n)=>n.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,n)=>t.multiply(n)})});var hE="multiply",dV=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],vd=T(hE,dV,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:i,equalScalar:a,dot:s}=e,c=ot({typed:r,equalScalar:a}),f=$t({typed:r});function o(C,S){switch(C.length){case 1:switch(S.length){case 1:if(C[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(C[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+C[0]+") must match Matrix rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;case 2:switch(S.length){case 1:if(C[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+C[1]+") must match Vector length ("+S[0]+")");break;case 2:if(C[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+C[1]+") must match Matrix B rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+C.length+" dimensions)")}}function u(C,S,O){if(O===0)throw new Error("Cannot multiply two empty vectors");return s(C,S)}function p(C,S){if(S.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return d(C,S)}function d(C,S){var O=C._data,F=C._size,M=C._datatype||C.getDataType(),_=S._data,k=S._size,L=S._datatype||S.getDataType(),Y=F[0],$=k[1],V,q=n,R=i;M&&L&&M===L&&typeof M=="string"&&M!=="mixed"&&(V=M,q=r.find(n,[V,V]),R=r.find(i,[V,V]));for(var j=[],U=0;U<$;U++){for(var se=R(O[0],_[0][U]),de=1;dexe)for(var ye=0,we=0;we(S,O)=>{o(cr(S),cr(O));var F=C(t(S),t(O));return Xe(F)?F.valueOf():F}),"Matrix, Matrix":function(S,O){var F=S.size(),M=O.size();return o(F,M),F.length===1?M.length===1?u(S,O,F[0]):p(S,O):M.length===1?h(S,O):x(S,O)},"Matrix, Array":r.referTo("Matrix,Matrix",C=>(S,O)=>C(S,t(O))),"Array, Matrix":r.referToSelf(C=>(S,O)=>C(t(S,O.storage()),O)),"SparseMatrix, any":function(S,O){return c(S,O,i,!1)},"DenseMatrix, any":function(S,O){return f(S,O,i,!1)},"any, SparseMatrix":function(S,O){return c(O,S,i,!0)},"any, DenseMatrix":function(S,O){return f(O,S,i,!0)},"Array, any":function(S,O){return f(t(S),O,i,!1).valueOf()},"any, Array":function(S,O){return f(t(O),S,i,!0).valueOf()},"any, any":i,"any, any, ...any":r.referToSelf(C=>(S,O,F)=>{for(var M=C(S,O),_=0;_{var{typed:r,matrix:t,equalScalar:n,BigNumber:i,concat:a}=e,s=In({typed:r}),c=Zt({typed:r,equalScalar:n}),f=cs({typed:r,equalScalar:n}),o=ot({typed:r,equalScalar:n}),u=br({typed:r,matrix:t,concat:a});function p(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return r(vE,{number:mD,"number, number":mD,BigNumber:h=>d(h,new i(2)),"BigNumber, BigNumber":d,Complex:p,"Complex, number":p,Array:r.referTo("DenseMatrix,number",h=>x=>h(t(x),2).valueOf()),DenseMatrix:r.referTo("DenseMatrix,number",h=>x=>h(x,2)),SparseMatrix:r.referTo("SparseMatrix,number",h=>x=>h(x,2)),"SparseMatrix, SparseMatrix":r.referToSelf(h=>(x,v)=>{if(v.density()===1)return f(x,v,h);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":r.referToSelf(h=>(x,v)=>{if(v.density()===1)return s(x,v,h,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":r.referTo("DenseMatrix,SparseMatrix",h=>(x,v)=>h(t(x),v)),"number | BigNumber, SparseMatrix":r.referToSelf(h=>(x,v)=>{if(v.density()===1)return o(v,x,h,!0);throw new Error("Root must be non-zero")})},u({scalar:"number | BigNumber",SD:c,Ss:o,sS:!1}));function d(h,x){var v=i.precision,y=i.clone({precision:v+2}),w=new i(0),E=new y(1),b=x.isNegative();if(b&&(x=x.neg()),x.isZero())throw new Error("Root must be non-zero");if(h.isNegative()&&!x.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(h.isZero())return b?new y(1/0):0;if(!h.isFinite())return b?w:h;var A=h.abs().pow(E.div(x));return A=h.isNeg()?A.neg():A,new i((b?E.div(A):A).toPrecision(v))}});var gE="sign",vV=["typed","BigNumber","Fraction","complex"],xd=T(gE,vV,e=>{var{typed:r,BigNumber:t,complex:n,Fraction:i}=e;return r(gE,{number:Fm,Complex:function(s){return s.im===0?n(Fm(s.re)):s.sign()},BigNumber:function(s){return new t(s.cmp(0))},Fraction:function(s){return new i(s.s,1)},"Array | Matrix":r.referToSelf(a=>s=>rr(s,a,!0)),Unit:r.referToSelf(a=>s=>{if(!s._isDerived()&&s.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return r.find(a,s.valueType())(s.value)})})});var gV="sqrt",xV=["config","typed","Complex"],yd=T(gV,xV,e=>{var{config:r,typed:t,Complex:n}=e;return t("sqrt",{number:i,Complex:function(s){return s.sqrt()},BigNumber:function(s){return!s.isNegative()||r.predictable?s.sqrt():i(s.toNumber())},Unit:function(s){return s.pow(.5)}});function i(a){return isNaN(a)?NaN:a>=0||r.predictable?Math.sqrt(a):new n(a,0).sqrt()}});var xE="square",yV=["typed"],bd=T(xE,yV,e=>{var{typed:r}=e;return r(xE,{number:dD,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})});var yE="subtract",bV=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],wd=T(yE,bV,e=>{var{typed:r,matrix:t,equalScalar:n,subtractScalar:i,unaryMinus:a,DenseMatrix:s,concat:c}=e,f=In({typed:r}),o=yt({typed:r}),u=fs({typed:r,equalScalar:n}),p=ci({typed:r,DenseMatrix:s}),d=Gr({typed:r,DenseMatrix:s}),h=br({typed:r,matrix:t,concat:c});return r(yE,{"any, any":i},h({elop:i,SS:u,DS:f,SD:o,Ss:d,sS:p}))});var bE="xgcd",wV=["typed","config","matrix","BigNumber"],Dd=T(bE,wV,e=>{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r(bE,{"number, number":function(c,f){var o=hD(c,f);return t.matrix==="Array"?o:n(o)},"BigNumber, BigNumber":a});function a(s,c){var f,o,u,p=new i(0),d=new i(1),h=p,x=d,v=d,y=p;if(!s.isInt()||!c.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!c.isZero();)o=s.div(c).floor(),u=s.mod(c),f=h,h=x.minus(o.times(h)),x=f,f=v,v=y.minus(o.times(v)),y=f,s=c,c=u;var w;return s.lt(p)?w=[s.neg(),x.neg(),y.neg()]:w=[s,s.isZero()?0:x,y],t.matrix==="Array"?w:n(w)}});var wE="invmod",DV=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],Sd=T(wE,DV,e=>{var{typed:r,config:t,BigNumber:n,xgcd:i,equal:a,smaller:s,mod:c,add:f,isInteger:o}=e;return r(wE,{"number, number":u,"BigNumber, BigNumber":u});function u(p,d){if(!o(p)||!o(d))throw new Error("Parameters in function invmod must be integer numbers");if(p=c(p,d),a(d,0))throw new Error("Divisor must be non zero");var h=i(p,d);h=h.valueOf();var[x,v]=h;return a(x,n(1))?(v=c(v,d),s(v,n(0))&&(v=f(v,d)),v):NaN}});var SV="matAlgo09xS0Sf",NV=["typed","equalScalar"],Nd=T(SV,NV,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new vr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");var w=u[0],E=u[1],b,A=t,C=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),C=r.convert(0,b),S=r.find(s,[b,b]));var O=c&&d?[]:void 0,F=[],M=[],_=O?[]:void 0,k=[],L,Y,$,V,q;for(Y=0;Y{var{typed:r,matrix:t,equalScalar:n,multiplyScalar:i,concat:a}=e,s=Zt({typed:r,equalScalar:n}),c=Nd({typed:r,equalScalar:n}),f=ot({typed:r,equalScalar:n}),o=br({typed:r,matrix:t,concat:a});return r(DE,o({elop:i,SS:c,DS:s,Ss:f}))});function SE(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitAnd");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero()||r.eq(-1)||e.eq(r))return e;if(r.isZero()||e.eq(-1))return r;if(!e.isFinite()||!r.isFinite()){if(!e.isFinite()&&!r.isFinite())return e.isNegative()===r.isNegative()?e:new t(0);if(!e.isFinite())return r.isNegative()?e:e.isNegative()?new t(0):r;if(!r.isFinite())return e.isNegative()?r:r.isNegative()?new t(0):e}return tS(e,r,function(n,i){return n&i})}function cf(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var r=e.constructor,t=r.precision;r.config({precision:1e9});var n=e.plus(new r(1));return n.s=-n.s||null,r.config({precision:t}),n}function NE(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitOr");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);var n=new t(-1);return e.isZero()||r.eq(n)||e.eq(r)?r:r.isZero()||e.eq(n)?e:!e.isFinite()||!r.isFinite()?!e.isFinite()&&!e.isNegative()&&r.isNegative()||e.isNegative()&&!r.isNegative()&&!r.isFinite()?n:e.isNegative()&&r.isNegative()?e.isFinite()?e:r:e.isFinite()?r:e:tS(e,r,function(i,a){return i|a})}function tS(e,r,t){var n=e.constructor,i,a,s=+(e.s<0),c=+(r.s<0);if(s){i=Cd(cf(e));for(var f=0;f0;)t(u[--h],p[--x])===v&&(y=y.plus(w)),w=w.times(E);for(;x>0;)t(d,p[--x])===v&&(y=y.plus(w)),w=w.times(E);return n.config({precision:b}),v===0&&(y.s=-y.s),y}function Cd(e){for(var r=e.d,t=r[0]+"",n=1;n0)if(++c>o)for(c-=o;c--;)f+="0";else c1&&((u[h+1]===null||u[h+1]===void 0)&&(u[h+1]=0),u[h+1]+=u[h]>>1,u[h]&=1)}return u.reverse()}function AE(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitXor");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero())return r;if(r.isZero())return e;if(e.eq(r))return new t(0);var n=new t(-1);return e.eq(n)?cf(r):r.eq(n)?cf(e):!e.isFinite()||!r.isFinite()?!e.isFinite()&&!r.isFinite()?n:new t(e.isNegative()===r.isNegative()?1/0:-1/0):tS(e,r,function(i,a){return i^a})}function CE(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function leftShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:!e.isFinite()&&!r.isFinite()?new t(NaN):r.lt(55)?e.times(Math.pow(2,r.toNumber())+""):e.times(new t(2).pow(r))}function EE(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function rightArithShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:r.isFinite()?r.lt(55)?e.div(Math.pow(2,r.toNumber())+"").floor():e.div(new t(2).pow(r)).floor():e.isNegative()?new t(-1):e.isFinite()?new t(0):new t(NaN)}var ME="bitAnd",CV=["typed","matrix","equalScalar","concat"],lf=T(ME,CV,e=>{var{typed:r,matrix:t,equalScalar:n,concat:i}=e,a=Zt({typed:r,equalScalar:n}),s=cs({typed:r,equalScalar:n}),c=ot({typed:r,equalScalar:n}),f=br({typed:r,matrix:t,concat:i});return r(ME,{"number, number":gD,"BigNumber, BigNumber":SE},f({SS:s,DS:a,Ss:c}))});var _E="bitNot",EV=["typed"],Ed=T(_E,EV,e=>{var{typed:r}=e;return r(_E,{number:xD,BigNumber:cf,"Array | Matrix":r.referToSelf(t=>n=>rr(n,t))})});var TE="bitOr",MV=["typed","matrix","equalScalar","DenseMatrix","concat"],pf=T(TE,MV,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=In({typed:r}),c=ff({typed:r,equalScalar:n}),f=ci({typed:r,DenseMatrix:i}),o=br({typed:r,matrix:t,concat:a});return r(TE,{"number, number":yD,"BigNumber, BigNumber":NE},o({SS:c,DS:s,Ss:f}))});var _V="matAlgo07xSSf",TV=["typed","DenseMatrix"],nn=T(_V,TV,e=>{var{typed:r,DenseMatrix:t}=e;return function(a,s,c){var f=a._size,o=a._datatype||a._data===void 0?a._datatype:a.getDataType(),u=s._size,p=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(f.length!==u.length)throw new vr(f.length,u.length);if(f[0]!==u[0]||f[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+f+") must match Matrix B ("+u+")");var d=f[0],h=f[1],x,v=0,y=c;typeof o=="string"&&o===p&&o!=="mixed"&&(x=o,v=r.convert(0,x),y=r.find(c,[x,x]));var w,E,b=[];for(w=0;w{var{typed:r,matrix:t,DenseMatrix:n,concat:i}=e,a=yt({typed:r}),s=nn({typed:r,DenseMatrix:n}),c=Gr({typed:r,DenseMatrix:n}),f=br({typed:r,matrix:t,concat:i});return r(FE,{"number, number":bD,"BigNumber, BigNumber":AE},f({SS:s,DS:a,Ss:c}))});var OE="arg",OV=["typed"],_d=T(OE,OV,e=>{var{typed:r}=e;return r(OE,{number:function(n){return Math.atan2(0,n)},BigNumber:function(n){return n.constructor.atan2(0,n)},Complex:function(n){return n.arg()},"Array | Matrix":r.referToSelf(t=>n=>rr(n,t))})});var BE="conj",BV=["typed"],Td=T(BE,BV,e=>{var{typed:r}=e;return r(BE,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":r.referToSelf(t=>n=>rr(n,t))})});var IE="im",IV=["typed"],Fd=T(IE,IV,e=>{var{typed:r}=e;return r(IE,{number:()=>0,"BigNumber | Fraction":t=>t.mul(0),Complex:t=>t.im,"Array | Matrix":r.referToSelf(t=>n=>rr(n,t))})});var PE="re",PV=["typed"],Od=T(PE,PV,e=>{var{typed:r}=e;return r(PE,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.re,"Array | Matrix":r.referToSelf(t=>n=>rr(n,t))})});var kE="not",kV=["typed"],Bd=T(kE,kV,e=>{var{typed:r}=e;return r(kE,{"null | undefined":()=>!0,number:CD,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>rr(n,t))})});var RE="or",RV=["typed","matrix","equalScalar","DenseMatrix","concat"],mf=T(RE,RV,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=yt({typed:r}),c=fs({typed:r,equalScalar:n}),f=Gr({typed:r,DenseMatrix:i}),o=br({typed:r,matrix:t,concat:a});return r(RE,{"number, number":ED,"Complex, Complex":function(p,d){return p.re!==0||p.im!==0||d.re!==0||d.im!==0},"BigNumber, BigNumber":function(p,d){return!p.isZero()&&!p.isNaN()||!d.isZero()&&!d.isNaN()},"Unit, Unit":r.referToSelf(u=>(p,d)=>u(p.value||0,d.value||0))},o({SS:c,DS:s,Ss:f}))});var LE="xor",LV=["typed","matrix","DenseMatrix","concat"],Id=T(LE,LV,e=>{var{typed:r,matrix:t,DenseMatrix:n,concat:i}=e,a=yt({typed:r}),s=nn({typed:r,DenseMatrix:n}),c=Gr({typed:r,DenseMatrix:n}),f=br({typed:r,matrix:t,concat:i});return r(LE,{"number, number":MD,"Complex, Complex":function(u,p){return(u.re!==0||u.im!==0)!=(p.re!==0||p.im!==0)},"BigNumber, BigNumber":function(u,p){return(!u.isZero()&&!u.isNaN())!=(!p.isZero()&&!p.isNaN())},"Unit, Unit":r.referToSelf(o=>(u,p)=>o(u.value||0,p.value||0))},f({SS:s,DS:a,Ss:c}))});var qE="concat",qV=["typed","matrix","isInteger"],df=T(qE,qV,e=>{var{typed:r,matrix:t,isInteger:n}=e;return r(qE,{"...Array | Matrix | number | BigNumber":function(a){var s,c=a.length,f=-1,o,u=!1,p=[];for(s=0;s0&&f>o)throw new pn(f,o+1)}else{var h=or(d).valueOf(),x=cr(h);if(p[s]=h,o=f,f=x.length-1,s>0&&f!==o)throw new vr(o+1,f+1)}}if(p.length===0)throw new SyntaxError("At least one matrix expected");for(var v=p.shift();p.length;)v=qw(v,p.shift(),f);return u?t(v):v},"...string":function(a){return a.join("")}})});var UE="column",UV=["typed","Index","matrix","range"],hf=T(UE,UV,e=>{var{typed:r,Index:t,matrix:n,range:i}=e;return r(UE,{"Matrix, number":a,"Array, number":function(c,f){return a(n(or(c)),f).valueOf()}});function a(s,c){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");at(c,s.size()[1]);var f=i(0,s.size()[0]),o=new t(f,c),u=s.subset(o);return Xe(u)?u:n([[u]])}});var zE="count",zV=["typed","size","prod"],Pd=T(zE,zV,e=>{var{typed:r,size:t,prod:n}=e;return r(zE,{string:function(a){return a.length},"Matrix | Array":function(a){return n(t(a))}})});var WE="cross",WV=["typed","matrix","subtract","multiply"],kd=T(WE,WV,e=>{var{typed:r,matrix:t,subtract:n,multiply:i}=e;return r(WE,{"Matrix, Matrix":function(c,f){return t(a(c.toArray(),f.toArray()))},"Matrix, Array":function(c,f){return t(a(c.toArray(),f))},"Array, Matrix":function(c,f){return t(a(c,f.toArray()))},"Array, Array":a});function a(s,c){var f=Math.max(cr(s).length,cr(c).length);s=Ju(s),c=Ju(c);var o=cr(s),u=cr(c);if(o.length!==1||u.length!==1||o[0]!==3||u[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+o.join(", ")+"], B = ["+u.join(", ")+"])");var p=[n(i(s[1],c[2]),i(s[2],c[1])),n(i(s[2],c[0]),i(s[0],c[2])),n(i(s[0],c[1]),i(s[1],c[0]))];return f>1?[p]:p}});var VE="diag",VV=["typed","matrix","DenseMatrix","SparseMatrix"],Rd=T(VE,VV,e=>{var{typed:r,matrix:t,DenseMatrix:n,SparseMatrix:i}=e;return r(VE,{Array:function(o){return a(o,0,cr(o),null)},"Array, number":function(o,u){return a(o,u,cr(o),null)},"Array, BigNumber":function(o,u){return a(o,u.toNumber(),cr(o),null)},"Array, string":function(o,u){return a(o,0,cr(o),u)},"Array, number, string":function(o,u,p){return a(o,u,cr(o),p)},"Array, BigNumber, string":function(o,u,p){return a(o,u.toNumber(),cr(o),p)},Matrix:function(o){return a(o,0,o.size(),o.storage())},"Matrix, number":function(o,u){return a(o,u,o.size(),o.storage())},"Matrix, BigNumber":function(o,u){return a(o,u.toNumber(),o.size(),o.storage())},"Matrix, string":function(o,u){return a(o,0,o.size(),u)},"Matrix, number, string":function(o,u,p){return a(o,u,o.size(),p)},"Matrix, BigNumber, string":function(o,u,p){return a(o,u.toNumber(),o.size(),p)}});function a(f,o,u,p){if(!Qe(o))throw new TypeError("Second parameter in function diag must be an integer");var d=o>0?o:0,h=o<0?-o:0;switch(u.length){case 1:return s(f,o,p,u[0],h,d);case 2:return c(f,o,p,u,h,d)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function s(f,o,u,p,d,h){var x=[p+d,p+h];if(u&&u!=="sparse"&&u!=="dense")throw new TypeError("Unknown matrix type ".concat(u,'"'));var v=u==="sparse"?i.diagonal(x,f,o):n.diagonal(x,f,o);return u!==null?v:v.valueOf()}function c(f,o,u,p,d,h){if(Xe(f)){var x=f.diagonal(o);return u!==null?u!==x.storage()?t(x,u):x:x.valueOf()}for(var v=Math.min(p[0]-d,p[1]-h),y=[],w=0;w=2&&v.push("index: ".concat(Ir(t))),h.length>=3&&v.push("array: ".concat(Ir(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(v.join(", "),") at index ").concat(JSON.stringify(t)))}else throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(y.message))}}}var YV="filter",HV=["typed"],Ld=T(YV,HV,e=>{var{typed:r}=e;return r("filter",{"Array, function":YE,"Matrix, function":function(n,i){return n.create(YE(n.toArray(),i))},"Array, RegExp":Ku,"Matrix, RegExp":function(n,i){return n.create(Ku(n.toArray(),i))}})});function YE(e,r){return um(e,function(t,n,i){return Gi(r,t,[n],i,"filter")})}var HE="flatten",GV=["typed","matrix"],qd=T(HE,GV,e=>{var{typed:r,matrix:t}=e;return r(HE,{Array:function(i){return wr(i)},Matrix:function(i){var a=wr(i.toArray());return t(a)}})});var GE="forEach",$V=["typed"],Ud=T(GE,$V,e=>{var{typed:r}=e;return r(GE,{"Array, function":ZV,"Matrix, function":function(n,i){n.forEach(i)}})});function ZV(e,r){var t=function n(i,a){if(Array.isArray(i))es(i,function(s,c){n(s,a.concat(c))});else return Gi(r,i,a,e,"forEach")};t(e,[])}var $E="getMatrixDataType",QV=["typed"],zd=T($E,QV,e=>{var{typed:r}=e;return r($E,{Array:function(n){return rs(n,Ir)},Matrix:function(n){return n.getDataType()}})});var ZE="identity",XV=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],Wd=T(ZE,XV,e=>{var{typed:r,config:t,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:s}=e;return r(ZE,{"":function(){return t.matrix==="Matrix"?n([]):[]},string:function(u){return n(u)},"number | BigNumber":function(u){return f(u,u,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(u,p){return f(u,u,p)},"number | BigNumber, number | BigNumber":function(u,p){return f(u,p,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(u,p,d){return f(u,p,d)},Array:function(u){return c(u)},"Array, string":function(u,p){return c(u,p)},Matrix:function(u){return c(u.valueOf(),u.storage())},"Matrix, string":function(u,p){return c(u.valueOf(),p)}});function c(o,u){switch(o.length){case 0:return u?n(u):[];case 1:return f(o[0],o[0],u);case 2:return f(o[0],o[1],u);default:throw new Error("Vector containing two values expected")}}function f(o,u,p){var d=nr(o)||nr(u)?i:null;if(nr(o)&&(o=o.toNumber()),nr(u)&&(u=u.toNumber()),!Qe(o)||o<1)throw new Error("Parameters in function identity must be positive integers");if(!Qe(u)||u<1)throw new Error("Parameters in function identity must be positive integers");var h=d?new i(1):1,x=d?new d(0):0,v=[o,u];if(p){if(p==="sparse")return s.diagonal(v,h,0,x);if(p==="dense")return a.diagonal(v,h,0,x);throw new TypeError('Unknown matrix type "'.concat(p,'"'))}for(var y=wa([],v,x),w=o{var{typed:r,matrix:t,multiplyScalar:n}=e;return r(QE,{"Matrix, Matrix":function(s,c){return t(i(s.toArray(),c.toArray()))},"Matrix, Array":function(s,c){return t(i(s.toArray(),c))},"Array, Matrix":function(s,c){return t(i(s,c.toArray()))},"Array, Array":i});function i(a,s){if(cr(a).length===1&&(a=[a]),cr(s).length===1&&(s=[s]),cr(a).length>2||cr(s).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(a.length)+", y = "+JSON.stringify(s.length)+")");var c=[],f=[];return a.map(function(o){return s.map(function(u){return f=[],c.push(f),o.map(function(p){return u.map(function(d){return f.push(n(p,d))})})})})&&c}});var XE="map",KV=["typed"],Yd=T(XE,KV,e=>{var{typed:r}=e;return r(XE,{"Array, function":jV,"Matrix, function":function(n,i){return n.map(i)}})});function jV(e,r){var t=function n(i,a){return Array.isArray(i)?i.map(function(s,c){return n(s,a.concat(c))}):Gi(r,i,a,e,"map")};return t(e,[])}var JE="diff",eY=["typed","matrix","subtract","number"],vf=T(JE,eY,e=>{var{typed:r,matrix:t,subtract:n,number:i}=e;return r(JE,{"Array | Matrix":function(u){return Xe(u)?t(s(u.toArray())):s(u)},"Array | Matrix, number":function(u,p){if(!Qe(p))throw new RangeError("Dimension must be a whole number");return Xe(u)?t(a(u.toArray(),p)):a(u,p)},"Array, BigNumber":r.referTo("Array,number",o=>(u,p)=>o(u,i(p))),"Matrix, BigNumber":r.referTo("Matrix,number",o=>(u,p)=>o(u,i(p)))});function a(o,u){if(Xe(o)&&(o=o.toArray()),!Array.isArray(o))throw RangeError("Array/Matrix does not have that many dimensions");if(u>0){var p=[];return o.forEach(d=>{p.push(a(d,u-1))}),p}else{if(u===0)return s(o);throw RangeError("Cannot have negative dimension")}}function s(o){for(var u=[],p=o.length,d=1;d{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r("ones",{"":function(){return t.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(o){var u=o[o.length-1];if(typeof u=="string"){var p=o.pop();return a(o,p)}else return t.matrix==="Array"?a(o):a(o,"default")},Array:a,Matrix:function(o){var u=o.storage();return a(o.valueOf(),u)},"Array | Matrix, string":function(o,u){return a(o.valueOf(),u)}});function a(f,o){var u=s(f),p=u?new i(1):1;if(c(f),o){var d=n(o);return f.length>0?d.resize(f,p):d}else{var h=[];return f.length>0?wa(h,f,p):h}}function s(f){var o=!1;return f.forEach(function(u,p,d){nr(u)&&(o=!0,d[p]=u.toNumber())}),o}function c(f){f.forEach(function(o){if(typeof o!="number"||!Qe(o)||o<0)throw new Error("Parameters in function ones must be positive integers")})}});function gf(){throw new Error('No "bignumber" implementation available')}function Gd(){throw new Error('No "fraction" implementation available')}function $d(){throw new Error('No "matrix" implementation available')}var KE="range",nY=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],xf=T(KE,nY,e=>{var{typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:c,largerEq:f,add:o,isPositive:u}=e;return r(KE,{string:d,"string, boolean":d,"number, number":function(y,w){return p(h(y,w,1,!1))},"number, number, number":function(y,w,E){return p(h(y,w,E,!1))},"number, number, boolean":function(y,w,E){return p(h(y,w,1,E))},"number, number, number, boolean":function(y,w,E,b){return p(h(y,w,E,b))},"BigNumber, BigNumber":function(y,w){var E=y.constructor;return p(h(y,w,new E(1),!1))},"BigNumber, BigNumber, BigNumber":function(y,w,E){return p(h(y,w,E,!1))},"BigNumber, BigNumber, boolean":function(y,w,E){var b=y.constructor;return p(h(y,w,new b(1),E))},"BigNumber, BigNumber, BigNumber, boolean":function(y,w,E,b){return p(h(y,w,E,b))},"Unit, Unit, Unit":function(y,w,E){return p(h(y,w,E,!1))},"Unit, Unit, Unit, boolean":function(y,w,E,b){return p(h(y,w,E,b))}});function p(v){return t.matrix==="Matrix"?n?n(v):$d():v}function d(v,y){var w=x(v);if(!w)throw new SyntaxError('String "'+v+'" is no valid range');return t.number==="BigNumber"?(i===void 0&&gf(),p(h(i(w.start),i(w.end),i(w.step)),y)):p(h(w.start,w.end,w.step,y))}function h(v,y,w,E){for(var b=[],A=u(w)?E?s:a:E?f:c,C=v;A(C,y);)b.push(C),C=o(C,w);return b}function x(v){var y=v.split(":"),w=y.map(function(b){return Number(b)}),E=w.some(function(b){return isNaN(b)});if(E)return null;switch(w.length){case 2:return{start:w[0],end:w[1],step:1};case 3:return{start:w[0],end:w[2],step:w[1]};default:return null}}});var jE="reshape",iY=["typed","isInteger","matrix"],Zd=T(jE,iY,e=>{var{typed:r,isInteger:t}=e;return r(jE,{"Matrix, Array":function(i,a){return i.reshape(a,!0)},"Array, Array":function(i,a){return a.forEach(function(s){if(!t(s))throw new TypeError("Invalid size for dimension: "+s)}),Xc(i,a)}})});var aY="resize",oY=["config","matrix"],Qd=T(aY,oY,e=>{var{config:r,matrix:t}=e;return function(a,s,c){if(arguments.length!==2&&arguments.length!==3)throw new Ci("resize",arguments.length,2,3);if(Xe(s)&&(s=s.valueOf()),nr(s[0])&&(s=s.map(function(u){return nr(u)?u.toNumber():u})),Xe(a))return a.resize(s,c,!0);if(typeof a=="string")return n(a,s,c);var f=Array.isArray(a)?!1:r.matrix!=="Array";if(s.length===0){for(;Array.isArray(a);)a=a[0];return or(a)}else{Array.isArray(a)||(a=[a]),a=or(a);var o=wa(a,s,c);return f?t(o):o}};function n(i,a,s){if(s!==void 0){if(typeof s!="string"||s.length!==1)throw new TypeError("Single character expected as defaultValue")}else s=" ";if(a.length!==1)throw new vr(a.length,1);var c=a[0];if(typeof c!="number"||!Qe(c))throw new TypeError("Invalid size, must contain positive integers (size: "+dr(a)+")");if(i.length>c)return i.substring(0,c);if(i.length{var{typed:r,multiply:t,rotationMatrix:n}=e;return r(eM,{"Array , number | BigNumber | Complex | Unit":function(s,c){i(s,2);var f=t(n(c),s);return f.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(s,c){return i(s,2),t(n(c),s)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(s,c,f){i(s,3);var o=t(n(c,f),s);return o},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(s,c,f){return i(s,3),t(n(c,f),s)}});function i(a,s){var c=Array.isArray(a)?cr(a):a.size();if(c.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(c.length===2&&c[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(s));if(c[0]!==s)throw new RangeError("Vector must be of dimensions 1x".concat(s))}});var rM="rotationMatrix",uY=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],Jd=T(rM,uY,e=>{var{typed:r,config:t,multiplyScalar:n,addScalar:i,unaryMinus:a,norm:s,BigNumber:c,matrix:f,DenseMatrix:o,SparseMatrix:u,cos:p,sin:d}=e;return r(rM,{"":function(){return t.matrix==="Matrix"?f([]):[]},string:function(b){return f(b)},"number | BigNumber | Complex | Unit":function(b){return h(b,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(b,A){return h(b,A)},"number | BigNumber | Complex | Unit, Array":function(b,A){var C=f(A);return x(C),w(b,C,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(b,A){x(A);var C=A.storage()||(t.matrix==="Matrix"?"dense":void 0);return w(b,A,C)},"number | BigNumber | Complex | Unit, Array, string":function(b,A,C){var S=f(A);return x(S),w(b,S,C)},"number | BigNumber | Complex | Unit, Matrix, string":function(b,A,C){return x(A),w(b,A,C)}});function h(E,b){var A=nr(E),C=A?new c(-1):-1,S=p(E),O=d(E),F=[[S,n(C,O)],[O,S]];return y(F,b)}function x(E){var b=E.size();if(b.length<1||b[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function v(E){return E.reduce((b,A)=>n(b,A))}function y(E,b){if(b){if(b==="sparse")return new u(E);if(b==="dense")return new o(E);throw new TypeError('Unknown matrix type "'.concat(b,'"'))}return E}function w(E,b,A){var C=s(b);if(C===0)throw new RangeError("Rotation around zero vector");var S=nr(E)?c:null,O=S?new S(1):1,F=S?new S(-1):-1,M=S?new S(b.get([0])/C):b.get([0])/C,_=S?new S(b.get([1])/C):b.get([1])/C,k=S?new S(b.get([2])/C):b.get([2])/C,L=p(E),Y=i(O,a(L)),$=d(E),V=i(L,v([M,M,Y])),q=i(v([M,_,Y]),v([F,k,$])),R=i(v([M,k,Y]),v([_,$])),j=i(v([M,_,Y]),v([k,$])),U=i(L,v([_,_,Y])),se=i(v([_,k,Y]),v([F,M,$])),de=i(v([M,k,Y]),v([F,_,$])),ae=i(v([_,k,Y]),v([M,$])),H=i(L,v([k,k,Y])),pe=[[V,q,R],[j,U,se],[de,ae,H]];return y(pe,A)}});var tM="row",fY=["typed","Index","matrix","range"],yf=T(tM,fY,e=>{var{typed:r,Index:t,matrix:n,range:i}=e;return r(tM,{"Matrix, number":a,"Array, number":function(c,f){return a(n(or(c)),f).valueOf()}});function a(s,c){if(s.size().length!==2)throw new Error("Only two dimensional matrix is supported");at(c,s.size()[0]);var f=i(0,s.size()[1]),o=new t(c,f),u=s.subset(o);return Xe(u)?u:n([[u]])}});var nM="size",cY=["typed","config","?matrix"],Kd=T(nM,cY,e=>{var{typed:r,config:t,matrix:n}=e;return r(nM,{Matrix:function(a){return a.create(a.size())},Array:cr,string:function(a){return t.matrix==="Array"?[a.length]:n([a.length])},"number | Complex | BigNumber | Unit | boolean | null":function(a){return t.matrix==="Array"?[]:n?n([]):$d()}})});var iM="squeeze",lY=["typed","matrix"],jd=T(iM,lY,e=>{var{typed:r,matrix:t}=e;return r(iM,{Array:function(i){return Ju(or(i))},Matrix:function(i){var a=Ju(i.toArray());return Array.isArray(a)?t(a):a},any:function(i){return or(i)}})});var aM="subset",pY=["typed","matrix","zeros","add"],bf=T(aM,pY,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e;return r(aM,{"Matrix, Index":function(c,f){return Xs(f)?t():(Qc(c,f),c.subset(f))},"Array, Index":r.referTo("Matrix, Index",function(s){return function(c,f){var o=s(t(c),f);return f.isScalar()?o:o.valueOf()}}),"Object, Index":dY,"string, Index":mY,"Matrix, Index, any, any":function(c,f,o,u){return Xs(f)?c:(Qc(c,f),c.clone().subset(f,a(o,f),u))},"Array, Index, any, any":r.referTo("Matrix, Index, any, any",function(s){return function(c,f,o,u){var p=s(t(c),f,o,u);return p.isMatrix?p.valueOf():p}}),"Array, Index, any":r.referTo("Matrix, Index, any, any",function(s){return function(c,f,o){return s(t(c),f,o,void 0).valueOf()}}),"Matrix, Index, any":r.referTo("Matrix, Index, any, any",function(s){return function(c,f,o){return s(c,f,o,void 0)}}),"string, Index, string":oM,"string, Index, string, string":oM,"Object, Index, any":hY});function a(s,c){if(typeof s=="string")throw new Error("can't boradcast a string");if(c._isScalar)return s;var f=c.size();if(f.every(o=>o>0))try{return i(s,n(f))}catch{return s}else return s}});function mY(e,r){if(!Va(r))throw new TypeError("Index expected");if(Xs(r))return"";if(Qc(Array.from(e),r),r.size().length!==1)throw new vr(r.size().length,1);var t=e.length;at(r.min()[0],t),at(r.max()[0],t);var n=r.dimension(0),i="";return n.forEach(function(a){i+=e.charAt(a)}),i}function oM(e,r,t,n){if(!r||r.isIndex!==!0)throw new TypeError("Index expected");if(Xs(r))return e;if(Qc(Array.from(e),r),r.size().length!==1)throw new vr(r.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=r.dimension(0),a=i.size()[0];if(a!==t.length)throw new vr(i.size()[0],t.length);var s=e.length;at(r.min()[0]),at(r.max()[0]);for(var c=[],f=0;fs)for(var o=s-1,u=c.length;o{var{typed:r,matrix:t}=e;return r(sM,{Array:s=>n(t(s)).valueOf(),Matrix:n,any:or});function n(s){var c=s.size(),f;switch(c.length){case 1:f=s.clone();break;case 2:{var o=c[0],u=c[1];if(u===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+dr(c)+")");switch(s.storage()){case"dense":f=i(s,o,u);break;case"sparse":f=a(s,o,u);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+dr(c)+")")}return f}function i(s,c,f){for(var o=s._data,u=[],p,d=0;d{var{typed:r,transpose:t,conj:n}=e;return r(uM,{any:function(a){return n(t(a))}})});var fM="zeros",xY=["typed","config","matrix","BigNumber"],th=T(fM,xY,e=>{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r(fM,{"":function(){return t.matrix==="Array"?a([]):a([],"default")},"...number | BigNumber | string":function(o){var u=o[o.length-1];if(typeof u=="string"){var p=o.pop();return a(o,p)}else return t.matrix==="Array"?a(o):a(o,"default")},Array:a,Matrix:function(o){var u=o.storage();return a(o.valueOf(),u)},"Array | Matrix, string":function(o,u){return a(o.valueOf(),u)}});function a(f,o){var u=s(f),p=u?new i(0):0;if(c(f),o){var d=n(o);return f.length>0?d.resize(f,p):d}else{var h=[];return f.length>0?wa(h,f,p):h}}function s(f){var o=!1;return f.forEach(function(u,p,d){nr(u)&&(o=!0,d[p]=u.toNumber())}),o}function c(f){f.forEach(function(o){if(typeof o!="number"||!Qe(o)||o<0)throw new Error("Parameters in function zeros must be positive integers")})}});var cM="fft",yY=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],nh=T(cM,yY,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:i,divideScalar:a,exp:s,tau:c,i:f,dotDivide:o,conj:u,pow:p,ceil:d,log2:h}=e;return r(cM,{Array:x,Matrix:function(b){return b.create(x(b.toArray()))}});function x(E){var b=cr(E);return b.length===1?w(E,b[0]):v(E.map(A=>x(A,b.slice(1))),0)}function v(E,b){var A=cr(E);if(b!==0)return new Array(A[0]).fill(0).map((S,O)=>v(E[O],b-1));if(A.length===1)return w(E);function C(S){var O=cr(S);return new Array(O[1]).fill(0).map((F,M)=>new Array(O[0]).fill(0).map((_,k)=>S[k][M]))}return C(v(C(E),1))}function y(E){for(var b=E.length,A=s(a(i(-1,i(f,c)),b)),C=[],S=1-b;Si(E[R],C[b-1+R])),...new Array(O-b).fill(0)],M=[...new Array(b+b-1).fill(0).map((q,R)=>a(1,C[R])),...new Array(O-(b+b-1)).fill(0)],_=w(F),k=w(M),L=new Array(O).fill(0).map((q,R)=>i(_[R],k[R])),Y=o(u(x(u(L))),O),$=[],V=b-1;VM%2===0),b/2),...w(E.filter((F,M)=>M%2===1),b/2)],C=0;C{var{typed:r,fft:t,dotDivide:n,conj:i}=e;return r(lM,{"Array | Matrix":function(s){var c=Xe(s)?s.size():cr(s);return n(i(t(i(s))),c.reduce((f,o)=>f*o,1))}})});function pM(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function wY(e){for(var r=1;r{var{typed:r,add:t,subtract:n,multiply:i,divide:a,max:s,map:c,abs:f,isPositive:o,isNegative:u,larger:p,smaller:d,matrix:h,bignumber:x,unaryMinus:v}=e;function y(F){return function(M,_,k,L){var Y=!(_.length===2&&(_.every(S)||_.every(jt)));if(Y)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var $=_[0],V=_[1],q=p(V,$),R=L.firstStep;if(R!==void 0&&!o(R))throw new Error('"firstStep" must be positive');var j=L.maxStep;if(j!==void 0&&!o(j))throw new Error('"maxStep" must be positive');var U=L.minStep;if(U&&u(U))throw new Error('"minStep" must be positive or zero');var se=[$,V,R,U,j].filter(Ue=>Ue!==void 0);if(!(se.every(S)||se.every(jt)))throw new Error('Inconsistent type of "t" dependant variables');for(var de=1,ae=L.tol?L.tol:1e-4,H=L.minDelta?L.minDelta:.2,pe=L.maxDelta?L.maxDelta:5,_e=L.maxIter?L.maxIter:1e4,me=[$,V,...k,j,U].some(nr),[xe,Ne,ye,we]=me?[x(F.a),x(F.c),x(F.b),x(F.bp)]:[F.a,F.c,F.b,F.bp],Se=R?q?R:v(R):a(n(V,$),de),Ce=[$],Ve=[k],Ke=n(ye,we),K=0,te=0,be=A(q),ee=C(q);be(Ce[K],V);){var ie=[];Se=ee(Ce[K],V,Se),ie.push(M(Ce[K],Ve[K]));for(var fe=1;fejt(Ue)?Ue.value:Ue)));Ee1/4&&(Ce.push(t(Ce[K],Se)),Ve.push(t(Ve[K],i(Se,ye,ie))),K++);var Me=.84*(ae/Ee)**(1/5);if(d(Me,H)?Me=H:p(Me,pe)&&(Me=pe),Me=me?x(Me):Me,Se=i(Se,Me),j&&p(f(Se),j)?Se=q?j:v(j):U&&d(f(Se),U)&&(Se=q?U:v(U)),te++,te>_e)throw new Error("Maximum number of iterations reached, try changing options")}return{t:Ce,y:Ve}}}function w(F,M,_,k){var L=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],Y=[null,1/2,3/4,1],$=[2/9,1/3,4/9,0],V=[7/24,1/4,1/3,1/8],q={a:L,c:Y,b:$,bp:V};return y(q)(F,M,_,k)}function E(F,M,_,k){var L=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],Y=[null,1/5,3/10,4/5,8/9,1,1],$=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],V=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],q={a:L,c:Y,b:$,bp:V};return y(q)(F,M,_,k)}function b(F,M,_,k){var L=k.method?k.method:"RK45",Y={RK23:w,RK45:E};if(L.toUpperCase()in Y){var $=wY({},k);return delete $.method,Y[L.toUpperCase()](F,M,_,$)}else{var V=Object.keys(Y).map(R=>'"'.concat(R,'"')),q="".concat(V.slice(0,-1).join(", ")," and ").concat(V.slice(-1));throw new Error('Unavailable method "'.concat(L,'". Available methods are ').concat(q))}}function A(F){return F?d:p}function C(F){var M=F?p:d;return function(_,k,L){var Y=t(_,L);return M(Y,k)?n(k,_):L}}function S(F){return nr(F)||fr(F)}function O(F,M,_,k){var L=b(F,M.toArray(),_.toArray(),k);return{t:h(L.t),y:h(L.y)}}return r("solveODE",{"function, Array, Array, Object":b,"function, Matrix, Matrix, Object":O,"function, Array, Array":(F,M,_)=>b(F,M,_,{}),"function, Matrix, Matrix":(F,M,_)=>O(F,M,_,{}),"function, Array, number | BigNumber | Unit":(F,M,_)=>{var k=b(F,M,[_],{});return{t:k.t,y:k.y.map(L=>L[0])}},"function, Matrix, number | BigNumber | Unit":(F,M,_)=>{var k=b(F,M.toArray(),[_],{});return{t:h(k.t),y:h(k.y.map(L=>L[0]))}},"function, Array, number | BigNumber | Unit, Object":(F,M,_,k)=>{var L=b(F,M,[_],k);return{t:L.t,y:L.y.map(Y=>Y[0])}},"function, Matrix, number | BigNumber | Unit, Object":(F,M,_,k)=>{var L=b(F,M.toArray(),[_],k);return{t:h(L.t),y:h(L.y.map(Y=>Y[0]))}}})});var NY="erf",AY=["typed"],oh=T(NY,AY,e=>{var{typed:r}=e;return r("name",{number:function(s){var c=Math.abs(s);return c>=MY?Vi(s):c<=CY?Vi(s)*t(c):c<=4?Vi(s)*(1-n(c)):Vi(s)*(1-i(c))},"Array | Matrix":r.referToSelf(a=>s=>rr(s,a))});function t(a){var s=a*a,c=So[0][4]*s,f=s,o;for(o=0;o<3;o+=1)c=(c+So[0][o])*s,f=(f+wf[0][o])*s;return a*(c+So[0][3])/(f+wf[0][3])}function n(a){var s=So[1][8]*a,c=a,f;for(f=0;f<7;f+=1)s=(s+So[1][f])*a,c=(c+wf[1][f])*a;var o=(s+So[1][7])/(c+wf[1][7]),u=parseInt(a*16)/16,p=(a-u)*(a+u);return Math.exp(-u*u)*Math.exp(-p)*o}function i(a){var s=1/(a*a),c=So[2][5]*s,f=s,o;for(o=0;o<4;o+=1)c=(c+So[2][o])*s,f=(f+wf[2][o])*s;var u=s*(c+So[2][4])/(f+wf[2][4]);u=(EY-u)/a,s=parseInt(a*16)/16;var p=(a-s)*(a+s);return Math.exp(-s*s)*Math.exp(-p)*u}}),CY=.46875,EY=.5641895835477563,So=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],wf=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],MY=Math.pow(2,53);var mM="zeta",_Y=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],sh=T(mM,_Y,e=>{var{typed:r,config:t,multiply:n,pow:i,divide:a,factorial:s,equal:c,smallerEq:f,isNegative:o,gamma:u,sin:p,subtract:d,add:h,Complex:x,BigNumber:v,pi:y}=e;return r(mM,{number:S=>w(S,O=>O,()=>20),BigNumber:S=>w(S,O=>new v(O),()=>Math.abs(Math.log10(t.epsilon))),Complex:E});function w(S,O,F){return c(S,0)?O(-.5):c(S,1)?O(NaN):isFinite(S)?b(S,O,F,M=>M):o(S)?O(NaN):O(1)}function E(S){return S.re===0&&S.im===0?new x(-.5):S.re===1?new x(NaN,NaN):S.re===1/0&&S.im===0?new x(1):S.im===1/0||S.re===-1/0?new x(NaN,NaN):b(S,O=>O,O=>Math.round(1.3*15+.9*Math.abs(O.im)),O=>O.re)}function b(S,O,F,M){var _=F(S);if(M(S)>-(_-1)/2)return C(S,O(_),O);var k=n(i(2,S),i(O(y),d(S,1)));return k=n(k,p(n(a(O(y),2),S))),k=n(k,u(d(1,S))),n(k,b(d(1,S),O,F,M))}function A(S,O){for(var F=S,M=S;f(M,O);M=h(M,1)){var _=a(n(s(h(O,d(M,1))),i(4,M)),n(s(d(O,M)),s(n(2,M))));F=h(F,_)}return n(O,F)}function C(S,O,F){for(var M=a(1,n(A(F(0),O),d(1,i(2,d(1,S))))),_=F(0),k=F(1);f(k,O);k=h(k,1))_=h(_,a(n((-1)**(k-1),A(k,O)),i(k,S)));return n(M,_)}});var dM="mode",TY=["typed","isNaN","isNumeric"],uh=T(dM,TY,e=>{var{typed:r,isNaN:t,isNumeric:n}=e;return r(dM,{"Array | Matrix":i,"...":function(s){return i(s)}});function i(a){a=wr(a.valueOf());var s=a.length;if(s===0)throw new Error("Cannot calculate mode of an empty array");for(var c={},f=[],o=0,u=0;uo&&(o=c[p],f=[p])}return f}});function kt(e,r,t){var n;return String(e).indexOf("Unexpected type")!==-1?(n=arguments.length>2?" (type: "+Ir(t)+", value: "+JSON.stringify(t)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+r+", unexpected type of argument"+n)):String(e).indexOf("complex numbers")!==-1?(n=arguments.length>2?" (type: "+Ir(t)+", value: "+JSON.stringify(t)+")":"",new TypeError("Cannot calculate "+r+", no ordering relation is defined for complex numbers"+n)):e}var hM="prod",FY=["typed","config","multiplyScalar","numeric"],fh=T(hM,FY,e=>{var{typed:r,config:t,multiplyScalar:n,numeric:i}=e;return r(hM,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(c,f){throw new Error("prod(A, dim) is not yet supported")},"...":function(c){return a(c)}});function a(s){var c;if(Bn(s,function(f){try{c=c===void 0?f:n(c,f)}catch(o){throw kt(o,"prod",f)}}),typeof c=="string"&&(c=i(c,t.number)),c===void 0)throw new Error("Cannot calculate prod of an empty array");return c}});var vM="format",OY=["typed"],ch=T(vM,OY,e=>{var{typed:r}=e;return r(vM,{any:dr,"any, Object | function | number | BigNumber":dr})});var gM="bin",BY=["typed","format"],lh=T(gM,BY,e=>{var{typed:r,format:t}=e;return r(gM,{"number | BigNumber":function(i){return t(i,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"bin",wordSize:a})}})});var xM="oct",IY=["typed","format"],ph=T(xM,IY,e=>{var{typed:r,format:t}=e;return r(xM,{"number | BigNumber":function(i){return t(i,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"oct",wordSize:a})}})});var yM="hex",PY=["typed","format"],mh=T(yM,PY,e=>{var{typed:r,format:t}=e;return r(yM,{"number | BigNumber":function(i){return t(i,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(i,a){return t(i,{notation:"hex",wordSize:a})}})});var dh=/\\$([\\w.]+)/g;var bM="print",kY=["typed"],Df=T(bM,kY,e=>{var{typed:r}=e;return r(bM,{"string, Object | Array":wM,"string, Object | Array, number | Object":wM})});function wM(e,r,t){return e.replace(dh,function(n,i){var a=i.split("."),s=r[a.shift()];for(s!==void 0&&s.isMatrix&&(s=s.toArray());a.length&&s!==void 0;){var c=a.shift();s=c?s[c]:s+"."}return s!==void 0?Ft(s)?s:dr(s,t):n})}var DM="to",RY=["typed","matrix","concat"],hh=T(DM,RY,e=>{var{typed:r,matrix:t,concat:n}=e,i=br({typed:r,matrix:t,concat:n});return r(DM,{"Unit, Unit | string":(a,s)=>a.to(s)},i({Ds:!0}))});var SM="isPrime",LY=["typed"],vh=T(SM,LY,e=>{var{typed:r}=e;return r(SM,{number:function(n){if(n*0!==0)return!1;if(n<=3)return n>1;if(n%2===0||n%3===0)return!1;for(var i=5;i*i<=n;i+=6)if(n%i===0||n%(i+2)===0)return!1;return!0},BigNumber:function(n){if(n.toNumber()*0!==0)return!1;if(n.lte(3))return n.gt(1);if(n.mod(2).eq(0)||n.mod(3).eq(0))return!1;if(n.lt(Math.pow(2,32))){for(var i=n.toNumber(),a=5;a*a<=i;a+=6)if(i%a===0||i%(a+2)===0)return!1;return!0}function s(E,b,A){for(var C=1;!b.eq(0);)b.mod(2).eq(0)?(b=b.div(2),E=E.mul(E).mod(A)):(b=b.sub(1),C=E.mul(C).mod(A));return C}var c=n.constructor.clone({precision:n.toFixed(0).length*2});n=new c(n);for(var f=0,o=n.sub(1);o.mod(2).eq(0);)o=o.div(2),f+=1;var u=null;if(n.lt("3317044064679887385961981"))u=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(E=>En=>rr(n,t))})});var qY="numeric",UY=["number","?bignumber","?fraction"],gh=T(qY,UY,e=>{var{number:r,bignumber:t,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:s=>r(s),BigNumber:t?s=>t(s):gf,Fraction:n?s=>n(s):Gd};return function(c){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",o=arguments.length>2?arguments[2]:void 0;if(o!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var u=Ir(c);if(!(u in i))throw new TypeError("Cannot convert "+c+' of type "'+u+'"; valid input types are '+Object.keys(i).join(", "));if(!(f in a))throw new TypeError("Cannot convert "+c+' to type "'+f+'"; valid output types are '+Object.keys(a).join(", "));return f===u?c:a[f](c)}});var NM="divideScalar",zY=["typed","numeric"],xh=T(NM,zY,e=>{var{typed:r,numeric:t}=e;return r(NM,{"number, number":function(i,a){return i/a},"Complex, Complex":function(i,a){return i.div(a)},"BigNumber, BigNumber":function(i,a){return i.div(a)},"Fraction, Fraction":function(i,a){return i.div(a)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,i)=>n.divide(i),"number | Fraction | Complex | BigNumber, Unit":(n,i)=>i.divideInto(n)})});var AM="pow",WY=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],yh=T(AM,WY,e=>{var{typed:r,config:t,identity:n,multiply:i,matrix:a,inv:s,number:c,fraction:f,Complex:o}=e;return r(AM,{"number, number":u,"Complex, Complex":function(x,v){return x.pow(v)},"BigNumber, BigNumber":function(x,v){return v.isInteger()||x>=0||t.predictable?x.pow(v):new o(x.toNumber(),0).pow(v.toNumber(),0)},"Fraction, Fraction":function(x,v){var y=x.pow(v);if(y!=null)return y;if(t.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return u(x.valueOf(),v.valueOf())},"Array, number":p,"Array, BigNumber":function(x,v){return p(x,v.toNumber())},"Matrix, number":d,"Matrix, BigNumber":function(x,v){return d(x,v.toNumber())},"Unit, number | BigNumber":function(x,v){return x.pow(v)}});function u(h,x){if(t.predictable&&!Qe(x)&&h<0)try{var v=f(x),y=c(v);if((x===y||Math.abs((x-y)/x)<1e-14)&&v.d%2===1)return(v.n%2===0?1:-1)*Math.pow(-h,x)}catch{}return t.predictable&&(h<-1&&x===1/0||h>-1&&h<0&&x===-1/0)?NaN:Qe(x)||h>=0||t.predictable?vD(h,x):h*h<1&&x===1/0||h*h>1&&x===-1/0?0:new o(h,0).pow(x,0)}function p(h,x){if(!Qe(x))throw new TypeError("For A^b, b must be an integer (value is "+x+")");var v=cr(h);if(v.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+v.length+" dimensions)");if(v[0]!==v[1])throw new Error("For A^b, A must be square (size is "+v[0]+"x"+v[1]+")");if(x<0)try{return p(s(h),-x)}catch(E){throw E.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+x+")"):E}for(var y=n(v[0]).valueOf(),w=h;x>=1;)(x&1)===1&&(y=i(w,y)),x>>=1,w=i(w,w);return y}function d(h,x){return a(p(h.valueOf(),x))}});var Sf="Number of decimals in function round must be an integer",CM="round",VY=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],bh=T(CM,VY,e=>{var{typed:r,config:t,matrix:n,equalScalar:i,zeros:a,BigNumber:s,DenseMatrix:c}=e,f=ot({typed:r,equalScalar:i}),o=Gr({typed:r,DenseMatrix:c}),u=$t({typed:r});function p(d){return Math.abs(Xu(d).exponent)}return r(CM,{number:function(h){var x=af(h,p(t.epsilon)),v=Bt(h,x,t.epsilon)?x:h;return af(v)},"number, number":function(h,x){var v=p(t.epsilon);if(x>=v)return af(h,x);var y=af(h,v),w=Bt(h,y,t.epsilon)?y:h;return af(w,x)},"number, BigNumber":function(h,x){if(!x.isInteger())throw new TypeError(Sf);return new s(h).toDecimalPlaces(x.toNumber())},Complex:function(h){return h.round()},"Complex, number":function(h,x){if(x%1)throw new TypeError(Sf);return h.round(x)},"Complex, BigNumber":function(h,x){if(!x.isInteger())throw new TypeError(Sf);var v=x.toNumber();return h.round(v)},BigNumber:function(h){var x=new s(h).toDecimalPlaces(p(t.epsilon)),v=en(h,x,t.epsilon)?x:h;return v.toDecimalPlaces(0)},"BigNumber, BigNumber":function(h,x){if(!x.isInteger())throw new TypeError(Sf);var v=p(t.epsilon);if(x>=v)return h.toDecimalPlaces(x.toNumber());var y=h.toDecimalPlaces(v),w=en(h,y,t.epsilon)?y:h;return w.toDecimalPlaces(x.toNumber())},Fraction:function(h){return h.round()},"Fraction, number":function(h,x){if(x%1)throw new TypeError(Sf);return h.round(x)},"Fraction, BigNumber":function(h,x){if(!x.isInteger())throw new TypeError(Sf);return h.round(x.toNumber())},"Unit, number, Unit":r.referToSelf(d=>function(h,x,v){var y=h.toNumeric(v);return v.multiply(d(y,x))}),"Unit, BigNumber, Unit":r.referToSelf(d=>(h,x,v)=>d(h,x.toNumber(),v)),"Unit, Unit":r.referToSelf(d=>(h,x)=>d(h,0,x)),"Array | Matrix, number, Unit":r.referToSelf(d=>(h,x,v)=>rr(h,y=>d(y,x,v),!0)),"Array | Matrix, BigNumber, Unit":r.referToSelf(d=>(h,x,v)=>d(h,x.toNumber(),v)),"Array | Matrix, Unit":r.referToSelf(d=>(h,x)=>d(h,0,x)),"Array | Matrix":r.referToSelf(d=>h=>rr(h,d,!0)),"SparseMatrix, number | BigNumber":r.referToSelf(d=>(h,x)=>f(h,x,d,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(d=>(h,x)=>u(h,x,d,!1)),"Array, number | BigNumber":r.referToSelf(d=>(h,x)=>u(n(h),x,d,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":r.referToSelf(d=>(h,x)=>i(h,0)?a(x.size(),x.storage()):o(x,h,d,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":r.referToSelf(d=>(h,x)=>i(h,0)?a(x.size(),x.storage()):u(x,h,d,!0)),"number | Complex | BigNumber | Fraction, Array":r.referToSelf(d=>(h,x)=>u(n(x),h,d,!0).valueOf())})});var EM="log",YY=["config","typed","divideScalar","Complex"],wh=T(EM,YY,e=>{var{typed:r,config:t,divideScalar:n,Complex:i}=e;return r(EM,{number:function(s){return s>=0||t.predictable?TC(s):new i(s,0).log()},Complex:function(s){return s.log()},BigNumber:function(s){return!s.isNegative()||t.predictable?s.ln():new i(s.toNumber(),0).log()},"any, any":r.referToSelf(a=>(s,c)=>n(a(s),a(c)))})});var MM="log1p",HY=["typed","config","divideScalar","log","Complex"],Dh=T(MM,HY,e=>{var{typed:r,config:t,divideScalar:n,log:i,Complex:a}=e;return r(MM,{number:function(f){return f>=-1||t.predictable?tm(f):s(new a(f,0))},Complex:s,BigNumber:function(f){var o=f.plus(1);return!o.isNegative()||t.predictable?o.ln():s(new a(f.toNumber(),0))},"Array | Matrix":r.referToSelf(c=>f=>rr(f,c)),"any, any":r.referToSelf(c=>(f,o)=>n(c(f),i(o)))});function s(c){var f=c.re+1;return new a(Math.log(Math.sqrt(f*f+c.im*c.im)),Math.atan2(c.im,f))}});var _M="nthRoots",GY=["config","typed","divideScalar","Complex"],Sh=T(_M,GY,e=>{var{typed:r,config:t,divideScalar:n,Complex:i}=e,a=[function(f){return new i(f,0)},function(f){return new i(0,f)},function(f){return new i(-f,0)},function(f){return new i(0,-f)}];function s(c,f){if(f<0)throw new Error("Root must be greater than zero");if(f===0)throw new Error("Root must be non-zero");if(f%1!==0)throw new Error("Root must be an integer");if(c===0||c.abs()===0)return[new i(0,0)];var o=typeof c=="number",u;(o||c.re===0||c.im===0)&&(o?u=2*+(c<0):c.im===0?u=2*+(c.re<0):u=2*+(c.im<0)+1);for(var p=c.arg(),d=c.abs(),h=[],x=Math.pow(d,1/f),v=0;v{var{typed:r,equalScalar:t,matrix:n,pow:i,DenseMatrix:a,concat:s}=e,c=yt({typed:r}),f=nn({typed:r,DenseMatrix:a}),o=ot({typed:r,equalScalar:t}),u=Gr({typed:r,DenseMatrix:a}),p=br({typed:r,matrix:n,concat:s}),d={};for(var h in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,h)&&!h.includes("Matrix")&&!h.includes("Array")&&(d[h]=i.signatures[h]);var x=r(d);return r(TM,p({elop:x,SS:f,DS:c,Ss:o,sS:u}))});var FM="dotDivide",ZY=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],Ah=T(FM,ZY,e=>{var{typed:r,matrix:t,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:s}=e,c=Zt({typed:r,equalScalar:n}),f=yt({typed:r}),o=nn({typed:r,DenseMatrix:a}),u=ot({typed:r,equalScalar:n}),p=Gr({typed:r,DenseMatrix:a}),d=br({typed:r,matrix:t,concat:s});return r(FM,d({elop:i,SS:o,DS:f,SD:c,Ss:u,sS:p}))});function Qa(e){var{DenseMatrix:r}=e;return function(n,i,a){var s=n.size();if(s.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+dr(s)+")");var c=s[0],f=s[1];if(c!==f)throw new RangeError("Matrix must be square (size: "+dr(s)+")");var o=[];if(Xe(i)){var u=i.size(),p=i._data;if(u.length===1){if(u[0]!==c)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var d=0;d{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:c}=e,f=Qa({DenseMatrix:c});return r(OM,{"SparseMatrix, Array | Matrix":function(d,h){return u(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return o(d,h)},"Array, Array | Matrix":function(d,h){var x=t(d),v=o(x,h);return v.valueOf()}});function o(p,d){d=f(p,d,!0);for(var h=d._data,x=p._size[0],v=p._size[1],y=[],w=p._data,E=0;EA&&(O.push(y[k]),F.push(L))}if(s(S,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var Y=n(C,S),$=0,V=F.length;${var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:c}=e,f=Qa({DenseMatrix:c});return r(BM,{"SparseMatrix, Array | Matrix":function(d,h){return u(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return o(d,h)},"Array, Array | Matrix":function(d,h){var x=t(d),v=o(x,h);return v.valueOf()}});function o(p,d){d=f(p,d,!0);for(var h=d._data,x=p._size[0],v=p._size[1],y=[],w=p._data,E=v-1;E>=0;E--){var b=h[E][0]||0,A=void 0;if(s(b,0))A=0;else{var C=w[E][E];if(s(C,0))throw new Error("Linear system cannot be solved since matrix is singular");A=n(b,C);for(var S=E-1;S>=0;S--)h[S]=[a(h[S][0]||0,i(A,w[S][E]))]}y[E]=[A]}return new c({data:y,size:[x,1]})}function u(p,d){d=f(p,d,!0);for(var h=d._data,x=p._size[0],v=p._size[1],y=p._values,w=p._index,E=p._ptr,b=[],A=v-1;A>=0;A--){var C=h[A][0]||0;if(s(C,0))b[A]=[0];else{for(var S=0,O=[],F=[],M=E[A],_=E[A+1],k=_-1;k>=M;k--){var L=w[k];L===A?S=y[k]:L{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:c}=e,f=Qa({DenseMatrix:c});return r(IM,{"SparseMatrix, Array | Matrix":function(d,h){return u(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return o(d,h)},"Array, Array | Matrix":function(d,h){var x=t(d),v=o(x,h);return v.map(y=>y.valueOf())}});function o(p,d){for(var h=[f(p,d,!0)._data.map(F=>F[0])],x=p._data,v=p._size[0],y=p._size[1],w=0;wnew c({data:F.map(M=>[M]),size:[v,1]}))}function u(p,d){for(var h=[f(p,d,!0)._data.map(de=>de[0])],x=p._size[0],v=p._size[1],y=p._values,w=p._index,E=p._ptr,b=0;bb&&(O.push(y[L]),F.push(Y))}if(s(k,0))if(s(S[b],0)){if(C===0){var R=[...S];R[b]=1;for(var j=0,U=F.length;jnew c({data:de.map(ae=>[ae]),size:[x,1]}))}});var PM="usolveAll",KY=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],_h=T(PM,KY,e=>{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtractScalar:a,equalScalar:s,DenseMatrix:c}=e,f=Qa({DenseMatrix:c});return r(PM,{"SparseMatrix, Array | Matrix":function(d,h){return u(d,h)},"DenseMatrix, Array | Matrix":function(d,h){return o(d,h)},"Array, Array | Matrix":function(d,h){var x=t(d),v=o(x,h);return v.map(y=>y.valueOf())}});function o(p,d){for(var h=[f(p,d,!0)._data.map(F=>F[0])],x=p._data,v=p._size[0],y=p._size[1],w=y-1;w>=0;w--)for(var E=h.length,b=0;b=0;O--)S[O]=a(S[O],x[O][w]);h.push(S)}}else{if(b===0)return[];h.splice(b,1),b-=1,E-=1}else{A[w]=n(A[w],x[w][w]);for(var C=w-1;C>=0;C--)A[C]=a(A[C],i(A[w],x[C][w]))}}return h.map(F=>new c({data:F.map(M=>[M]),size:[v,1]}))}function u(p,d){for(var h=[f(p,d,!0)._data.map(de=>de[0])],x=p._size[0],v=p._size[1],y=p._values,w=p._index,E=p._ptr,b=v-1;b>=0;b--)for(var A=h.length,C=0;C=M;L--){var Y=w[L];Y===b?k=y[L]:Ynew c({data:de.map(ae=>[ae]),size:[x,1]}))}});var jY="matAlgo08xS0Sid",eH=["typed","equalScalar"],Nf=T(jY,eH,e=>{var{typed:r,equalScalar:t}=e;return function(i,a,s){var c=i._values,f=i._index,o=i._ptr,u=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType(),d=a._values,h=a._index,x=a._ptr,v=a._size,y=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==v.length)throw new vr(u.length,v.length);if(u[0]!==v[0]||u[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+v+")");if(!c||!d)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var w=u[0],E=u[1],b,A=t,C=0,S=s;typeof p=="string"&&p===y&&p!=="mixed"&&(b=p,A=r.find(t,[b,b]),C=r.convert(0,b),S=r.find(s,[b,b]));for(var O=[],F=[],M=[],_=[],k=[],L,Y,$,V,q=0;q{var{typed:r,matrix:t}=e;return{"Array, number":r.referTo("DenseMatrix, number",n=>(i,a)=>n(t(i),a).valueOf()),"Array, BigNumber":r.referTo("DenseMatrix, BigNumber",n=>(i,a)=>n(t(i),a).valueOf()),"number, Array":r.referTo("number, DenseMatrix",n=>(i,a)=>n(i,t(a)).valueOf()),"BigNumber, Array":r.referTo("BigNumber, DenseMatrix",n=>(i,a)=>n(i,t(a)).valueOf())}});var kM="leftShift",rH=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],Th=T(kM,rH,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,c=In({typed:r}),f=Zt({typed:r,equalScalar:n}),o=Nf({typed:r,equalScalar:n}),u=ci({typed:r,DenseMatrix:a}),p=ot({typed:r,equalScalar:n}),d=$t({typed:r}),h=br({typed:r,matrix:t,concat:s}),x=Af({typed:r,matrix:t});return r(kM,{"number, number":wD,"BigNumber, BigNumber":CE,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():d(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):d(w,y,v,!0))},x,h({SS:o,DS:c,SD:f}))});var RM="rightArithShift",tH=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],Fh=T(RM,tH,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,c=In({typed:r}),f=Zt({typed:r,equalScalar:n}),o=Nf({typed:r,equalScalar:n}),u=ci({typed:r,DenseMatrix:a}),p=ot({typed:r,equalScalar:n}),d=$t({typed:r}),h=br({typed:r,matrix:t,concat:s}),x=Af({typed:r,matrix:t});return r(RM,{"number, number":DD,"BigNumber, BigNumber":EE,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():d(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):d(w,y,v,!0))},x,h({SS:o,DS:c,SD:f}))});var LM="rightLogShift",nH=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],Oh=T(LM,nH,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:s}=e,c=In({typed:r}),f=Zt({typed:r,equalScalar:n}),o=Nf({typed:r,equalScalar:n}),u=ci({typed:r,DenseMatrix:a}),p=ot({typed:r,equalScalar:n}),d=$t({typed:r}),h=br({typed:r,matrix:t,concat:s}),x=Af({typed:r,matrix:t});return r(LM,{"number, number":SD,"SparseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():p(y,w,v,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(v=>(y,w)=>n(w,0)?y.clone():d(y,w,v,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):u(w,y,v,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(v=>(y,w)=>n(y,0)?i(w.size(),w.storage()):d(w,y,v,!0))},x,h({SS:o,DS:c,SD:f}))});var qM="and",iH=["typed","matrix","equalScalar","zeros","not","concat"],Cf=T(qM,iH,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,c=Zt({typed:r,equalScalar:n}),f=cs({typed:r,equalScalar:n}),o=ot({typed:r,equalScalar:n}),u=$t({typed:r}),p=br({typed:r,matrix:t,concat:s});return r(qM,{"number, number":_D,"Complex, Complex":function(h,x){return(h.re!==0||h.im!==0)&&(x.re!==0||x.im!==0)},"BigNumber, BigNumber":function(h,x){return!h.isZero()&&!x.isZero()&&!h.isNaN()&&!x.isNaN()},"Unit, Unit":r.referToSelf(d=>(h,x)=>d(h.value||0,x.value||0)),"SparseMatrix, any":r.referToSelf(d=>(h,x)=>a(x)?i(h.size(),h.storage()):o(h,x,d,!1)),"DenseMatrix, any":r.referToSelf(d=>(h,x)=>a(x)?i(h.size(),h.storage()):u(h,x,d,!1)),"any, SparseMatrix":r.referToSelf(d=>(h,x)=>a(h)?i(h.size(),h.storage()):o(x,h,d,!0)),"any, DenseMatrix":r.referToSelf(d=>(h,x)=>a(h)?i(h.size(),h.storage()):u(x,h,d,!0)),"Array, any":r.referToSelf(d=>(h,x)=>d(t(h),x).valueOf()),"any, Array":r.referToSelf(d=>(h,x)=>d(h,t(x)).valueOf())},p({SS:f,DS:c}))});var Bh="compare",aH=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],Ih=T(Bh,aH,e=>{var{typed:r,config:t,equalScalar:n,matrix:i,BigNumber:a,Fraction:s,DenseMatrix:c,concat:f}=e,o=yt({typed:r}),u=fs({typed:r,equalScalar:n}),p=Gr({typed:r,DenseMatrix:c}),d=br({typed:r,matrix:i,concat:f}),h=Hi({typed:r});return r(Bh,oH({typed:r,config:t}),{"boolean, boolean":function(v,y){return v===y?0:v>y?1:-1},"BigNumber, BigNumber":function(v,y){return en(v,y,t.epsilon)?new a(0):new a(v.cmp(y))},"Fraction, Fraction":function(v,y){return new s(v.compare(y))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},h,d({SS:u,DS:o,Ss:p}))}),oH=T(Bh,["typed","config"],e=>{var{typed:r,config:t}=e;return r(Bh,{"number, number":function(i,a){return Bt(i,a,t.epsilon)?0:i>a?1:-1}})});var tu=Ui(zM(),1);var WM="compareNatural",sH=["typed","compare"],Ph=T(WM,sH,e=>{var{typed:r,compare:t}=e,n=t.signatures["boolean,boolean"];return r(WM,{"any, any":i});function i(f,o){var u=Ir(f),p=Ir(o),d;if((u==="number"||u==="BigNumber"||u==="Fraction")&&(p==="number"||p==="BigNumber"||p==="Fraction"))return d=t(f,o),d.toString()!=="0"?d>0?1:-1:(0,tu.default)(u,p);var h=["Array","DenseMatrix","SparseMatrix"];if(h.includes(u)||h.includes(p))return d=a(i,f,o),d!==0?d:(0,tu.default)(u,p);if(u!==p)return(0,tu.default)(u,p);if(u==="Complex")return uH(f,o);if(u==="Unit")return f.equalBase(o)?i(f.value,o.value):s(i,f.formatUnits(),o.formatUnits());if(u==="boolean")return n(f,o);if(u==="string")return(0,tu.default)(f,o);if(u==="Object")return c(i,f,o);if(u==="null"||u==="undefined")return 0;throw new TypeError('Unsupported type of value "'+u+'"')}function a(f,o,u){return Ni(o)&&Ni(u)?s(f,o.toJSON().values,u.toJSON().values):Ni(o)?a(f,o.toArray(),u):Ni(u)?a(f,o,u.toArray()):xo(o)?a(f,o.toJSON().data,u):xo(u)?a(f,o,u.toJSON().data):Array.isArray(o)?Array.isArray(u)?s(f,o,u):a(f,o,[u]):a(f,[o],u)}function s(f,o,u){for(var p=0,d=Math.min(o.length,u.length);pu.length?1:o.lengthr.re?1:e.rer.im?1:e.im{var{typed:r,matrix:t,concat:n}=e,i=br({typed:r,matrix:t,concat:n});return r(VM,om,i({elop:om,Ds:!0}))});var Rh="equal",cH=["typed","matrix","equalScalar","DenseMatrix","concat"],Lh=T(Rh,cH,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=yt({typed:r}),c=nn({typed:r,DenseMatrix:i}),f=Gr({typed:r,DenseMatrix:i}),o=br({typed:r,matrix:t,concat:a});return r(Rh,lH({typed:r,equalScalar:n}),o({elop:n,SS:c,DS:s,Ss:f}))}),lH=T(Rh,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(Rh,{"any, any":function(i,a){return i===null?a===null:a===null?i===null:i===void 0?a===void 0:a===void 0?i===void 0:t(i,a)}})});var YM="equalText",pH=["typed","compareText","isZero"],qh=T(YM,pH,e=>{var{typed:r,compareText:t,isZero:n}=e;return r(YM,{"any, any":function(a,s){return n(t(a,s))}})});var Uh="smaller",mH=["typed","config","matrix","DenseMatrix","concat"],zh=T(Uh,mH,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=yt({typed:r}),c=nn({typed:r,DenseMatrix:i}),f=Gr({typed:r,DenseMatrix:i}),o=br({typed:r,matrix:n,concat:a}),u=Hi({typed:r});return r(Uh,dH({typed:r,config:t}),{"boolean, boolean":(p,d)=>pp.compare(d)===-1,"Complex, Complex":function(d,h){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:c,DS:s,Ss:f}))}),dH=T(Uh,["typed","config"],e=>{var{typed:r,config:t}=e;return r(Uh,{"number, number":function(i,a){return i{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=yt({typed:r}),c=nn({typed:r,DenseMatrix:i}),f=Gr({typed:r,DenseMatrix:i}),o=br({typed:r,matrix:n,concat:a}),u=Hi({typed:r});return r(Wh,vH({typed:r,config:t}),{"boolean, boolean":(p,d)=>p<=d,"BigNumber, BigNumber":function(d,h){return d.lte(h)||en(d,h,t.epsilon)},"Fraction, Fraction":(p,d)=>p.compare(d)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:c,DS:s,Ss:f}))}),vH=T(Wh,["typed","config"],e=>{var{typed:r,config:t}=e;return r(Wh,{"number, number":function(i,a){return i<=a||Bt(i,a,t.epsilon)}})});var Yh="larger",gH=["typed","config","matrix","DenseMatrix","concat"],Hh=T(Yh,gH,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=yt({typed:r}),c=nn({typed:r,DenseMatrix:i}),f=Gr({typed:r,DenseMatrix:i}),o=br({typed:r,matrix:n,concat:a}),u=Hi({typed:r});return r(Yh,xH({typed:r,config:t}),{"boolean, boolean":(p,d)=>p>d,"BigNumber, BigNumber":function(d,h){return d.gt(h)&&!en(d,h,t.epsilon)},"Fraction, Fraction":(p,d)=>p.compare(d)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:c,DS:s,Ss:f}))}),xH=T(Yh,["typed","config"],e=>{var{typed:r,config:t}=e;return r(Yh,{"number, number":function(i,a){return i>a&&!Bt(i,a,t.epsilon)}})});var Gh="largerEq",yH=["typed","config","matrix","DenseMatrix","concat"],$h=T(Gh,yH,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,s=yt({typed:r}),c=nn({typed:r,DenseMatrix:i}),f=Gr({typed:r,DenseMatrix:i}),o=br({typed:r,matrix:n,concat:a}),u=Hi({typed:r});return r(Gh,bH({typed:r,config:t}),{"boolean, boolean":(p,d)=>p>=d,"BigNumber, BigNumber":function(d,h){return d.gte(h)||en(d,h,t.epsilon)},"Fraction, Fraction":(p,d)=>p.compare(d)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},u,o({SS:c,DS:s,Ss:f}))}),bH=T(Gh,["typed","config"],e=>{var{typed:r,config:t}=e;return r(Gh,{"number, number":function(i,a){return i>=a||Bt(i,a,t.epsilon)}})});var HM="deepEqual",wH=["typed","equal"],Zh=T(HM,wH,e=>{var{typed:r,equal:t}=e;return r(HM,{"any, any":function(a,s){return n(a.valueOf(),s.valueOf())}});function n(i,a){if(Array.isArray(i))if(Array.isArray(a)){var s=i.length;if(s!==a.length)return!1;for(var c=0;c{var{typed:r,config:t,equalScalar:n,matrix:i,DenseMatrix:a,concat:s}=e,c=yt({typed:r}),f=nn({typed:r,DenseMatrix:a}),o=Gr({typed:r,DenseMatrix:a}),u=br({typed:r,matrix:i,concat:s});return r(Qh,SH({typed:r,equalScalar:n}),u({elop:p,SS:f,DS:c,Ss:o}));function p(d,h){return!n(d,h)}}),SH=T(Qh,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(Qh,{"any, any":function(i,a){return i===null?a!==null:a===null?i!==null:i===void 0?a!==void 0:a===void 0?i!==void 0:!t(i,a)}})});var GM="partitionSelect",NH=["typed","isNumeric","isNaN","compare"],Jh=T(GM,NH,e=>{var{typed:r,isNumeric:t,isNaN:n,compare:i}=e,a=i,s=(o,u)=>-i(o,u);return r(GM,{"Array | Matrix, number":function(u,p){return c(u,p,a)},"Array | Matrix, number, string":function(u,p,d){if(d==="asc")return c(u,p,a);if(d==="desc")return c(u,p,s);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":c});function c(o,u,p){if(!Qe(u)||u<0)throw new Error("k must be a non-negative integer");if(Xe(o)){var d=o.size();if(d.length>1)throw new Error("Only one dimensional matrices supported");return f(o.valueOf(),u,p)}if(Array.isArray(o))return f(o,u,p)}function f(o,u,p){if(u>=o.length)throw new Error("k out of bounds");for(var d=0;d=0){var E=o[y];o[y]=o[v],o[v]=E,--y}else++v;p(o[v],w)>0&&--v,u<=v?x=v:h=v+1}return o[u]}});var $M="sort",AH=["typed","matrix","compare","compareNatural"],Kh=T($M,AH,e=>{var{typed:r,matrix:t,compare:n,compareNatural:i}=e,a=n,s=(u,p)=>-n(u,p);return r($M,{Array:function(p){return f(p),p.sort(a)},Matrix:function(p){return o(p),t(p.toArray().sort(a),p.storage())},"Array, function":function(p,d){return f(p),p.sort(d)},"Matrix, function":function(p,d){return o(p),t(p.toArray().sort(d),p.storage())},"Array, string":function(p,d){return f(p),p.sort(c(d))},"Matrix, string":function(p,d){return o(p),t(p.toArray().sort(c(d)),p.storage())}});function c(u){if(u==="asc")return a;if(u==="desc")return s;if(u==="natural")return i;throw new Error('String "asc", "desc", or "natural" expected')}function f(u){if(cr(u).length!==1)throw new Error("One dimensional array expected")}function o(u){if(u.size().length!==1)throw new Error("One dimensional matrix expected")}});var ZM="max",CH=["typed","config","numeric","larger"],Ef=T(ZM,CH,e=>{var{typed:r,config:t,numeric:n,larger:i}=e;return r(ZM,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(f,o){return ss(f,o.valueOf(),a)},"...":function(f){if(Yi(f))throw new TypeError("Scalar values expected in function max");return s(f)}});function a(c,f){try{return i(c,f)?c:f}catch(o){throw kt(o,"max",f)}}function s(c){var f;if(Bn(c,function(o){try{isNaN(o)&&typeof o=="number"?f=NaN:(f===void 0||i(o,f))&&(f=o)}catch(u){throw kt(u,"max",o)}}),f===void 0)throw new Error("Cannot calculate max of an empty array");return typeof f=="string"&&(f=n(f,t.number)),f}});var QM="min",EH=["typed","config","numeric","smaller"],Mf=T(QM,EH,e=>{var{typed:r,config:t,numeric:n,smaller:i}=e;return r(QM,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(f,o){return ss(f,o.valueOf(),a)},"...":function(f){if(Yi(f))throw new TypeError("Scalar values expected in function min");return s(f)}});function a(c,f){try{return i(c,f)?c:f}catch(o){throw kt(o,"min",f)}}function s(c){var f;if(Bn(c,function(o){try{isNaN(o)&&typeof o=="number"?f=NaN:(f===void 0||i(o,f))&&(f=o)}catch(u){throw kt(u,"min",o)}}),f===void 0)throw new Error("Cannot calculate min of an empty array");return typeof f=="string"&&(f=n(f,t.number)),f}});var MH="ImmutableDenseMatrix",_H=["smaller","DenseMatrix"],jh=T(MH,_H,e=>{var{smaller:r,DenseMatrix:t}=e;function n(i,a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(a&&!Ft(a))throw new Error("Invalid datatype: "+a);if(Xe(i)||Tr(i)){var s=new t(i,a);this._data=s._data,this._size=s._size,this._datatype=s._datatype,this._min=null,this._max=null}else if(i&&Tr(i.data)&&Tr(i.size))this._data=i.data,this._size=i.size,this._datatype=i.datatype,this._min=typeof i.min<"u"?i.min:null,this._max=typeof i.max<"u"?i.max:null;else{if(i)throw new TypeError("Unsupported type of data ("+Ir(i)+")");this._data=[],this._size=[0],this._datatype=a,this._min=null,this._max=null}}return n.prototype=new t,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(i){switch(arguments.length){case 1:{var a=t.prototype.subset.call(this,i);return Xe(a)?new n({data:a._data,size:a._size,datatype:a._datatype}):a}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:or(this._data),size:or(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(i){return new n(i)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var i=null;this.forEach(function(a){(i===null||r(a,i))&&(i=a)}),this._min=i!==null?i:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var i=null;this.forEach(function(a){(i===null||r(i,a))&&(i=a)}),this._max=i!==null?i:void 0}return this._max},n},{isClass:!0});var TH="Index",FH=["ImmutableDenseMatrix","getMatrixDataType"],ev=T(TH,FH,e=>{var{ImmutableDenseMatrix:r,getMatrixDataType:t}=e;function n(a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var s=0,c=arguments.length;s{t&&r.push(n)}),r}var OH="FibonacciHeap",BH=["smaller","larger"],rv=T(OH,BH,e=>{var{smaller:r,larger:t}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(u,p){var d={key:u,value:p,degree:0};if(this._minimum){var h=this._minimum;d.left=h,d.right=h.right,h.right=d,d.right.left=d,r(u,h.key)&&(this._minimum=d)}else d.left=d,d.right=d,this._minimum=d;return this._size++,d},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var u=this._minimum;if(u===null)return u;for(var p=this._minimum,d=u.degree,h=u.child;d>0;){var x=h.right;h.left.right=h.right,h.right.left=h.left,h.left=p,h.right=p.right,p.right=h,h.right.left=h,h.parent=null,h=x,d--}return u.left.right=u.right,u.right.left=u.left,u===u.right?p=null:(p=u.right,p=o(p,this._size)),this._size--,this._minimum=p,u},i.prototype.remove=function(u){this._minimum=a(this._minimum,u,-1),this.extractMinimum()};function a(u,p,d){p.key=d;var h=p.parent;return h&&r(p.key,h.key)&&(s(u,p,h),c(u,h)),r(p.key,u.key)&&(u=p),u}function s(u,p,d){p.left.right=p.right,p.right.left=p.left,d.degree--,d.child===p&&(d.child=p.right),d.degree===0&&(d.child=null),p.left=u,p.right=u.right,u.right=p,p.right.left=p,p.parent=null,p.mark=!1}function c(u,p){var d=p.parent;!d||(p.mark?(s(u,p,d),c(d)):p.mark=!0)}var f=function(p,d){p.left.right=p.right,p.right.left=p.left,p.parent=d,d.child?(p.left=d.child,p.right=d.child.right,d.child.right=p,p.right.left=p):(d.child=p,p.right=p,p.left=p),d.degree++,p.mark=!1};function o(u,p){var d=Math.floor(Math.log(p)*n)+1,h=new Array(d),x=0,v=u;if(v)for(x++,v=v.right;v!==u;)x++,v=v.right;for(var y;x>0;){for(var w=v.degree,E=v.right;y=h[w],!!y;){if(t(v.key,y.key)){var b=y;y=v,v=b}f(y,v),h[w]=null,w++}h[w]=v,v=E,x--}u=null;for(var A=0;A{var{addScalar:r,equalScalar:t,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(a,s){if(this._values[a])this._values[a].value=s;else{var c=this._heap.insert(a,s);this._values[a]=c}},i.prototype.get=function(a){var s=this._values[a];return s?s.value:0},i.prototype.accumulate=function(a,s){var c=this._values[a];c?c.value=r(c.value,s):(c=this._heap.insert(a,s),this._values[a]=c)},i.prototype.forEach=function(a,s,c){var f=this._heap,o=this._values,u=[],p=f.extractMinimum();for(p&&u.push(p);p&&p.key<=s;)p.key>=a&&(t(p.value,0)||c(p.key,p.value,this)),p=f.extractMinimum(),p&&u.push(p);for(var d=0;d{var{on:r,config:t,addScalar:n,subtractScalar:i,multiplyScalar:a,divideScalar:s,pow:c,abs:f,fix:o,round:u,equal:p,isNumeric:d,format:h,number:x,Complex:v,BigNumber:y,Fraction:w}=e,E=x;function b(K,te){if(!(this instanceof b))throw new Error("Constructor must be called with the new operator");if(!(K==null||d(K)||un(K)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,te===void 0)this.units=[],this.dimensions=j.map(ee=>0);else if(typeof te=="string"){var be=b.parse(te);this.units=be.units,this.dimensions=be.dimensions}else if(jt(te)&&te.value===null)this.fixPrefix=te.fixPrefix,this.skipAutomaticSimplification=te.skipAutomaticSimplification,this.dimensions=te.dimensions.slice(0),this.units=te.units.map(ee=>St({},ee));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(K)}Object.defineProperty(b,"name",{value:"Unit"}),b.prototype.constructor=b,b.prototype.type="Unit",b.prototype.isUnit=!0;var A,C,S;function O(){for(;S===" "||S===" ";)_()}function F(K){return K>="0"&&K<="9"||K==="."}function M(K){return K>="0"&&K<="9"}function _(){C++,S=A.charAt(C)}function k(K){C=K,S=A.charAt(C)}function L(){var K="",te=C;if(S==="+"?_():S==="-"&&(K+=S,_()),!F(S))return k(te),null;if(S==="."){if(K+=S,_(),!M(S))return k(te),null}else{for(;M(S);)K+=S,_();S==="."&&(K+=S,_())}for(;M(S);)K+=S,_();if(S==="E"||S==="e"){var be="",ee=C;if(be+=S,_(),(S==="+"||S==="-")&&(be+=S,_()),!M(S))return k(ee),K;for(K=K+be;M(S);)K+=S,_()}return K}function Y(){for(var K="";M(S)||b.isValidAlpha(S);)K+=S,_();var te=K.charAt(0);return b.isValidAlpha(te)?K:null}function $(K){return S===K?(_(),K):null}b.parse=function(K,te){if(te=te||{},A=K,C=-1,S="",typeof A!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var be=new b;be.units=[];var ee=1,ie=!1;_(),O();var fe=L(),Ee=null;if(fe){if(t.number==="BigNumber")Ee=new y(fe);else if(t.number==="Fraction")try{Ee=new w(fe)}catch{Ee=parseFloat(fe)}else Ee=parseFloat(fe);O(),$("*")?(ee=1,ie=!0):$("/")&&(ee=-1,ie=!0)}for(var Me=[],Ue=1;;){for(O();S==="(";)Me.push(ee),Ue*=ee,ee=1,_(),O();var ke=void 0;if(S){var lr=S;if(ke=Y(),ke===null)throw new SyntaxError('Unexpected "'+lr+'" in "'+A+'" at index '+C.toString())}else break;var ur=V(ke);if(ur===null)throw new SyntaxError('Unit "'+ke+'" not found.');var er=ee*Ue;if(O(),$("^")){O();var Lr=L();if(Lr===null)throw new SyntaxError('In "'+K+'", "^" must be followed by a floating-point number');er*=Lr}be.units.push({unit:ur.unit,prefix:ur.prefix,power:er});for(var re=0;re1||Math.abs(this.units[0].power-1)>1e-15},b.prototype._normalize=function(K){if(K==null||this.units.length===0)return K;for(var te=K,be=b._getNumberConverter(Ir(K)),ee=0;ee{if(Je(H,K)){var te=H[K],be=te.prefixes[""];return{unit:te,prefix:be}}for(var ee in H)if(Je(H,ee)&&QA(K,ee)){var ie=H[ee],fe=K.length-ee.length,Ee=K.substring(0,fe),Me=Je(ie.prefixes,Ee)?ie.prefixes[Ee]:void 0;if(Me!==void 0)return{unit:ie,prefix:Me}}return null},{hasher:K=>K[0],limit:100});b.isValuelessUnit=function(K){return V(K)!==null},b.prototype.hasBase=function(K){if(typeof K=="string"&&(K=U[K]),!K)return!1;for(var te=0;te1e-12)return!1;return!0},b.prototype.equalBase=function(K){for(var te=0;te1e-12)return!1;return!0},b.prototype.equals=function(K){return this.equalBase(K)&&p(this.value,K.value)},b.prototype.multiply=function(K){for(var te=this.clone(),be=jt(K)?K:new b(K),ee=0;ee1e-12&&(Je(xe,Me)?te.push({unit:xe[Me].unit,prefix:xe[Me].prefix,power:K.dimensions[Ee]||0}):fe=!0)}te.length1e-12)if(Je(me.si,ee))te.push({unit:me.si[ee].unit,prefix:me.si[ee].prefix,power:K.dimensions[be]||0});else throw new Error("Cannot express custom unit "+ee+" in SI units")}return K.units=te,K.fixPrefix=!0,K.skipAutomaticSimplification=!0,this.value!==null?(K.value=null,this.to(K)):K},b.prototype.formatUnits=function(){for(var K="",te="",be=0,ee=0,ie=0;ie0?(be++,K+=" "+this.units[ie].prefix.name+this.units[ie].unit.name,Math.abs(this.units[ie].power-1)>1e-15&&(K+="^"+this.units[ie].power)):this.units[ie].power<0&&ee++;if(ee>0)for(var fe=0;fe0?(te+=" "+this.units[fe].prefix.name+this.units[fe].unit.name,Math.abs(this.units[fe].power+1)>1e-15&&(te+="^"+-this.units[fe].power)):(te+=" "+this.units[fe].prefix.name+this.units[fe].unit.name,te+="^"+this.units[fe].power));K=K.substr(1),te=te.substr(1),be>1&&ee>0&&(K="("+K+")"),ee>1&&be>0&&(te="("+te+")");var Ee=K;return be>0&&ee>0&&(Ee+=" / "),Ee+=te,Ee},b.prototype.format=function(K){var te=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),be=!1;typeof te.value<"u"&&te.value!==null&&un(te.value)&&(be=Math.abs(te.value.re)<1e-14);for(var ee in te.units)Je(te.units,ee)&&te.units[ee].unit&&(te.units[ee].unit.name==="VA"&&be?te.units[ee].unit=H.VAR:te.units[ee].unit.name==="VAR"&&!be&&(te.units[ee].unit=H.VA));te.units.length===1&&!te.fixPrefix&&Math.abs(te.units[0].power-Math.round(te.units[0].power))<1e-14&&(te.units[0].prefix=te._bestPrefix());var ie=te._denormalize(te.value),fe=te.value!==null?h(ie,K||{}):"",Ee=te.formatUnits();return te.value&&un(te.value)&&(fe="("+fe+")"),Ee.length>0&&fe.length>0&&(fe+=" "),fe+=Ee,fe},b.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var K=this.value!==null?f(this.value):0,te=f(this.units[0].unit.value),be=this.units[0].prefix;if(K===0)return be;var ee=this.units[0].power,ie=Math.log(K/Math.pow(be.value*te,ee))/Math.LN10-1.2;if(ie>-2.200001&&ie<1.800001)return be;ie=Math.abs(ie);var fe=this.units[0].unit.prefixes;for(var Ee in fe)if(Je(fe,Ee)){var Me=fe[Ee];if(Me.scientific){var Ue=Math.abs(Math.log(K/Math.pow(Me.value*te,ee))/Math.LN10-1.2);(Ue0)},H={meter:{name:"meter",base:U.LENGTH,prefixes:R.LONG,value:1,offset:0},inch:{name:"inch",base:U.LENGTH,prefixes:R.NONE,value:.0254,offset:0},foot:{name:"foot",base:U.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yard:{name:"yard",base:U.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mile:{name:"mile",base:U.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},link:{name:"link",base:U.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rod:{name:"rod",base:U.LENGTH,prefixes:R.NONE,value:5.0292,offset:0},chain:{name:"chain",base:U.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:U.LENGTH,prefixes:R.NONE,value:1e-10,offset:0},m:{name:"m",base:U.LENGTH,prefixes:R.SHORT,value:1,offset:0},in:{name:"in",base:U.LENGTH,prefixes:R.NONE,value:.0254,offset:0},ft:{name:"ft",base:U.LENGTH,prefixes:R.NONE,value:.3048,offset:0},yd:{name:"yd",base:U.LENGTH,prefixes:R.NONE,value:.9144,offset:0},mi:{name:"mi",base:U.LENGTH,prefixes:R.NONE,value:1609.344,offset:0},li:{name:"li",base:U.LENGTH,prefixes:R.NONE,value:.201168,offset:0},rd:{name:"rd",base:U.LENGTH,prefixes:R.NONE,value:5.02921,offset:0},ch:{name:"ch",base:U.LENGTH,prefixes:R.NONE,value:20.1168,offset:0},mil:{name:"mil",base:U.LENGTH,prefixes:R.NONE,value:254e-7,offset:0},m2:{name:"m2",base:U.SURFACE,prefixes:R.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:U.SURFACE,prefixes:R.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:U.SURFACE,prefixes:R.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:U.SURFACE,prefixes:R.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:U.SURFACE,prefixes:R.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:U.SURFACE,prefixes:R.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:U.SURFACE,prefixes:R.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:U.SURFACE,prefixes:R.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:U.SURFACE,prefixes:R.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:U.SURFACE,prefixes:R.NONE,value:1e4,offset:0},m3:{name:"m3",base:U.VOLUME,prefixes:R.CUBIC,value:1,offset:0},L:{name:"L",base:U.VOLUME,prefixes:R.SHORT,value:.001,offset:0},l:{name:"l",base:U.VOLUME,prefixes:R.SHORT,value:.001,offset:0},litre:{name:"litre",base:U.VOLUME,prefixes:R.LONG,value:.001,offset:0},cuin:{name:"cuin",base:U.VOLUME,prefixes:R.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:U.VOLUME,prefixes:R.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:U.VOLUME,prefixes:R.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:U.VOLUME,prefixes:R.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:U.VOLUME,prefixes:R.NONE,value:15e-6,offset:0},drop:{name:"drop",base:U.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:U.VOLUME,prefixes:R.NONE,value:5e-8,offset:0},minim:{name:"minim",base:U.VOLUME,prefixes:R.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:U.VOLUME,prefixes:R.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:U.VOLUME,prefixes:R.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:U.VOLUME,prefixes:R.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:U.VOLUME,prefixes:R.NONE,value:1e-6,offset:0},cup:{name:"cup",base:U.VOLUME,prefixes:R.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:U.VOLUME,prefixes:R.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:U.VOLUME,prefixes:R.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:U.VOLUME,prefixes:R.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:U.VOLUME,prefixes:R.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:U.VOLUME,prefixes:R.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:U.VOLUME,prefixes:R.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:U.VOLUME,prefixes:R.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:U.VOLUME,prefixes:R.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:U.VOLUME,prefixes:R.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:U.VOLUME,prefixes:R.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:U.VOLUME,prefixes:R.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:U.VOLUME,prefixes:R.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:U.VOLUME,prefixes:R.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:U.VOLUME,prefixes:R.NONE,value:.1173478,offset:0},obl:{name:"obl",base:U.VOLUME,prefixes:R.NONE,value:.1589873,offset:0},g:{name:"g",base:U.MASS,prefixes:R.SHORT,value:.001,offset:0},gram:{name:"gram",base:U.MASS,prefixes:R.LONG,value:.001,offset:0},ton:{name:"ton",base:U.MASS,prefixes:R.SHORT,value:907.18474,offset:0},t:{name:"t",base:U.MASS,prefixes:R.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:U.MASS,prefixes:R.LONG,value:1e3,offset:0},grain:{name:"grain",base:U.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:U.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:U.MASS,prefixes:R.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:U.MASS,prefixes:R.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:U.MASS,prefixes:R.NONE,value:45.359237,offset:0},stick:{name:"stick",base:U.MASS,prefixes:R.NONE,value:.115,offset:0},stone:{name:"stone",base:U.MASS,prefixes:R.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:U.MASS,prefixes:R.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:U.MASS,prefixes:R.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:U.MASS,prefixes:R.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:U.MASS,prefixes:R.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:U.MASS,prefixes:R.NONE,value:45.359237,offset:0},s:{name:"s",base:U.TIME,prefixes:R.SHORT,value:1,offset:0},min:{name:"min",base:U.TIME,prefixes:R.NONE,value:60,offset:0},h:{name:"h",base:U.TIME,prefixes:R.NONE,value:3600,offset:0},second:{name:"second",base:U.TIME,prefixes:R.LONG,value:1,offset:0},sec:{name:"sec",base:U.TIME,prefixes:R.LONG,value:1,offset:0},minute:{name:"minute",base:U.TIME,prefixes:R.NONE,value:60,offset:0},hour:{name:"hour",base:U.TIME,prefixes:R.NONE,value:3600,offset:0},day:{name:"day",base:U.TIME,prefixes:R.NONE,value:86400,offset:0},week:{name:"week",base:U.TIME,prefixes:R.NONE,value:7*86400,offset:0},month:{name:"month",base:U.TIME,prefixes:R.NONE,value:2629800,offset:0},year:{name:"year",base:U.TIME,prefixes:R.NONE,value:31557600,offset:0},decade:{name:"decade",base:U.TIME,prefixes:R.NONE,value:315576e3,offset:0},century:{name:"century",base:U.TIME,prefixes:R.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:U.TIME,prefixes:R.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:U.FREQUENCY,prefixes:R.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:U.FREQUENCY,prefixes:R.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:U.ANGLE,prefixes:R.SHORT,value:1,offset:0},radian:{name:"radian",base:U.ANGLE,prefixes:R.LONG,value:1,offset:0},deg:{name:"deg",base:U.ANGLE,prefixes:R.SHORT,value:null,offset:0},degree:{name:"degree",base:U.ANGLE,prefixes:R.LONG,value:null,offset:0},grad:{name:"grad",base:U.ANGLE,prefixes:R.SHORT,value:null,offset:0},gradian:{name:"gradian",base:U.ANGLE,prefixes:R.LONG,value:null,offset:0},cycle:{name:"cycle",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:U.ANGLE,prefixes:R.NONE,value:null,offset:0},A:{name:"A",base:U.CURRENT,prefixes:R.SHORT,value:1,offset:0},ampere:{name:"ampere",base:U.CURRENT,prefixes:R.LONG,value:1,offset:0},K:{name:"K",base:U.TEMPERATURE,prefixes:R.SHORT,value:1,offset:0},degC:{name:"degC",base:U.TEMPERATURE,prefixes:R.SHORT,value:1,offset:273.15},degF:{name:"degF",base:U.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:459.67},degR:{name:"degR",base:U.TEMPERATURE,prefixes:R.SHORT,value:new w(5,9),offset:0},kelvin:{name:"kelvin",base:U.TEMPERATURE,prefixes:R.LONG,value:1,offset:0},celsius:{name:"celsius",base:U.TEMPERATURE,prefixes:R.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:U.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:459.67},rankine:{name:"rankine",base:U.TEMPERATURE,prefixes:R.LONG,value:new w(5,9),offset:0},mol:{name:"mol",base:U.AMOUNT_OF_SUBSTANCE,prefixes:R.SHORT,value:1,offset:0},mole:{name:"mole",base:U.AMOUNT_OF_SUBSTANCE,prefixes:R.LONG,value:1,offset:0},cd:{name:"cd",base:U.LUMINOUS_INTENSITY,prefixes:R.SHORT,value:1,offset:0},candela:{name:"candela",base:U.LUMINOUS_INTENSITY,prefixes:R.LONG,value:1,offset:0},N:{name:"N",base:U.FORCE,prefixes:R.SHORT,value:1,offset:0},newton:{name:"newton",base:U.FORCE,prefixes:R.LONG,value:1,offset:0},dyn:{name:"dyn",base:U.FORCE,prefixes:R.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:U.FORCE,prefixes:R.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:U.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:U.FORCE,prefixes:R.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:U.FORCE,prefixes:R.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:U.FORCE,prefixes:R.NONE,value:9.80665,offset:0},J:{name:"J",base:U.ENERGY,prefixes:R.SHORT,value:1,offset:0},joule:{name:"joule",base:U.ENERGY,prefixes:R.LONG,value:1,offset:0},erg:{name:"erg",base:U.ENERGY,prefixes:R.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:U.ENERGY,prefixes:R.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:U.ENERGY,prefixes:R.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:U.ENERGY,prefixes:R.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:U.ENERGY,prefixes:R.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:U.POWER,prefixes:R.SHORT,value:1,offset:0},watt:{name:"watt",base:U.POWER,prefixes:R.LONG,value:1,offset:0},hp:{name:"hp",base:U.POWER,prefixes:R.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:U.POWER,prefixes:R.SHORT,value:v.I,offset:0},VA:{name:"VA",base:U.POWER,prefixes:R.SHORT,value:1,offset:0},Pa:{name:"Pa",base:U.PRESSURE,prefixes:R.SHORT,value:1,offset:0},psi:{name:"psi",base:U.PRESSURE,prefixes:R.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:U.PRESSURE,prefixes:R.NONE,value:101325,offset:0},bar:{name:"bar",base:U.PRESSURE,prefixes:R.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:U.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:U.PRESSURE,prefixes:R.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:U.PRESSURE,prefixes:R.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:U.PRESSURE,prefixes:R.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:U.ELECTRIC_CHARGE,prefixes:R.LONG,value:1,offset:0},C:{name:"C",base:U.ELECTRIC_CHARGE,prefixes:R.SHORT,value:1,offset:0},farad:{name:"farad",base:U.ELECTRIC_CAPACITANCE,prefixes:R.LONG,value:1,offset:0},F:{name:"F",base:U.ELECTRIC_CAPACITANCE,prefixes:R.SHORT,value:1,offset:0},volt:{name:"volt",base:U.ELECTRIC_POTENTIAL,prefixes:R.LONG,value:1,offset:0},V:{name:"V",base:U.ELECTRIC_POTENTIAL,prefixes:R.SHORT,value:1,offset:0},ohm:{name:"ohm",base:U.ELECTRIC_RESISTANCE,prefixes:R.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:U.ELECTRIC_INDUCTANCE,prefixes:R.LONG,value:1,offset:0},H:{name:"H",base:U.ELECTRIC_INDUCTANCE,prefixes:R.SHORT,value:1,offset:0},siemens:{name:"siemens",base:U.ELECTRIC_CONDUCTANCE,prefixes:R.LONG,value:1,offset:0},S:{name:"S",base:U.ELECTRIC_CONDUCTANCE,prefixes:R.SHORT,value:1,offset:0},weber:{name:"weber",base:U.MAGNETIC_FLUX,prefixes:R.LONG,value:1,offset:0},Wb:{name:"Wb",base:U.MAGNETIC_FLUX,prefixes:R.SHORT,value:1,offset:0},tesla:{name:"tesla",base:U.MAGNETIC_FLUX_DENSITY,prefixes:R.LONG,value:1,offset:0},T:{name:"T",base:U.MAGNETIC_FLUX_DENSITY,prefixes:R.SHORT,value:1,offset:0},b:{name:"b",base:U.BIT,prefixes:R.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:U.BIT,prefixes:R.BINARY_LONG,value:1,offset:0},B:{name:"B",base:U.BIT,prefixes:R.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:U.BIT,prefixes:R.BINARY_LONG,value:8,offset:0}},pe={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function _e(K){if(K.number==="BigNumber"){var te=al(y);H.rad.value=new y(1),H.deg.value=te.div(180),H.grad.value=te.div(200),H.cycle.value=te.times(2),H.arcsec.value=te.div(648e3),H.arcmin.value=te.div(10800)}else H.rad.value=1,H.deg.value=Math.PI/180,H.grad.value=Math.PI/200,H.cycle.value=Math.PI*2,H.arcsec.value=Math.PI/648e3,H.arcmin.value=Math.PI/10800;H.radian.value=H.rad.value,H.degree.value=H.deg.value,H.gradian.value=H.grad.value}_e(t),r&&r("config",function(K,te){K.number!==te.number&&_e(K)});var me={si:{NONE:{unit:ae,prefix:R.NONE[""]},LENGTH:{unit:H.m,prefix:R.SHORT[""]},MASS:{unit:H.g,prefix:R.SHORT.k},TIME:{unit:H.s,prefix:R.SHORT[""]},CURRENT:{unit:H.A,prefix:R.SHORT[""]},TEMPERATURE:{unit:H.K,prefix:R.SHORT[""]},LUMINOUS_INTENSITY:{unit:H.cd,prefix:R.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:H.mol,prefix:R.SHORT[""]},ANGLE:{unit:H.rad,prefix:R.SHORT[""]},BIT:{unit:H.bits,prefix:R.SHORT[""]},FORCE:{unit:H.N,prefix:R.SHORT[""]},ENERGY:{unit:H.J,prefix:R.SHORT[""]},POWER:{unit:H.W,prefix:R.SHORT[""]},PRESSURE:{unit:H.Pa,prefix:R.SHORT[""]},ELECTRIC_CHARGE:{unit:H.C,prefix:R.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:H.F,prefix:R.SHORT[""]},ELECTRIC_POTENTIAL:{unit:H.V,prefix:R.SHORT[""]},ELECTRIC_RESISTANCE:{unit:H.ohm,prefix:R.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:H.H,prefix:R.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:H.S,prefix:R.SHORT[""]},MAGNETIC_FLUX:{unit:H.Wb,prefix:R.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:H.T,prefix:R.SHORT[""]},FREQUENCY:{unit:H.Hz,prefix:R.SHORT[""]}}};me.cgs=JSON.parse(JSON.stringify(me.si)),me.cgs.LENGTH={unit:H.m,prefix:R.SHORT.c},me.cgs.MASS={unit:H.g,prefix:R.SHORT[""]},me.cgs.FORCE={unit:H.dyn,prefix:R.SHORT[""]},me.cgs.ENERGY={unit:H.erg,prefix:R.NONE[""]},me.us=JSON.parse(JSON.stringify(me.si)),me.us.LENGTH={unit:H.ft,prefix:R.NONE[""]},me.us.MASS={unit:H.lbm,prefix:R.NONE[""]},me.us.TEMPERATURE={unit:H.degF,prefix:R.NONE[""]},me.us.FORCE={unit:H.lbf,prefix:R.NONE[""]},me.us.ENERGY={unit:H.BTU,prefix:R.BTU[""]},me.us.POWER={unit:H.hp,prefix:R.NONE[""]},me.us.PRESSURE={unit:H.psi,prefix:R.NONE[""]},me.auto=JSON.parse(JSON.stringify(me.si));var xe=me.auto;b.setUnitSystem=function(K){if(Je(me,K))xe=me[K];else throw new Error("Unit system "+K+" does not exist. Choices are: "+Object.keys(me).join(", "))},b.getUnitSystem=function(){for(var K in me)if(Je(me,K)&&me[K]===xe)return K},b.typeConverters={BigNumber:function(te){return te!=null&&te.isFraction?new y(te.n).div(te.d).times(te.s):new y(te+"")},Fraction:function(te){return new w(te)},Complex:function(te){return te},number:function(te){return te!=null&&te.isFraction?x(te):te}},b.prototype._numberConverter=function(){var K=b.typeConverters[this.valueType()];if(K)return K;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},b._getNumberConverter=function(K){if(!b.typeConverters[K])throw new TypeError('Unsupported type "'+K+'"');return b.typeConverters[K]};for(var Ne in H)if(Je(H,Ne)){var ye=H[Ne];ye.dimensions=ye.base.dimensions}for(var we in pe)if(Je(pe,we)){var Se=H[pe[we]],Ce={};for(var Ve in Se)Je(Se,Ve)&&(Ce[Ve]=Se[Ve]);Ce.name=we,H[we]=Ce}b.isValidAlpha=function(te){return/^[a-zA-Z]$/.test(te)};function Ke(K){for(var te=0;te0&&!(b.isValidAlpha(S)||M(S)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+K+'"')}}return b.createUnit=function(K,te){if(typeof K!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(te&&te.override){for(var be in K)if(Je(K,be)&&b.deleteUnit(be),K[be].aliases)for(var ee=0;ee"u"||te===null)&&(te={}),typeof K!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(Je(H,K))throw new Error('Cannot create unit "'+K+'": a unit with that name already exists');Ke(K);var be=null,ee=[],ie=0,fe,Ee,Me;if(te&&te.type==="Unit")be=te.clone();else if(typeof te=="string")te!==""&&(fe=te);else if(typeof te=="object")fe=te.definition,Ee=te.prefixes,ie=te.offset,Me=te.baseName,te.aliases&&(ee=te.aliases.valueOf());else throw new TypeError('Cannot create unit "'+K+'" from "'+te.toString()+'": expecting "string" or "Unit" or "Object"');if(ee){for(var Ue=0;Ue1e-12){le=!1;break}if(le){Lr=!0,ke.base=U[re];break}}if(!Lr){Me=Me||K+"_STUFF";var Ie={dimensions:be.dimensions.slice(0)};Ie.key=Me,U[Me]=Ie,xe[Me]={unit:ke,prefix:R.NONE[""]},ke.base=U[Me]}}else{if(Me=Me||K+"_STUFF",j.indexOf(Me)>=0)throw new Error('Cannot create new base unit "'+K+'": a base unit with that name already exists (and cannot be overridden)');j.push(Me);for(var lr in U)Je(U,lr)&&(U[lr].dimensions[j.length-1]=0);for(var ur={dimensions:[]},er=0;er{var{typed:r,Unit:t}=e;return r(r_,{Unit:function(i){return i.clone()},string:function(i){return t.isValuelessUnit(i)?new t(null,i):t.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,a){return new t(i,a)},"number | BigNumber | Fraction":function(i){return new t(i)},"Array | Matrix":r.referToSelf(n=>i=>rr(i,n))})});var t_="sparse",qH=["typed","SparseMatrix"],ov=T(t_,qH,e=>{var{typed:r,SparseMatrix:t}=e;return r(t_,{"":function(){return new t([])},string:function(i){return new t([],i)},"Array | Matrix":function(i){return new t(i)},"Array | Matrix, string":function(i,a){return new t(i,a)}})});var n_="createUnit",UH=["typed","Unit"],sv=T(n_,UH,e=>{var{typed:r,Unit:t}=e;return r(n_,{"Object, Object":function(i,a){return t.createUnit(i,a)},Object:function(i){return t.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,a,s){var c={};return c[i]=a,t.createUnit(c,s)},"string, Unit | string | Object":function(i,a){var s={};return s[i]=a,t.createUnit(s,{})},string:function(i){var a={};return a[i]={},t.createUnit(a,{})}})});var i_="acos",zH=["typed","config","Complex"],uv=T(i_,zH,e=>{var{typed:r,config:t,Complex:n}=e;return r(i_,{number:function(a){return a>=-1&&a<=1||t.predictable?Math.acos(a):new n(a,0).acos()},Complex:function(a){return a.acos()},BigNumber:function(a){return a.acos()}})});var a_="acosh",WH=["typed","config","Complex"],fv=T(a_,WH,e=>{var{typed:r,config:t,Complex:n}=e;return r(a_,{number:function(a){return a>=1||t.predictable?OD(a):a<=-1?new n(Math.log(Math.sqrt(a*a-1)-a),Math.PI):new n(a,0).acosh()},Complex:function(a){return a.acosh()},BigNumber:function(a){return a.acosh()}})});var o_="acot",VH=["typed","BigNumber"],cv=T(o_,VH,e=>{var{typed:r,BigNumber:t}=e;return r(o_,{number:BD,Complex:function(i){return i.acot()},BigNumber:function(i){return new t(1).div(i).atan()}})});var s_="acoth",YH=["typed","config","Complex","BigNumber"],lv=T(s_,YH,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(s_,{number:function(s){return s>=1||s<=-1||t.predictable?ID(s):new n(s,0).acoth()},Complex:function(s){return s.acoth()},BigNumber:function(s){return new i(1).div(s).atanh()}})});var u_="acsc",HH=["typed","config","Complex","BigNumber"],pv=T(u_,HH,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(u_,{number:function(s){return s<=-1||s>=1||t.predictable?PD(s):new n(s,0).acsc()},Complex:function(s){return s.acsc()},BigNumber:function(s){return new i(1).div(s).asin()}})});var f_="acsch",GH=["typed","BigNumber"],mv=T(f_,GH,e=>{var{typed:r,BigNumber:t}=e;return r(f_,{number:kD,Complex:function(i){return i.acsch()},BigNumber:function(i){return new t(1).div(i).asinh()}})});var c_="asec",$H=["typed","config","Complex","BigNumber"],dv=T(c_,$H,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(c_,{number:function(s){return s<=-1||s>=1||t.predictable?RD(s):new n(s,0).asec()},Complex:function(s){return s.asec()},BigNumber:function(s){return new i(1).div(s).acos()}})});var l_="asech",ZH=["typed","config","Complex","BigNumber"],hv=T(l_,ZH,e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(l_,{number:function(s){if(s<=1&&s>=-1||t.predictable){var c=1/s;if(c>0||t.predictable)return LD(s);var f=Math.sqrt(c*c-1);return new n(Math.log(f-c),Math.PI)}return new n(s,0).asech()},Complex:function(s){return s.asech()},BigNumber:function(s){return new i(1).div(s).acosh()}})});var p_="asin",QH=["typed","config","Complex"],vv=T(p_,QH,e=>{var{typed:r,config:t,Complex:n}=e;return r(p_,{number:function(a){return a>=-1&&a<=1||t.predictable?Math.asin(a):new n(a,0).asin()},Complex:function(a){return a.asin()},BigNumber:function(a){return a.asin()}})});var XH="asinh",JH=["typed"],gv=T(XH,JH,e=>{var{typed:r}=e;return r("asinh",{number:qD,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})});var KH="atan",jH=["typed"],xv=T(KH,jH,e=>{var{typed:r}=e;return r("atan",{number:function(n){return Math.atan(n)},Complex:function(n){return n.atan()},BigNumber:function(n){return n.atan()}})});var m_="atan2",eG=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],yv=T(m_,eG,e=>{var{typed:r,matrix:t,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:s}=e,c=Zt({typed:r,equalScalar:n}),f=yt({typed:r}),o=Nd({typed:r,equalScalar:n}),u=ot({typed:r,equalScalar:n}),p=Gr({typed:r,DenseMatrix:a}),d=br({typed:r,matrix:t,concat:s});return r(m_,{"number, number":Math.atan2,"BigNumber, BigNumber":(h,x)=>i.atan2(h,x)},d({scalar:"number | BigNumber",SS:o,DS:f,SD:c,Ss:u,sS:p}))});var d_="atanh",rG=["typed","config","Complex"],bv=T(d_,rG,e=>{var{typed:r,config:t,Complex:n}=e;return r(d_,{number:function(a){return a<=1&&a>=-1||t.predictable?UD(a):new n(a,0).atanh()},Complex:function(a){return a.atanh()},BigNumber:function(a){return a.atanh()}})});var $i=T("trigUnit",["typed"],e=>{var{typed:r}=e;return{Unit:r.referToSelf(t=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return r.find(t,n.valueType())(n.value)})}});var h_="cos",tG=["typed"],wv=T(h_,tG,e=>{var{typed:r}=e,t=$i({typed:r});return r(h_,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},t)});var v_="cosh",nG=["typed"],Dv=T(v_,nG,e=>{var{typed:r}=e;return r(v_,{number:im,"Complex | BigNumber":t=>t.cosh()})});var g_="cot",iG=["typed","BigNumber"],Sv=T(g_,iG,e=>{var{typed:r,BigNumber:t}=e,n=$i({typed:r});return r(g_,{number:zD,Complex:i=>i.cot(),BigNumber:i=>new t(1).div(i.tan())},n)});var x_="coth",aG=["typed","BigNumber"],Nv=T(x_,aG,e=>{var{typed:r,BigNumber:t}=e;return r(x_,{number:WD,Complex:n=>n.coth(),BigNumber:n=>new t(1).div(n.tanh())})});var y_="csc",oG=["typed","BigNumber"],Av=T(y_,oG,e=>{var{typed:r,BigNumber:t}=e,n=$i({typed:r});return r(y_,{number:VD,Complex:i=>i.csc(),BigNumber:i=>new t(1).div(i.sin())},n)});var b_="csch",sG=["typed","BigNumber"],Cv=T(b_,sG,e=>{var{typed:r,BigNumber:t}=e;return r(b_,{number:YD,Complex:n=>n.csch(),BigNumber:n=>new t(1).div(n.sinh())})});var w_="sec",uG=["typed","BigNumber"],Ev=T(w_,uG,e=>{var{typed:r,BigNumber:t}=e,n=$i({typed:r});return r(w_,{number:HD,Complex:i=>i.sec(),BigNumber:i=>new t(1).div(i.cos())},n)});var D_="sech",fG=["typed","BigNumber"],Mv=T(D_,fG,e=>{var{typed:r,BigNumber:t}=e;return r(D_,{number:GD,Complex:n=>n.sech(),BigNumber:n=>new t(1).div(n.cosh())})});var S_="sin",cG=["typed"],_v=T(S_,cG,e=>{var{typed:r}=e,t=$i({typed:r});return r(S_,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},t)});var N_="sinh",lG=["typed"],Tv=T(N_,lG,e=>{var{typed:r}=e;return r(N_,{number:$D,"Complex | BigNumber":t=>t.sinh()})});var A_="tan",pG=["typed"],Fv=T(A_,pG,e=>{var{typed:r}=e,t=$i({typed:r});return r(A_,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},t)});var mG="tanh",dG=["typed"],Ov=T(mG,dG,e=>{var{typed:r}=e;return r("tanh",{number:am,"Complex | BigNumber":t=>t.tanh()})});var C_="setCartesian",hG=["typed","size","subset","compareNatural","Index","DenseMatrix"],Bv=T(C_,hG,e=>{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(C_,{"Array | Matrix, Array | Matrix":function(f,o){var u=[];if(n(t(f),new a(0))!==0&&n(t(o),new a(0))!==0){var p=wr(Array.isArray(f)?f:f.toArray()).sort(i),d=wr(Array.isArray(o)?o:o.toArray()).sort(i);u=[];for(var h=0;h{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(E_,{"Array | Matrix, Array | Matrix":function(f,o){var u;if(n(t(f),new a(0))===0)u=[];else{if(n(t(o),new a(0))===0)return wr(f.toArray());var p=yo(wr(Array.isArray(f)?f:f.toArray()).sort(i)),d=yo(wr(Array.isArray(o)?o:o.toArray()).sort(i));u=[];for(var h,x=0;x{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(M_,{"Array | Matrix":function(f){var o;if(n(t(f),new a(0))===0)o=[];else{var u=wr(Array.isArray(f)?f:f.toArray()).sort(i);o=[],o.push(u[0]);for(var p=1;p{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:s}=e;return r(__,{"Array | Matrix, Array | Matrix":function(f,o){var u;if(n(t(f),new a(0))===0||n(t(o),new a(0))===0)u=[];else{var p=yo(wr(Array.isArray(f)?f:f.toArray()).sort(i)),d=yo(wr(Array.isArray(o)?o:o.toArray()).sort(i));u=[];for(var h=0;h{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(T_,{"Array | Matrix, Array | Matrix":function(c,f){if(n(t(c),new a(0))===0)return!0;if(n(t(f),new a(0))===0)return!1;for(var o=yo(wr(Array.isArray(c)?c:c.toArray()).sort(i)),u=yo(wr(Array.isArray(f)?f:f.toArray()).sort(i)),p,d=0;d{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(F_,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(c,f){if(n(t(f),new a(0))===0)return 0;for(var o=wr(Array.isArray(f)?f:f.toArray()),u=0,p=0;p{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(O_,{"Array | Matrix":function(o){if(n(t(o),new a(0))===0)return[];for(var u=wr(Array.isArray(o)?o:o.toArray()).sort(i),p=[],d=0;d.toString(2).length<=u.length;)p.push(s(u,d.toString(2).split("").reverse())),d++;return c(p)}});function s(f,o){for(var u=[],p=0;p0;u--)for(var p=0;pf[p+1].length&&(o=f[p],f[p]=f[p+1],f[p+1]=o);return f}});var B_="setSize",DG=["typed","compareNatural"],Uv=T(B_,DG,e=>{var{typed:r,compareNatural:t}=e;return r(B_,{"Array | Matrix":function(i){return Array.isArray(i)?wr(i).length:wr(i.toArray()).length},"Array | Matrix, boolean":function(i,a){if(a===!1||i.length===0)return Array.isArray(i)?wr(i).length:wr(i.toArray()).length;for(var s=wr(Array.isArray(i)?i:i.toArray()).sort(t),c=1,f=1;f{var{typed:r,size:t,concat:n,subset:i,setDifference:a,Index:s}=e;return r(I_,{"Array | Matrix, Array | Matrix":function(f,o){if(i(t(f),new s(0))===0)return wr(o);if(i(t(o),new s(0))===0)return wr(f);var u=wr(f),p=wr(o);return n(a(u,p),a(p,u))}})});var P_="setUnion",NG=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],Wv=T(P_,NG,e=>{var{typed:r,size:t,concat:n,subset:i,setIntersect:a,setSymDifference:s,Index:c}=e;return r(P_,{"Array | Matrix, Array | Matrix":function(o,u){if(i(t(o),new c(0))===0)return wr(u);if(i(t(u),new c(0))===0)return wr(o);var p=wr(o),d=wr(u);return n(s(p,d),a(p,d))}})});var k_="add",AG=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],Vv=T(k_,AG,e=>{var{typed:r,matrix:t,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:s,concat:c}=e,f=In({typed:r}),o=ff({typed:r,equalScalar:i}),u=ci({typed:r,DenseMatrix:a}),p=br({typed:r,matrix:t,concat:c});return r(k_,{"any, any":n,"any, any, ...any":r.referToSelf(d=>(h,x,v)=>{for(var y=d(h,x),w=0;w{var{typed:r,abs:t,addScalar:n,divideScalar:i,multiplyScalar:a,sqrt:s,smaller:c,isPositive:f}=e;return r(R_,{"... number | BigNumber":o,Array:o,Matrix:u=>o(wr(u.toArray()))});function o(u){for(var p=0,d=0,h=0;h{var{typed:r,abs:t,add:n,pow:i,conj:a,sqrt:s,multiply:c,equalScalar:f,larger:o,smaller:u,matrix:p,ctranspose:d,eigs:h}=e;return r(L_,{number:Math.abs,Complex:function(F){return F.abs()},BigNumber:function(F){return F.abs()},boolean:function(F){return Math.abs(F)},Array:function(F){return S(p(F),2)},Matrix:function(F){return S(F,2)},"Array, number | BigNumber | string":function(F,M){return S(p(F),M)},"Matrix, number | BigNumber | string":function(F,M){return S(F,M)}});function x(O){var F=0;return O.forEach(function(M){var _=t(M);o(_,F)&&(F=_)},!0),F}function v(O){var F;return O.forEach(function(M){var _=t(M);(!F||u(_,F))&&(F=_)},!0),F||0}function y(O,F){if(F===Number.POSITIVE_INFINITY||F==="inf")return x(O);if(F===Number.NEGATIVE_INFINITY||F==="-inf")return v(O);if(F==="fro")return S(O,2);if(typeof F=="number"&&!isNaN(F)){if(!f(F,0)){var M=0;return O.forEach(function(_){M=n(i(t(_),F),M)},!0),i(M,1/F)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function w(O){var F=0;return O.forEach(function(M,_){F=n(F,c(M,a(M)))}),t(s(F))}function E(O){var F=[],M=0;return O.forEach(function(_,k){var L=k[1],Y=n(F[L]||0,t(_));o(Y,M)&&(M=Y),F[L]=Y},!0),M}function b(O){var F=O.size();if(F[0]!==F[1])throw new RangeError("Invalid matrix dimensions");var M=d(O),_=c(M,O),k=h(_).values.toArray(),L=k[k.length-1];return t(s(L))}function A(O){var F=[],M=0;return O.forEach(function(_,k){var L=k[0],Y=n(F[L]||0,t(_));o(Y,M)&&(M=Y),F[L]=Y},!0),M}function C(O,F){if(F===1)return E(O);if(F===Number.POSITIVE_INFINITY||F==="inf")return A(O);if(F==="fro")return w(O);if(F===2)return b(O);throw new Error("Unsupported parameter value "+F)}function S(O,F){var M=O.size();if(M.length===1)return y(O,F);if(M.length===2){if(M[0]&&M[1])return C(O,F);throw new RangeError("Invalid matrix dimensions")}}});var q_="dot",MG=["typed","addScalar","multiplyScalar","conj","size"],Gv=T(q_,MG,e=>{var{typed:r,addScalar:t,multiplyScalar:n,conj:i,size:a}=e;return r(q_,{"Array | DenseMatrix, Array | DenseMatrix":c,"SparseMatrix, SparseMatrix":f});function s(u,p){var d=o(u),h=o(p),x,v;if(d.length===1)x=d[0];else if(d.length===2&&d[1]===1)x=d[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+d.join(", ")+")");if(h.length===1)v=h[0];else if(h.length===2&&h[1]===1)v=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(x!==v)throw new RangeError("Vectors must have equal length ("+x+" != "+v+")");if(x===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return x}function c(u,p){var d=s(u,p),h=Xe(u)?u._data:u,x=Xe(u)?u._datatype||u.getDataType():void 0,v=Xe(p)?p._data:p,y=Xe(p)?p._datatype||p.getDataType():void 0,w=o(u).length===2,E=o(p).length===2,b=t,A=n;if(x&&y&&x===y&&typeof x=="string"&&x!=="mixed"){var C=x;b=r.find(t,[C,C]),A=r.find(n,[C,C])}if(!w&&!E){for(var S=A(i(h[0]),v[0]),O=1;OS){A++;continue}C===S&&(y=w(y,E(h[b],v[A])),b++,A++)}return y}function o(u){return Xe(u)?u.size():a(u)}});var _G="trace",TG=["typed","matrix","add"],$v=T(_G,TG,e=>{var{typed:r,matrix:t,add:n}=e;return r("trace",{Array:function(c){return i(t(c))},SparseMatrix:a,DenseMatrix:i,any:or});function i(s){var c=s._size,f=s._data;switch(c.length){case 1:if(c[0]===1)return or(f[0]);throw new RangeError("Matrix must be square (size: "+dr(c)+")");case 2:{var o=c[0],u=c[1];if(o===u){for(var p=0,d=0;d0)for(var x=0;xx)break}return h}throw new RangeError("Matrix must be square (size: "+dr(u)+")")}});var U_="index",FG=["typed","Index"],Zv=T(U_,FG,e=>{var{typed:r,Index:t}=e;return r(U_,{"...number | string | BigNumber | Range | Array | Matrix":function(i){var a=i.map(function(c){return nr(c)?c.toNumber():Tr(c)||Xe(c)?c.map(function(f){return nr(f)?f.toNumber():f}):c}),s=new t;return t.apply(s,a),s}})});var Qv=new Set(["end"]);var OG="Node",BG=["mathWithTransform"],Xv=T(OG,BG,e=>{var{mathWithTransform:r}=e;function t(i){for(var a of[...Qv])if(i.has(a))throw new Error('Scope contains an illegal symbol, "'+a+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(a){return this.compile().evaluate(a)}compile(){var a=this._compile(r,{}),s={},c=null;function f(o){var u=bo(o);return t(u),a(u,s,c)}return{evaluate:f}}_compile(a,s){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(a){throw new Error("Cannot run forEach on a Node interface")}map(a){throw new Error("Cannot run map on a Node interface")}_ifNode(a){if(!Mr(a))throw new TypeError("Callback function must return a Node");return a}traverse(a){a(this,null,null);function s(c,f){c.forEach(function(o,u,p){f(o,u,p),s(o,f)})}s(this,a)}transform(a){function s(c,f,o){var u=a(c,f,o);return u!==c?u:c.map(s)}return s(this,null,null)}filter(a){var s=[];return this.traverse(function(c,f,o){a(c,f,o)&&s.push(c)}),s}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(a){return a.cloneDeep()})}equals(a){return a?this.type===a.type&&ya(this,a):!1}toString(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toString(a)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toHTML(a)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(a){var s=this._getCustomString(a);return typeof s<"u"?s:this._toTex(a)}_toTex(a){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(a){if(a&&typeof a=="object")switch(typeof a.handler){case"object":case"undefined":return;case"function":return a.handler(this,a);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function bt(e){return e&&e.isIndexError?new pn(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function Jv(e){var{subset:r}=e;return function(n,i){try{if(Array.isArray(n))return r(n,i);if(n&&typeof n.subset=="function")return n.subset(i);if(typeof n=="string")return r(n,i);if(typeof n=="object"){if(!i.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return _t(n,i.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(a){throw bt(a)}}}var Kv="AccessorNode",IG=["subset","Node"],jv=T(Kv,IG,e=>{var{subset:r,Node:t}=e,n=Jv({subset:r});function i(s){return!(Gn(s)||fn(s)||Sr(s)||En(s)||Ha(s)||cn(s)||ct(s))}class a extends t{constructor(c,f){if(super(),!Mr(c))throw new TypeError('Node expected for parameter "object"');if(!oi(f))throw new TypeError('IndexNode expected for parameter "index"');this.object=c,this.index=f}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Kv}get isAccessorNode(){return!0}_compile(c,f){var o=this.object._compile(c,f),u=this.index._compile(c,f);if(this.index.isObjectProperty()){var p=this.index.getObjectProperty();return function(h,x,v){return _t(o(h,x,v),p)}}else return function(h,x,v){var y=o(h,x,v),w=u(h,x,y);return n(y,w)}}forEach(c){c(this.object,"object",this),c(this.index,"index",this)}map(c){return new a(this._ifNode(c(this.object,"object",this)),this._ifNode(c(this.index,"index",this)))}clone(){return new a(this.object,this.index)}_toString(c){var f=this.object.toString(c);return i(this.object)&&(f="("+f+")"),f+this.index.toString(c)}_toHTML(c){var f=this.object.toHTML(c);return i(this.object)&&(f='('+f+')'),f+this.index.toHTML(c)}_toTex(c){var f=this.object.toTex(c);return i(this.object)&&(f="\\\\left(' + object + '\\\\right)"),f+this.index.toTex(c)}toJSON(){return{mathjs:Kv,object:this.object,index:this.index}}static fromJSON(c){return new a(c.object,c.index)}}return Zr(a,"name",Kv),a},{isClass:!0,isNode:!0});var eg="ArrayNode",PG=["Node"],rg=T(eg,PG,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),this.items=i||[],!Array.isArray(this.items)||!this.items.every(Mr))throw new TypeError("Array containing Nodes expected")}get type(){return eg}get isArrayNode(){return!0}_compile(i,a){var s=si(this.items,function(o){return o._compile(i,a)}),c=i.config.matrix!=="Array";if(c){var f=i.matrix;return function(u,p,d){return f(si(s,function(h){return h(u,p,d)}))}}else return function(u,p,d){return si(s,function(h){return h(u,p,d)})}}forEach(i){for(var a=0;a['+a.join(',')+']'}_toTex(i){function a(s,c){var f=s.some(fn)&&!s.every(fn),o=c||f,u=o?"&":"\\\\\\\\",p=s.map(function(d){return d.items?a(d.items,!c):d.toTex(i)}).join(u);return f||!o||o&&!c?"\\\\begin{bmatrix}"+p+"\\\\end{bmatrix}":p}return a(this.items,!1)}}return Zr(t,"name",eg),t},{isClass:!0,isNode:!0});function z_(e){var{subset:r,matrix:t}=e;return function(i,a,s){try{if(Array.isArray(i)){var c=t(i).subset(a,s).valueOf();return c.forEach((f,o)=>{i[o]=f}),i}else{if(i&&typeof i.subset=="function")return i.subset(a,s);if(typeof i=="string")return r(i,a,s);if(typeof i=="object"){if(!a.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return Ga(i,a.getObjectProperty(),s),i}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(f){throw bt(f)}}}var Zi=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function tg(e,r){if(!r||r!=="auto")return e;for(var t=e;cn(t);)t=t.content;return t}function rt(e,r,t,n){var i=e;r!=="keep"&&(i=e.getContent());for(var a=i.getIdentifier(),s=null,c=0;c{var{subset:r,matrix:t,Node:n}=e,i=Jv({subset:r}),a=z_({subset:r,matrix:t});function s(f,o,u){o||(o="keep");var p=rt(f,o,u),d=rt(f.value,o,u);return o==="all"||d!==null&&d<=p}class c extends n{constructor(o,u,p){if(super(),this.object=o,this.index=p?u:null,this.value=p||u,!ct(o)&&!Gn(o))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(ct(o)&&o.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!oi(this.index))throw new TypeError('IndexNode expected as "index"');if(!Mr(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return ig}get isAssignmentNode(){return!0}_compile(o,u){var p=this.object._compile(o,u),d=this.index?this.index._compile(o,u):null,h=this.value._compile(o,u),x=this.object.name;if(this.index)if(this.index.isObjectProperty()){var v=this.index.getObjectProperty();return function(A,C,S){var O=p(A,C,S),F=h(A,C,S);return Ga(O,v,F),F}}else{if(ct(this.object))return function(A,C,S){var O=p(A,C,S),F=h(A,C,S),M=d(A,C,O);return A.set(x,a(O,M,F)),F};var y=this.object.object._compile(o,u);if(this.object.index.isObjectProperty()){var w=this.object.index.getObjectProperty();return function(A,C,S){var O=y(A,C,S),F=_t(O,w),M=d(A,C,F),_=h(A,C,S);return Ga(O,w,a(F,M,_)),_}}else{var E=this.object.index._compile(o,u);return function(A,C,S){var O=y(A,C,S),F=E(A,C,O),M=i(O,F),_=d(A,C,M),k=h(A,C,S);return a(O,F,a(M,_,k)),k}}}else{if(!ct(this.object))throw new TypeError("SymbolNode expected as object");return function(A,C,S){var O=h(A,C,S);return A.set(x,O),O}}}forEach(o){o(this.object,"object",this),this.index&&o(this.index,"index",this),o(this.value,"value",this)}map(o){var u=this._ifNode(o(this.object,"object",this)),p=this.index?this._ifNode(o(this.index,"index",this)):null,d=this._ifNode(o(this.value,"value",this));return new c(u,p,d)}clone(){return new c(this.object,this.index,this.value)}_toString(o){var u=this.object.toString(o),p=this.index?this.index.toString(o):"",d=this.value.toString(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(d="("+d+")"),u+p+" = "+d}toJSON(){return{mathjs:ig,object:this.object,index:this.index,value:this.value}}static fromJSON(o){return new c(o.object,o.index,o.value)}_toHTML(o){var u=this.object.toHTML(o),p=this.index?this.index.toHTML(o):"",d=this.value.toHTML(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(d='('+d+')'),u+p+'='+d}_toTex(o){var u=this.object.toTex(o),p=this.index?this.index.toTex(o):"",d=this.value.toTex(o);return s(this,o&&o.parenthesis,o&&o.implicit)&&(d="\\\\left(".concat(d,"\\\\right)")),u+p+"="+d}}return Zr(c,"name",ig),c},{isClass:!0,isNode:!0});var og="BlockNode",RG=["ResultSet","Node"],sg=T(og,RG,e=>{var{ResultSet:r,Node:t}=e;class n extends t{constructor(a){if(super(),!Array.isArray(a))throw new Error("Array expected");this.blocks=a.map(function(s){var c=s&&s.node,f=s&&s.visible!==void 0?s.visible:!0;if(!Mr(c))throw new TypeError('Property "node" must be a Node');if(typeof f!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:c,visible:f}})}get type(){return og}get isBlockNode(){return!0}_compile(a,s){var c=si(this.blocks,function(f){return{evaluate:f.node._compile(a,s),visible:f.visible}});return function(o,u,p){var d=[];return es(c,function(x){var v=x.evaluate(o,u,p);x.visible&&d.push(v)}),new r(d)}}forEach(a){for(var s=0;s;')}).join('
')}_toTex(a){return this.blocks.map(function(s){return s.node.toTex(a)+(s.visible?"":";")}).join(\`\\\\;\\\\; -\`)}}return Zr(n,"name",og),n},{isClass:!0,isNode:!0});var ug="ConditionalNode",LG=["Node"],fg=T(ug,LG,e=>{var{Node:r}=e;function t(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(nr(i))return!i.isZero();if(un(i))return!!(i.re||i.im);if(jt(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+Ir(i)+'"')}class n extends r{constructor(a,s,c){if(super(),!Mr(a))throw new TypeError("Parameter condition must be a Node");if(!Mr(s))throw new TypeError("Parameter trueExpr must be a Node");if(!Mr(c))throw new TypeError("Parameter falseExpr must be a Node");this.condition=a,this.trueExpr=s,this.falseExpr=c}get type(){return ug}get isConditionalNode(){return!0}_compile(a,s){var c=this.condition._compile(a,s),f=this.trueExpr._compile(a,s),o=this.falseExpr._compile(a,s);return function(p,d,h){return t(c(p,d,h))?f(p,d,h):o(p,d,h)}}forEach(a){a(this.condition,"condition",this),a(this.trueExpr,"trueExpr",this),a(this.falseExpr,"falseExpr",this)}map(a){return new n(this._ifNode(a(this.condition,"condition",this)),this._ifNode(a(this.trueExpr,"trueExpr",this)),this._ifNode(a(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=rt(this,s,a&&a.implicit),f=this.condition.toString(a),o=rt(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=c)&&(f="("+f+")");var u=this.trueExpr.toString(a),p=rt(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=c)&&(u="("+u+")");var d=this.falseExpr.toString(a),h=rt(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||h!==null&&h<=c)&&(d="("+d+")"),f+" ? "+u+" : "+d}toJSON(){return{mathjs:ug,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(a){return new n(a.condition,a.trueExpr,a.falseExpr)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=rt(this,s,a&&a.implicit),f=this.condition.toHTML(a),o=rt(this.condition,s,a&&a.implicit);(s==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=c)&&(f='('+f+')');var u=this.trueExpr.toHTML(a),p=rt(this.trueExpr,s,a&&a.implicit);(s==="all"||this.trueExpr.type==="OperatorNode"||p!==null&&p<=c)&&(u='('+u+')');var d=this.falseExpr.toHTML(a),h=rt(this.falseExpr,s,a&&a.implicit);return(s==="all"||this.falseExpr.type==="OperatorNode"||h!==null&&h<=c)&&(d='('+d+')'),f+'?'+u+':'+d}_toTex(a){return"\\\\begin{cases} {"+this.trueExpr.toTex(a)+"}, &\\\\quad{\\\\text{if }\\\\;"+this.condition.toTex(a)+"}\\\\\\\\{"+this.falseExpr.toTex(a)+"}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}"}}return Zr(n,"name",ug),n},{isClass:!0,isNode:!0});var G_=Ui(Y_(),1);var aS={Alpha:"A",alpha:"\\\\alpha",Beta:"B",beta:"\\\\beta",Gamma:"\\\\Gamma",gamma:"\\\\gamma",Delta:"\\\\Delta",delta:"\\\\delta",Epsilon:"E",epsilon:"\\\\epsilon",varepsilon:"\\\\varepsilon",Zeta:"Z",zeta:"\\\\zeta",Eta:"H",eta:"\\\\eta",Theta:"\\\\Theta",theta:"\\\\theta",vartheta:"\\\\vartheta",Iota:"I",iota:"\\\\iota",Kappa:"K",kappa:"\\\\kappa",varkappa:"\\\\varkappa",Lambda:"\\\\Lambda",lambda:"\\\\lambda",Mu:"M",mu:"\\\\mu",Nu:"N",nu:"\\\\nu",Xi:"\\\\Xi",xi:"\\\\xi",Omicron:"O",omicron:"o",Pi:"\\\\Pi",pi:"\\\\pi",varpi:"\\\\varpi",Rho:"P",rho:"\\\\rho",varrho:"\\\\varrho",Sigma:"\\\\Sigma",sigma:"\\\\sigma",varsigma:"\\\\varsigma",Tau:"T",tau:"\\\\tau",Upsilon:"\\\\Upsilon",upsilon:"\\\\upsilon",Phi:"\\\\Phi",phi:"\\\\phi",varphi:"\\\\varphi",Chi:"X",chi:"\\\\chi",Psi:"\\\\Psi",psi:"\\\\psi",Omega:"\\\\Omega",omega:"\\\\omega",true:"\\\\mathrm{True}",false:"\\\\mathrm{False}",i:"i",inf:"\\\\infty",Inf:"\\\\infty",infinity:"\\\\infty",Infinity:"\\\\infty",oo:"\\\\infty",lim:"\\\\lim",undefined:"\\\\mathbf{?}"},Qr={transpose:"^\\\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\\\~",not:"\\\\neg",multiply:"\\\\cdot",divide:"\\\\frac",dotMultiply:".\\\\cdot",dotDivide:".:",mod:"\\\\mod",add:"+",subtract:"-",to:"\\\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\\\neq",smaller:"<",larger:">",smallerEq:"\\\\leq",largerEq:"\\\\geq",bitAnd:"\\\\&",bitXor:"\\\\underline{|}",bitOr:"|",and:"\\\\wedge",xor:"\\\\veebar",or:"\\\\vee"},oS={abs:{1:"\\\\left|\${args[0]}\\\\right|"},add:{2:"\\\\left(\${args[0]}".concat(Qr.add,"\${args[1]}\\\\right)")},cbrt:{1:"\\\\sqrt[3]{\${args[0]}}"},ceil:{1:"\\\\left\\\\lceil\${args[0]}\\\\right\\\\rceil"},cube:{1:"\\\\left(\${args[0]}\\\\right)^3"},divide:{2:"\\\\frac{\${args[0]}}{\${args[1]}}"},dotDivide:{2:"\\\\left(\${args[0]}".concat(Qr.dotDivide,"\${args[1]}\\\\right)")},dotMultiply:{2:"\\\\left(\${args[0]}".concat(Qr.dotMultiply,"\${args[1]}\\\\right)")},dotPow:{2:"\\\\left(\${args[0]}".concat(Qr.dotPow,"\${args[1]}\\\\right)")},exp:{1:"\\\\exp\\\\left(\${args[0]}\\\\right)"},expm1:"\\\\left(e".concat(Qr.pow,"{\${args[0]}}-1\\\\right)"),fix:{1:"\\\\mathrm{\${name}}\\\\left(\${args[0]}\\\\right)"},floor:{1:"\\\\left\\\\lfloor\${args[0]}\\\\right\\\\rfloor"},gcd:"\\\\gcd\\\\left(\${args}\\\\right)",hypot:"\\\\hypot\\\\left(\${args}\\\\right)",log:{1:"\\\\ln\\\\left(\${args[0]}\\\\right)",2:"\\\\log_{\${args[1]}}\\\\left(\${args[0]}\\\\right)"},log10:{1:"\\\\log_{10}\\\\left(\${args[0]}\\\\right)"},log1p:{1:"\\\\ln\\\\left(\${args[0]}+1\\\\right)",2:"\\\\log_{\${args[1]}}\\\\left(\${args[0]}+1\\\\right)"},log2:"\\\\log_{2}\\\\left(\${args[0]}\\\\right)",mod:{2:"\\\\left(\${args[0]}".concat(Qr.mod,"\${args[1]}\\\\right)")},multiply:{2:"\\\\left(\${args[0]}".concat(Qr.multiply,"\${args[1]}\\\\right)")},norm:{1:"\\\\left\\\\|\${args[0]}\\\\right\\\\|",2:void 0},nthRoot:{2:"\\\\sqrt[\${args[1]}]{\${args[0]}}"},nthRoots:{2:"\\\\{y : $y^{args[1]} = {\${args[0]}}\\\\}"},pow:{2:"\\\\left(\${args[0]}\\\\right)".concat(Qr.pow,"{\${args[1]}}")},round:{1:"\\\\left\\\\lfloor\${args[0]}\\\\right\\\\rceil",2:void 0},sign:{1:"\\\\mathrm{\${name}}\\\\left(\${args[0]}\\\\right)"},sqrt:{1:"\\\\sqrt{\${args[0]}}"},square:{1:"\\\\left(\${args[0]}\\\\right)^2"},subtract:{2:"\\\\left(\${args[0]}".concat(Qr.subtract,"\${args[1]}\\\\right)")},unaryMinus:{1:"".concat(Qr.unaryMinus,"\\\\left(\${args[0]}\\\\right)")},unaryPlus:{1:"".concat(Qr.unaryPlus,"\\\\left(\${args[0]}\\\\right)")},bitAnd:{2:"\\\\left(\${args[0]}".concat(Qr.bitAnd,"\${args[1]}\\\\right)")},bitNot:{1:Qr.bitNot+"\\\\left(\${args[0]}\\\\right)"},bitOr:{2:"\\\\left(\${args[0]}".concat(Qr.bitOr,"\${args[1]}\\\\right)")},bitXor:{2:"\\\\left(\${args[0]}".concat(Qr.bitXor,"\${args[1]}\\\\right)")},leftShift:{2:"\\\\left(\${args[0]}".concat(Qr.leftShift,"\${args[1]}\\\\right)")},rightArithShift:{2:"\\\\left(\${args[0]}".concat(Qr.rightArithShift,"\${args[1]}\\\\right)")},rightLogShift:{2:"\\\\left(\${args[0]}".concat(Qr.rightLogShift,"\${args[1]}\\\\right)")},bellNumbers:{1:"\\\\mathrm{B}_{\${args[0]}}"},catalan:{1:"\\\\mathrm{C}_{\${args[0]}}"},stirlingS2:{2:"\\\\mathrm{S}\\\\left(\${args}\\\\right)"},arg:{1:"\\\\arg\\\\left(\${args[0]}\\\\right)"},conj:{1:"\\\\left(\${args[0]}\\\\right)^*"},im:{1:"\\\\Im\\\\left\\\\lbrace\${args[0]}\\\\right\\\\rbrace"},re:{1:"\\\\Re\\\\left\\\\lbrace\${args[0]}\\\\right\\\\rbrace"},and:{2:"\\\\left(\${args[0]}".concat(Qr.and,"\${args[1]}\\\\right)")},not:{1:Qr.not+"\\\\left(\${args[0]}\\\\right)"},or:{2:"\\\\left(\${args[0]}".concat(Qr.or,"\${args[1]}\\\\right)")},xor:{2:"\\\\left(\${args[0]}".concat(Qr.xor,"\${args[1]}\\\\right)")},cross:{2:"\\\\left(\${args[0]}\\\\right)\\\\times\\\\left(\${args[1]}\\\\right)"},ctranspose:{1:"\\\\left(\${args[0]}\\\\right)".concat(Qr.ctranspose)},det:{1:"\\\\det\\\\left(\${args[0]}\\\\right)"},dot:{2:"\\\\left(\${args[0]}\\\\cdot\${args[1]}\\\\right)"},expm:{1:"\\\\exp\\\\left(\${args[0]}\\\\right)"},inv:{1:"\\\\left(\${args[0]}\\\\right)^{-1}"},pinv:{1:"\\\\left(\${args[0]}\\\\right)^{+}"},sqrtm:{1:"{\${args[0]}}".concat(Qr.pow,"{\\\\frac{1}{2}}")},trace:{1:"\\\\mathrm{tr}\\\\left(\${args[0]}\\\\right)"},transpose:{1:"\\\\left(\${args[0]}\\\\right)".concat(Qr.transpose)},combinations:{2:"\\\\binom{\${args[0]}}{\${args[1]}}"},combinationsWithRep:{2:"\\\\left(\\\\!\\\\!{\\\\binom{\${args[0]}}{\${args[1]}}}\\\\!\\\\!\\\\right)"},factorial:{1:"\\\\left(\${args[0]}\\\\right)".concat(Qr.factorial)},gamma:{1:"\\\\Gamma\\\\left(\${args[0]}\\\\right)"},lgamma:{1:"\\\\ln\\\\Gamma\\\\left(\${args[0]}\\\\right)"},equal:{2:"\\\\left(\${args[0]}".concat(Qr.equal,"\${args[1]}\\\\right)")},larger:{2:"\\\\left(\${args[0]}".concat(Qr.larger,"\${args[1]}\\\\right)")},largerEq:{2:"\\\\left(\${args[0]}".concat(Qr.largerEq,"\${args[1]}\\\\right)")},smaller:{2:"\\\\left(\${args[0]}".concat(Qr.smaller,"\${args[1]}\\\\right)")},smallerEq:{2:"\\\\left(\${args[0]}".concat(Qr.smallerEq,"\${args[1]}\\\\right)")},unequal:{2:"\\\\left(\${args[0]}".concat(Qr.unequal,"\${args[1]}\\\\right)")},erf:{1:"erf\\\\left(\${args[0]}\\\\right)"},max:"\\\\max\\\\left(\${args}\\\\right)",min:"\\\\min\\\\left(\${args}\\\\right)",variance:"\\\\mathrm{Var}\\\\left(\${args}\\\\right)",acos:{1:"\\\\cos^{-1}\\\\left(\${args[0]}\\\\right)"},acosh:{1:"\\\\cosh^{-1}\\\\left(\${args[0]}\\\\right)"},acot:{1:"\\\\cot^{-1}\\\\left(\${args[0]}\\\\right)"},acoth:{1:"\\\\coth^{-1}\\\\left(\${args[0]}\\\\right)"},acsc:{1:"\\\\csc^{-1}\\\\left(\${args[0]}\\\\right)"},acsch:{1:"\\\\mathrm{csch}^{-1}\\\\left(\${args[0]}\\\\right)"},asec:{1:"\\\\sec^{-1}\\\\left(\${args[0]}\\\\right)"},asech:{1:"\\\\mathrm{sech}^{-1}\\\\left(\${args[0]}\\\\right)"},asin:{1:"\\\\sin^{-1}\\\\left(\${args[0]}\\\\right)"},asinh:{1:"\\\\sinh^{-1}\\\\left(\${args[0]}\\\\right)"},atan:{1:"\\\\tan^{-1}\\\\left(\${args[0]}\\\\right)"},atan2:{2:"\\\\mathrm{atan2}\\\\left(\${args}\\\\right)"},atanh:{1:"\\\\tanh^{-1}\\\\left(\${args[0]}\\\\right)"},cos:{1:"\\\\cos\\\\left(\${args[0]}\\\\right)"},cosh:{1:"\\\\cosh\\\\left(\${args[0]}\\\\right)"},cot:{1:"\\\\cot\\\\left(\${args[0]}\\\\right)"},coth:{1:"\\\\coth\\\\left(\${args[0]}\\\\right)"},csc:{1:"\\\\csc\\\\left(\${args[0]}\\\\right)"},csch:{1:"\\\\mathrm{csch}\\\\left(\${args[0]}\\\\right)"},sec:{1:"\\\\sec\\\\left(\${args[0]}\\\\right)"},sech:{1:"\\\\mathrm{sech}\\\\left(\${args[0]}\\\\right)"},sin:{1:"\\\\sin\\\\left(\${args[0]}\\\\right)"},sinh:{1:"\\\\sinh\\\\left(\${args[0]}\\\\right)"},tan:{1:"\\\\tan\\\\left(\${args[0]}\\\\right)"},tanh:{1:"\\\\tanh\\\\left(\${args[0]}\\\\right)"},to:{2:"\\\\left(\${args[0]}".concat(Qr.to,"\${args[1]}\\\\right)")},numeric:function(r,t){return r.args[0].toTex()},number:{0:"0",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)\${args[1]}\\\\right)"},string:{0:'\\\\mathtt{""}',1:"\\\\mathrm{string}\\\\left(\${args[0]}\\\\right)"},bignumber:{0:"0",1:"\\\\left(\${args[0]}\\\\right)"},complex:{0:"0",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)+".concat(aS.i,"\\\\cdot\\\\left(\${args[1]}\\\\right)\\\\right)")},matrix:{0:"\\\\begin{bmatrix}\\\\end{bmatrix}",1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\${args[0]}\\\\right)"},sparse:{0:"\\\\begin{bsparse}\\\\end{bsparse}",1:"\\\\left(\${args[0]}\\\\right)"},unit:{1:"\\\\left(\${args[0]}\\\\right)",2:"\\\\left(\\\\left(\${args[0]}\\\\right)\${args[1]}\\\\right)"}},$_="\\\\mathrm{\${name}}\\\\left(\${args}\\\\right)",H_={deg:"^\\\\circ"};function cg(e){return(0,G_.default)(e,{preserveFormatting:!0})}function lg(e,r){return r=typeof r>"u"?!1:r,r?Je(H_,e)?H_[e]:"\\\\mathrm{"+cg(e)+"}":Je(aS,e)?aS[e]:cg(e)}var pg="ConstantNode",WG=["Node"],mg=T(pg,WG,e=>{var{Node:r}=e;class t extends r{constructor(i){super(),this.value=i}get type(){return pg}get isConstantNode(){return!0}_compile(i,a){var s=this.value;return function(){return s}}forEach(i){}map(i){return this.clone()}clone(){return new t(this.value)}_toString(i){return dr(this.value,i)}_toHTML(i){var a=this._toString(i);switch(Ir(this.value)){case"number":case"BigNumber":case"Fraction":return''+a+"";case"string":return''+a+"";case"boolean":return''+a+"";case"null":return''+a+"";case"undefined":return''+a+"";default:return''+a+""}}toJSON(){return{mathjs:pg,value:this.value}}static fromJSON(i){return new t(i.value)}_toTex(i){var a=this._toString(i),s=Ir(this.value);switch(s){case"string":return"\\\\mathtt{"+cg(a)+"}";case"number":case"BigNumber":{var c=s==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!c)return this.value.valueOf()<0?"-\\\\infty":"\\\\infty";var f=a.toLowerCase().indexOf("e");return f!==-1?a.substring(0,f)+"\\\\cdot10^{"+a.substring(f+1)+"}":a}case"Fraction":return this.value.toLatex();default:return a}}}return Zr(t,"name",pg),t},{isClass:!0,isNode:!0});var dg="FunctionAssignmentNode",VG=["typed","Node"],hg=T(dg,VG,e=>{var{typed:r,Node:t}=e;function n(a,s,c){var f=rt(a,s,c),o=rt(a.expr,s,c);return s==="all"||o!==null&&o<=f}class i extends t{constructor(s,c,f){if(super(),typeof s!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(c))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!Mr(f))throw new TypeError('Node expected for parameter "expr"');if(Qv.has(s))throw new Error('Illegal function name, "'+s+'" is a reserved keyword');var o=new Set;for(var u of c){var p=typeof u=="string"?u:u.name;if(o.has(p))throw new Error('Duplicate parameter name "'.concat(p,'"'));o.add(p)}this.name=s,this.params=c.map(function(d){return d&&d.name||d}),this.types=c.map(function(d){return d&&d.type||"any"}),this.expr=f}get type(){return dg}get isFunctionAssignmentNode(){return!0}_compile(s,c){var f=Object.create(c);es(this.params,function(x){f[x]=!0});var o=this.expr._compile(s,f),u=this.name,p=this.params,d=Rw(this.types,","),h=u+"("+Rw(this.params,", ")+")";return function(v,y,w){var E={};E[d]=function(){for(var A=Object.create(y),C=0;C'+ln(this.params[o])+"");var u=this.expr.toHTML(s);return n(this,c,s&&s.implicit)&&(u='('+u+')'),''+ln(this.name)+'('+f.join(',')+')='+u}_toTex(s){var c=s&&s.parenthesis?s.parenthesis:"keep",f=this.expr.toTex(s);return n(this,c,s&&s.implicit)&&(f="\\\\left(".concat(f,"\\\\right)")),"\\\\mathrm{"+this.name+"}\\\\left("+this.params.map(lg).join(",")+"\\\\right)="+f}}return Zr(i,"name",dg),i},{isClass:!0,isNode:!0});var vg="IndexNode",YG=["Node","size"],gg=T(vg,YG,e=>{var{Node:r,size:t}=e;class n extends r{constructor(a,s){if(super(),this.dimensions=a,this.dotNotation=s||!1,!Array.isArray(a)||!a.every(Mr))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return vg}get isIndexNode(){return!0}_compile(a,s){var c=si(this.dimensions,function(o,u){var p=o.filter(x=>x.isSymbolNode&&x.name==="end").length>0;if(p){var d=Object.create(s);d.end=!0;var h=o._compile(a,d);return function(v,y,w){if(!Xe(w)&&!Tr(w)&&!Ft(w))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+Ir(w));var E=t(w).valueOf(),b=Object.create(y);return b.end=E[u],h(v,b,w)}}else return o._compile(a,s)}),f=_t(a,"index");return function(u,p,d){var h=si(c,function(x){return x(u,p,d)});return f(...h)}}forEach(a){for(var s=0;s.'+ln(this.getObjectProperty())+"":'['+s.join(',')+']'}_toTex(a){var s=this.dimensions.map(function(c){return c.toTex(a)});return this.dotNotation?"."+this.getObjectProperty():"_{"+s.join(",")+"}"}}return Zr(n,"name",vg),n},{isClass:!0,isNode:!0});var xg="ObjectNode",HG=["Node"],yg=T(xg,HG,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),this.properties=i||{},i&&(typeof i!="object"||!Object.keys(i).every(function(a){return Mr(i[a])})))throw new TypeError("Object containing Nodes expected")}get type(){return xg}get isObjectNode(){return!0}_compile(i,a){var s={};for(var c in this.properties)if(Je(this.properties,c)){var f=Qs(c),o=JSON.parse(f),u=_t(this.properties,c);s[o]=u._compile(i,a)}return function(d,h,x){var v={};for(var y in s)Je(s,y)&&(v[y]=s[y](d,h,x));return v}}forEach(i){for(var a in this.properties)Je(this.properties,a)&&i(this.properties[a],"properties["+Qs(a)+"]",this)}map(i){var a={};for(var s in this.properties)Je(this.properties,s)&&(a[s]=this._ifNode(i(this.properties[s],"properties["+Qs(s)+"]",this)));return new t(a)}clone(){var i={};for(var a in this.properties)Je(this.properties,a)&&(i[a]=this.properties[a]);return new t(i)}_toString(i){var a=[];for(var s in this.properties)Je(this.properties,s)&&a.push(Qs(s)+": "+this.properties[s].toString(i));return"{"+a.join(", ")+"}"}toJSON(){return{mathjs:xg,properties:this.properties}}static fromJSON(i){return new t(i.properties)}_toHTML(i){var a=[];for(var s in this.properties)Je(this.properties,s)&&a.push(''+ln(s)+':'+this.properties[s].toHTML(i));return'{'+a.join(',')+'}'}_toTex(i){var a=[];for(var s in this.properties)Je(this.properties,s)&&a.push("\\\\mathbf{"+s+":} & "+this.properties[s].toTex(i)+"\\\\\\\\");var c="\\\\left\\\\{\\\\begin{array}{ll}"+a.join(\` -\`)+"\\\\end{array}\\\\right\\\\}";return c}}return Zr(t,"name",xg),t},{isClass:!0,isNode:!0});function nu(e,r){return new ef(e,new Ks(r),new Set(Object.keys(r)))}var bg="OperatorNode",GG=["Node"],wg=T(bg,GG,e=>{var{Node:r}=e;function t(a,s){var c=a;if(s==="auto")for(;cn(c);)c=c.content;return Sr(c)?!0:xt(c)?t(c.args[0],s):!1}function n(a,s,c,f,o){var u=rt(a,s,c),p=_f(a,s);if(s==="all"||f.length>2&&a.getIdentifier()!=="OperatorNode:add"&&a.getIdentifier()!=="OperatorNode:multiply")return f.map(function(_){switch(_.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var d;switch(f.length){case 0:d=[];break;case 1:{var h=rt(f[0],s,c,a);if(o&&h!==null){var x,v;if(s==="keep"?(x=f[0].getIdentifier(),v=a.getIdentifier()):(x=f[0].getContent().getIdentifier(),v=a.getContent().getIdentifier()),Zi[u][v].latexLeftParens===!1){d=[!1];break}if(Zi[h][x].latexParens===!1){d=[!1];break}}if(h===null){d=[!1];break}if(h<=u){d=[!0];break}d=[!1]}break;case 2:{var y,w=rt(f[0],s,c,a),E=ng(a,f[0],s);w===null?y=!1:w===u&&p==="right"&&!E||w=2&&a.getIdentifier()==="OperatorNode:multiply"&&a.implicit&&s!=="all"&&c==="hide")for(var M=1;M2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var y=o.map(function(w,E){return w=w.toString(s),u[E]&&(w="("+w+")"),w});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?y.join(" "):y.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:bg,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(s){return new i(s.op,s.fn,s.args,s.implicit,s.isPercentage)}_toHTML(s){var c=s&&s.parenthesis?s.parenthesis:"keep",f=s&&s.implicit?s.implicit:"hide",o=this.args,u=n(this,c,f,o,!1);if(o.length===1){var p=_f(this,c),d=o[0].toHTML(s);return u[0]&&(d='('+d+')'),p==="right"?''+ln(this.op)+""+d:d+''+ln(this.op)+""}else if(o.length===2){var h=o[0].toHTML(s),x=o[1].toHTML(s);return u[0]&&(h='('+h+')'),u[1]&&(x='('+x+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?h+''+x:h+''+ln(this.op)+""+x}else{var v=o.map(function(y,w){return y=y.toHTML(s),u[w]&&(y='('+y+')'),y});return o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&f==="hide"?v.join(''):v.join(''+ln(this.op)+""):''+ln(this.fn)+'('+v.join(',')+')'}}_toTex(s){var c=s&&s.parenthesis?s.parenthesis:"keep",f=s&&s.implicit?s.implicit:"hide",o=this.args,u=n(this,c,f,o,!0),p=Qr[this.fn];if(p=typeof p>"u"?this.op:p,o.length===1){var d=_f(this,c),h=o[0].toTex(s);return u[0]&&(h="\\\\left(".concat(h,"\\\\right)")),d==="right"?p+h:h+p}else if(o.length===2){var x=o[0],v=x.toTex(s);u[0]&&(v="\\\\left(".concat(v,"\\\\right)"));var y=o[1],w=y.toTex(s);u[1]&&(w="\\\\left(".concat(w,"\\\\right)"));var E;switch(c==="keep"?E=x.getIdentifier():E=x.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return p+"{"+v+"}{"+w+"}";case"OperatorNode:pow":switch(v="{"+v+"}",w="{"+w+"}",E){case"ConditionalNode":case"OperatorNode:divide":v="\\\\left(".concat(v,"\\\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&f==="hide")return v+"~"+w}return v+p+w}else if(o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var b=o.map(function(A,C){return A=A.toTex(s),u[C]&&(A="\\\\left(".concat(A,"\\\\right)")),A});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&f==="hide"?b.join("~"):b.join(p)}else return"\\\\mathrm{"+this.fn+"}\\\\left("+o.map(function(A){return A.toTex(s)}).join(",")+"\\\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Zr(i,"name",bg),i},{isClass:!0,isNode:!0});var Dg="ParenthesisNode",$G=["Node"],Sg=T(Dg,$G,e=>{var{Node:r}=e;class t extends r{constructor(i){if(super(),!Mr(i))throw new TypeError('Node expected for parameter "content"');this.content=i}get type(){return Dg}get isParenthesisNode(){return!0}_compile(i,a){return this.content._compile(i,a)}getContent(){return this.content.getContent()}forEach(i){i(this.content,"content",this)}map(i){var a=i(this.content,"content",this);return new t(a)}clone(){return new t(this.content)}_toString(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"("+this.content.toString(i)+")":this.content.toString(i)}toJSON(){return{mathjs:Dg,content:this.content}}static fromJSON(i){return new t(i.content)}_toHTML(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?'('+this.content.toHTML(i)+')':this.content.toHTML(i)}_toTex(i){return!i||i&&!i.parenthesis||i&&i.parenthesis==="keep"?"\\\\left(".concat(this.content.toTex(i),"\\\\right)"):this.content.toTex(i)}}return Zr(t,"name",Dg),t},{isClass:!0,isNode:!0});var Ng="RangeNode",ZG=["Node"],Ag=T(Ng,ZG,e=>{var{Node:r}=e;function t(i,a,s){var c=rt(i,a,s),f={},o=rt(i.start,a,s);if(f.start=o!==null&&o<=c||a==="all",i.step){var u=rt(i.step,a,s);f.step=u!==null&&u<=c||a==="all"}var p=rt(i.end,a,s);return f.end=p!==null&&p<=c||a==="all",f}class n extends r{constructor(a,s,c){if(super(),!Mr(a))throw new TypeError("Node expected");if(!Mr(s))throw new TypeError("Node expected");if(c&&!Mr(c))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=a,this.end=s,this.step=c||null}get type(){return Ng}get isRangeNode(){return!0}needsEnd(){var a=this.filter(function(s){return ct(s)&&s.name==="end"});return a.length>0}_compile(a,s){var c=a.range,f=this.start._compile(a,s),o=this.end._compile(a,s);if(this.step){var u=this.step._compile(a,s);return function(d,h,x){return c(f(d,h,x),o(d,h,x),u(d,h,x))}}else return function(d,h,x){return c(f(d,h,x),o(d,h,x))}}forEach(a){a(this.start,"start",this),a(this.end,"end",this),this.step&&a(this.step,"step",this)}map(a){return new n(this._ifNode(a(this.start,"start",this)),this._ifNode(a(this.end,"end",this)),this.step&&this._ifNode(a(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=t(this,s,a&&a.implicit),f,o=this.start.toString(a);if(c.start&&(o="("+o+")"),f=o,this.step){var u=this.step.toString(a);c.step&&(u="("+u+")"),f+=":"+u}var p=this.end.toString(a);return c.end&&(p="("+p+")"),f+=":"+p,f}toJSON(){return{mathjs:Ng,start:this.start,end:this.end,step:this.step}}static fromJSON(a){return new n(a.start,a.end,a.step)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=t(this,s,a&&a.implicit),f,o=this.start.toHTML(a);if(c.start&&(o='('+o+')'),f=o,this.step){var u=this.step.toHTML(a);c.step&&(u='('+u+')'),f+=':'+u}var p=this.end.toHTML(a);return c.end&&(p='('+p+')'),f+=':'+p,f}_toTex(a){var s=a&&a.parenthesis?a.parenthesis:"keep",c=t(this,s,a&&a.implicit),f=this.start.toTex(a);if(c.start&&(f="\\\\left(".concat(f,"\\\\right)")),this.step){var o=this.step.toTex(a);c.step&&(o="\\\\left(".concat(o,"\\\\right)")),f+=":"+o}var u=this.end.toTex(a);return c.end&&(u="\\\\left(".concat(u,"\\\\right)")),f+=":"+u,f}}return Zr(n,"name",Ng),n},{isClass:!0,isNode:!0});var Cg="RelationalNode",QG=["Node"],Eg=T(Cg,QG,e=>{var{Node:r}=e,t={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends r{constructor(a,s){if(super(),!Array.isArray(a))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(s))throw new TypeError("Parameter params must be an array");if(a.length!==s.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=a,this.params=s}get type(){return Cg}get isRelationalNode(){return!0}_compile(a,s){var c=this,f=this.params.map(o=>o._compile(a,s));return function(u,p,d){for(var h,x=f[0](u,p,d),v=0;va(s,"params["+c+"]",this),this)}map(a){return new n(this.conditionals.slice(),this.params.map((s,c)=>this._ifNode(a(s,"params["+c+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",c=rt(this,s,a&&a.implicit),f=this.params.map(function(p,d){var h=rt(p,s,a&&a.implicit);return s==="all"||h!==null&&h<=c?"("+p.toString(a)+")":p.toString(a)}),o=f[0],u=0;u('+p.toHTML(a)+')':p.toHTML(a)}),o=f[0],u=0;u'+ln(t[this.conditionals[u]])+""+f[u+1];return o}_toTex(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",c=rt(this,s,a&&a.implicit),f=this.params.map(function(p,d){var h=rt(p,s,a&&a.implicit);return s==="all"||h!==null&&h<=c?"\\\\left("+p.toTex(a)+"\\right)":p.toTex(a)}),o=f[0],u=0;u{var{math:r,Unit:t,Node:n}=e;function i(s){return t?t.isValuelessUnit(s):!1}class a extends n{constructor(c){if(super(),typeof c!="string")throw new TypeError('String expected for parameter "name"');this.name=c}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(c,f){var o=this.name;if(f[o]===!0)return function(p,d,h){return _t(d,o)};if(o in c)return function(p,d,h){return p.has(o)?p.get(o):_t(c,o)};var u=i(o);return function(p,d,h){return p.has(o)?p.get(o):u?new t(null,o):a.onUndefinedSymbol(o)}}forEach(c){}map(c){return this.clone()}static onUndefinedSymbol(c){throw new Error("Undefined symbol "+c)}clone(){return new a(this.name)}_toString(c){return this.name}_toHTML(c){var f=ln(this.name);return f==="true"||f==="false"?''+f+"":f==="i"?''+f+"":f==="Infinity"?''+f+"":f==="NaN"?''+f+"":f==="null"?''+f+"":f==="undefined"?''+f+"":''+f+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(c){return new a(c.name)}_toTex(c){var f=!1;typeof r[this.name]>"u"&&i(this.name)&&(f=!0);var o=lg(this.name,f);return o[0]==="\\\\"?o:" "+o}}return a},{isClass:!0,isNode:!0});var _g="FunctionNode",KG=["math","Node","SymbolNode"],Tg=T(_g,KG,e=>{var r,{math:t,Node:n,SymbolNode:i}=e,a=f=>dr(f,{truncate:78});function s(f,o,u){for(var p="",d=/\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi,h=0,x;(x=d.exec(f))!==null;)if(p+=f.substring(h,x.index),h=x.index,x[0]==="$$")p+="$",h++;else{h+=x[0].length;var v=o[x[1]];if(!v)throw new ReferenceError("Template: Property "+x[1]+" does not exist.");if(x[2]===void 0)switch(typeof v){case"string":p+=v;break;case"object":if(Mr(v))p+=v.toTex(u);else if(Array.isArray(v))p+=v.map(function(y,w){if(Mr(y))return y.toTex(u);throw new TypeError("Template: "+x[1]+"["+w+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+x[1]+" has to be a Node, String or array of Nodes")}else if(Mr(v[x[2]]&&v[x[2]]))p+=v[x[2]].toTex(u);else throw new TypeError("Template: "+x[1]+"["+x[2]+"] is not a Node.")}return p+=f.slice(h),p}class c extends n{constructor(o,u){if(super(),typeof o=="string"&&(o=new i(o)),!Mr(o))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(u)||!u.every(Mr))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=o,this.args=u||[]}get name(){return this.fn.name||""}get type(){return _g}get isFunctionNode(){return!0}_compile(o,u){var p=this.args.map(F=>F._compile(o,u));if(ct(this.fn)){var d=this.fn.name;if(u[d]){var w=this.args;return function(M,_,k){var L=_t(_,d);if(typeof L!="function")throw new TypeError("Argument '".concat(d,"' was not a function; received: ").concat(a(L)));if(L.rawArgs)return L(w,o,nu(M,_));var Y=p.map($=>$(M,_,k));return L.apply(L,Y)}}else{var h=d in o?_t(o,d):void 0,x=typeof h=="function"&&h.rawArgs===!0,v=F=>{var M;if(F.has(d))M=F.get(d);else if(d in o)M=_t(o,d);else return c.onUndefinedFunction(d);if(typeof M=="function")return M;throw new TypeError("'".concat(d,\`' is not a function; its value is: - \`).concat(a(M)))};if(x){var y=this.args;return function(M,_,k){var L=v(M);return L(y,o,nu(M,_))}}else switch(p.length){case 0:return function(M,_,k){var L=v(M);return L()};case 1:return function(M,_,k){var L=v(M),Y=p[0];return L(Y(M,_,k))};case 2:return function(M,_,k){var L=v(M),Y=p[0],$=p[1];return L(Y(M,_,k),$(M,_,k))};default:return function(M,_,k){var L=v(M),Y=p.map($=>$(M,_,k));return L(...Y)}}}}else if(Gn(this.fn)&&oi(this.fn.index)&&this.fn.index.isObjectProperty()){var E=this.fn.object._compile(o,u),b=this.fn.index.getObjectProperty(),A=this.args;return function(M,_,k){var L=E(M,_,k),Y=iC(L,b);if(Y!=null&&Y.rawArgs)return Y(A,o,nu(M,_));var $=p.map(V=>V(M,_,k));return Y.apply(L,$)}}else{var C=this.fn.toString(),S=this.fn._compile(o,u),O=this.args;return function(M,_,k){var L=S(M,_,k);if(typeof L!="function")throw new TypeError("Expression '".concat(C,"' did not evaluate to a function; value is:")+\` - \`.concat(a(L)));if(L.rawArgs)return L(O,o,nu(M,_));var Y=p.map($=>$(M,_,k));return L.apply(L,Y)}}}forEach(o){o(this.fn,"fn",this);for(var u=0;u'+ln(this.fn)+'('+u.join(',')+')'}toTex(o){var u;return o&&typeof o.handler=="object"&&Je(o.handler,this.name)&&(u=o.handler[this.name](this,o)),typeof u<"u"?u:super.toTex(o)}_toTex(o){var u=this.args.map(function(h){return h.toTex(o)}),p;oS[this.name]&&(p=oS[this.name]),t[this.name]&&(typeof t[this.name].toTex=="function"||typeof t[this.name].toTex=="object"||typeof t[this.name].toTex=="string")&&(p=t[this.name].toTex);var d;switch(typeof p){case"function":d=p(this,o);break;case"string":d=s(p,this,o);break;case"object":switch(typeof p[u.length]){case"function":d=p[u.length](this,o);break;case"string":d=s(p[u.length],this,o);break}}return typeof d<"u"?d:s($_,this,o)}getIdentifier(){return this.type+":"+this.name}}return r=c,Zr(c,"name",_g),Zr(c,"onUndefinedFunction",function(f){throw new Error("Undefined function "+f)}),Zr(c,"fromJSON",function(f){return new r(f.fn,f.args)}),c},{isClass:!0,isNode:!0});var Z_="parse",jG=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],Fg=T(Z_,jG,e=>{var{typed:r,numeric:t,config:n,AccessorNode:i,ArrayNode:a,AssignmentNode:s,BlockNode:c,ConditionalNode:f,ConstantNode:o,FunctionAssignmentNode:u,FunctionNode:p,IndexNode:d,ObjectNode:h,OperatorNode:x,ParenthesisNode:v,RangeNode:y,RelationalNode:w,SymbolNode:E}=e,b=r(Z_,{string:function(Q){return de(Q,{})},"Array | Matrix":function(Q){return A(Q,{})},"string, Object":function(Q,ge){var Pe=ge.nodes!==void 0?ge.nodes:{};return de(Q,Pe)},"Array | Matrix, Object":A});function A(B){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=Q.nodes!==void 0?Q.nodes:{};return rr(B,function(Pe){if(typeof Pe!="string")throw new TypeError("String expected");return de(Pe,ge)})}var C={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},S={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},O={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},F={true:!0,false:!1,null:null,undefined:void 0},M=["NaN","Infinity"],_={'"':'"',"'":"'","\\\\":"\\\\","/":"/",b:"\\b",f:"\\f",n:\` -\`,r:"\\r",t:" "};function k(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:C.NULL,nestingLevel:0,conditionalLevel:null}}function L(B,Q){return B.expression.substr(B.index,Q)}function Y(B){return L(B,1)}function $(B){B.index++}function V(B){return B.expression.charAt(B.index-1)}function q(B){return B.expression.charAt(B.index+1)}function R(B){for(B.tokenType=C.NULL,B.token="",B.comment="";;){if(Y(B)==="#")for(;Y(B)!==\` -\`&&Y(B)!=="";)B.comment+=Y(B),$(B);if(b.isWhitespace(Y(B),B.nestingLevel))$(B);else break}if(Y(B)===""){B.tokenType=C.DELIMITER;return}if(Y(B)===\` -\`&&!B.nestingLevel){B.tokenType=C.DELIMITER,B.token=Y(B),$(B);return}var Q=Y(B),ge=L(B,2),Pe=L(B,3);if(Pe.length===3&&S[Pe]){B.tokenType=C.DELIMITER,B.token=Pe,$(B),$(B),$(B);return}if(ge.length===2&&S[ge]){B.tokenType=C.DELIMITER,B.token=ge,$(B),$(B);return}if(S[Q]){B.tokenType=C.DELIMITER,B.token=Q,$(B);return}if(b.isDigitDot(Q)){B.tokenType=C.NUMBER;var ir=L(B,2);if(ir==="0b"||ir==="0o"||ir==="0x"){for(B.token+=Y(B),$(B),B.token+=Y(B),$(B);b.isHexDigit(Y(B));)B.token+=Y(B),$(B);if(Y(B)===".")for(B.token+=".",$(B);b.isHexDigit(Y(B));)B.token+=Y(B),$(B);else if(Y(B)==="i")for(B.token+="i",$(B);b.isDigit(Y(B));)B.token+=Y(B),$(B);return}if(Y(B)==="."){if(B.token+=Y(B),$(B),!b.isDigit(Y(B))){B.tokenType=C.DELIMITER;return}}else{for(;b.isDigit(Y(B));)B.token+=Y(B),$(B);b.isDecimalMark(Y(B),q(B))&&(B.token+=Y(B),$(B))}for(;b.isDigit(Y(B));)B.token+=Y(B),$(B);if(Y(B)==="E"||Y(B)==="e"){if(b.isDigit(q(B))||q(B)==="-"||q(B)==="+"){if(B.token+=Y(B),$(B),(Y(B)==="+"||Y(B)==="-")&&(B.token+=Y(B),$(B)),!b.isDigit(Y(B)))throw Re(B,'Digit expected, got "'+Y(B)+'"');for(;b.isDigit(Y(B));)B.token+=Y(B),$(B);if(b.isDecimalMark(Y(B),q(B)))throw Re(B,'Digit expected, got "'+Y(B)+'"')}else if(q(B)===".")throw $(B),Re(B,'Digit expected, got "'+Y(B)+'"')}return}if(b.isAlpha(Y(B),V(B),q(B))){for(;b.isAlpha(Y(B),V(B),q(B))||b.isDigit(Y(B));)B.token+=Y(B),$(B);Je(O,B.token)?B.tokenType=C.DELIMITER:B.tokenType=C.SYMBOL;return}for(B.tokenType=C.UNKNOWN;Y(B)!=="";)B.token+=Y(B),$(B);throw Re(B,'Syntax error in part "'+B.token+'"')}function j(B){do R(B);while(B.token===\` -\`)}function U(B){B.nestingLevel++}function se(B){B.nestingLevel--}b.isAlpha=function(Q,ge,Pe){return b.isValidLatinOrGreek(Q)||b.isValidMathSymbol(Q,Pe)||b.isValidMathSymbol(ge,Q)},b.isValidLatinOrGreek=function(Q){return/^[a-zA-Z_$\\u00C0-\\u02AF\\u0370-\\u03FF\\u2100-\\u214F]$/.test(Q)},b.isValidMathSymbol=function(Q,ge){return/^[\\uD835]$/.test(Q)&&/^[\\uDC00-\\uDFFF]$/.test(ge)&&/^[^\\uDC55\\uDC9D\\uDCA0\\uDCA1\\uDCA3\\uDCA4\\uDCA7\\uDCA8\\uDCAD\\uDCBA\\uDCBC\\uDCC4\\uDD06\\uDD0B\\uDD0C\\uDD15\\uDD1D\\uDD3A\\uDD3F\\uDD45\\uDD47-\\uDD49\\uDD51\\uDEA6\\uDEA7\\uDFCC\\uDFCD]$/.test(ge)},b.isWhitespace=function(Q,ge){return Q===" "||Q===" "||Q===\` -\`&&ge>0},b.isDecimalMark=function(Q,ge){return Q==="."&&ge!=="/"&&ge!=="*"&&ge!=="^"},b.isDigitDot=function(Q){return Q>="0"&&Q<="9"||Q==="."},b.isDigit=function(Q){return Q>="0"&&Q<="9"},b.isHexDigit=function(Q){return Q>="0"&&Q<="9"||Q>="a"&&Q<="f"||Q>="A"&&Q<="F"};function de(B,Q){var ge=k();St(ge,{expression:B,extraNodes:Q}),R(ge);var Pe=ae(ge);if(ge.token!=="")throw ge.tokenType===C.DELIMITER?Ye(ge,"Unexpected operator "+ge.token):Re(ge,'Unexpected part "'+ge.token+'"');return Pe}function ae(B){var Q,ge=[],Pe;for(B.token!==""&&B.token!==\` -\`&&B.token!==";"&&(Q=H(B),B.comment&&(Q.comment=B.comment));B.token===\` -\`||B.token===";";)ge.length===0&&Q&&(Pe=B.token!==";",ge.push({node:Q,visible:Pe})),R(B),B.token!==\` -\`&&B.token!==";"&&B.token!==""&&(Q=H(B),B.comment&&(Q.comment=B.comment),Pe=B.token!==";",ge.push({node:Q,visible:Pe}));return ge.length>0?new c(ge):(Q||(Q=new o(void 0),B.comment&&(Q.comment=B.comment)),Q)}function H(B){var Q,ge,Pe,ir,mr=pe(B);if(B.token==="="){if(ct(mr))return Q=mr.name,j(B),Pe=H(B),new s(new E(Q),Pe);if(Gn(mr))return j(B),Pe=H(B),new s(mr.object,mr.index,Pe);if(En(mr)&&ct(mr.fn)&&(ir=!0,ge=[],Q=mr.name,mr.args.forEach(function(nt,Vt){ct(nt)?ge[Vt]=nt.name:ir=!1}),ir))return j(B),Pe=H(B),new u(Q,ge,Pe);throw Re(B,"Invalid left hand side of assignment operator =")}return mr}function pe(B){for(var Q=_e(B);B.token==="?";){var ge=B.conditionalLevel;B.conditionalLevel=B.nestingLevel,j(B);var Pe=Q,ir=H(B);if(B.token!==":")throw Re(B,"False part of conditional expression expected");B.conditionalLevel=null,j(B);var mr=H(B);Q=new f(Pe,ir,mr),B.conditionalLevel=ge}return Q}function _e(B){for(var Q=me(B);B.token==="or";)j(B),Q=new x("or","or",[Q,me(B)]);return Q}function me(B){for(var Q=xe(B);B.token==="xor";)j(B),Q=new x("xor","xor",[Q,xe(B)]);return Q}function xe(B){for(var Q=Ne(B);B.token==="and";)j(B),Q=new x("and","and",[Q,Ne(B)]);return Q}function Ne(B){for(var Q=ye(B);B.token==="|";)j(B),Q=new x("|","bitOr",[Q,ye(B)]);return Q}function ye(B){for(var Q=we(B);B.token==="^|";)j(B),Q=new x("^|","bitXor",[Q,we(B)]);return Q}function we(B){for(var Q=Se(B);B.token==="&";)j(B),Q=new x("&","bitAnd",[Q,Se(B)]);return Q}function Se(B){for(var Q=[Ce(B)],ge=[],Pe={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Je(Pe,B.token);){var ir={name:B.token,fn:Pe[B.token]};ge.push(ir),j(B),Q.push(Ce(B))}return Q.length===1?Q[0]:Q.length===2?new x(ge[0].name,ge[0].fn,Q):new w(ge.map(mr=>mr.fn),Q)}function Ce(B){var Q,ge,Pe,ir;Q=Ve(B);for(var mr={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Je(mr,B.token);)ge=B.token,Pe=mr[ge],j(B),ir=[Q,Ve(B)],Q=new x(ge,Pe,ir);return Q}function Ve(B){var Q,ge,Pe,ir;Q=Ke(B);for(var mr={to:"to",in:"to"};Je(mr,B.token);)ge=B.token,Pe=mr[ge],j(B),ge==="in"&&B.token===""?Q=new x("*","multiply",[Q,new E("in")],!0):(ir=[Q,Ke(B)],Q=new x(ge,Pe,ir));return Q}function Ke(B){var Q,ge=[];if(B.token===":"?Q=new o(1):Q=K(B),B.token===":"&&B.conditionalLevel!==B.nestingLevel){for(ge.push(Q);B.token===":"&&ge.length<3;)j(B),B.token===")"||B.token==="]"||B.token===","||B.token===""?ge.push(new E("end")):ge.push(K(B));ge.length===3?Q=new y(ge[0],ge[2],ge[1]):Q=new y(ge[0],ge[1])}return Q}function K(B){var Q,ge,Pe,ir;Q=te(B);for(var mr={"+":"add","-":"subtract"};Je(mr,B.token);){ge=B.token,Pe=mr[ge],j(B);var nt=te(B);nt.isPercentage?ir=[Q,new x("*","multiply",[Q,nt])]:ir=[Q,nt],Q=new x(ge,Pe,ir)}return Q}function te(B){var Q,ge,Pe,ir;Q=be(B),ge=Q;for(var mr={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};Je(mr,B.token);)Pe=B.token,ir=mr[Pe],j(B),ge=be(B),Q=new x(Pe,ir,[Q,ge]);return Q}function be(B){var Q,ge;for(Q=ee(B),ge=Q;B.tokenType===C.SYMBOL||B.token==="in"&&Sr(Q)||B.tokenType===C.NUMBER&&!Sr(ge)&&(!xt(ge)||ge.op==="!")||B.token==="(";)ge=ee(B),Q=new x("*","multiply",[Q,ge],!0);return Q}function ee(B){for(var Q=ie(B),ge=Q,Pe=[];B.token==="/"&&Zc(ge);)if(Pe.push(St({},B)),j(B),B.tokenType===C.NUMBER)if(Pe.push(St({},B)),j(B),B.tokenType===C.SYMBOL||B.token==="(")St(B,Pe.pop()),Pe.pop(),ge=ie(B),Q=new x("/","divide",[Q,ge]);else{Pe.pop(),St(B,Pe.pop());break}else{St(B,Pe.pop());break}return Q}function ie(B){var Q,ge,Pe,ir;Q=fe(B);for(var mr={"%":"mod",mod:"mod"};Je(mr,B.token);)ge=B.token,Pe=mr[ge],j(B),ge==="%"&&B.tokenType===C.DELIMITER&&B.token!=="("?Q=new x("/","divide",[Q,new o(100)],!1,!0):(ir=[Q,fe(B)],Q=new x(ge,Pe,ir));return Q}function fe(B){var Q,ge,Pe,ir={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Je(ir,B.token)?(Pe=ir[B.token],Q=B.token,j(B),ge=[fe(B)],new x(Q,Pe,ge)):Ee(B)}function Ee(B){var Q,ge,Pe,ir;return Q=Me(B),(B.token==="^"||B.token===".^")&&(ge=B.token,Pe=ge==="^"?"pow":"dotPow",j(B),ir=[Q,fe(B)],Q=new x(ge,Pe,ir)),Q}function Me(B){var Q,ge,Pe,ir;Q=Ue(B);for(var mr={"!":"factorial","'":"ctranspose"};Je(mr,B.token);)ge=B.token,Pe=mr[ge],R(B),ir=[Q],Q=new x(ge,Pe,ir),Q=lr(B,Q);return Q}function Ue(B){var Q=[];if(B.tokenType===C.SYMBOL&&Je(B.extraNodes,B.token)){var ge=B.extraNodes[B.token];if(R(B),B.token==="("){if(Q=[],U(B),R(B),B.token!==")")for(Q.push(H(B));B.token===",";)R(B),Q.push(H(B));if(B.token!==")")throw Re(B,"Parenthesis ) expected");se(B),R(B)}return new ge(Q)}return ke(B)}function ke(B){var Q,ge;return B.tokenType===C.SYMBOL||B.tokenType===C.DELIMITER&&B.token in O?(ge=B.token,R(B),Je(F,ge)?Q=new o(F[ge]):M.indexOf(ge)!==-1?Q=new o(t(ge,"number")):Q=new E(ge),Q=lr(B,Q),Q):ur(B)}function lr(B,Q,ge){for(var Pe;(B.token==="("||B.token==="["||B.token===".")&&(!ge||ge.indexOf(B.token)!==-1);)if(Pe=[],B.token==="(")if(ct(Q)||Gn(Q)){if(U(B),R(B),B.token!==")")for(Pe.push(H(B));B.token===",";)R(B),Pe.push(H(B));if(B.token!==")")throw Re(B,"Parenthesis ) expected");se(B),R(B),Q=new p(Q,Pe)}else return Q;else if(B.token==="["){if(U(B),R(B),B.token!=="]")for(Pe.push(H(B));B.token===",";)R(B),Pe.push(H(B));if(B.token!=="]")throw Re(B,"Parenthesis ] expected");se(B),R(B),Q=new i(Q,new d(Pe))}else{R(B);var ir=B.tokenType===C.SYMBOL||B.tokenType===C.DELIMITER&&B.token in O;if(!ir)throw Re(B,"Property name expected after dot");Pe.push(new o(B.token)),R(B);var mr=!0;Q=new i(Q,new d(Pe,mr))}return Q}function ur(B){var Q,ge;return B.token==='"'||B.token==="'"?(ge=er(B,B.token),Q=new o(ge),Q=lr(B,Q),Q):Lr(B)}function er(B,Q){for(var ge="";Y(B)!==""&&Y(B)!==Q;)if(Y(B)==="\\\\"){$(B);var Pe=Y(B),ir=_[Pe];if(ir!==void 0)ge+=ir,B.index+=1;else if(Pe==="u"){var mr=B.expression.slice(B.index+1,B.index+5);if(/^[0-9A-Fa-f]{4}$/.test(mr))ge+=String.fromCharCode(parseInt(mr,16)),B.index+=5;else throw Re(B,"Invalid unicode character \\\\u".concat(mr))}else throw Re(B,"Bad escape character \\\\".concat(Pe))}else ge+=Y(B),$(B);if(R(B),B.token!==Q)throw Re(B,"End of string ".concat(Q," expected"));return R(B),ge}function Lr(B){var Q,ge,Pe,ir;if(B.token==="["){if(U(B),R(B),B.token!=="]"){var mr=re(B);if(B.token===";"){for(Pe=1,ge=[mr];B.token===";";)R(B),B.token!=="]"&&(ge[Pe]=re(B),Pe++);if(B.token!=="]")throw Re(B,"End of matrix ] expected");se(B),R(B),ir=ge[0].items.length;for(var nt=1;nt{var{typed:r,parse:t}=e;return r(Q_,{string:function(i){return t(i).compile()},"Array | Matrix":function(i){return rr(i,function(a){return t(a).compile()})}})});var X_="evaluate",r$=["typed","parse"],Bg=T(X_,r$,e=>{var{typed:r,parse:t}=e;return r(X_,{string:function(i){var a=ts();return t(i).compile().evaluate(a)},"string, Map | Object":function(i,a){return t(i).compile().evaluate(a)},"Array | Matrix":function(i){var a=ts();return rr(i,function(s){return t(s).compile().evaluate(a)})},"Array | Matrix, Map | Object":function(i,a){return rr(i,function(s){return t(s).compile().evaluate(a)})}})});var t$="Parser",n$=["evaluate"],Ig=T(t$,n$,e=>{var{evaluate:r}=e;function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:ts(),writable:!1})}return t.prototype.type="Parser",t.prototype.isParser=!0,t.prototype.evaluate=function(n){return r(n,this.scope)},t.prototype.get=function(n){if(this.scope.has(n))return this.scope.get(n)},t.prototype.getAll=function(){return sC(this.scope)},t.prototype.getAllAsMap=function(){return this.scope},t.prototype.set=function(n,i){return this.scope.set(n,i),i},t.prototype.remove=function(n){this.scope.delete(n)},t.prototype.clear=function(){this.scope.clear()},t},{isClass:!0});var J_="parser",i$=["typed","Parser"],Pg=T(J_,i$,e=>{var{typed:r,Parser:t}=e;return r(J_,{"":function(){return new t}})});var K_="lup",a$=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],kg=T(K_,a$,e=>{var{typed:r,matrix:t,abs:n,addScalar:i,divideScalar:a,multiplyScalar:s,subtractScalar:c,larger:f,equalScalar:o,unaryMinus:u,DenseMatrix:p,SparseMatrix:d,Spa:h}=e;return r(K_,{DenseMatrix:function(w){return x(w)},SparseMatrix:function(w){return v(w)},Array:function(w){var E=t(w),b=x(E);return{L:b.L.valueOf(),U:b.U.valueOf(),p:b.p}}});function x(y){var w=y._size[0],E=y._size[1],b=Math.min(w,E),A=or(y._data),C=[],S=[w,b],O=[],F=[b,E],M,_,k,L=[];for(M=0;M0)for(M=0;M0&&H.forEach(0,q-1,function(ye,we){d._forEachRow(ye,O,F,M,function(Se,Ce){Se>ye&&H.accumulate(Se,u(s(Ce,we)))})});var me=q,xe=H.get(q),Ne=n(xe);H.forEach(q+1,w-1,function(ye,we){var Se=n(we);f(Se,Ne)&&(me=ye,Ne=Se,xe=we)}),q!==me&&(d._swapRows(q,me,_[1],O,F,M),d._swapRows(q,me,$[1],k,L,Y),H.swap(q,me),se(q,me)),H.forEach(0,w-1,function(ye,we){ye<=q?(k.push(we),L.push(ye)):(we=a(we,xe),o(we,0)||(O.push(we),F.push(ye)))})};for(q=0;q{var{typed:r,matrix:t,zeros:n,identity:i,isZero:a,equal:s,sign:c,sqrt:f,conj:o,unaryMinus:u,addScalar:p,divideScalar:d,multiplyScalar:h,subtractScalar:x,complex:v}=e;return St(r(j_,{DenseMatrix:function(A){return w(A)},SparseMatrix:function(A){return E(A)},Array:function(A){var C=t(A),S=w(C);return{Q:S.Q.valueOf(),R:S.R.valueOf()}}}),{_denseQRimpl:y});function y(b){var A=b._size[0],C=b._size[1],S=i([A],"dense"),O=S._data,F=b.clone(),M=F._data,_,k,L,Y=n([A],"");for(L=0;L0)for(var S=C[0][0].type==="Complex"?v(0):0,O=0;O=0;){var f=t[s+c],o=t[n+f];o===-1?(c--,a[r++]=f):(t[n+f]=t[i+o],++c,t[s+c]=o)}return r}function rT(e,r){if(!e)return null;var t=0,n,i=[],a=[],s=0,c=r,f=2*r;for(n=0;n=0;n--)e[n]!==-1&&(a[c+n]=a[s+e[n]],a[s+e[n]]=n);for(n=0;n{var{add:r,multiply:t,transpose:n}=e;return function(u,p){if(!p||u<=0||u>3)return null;var d=p._size,h=d[0],x=d[1],v=0,y=Math.max(16,10*Math.sqrt(x));y=Math.min(x-2,y);var w=i(u,p,h,x,y);nT(w,f,null);for(var E=w._index,b=w._ptr,A=b[x],C=[],S=[],O=0,F=x+1,M=2*(x+1),_=3*(x+1),k=4*(x+1),L=5*(x+1),Y=6*(x+1),$=7*(x+1),V=C,q=a(x,b,S,O,_,V,M,$,F,Y,k,L),R=s(x,b,S,L,k,Y,y,F,_,V,M),j=0,U,se,de,ae,H,pe,_e,me,xe,Ne,ye,we,Se,Ce,Ve,Ke;RK?(pe=de,_e=ee,me=S[O+de]-K):(pe=E[ee++],_e=b[pe],me=S[O+pe]),H=1;H<=me;H++)U=E[_e++],!((xe=S[F+U])<=0)&&(be+=xe,S[F+U]=-xe,E[fe++]=U,S[M+U]!==-1&&(V[S[M+U]]=V[U]),V[U]!==-1?S[M+V[U]]=S[M+U]:S[_+S[L+U]]=S[M+U]);pe!==de&&(b[pe]=Na(de),S[Y+pe]=0)}for(K!==0&&(A=fe),S[L+de]=be,b[de]=ie,S[O+de]=fe-ie,S[k+de]=-2,q=c(q,v,S,Y,x),Ne=ie;Ne=q?S[Y+pe]-=xe:S[Y+pe]!==0&&(S[Y+pe]=S[L+pe]+Ee)}for(Ne=ie;Ne0?(Ke+=Me,E[Ce++]=pe,Ve+=pe):(b[pe]=Na(de),S[Y+pe]=0)}S[k+U]=Ce-we+1;var Ue=Ce,ke=we+S[O+U];for(ee=Se+1;ee=0))for(Ve=V[U],U=S[$+Ve],S[$+Ve]=-1;U!==-1&&S[M+U]!==-1;U=S[M+U],q++){for(me=S[O+U],ye=S[k+U],ee=b[U]+1;ee<=b[U]+me-1;ee++)S[Y+E[ee]]=q;var ur=U;for(se=S[M+U];se!==-1;){var er=S[O+se]===me&&S[k+se]===ye;for(ee=b[se]+1;er&&ee<=b[se]+me-1;ee++)S[Y+E[ee]]!==q&&(er=0);er?(b[se]=Na(U),S[F+U]+=S[F+se],S[F+se]=0,S[k+se]=-1,se=S[M+se],S[M+ur]=se):(ur=se,se=S[M+se])}}for(ee=ie,Ne=ie;Ne=0;se--)S[F+se]>0||(S[M+se]=S[_+b[se]],S[_+b[se]]=se);for(pe=x;pe>=0;pe--)S[F+pe]<=0||b[pe]!==-1&&(S[M+pe]=S[_+b[pe]],S[_+b[pe]]=pe);for(de=0,U=0;U<=x;U++)b[U]===-1&&(de=Lg(U,de,S,_,M,C,Y));return C.splice(C.length-1,1),C};function i(o,u,p,d,h){var x=n(u);if(o===1&&d===p)return r(u,x);if(o===2){for(var v=x._index,y=x._ptr,w=0,E=0;Eh))for(var A=y[E+1];bv)p[y+C]=0,p[h+C]=-1,A++,u[C]=Na(o),p[y+o]++;else{var O=p[w+S];O!==-1&&(E[O]=C),p[b+C]=p[w+S],p[w+S]=C}}return A}function c(o,u,p,d,h){if(o<2||o+u<0){for(var x=0;x{var{transpose:r}=e;return function(t,n,i,a){if(!t||!n||!i)return null;var s=t._size,c=s[0],f=s[1],o,u,p,d,h,x,v,y=4*f+(a?f+c+1:0),w=[],E=0,b=f,A=2*f,C=3*f,S=4*f,O=5*f+1;for(p=0;p=1&&F[u]++,L.jleaf===2&&F[L.q]--}n[u]!==-1&&(w[E+u]=n[u])}for(u=0;u{var{add:r,multiply:t,transpose:n}=e,i=iT({add:r,multiply:t,transpose:n}),a=oT({transpose:n});return function(f,o,u){var p=o._ptr,d=o._size,h=d[1],x,v={};if(v.q=i(f,o),f&&!v.q)return null;if(u){var y=f?eT(o,null,v.q,0):o;v.parent=tT(y,1);var w=rT(v.parent,h);if(v.cp=a(y,v.parent,w,1),y&&v.parent&&v.cp&&s(y,v))for(v.unz=0,x=0;x=0;O--)for(M=o[O],_=o[O+1],F=M;F<_;F++)y[u[F]]=O;for(S=d-1;S>=0;S--)v[S]=-1,O=y[S],O!==-1&&(w[C+O]++===0&&(w[A+O]=S),w[E+S]=w[b+O],w[b+O]=S);for(f.lnz=0,f.m2=d,O=0;O=0;){e=n[d];var h=i?i[e]:e;ol(s,e)||(qg(s,e),n[f+d]=h<0?0:sS(s[h]));var x=1;for(u=n[f+d],p=h<0?0:sS(s[h+1]);u{var{divideScalar:r,multiply:t,subtract:n}=e;return function(a,s,c,f,o,u,p){var d=a._values,h=a._index,x=a._ptr,v=a._size,y=v[1],w=s._values,E=s._index,b=s._ptr,A,C,S,O,F=fT(a,s,c,f,u);for(A=F;A{var{abs:r,divideScalar:t,multiply:n,subtract:i,larger:a,largerEq:s,SparseMatrix:c}=e,f=cT({divideScalar:t,multiply:n,subtract:i});return function(u,p,d){if(!u)return null;var h=u._size,x=h[1],v,y=100,w=100;p&&(v=p.q,y=p.lnz||y,w=p.unz||w);var E=[],b=[],A=[],C=new c({values:E,index:b,ptr:A,size:[x,x]}),S=[],O=[],F=[],M=new c({values:S,index:O,ptr:F,size:[x,x]}),_=[],k,L,Y=[],$=[];for(k=0;k{var{typed:r,abs:t,add:n,multiply:i,transpose:a,divideScalar:s,subtract:c,larger:f,largerEq:o,SparseMatrix:u}=e,p=sT({add:n,multiply:i,transpose:a}),d=lT({abs:t,divideScalar:s,multiply:i,subtract:c,larger:f,largerEq:o,SparseMatrix:u});return r(pT,{"SparseMatrix, number, number":function(x,v,y){if(!Qe(v)||v<0||v>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(y<0||y>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var w=p(v,x,!1),E=d(x,w,y);return{L:E.L,U:E.U,p:E.pinv,q:w.q,toString:function(){return"L: "+this.L.toString()+\` -U: \`+this.U.toString()+\` -p: \`+this.p.toString()+(this.q?\` -q: \`+this.q.toString():"")+\` -\`}}}})});function uS(e,r){var t,n=r.length,i=[];if(e)for(t=0;t{var{typed:r,matrix:t,lup:n,slu:i,usolve:a,lsolve:s,DenseMatrix:c}=e,f=Qa({DenseMatrix:c});return r(mT,{"Array, Array | Matrix":function(d,h){d=t(d);var x=n(d),v=u(x.L,x.U,x.p,null,h);return v.valueOf()},"DenseMatrix, Array | Matrix":function(d,h){var x=n(d);return u(x.L,x.U,x.p,null,h)},"SparseMatrix, Array | Matrix":function(d,h){var x=n(d);return u(x.L,x.U,x.p,null,h)},"SparseMatrix, Array | Matrix, number, number":function(d,h,x,v){var y=i(d,x,v);return u(y.L,y.U,y.p,y.q,h)},"Object, Array | Matrix":function(d,h){return u(d.L,d.U,d.p,d.q,h)}});function o(p){if(Xe(p))return p;if(Tr(p))return t(p);throw new TypeError("Invalid Matrix LU decomposition")}function u(p,d,h,x,v){p=o(p),d=o(d),h&&(v=f(p,v,!0),v._data=uS(h,v._data));var y=s(p,v),w=a(d,y);return x&&(w._data=uS(x,w._data)),w}});var dT="polynomialRoot",y$=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],Wg=T(dT,y$,e=>{var{typed:r,isZero:t,equalScalar:n,add:i,subtract:a,multiply:s,divide:c,sqrt:f,unaryMinus:o,cbrt:u,typeOf:p,im:d,re:h}=e;return r(dT,{"number|Complex, ...number|Complex":(x,v)=>{for(var y=[x,...v];y.length>0&&t(y[y.length-1]);)y.pop();if(y.length<2)throw new RangeError("Polynomial [".concat(x,", ").concat(v,"] must have a non-zero non-constant coefficient"));switch(y.length){case 2:return[o(c(y[0],y[1]))];case 3:{var[w,E,b]=y,A=s(2,b),C=s(E,E),S=s(4,b,w);if(n(C,S))return[c(o(E),A)];var O=f(a(C,S));return[c(a(O,E),A),c(a(o(O),E),A)]}case 4:{var[F,M,_,k]=y,L=o(s(3,k)),Y=s(_,_),$=s(3,k,M),V=i(s(2,_,_,_),s(27,k,k,F)),q=s(9,k,_,M);if(n(Y,$)&&n(V,q))return[c(_,L)];var R=a(Y,$),j=a(V,q),U=i(s(18,k,_,M,F),s(_,_,M,M)),se=i(s(4,_,_,_,F),s(4,k,M,M,M),s(27,k,k,F,F));if(n(U,se))return[c(a(s(4,k,_,M),i(s(9,k,k,F),s(_,_,_))),s(k,R)),c(a(s(9,k,F),s(_,M)),s(2,R))];var de;n(Y,$)?de=j:de=c(i(j,f(a(s(j,j),s(4,R,R,R)))),2);var ae=!0,H=u(de,ae).toArray().map(pe=>c(i(_,pe,c(R,pe)),L));return H.map(pe=>p(pe)==="Complex"&&n(h(pe),h(pe)+d(pe))?h(pe):pe)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(y))}}})});var b$="Help",w$=["evaluate"],Vg=T(b$,w$,e=>{var{evaluate:r}=e;function t(n){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return t.prototype.type="Help",t.prototype.isHelp=!0,t.prototype.toString=function(){var n=this.doc||{},i=\` -\`;if(n.name&&(i+="Name: "+n.name+\` - -\`),n.category&&(i+="Category: "+n.category+\` - -\`),n.description&&(i+=\`Description: - \`+n.description+\` - -\`),n.syntax&&(i+=\`Syntax: - \`+n.syntax.join(\` - \`)+\` - -\`),n.examples){i+=\`Examples: -\`;for(var a=!1,s=r("config()"),c={config:p=>(a=!0,r("config(newConfig)",{newConfig:p}))},f=0;fa!=="mathjs").forEach(a=>{i[a]=n[a]}),new t(i)},t.prototype.valueOf=t.prototype.toString,t},{isClass:!0});var D$="Chain",S$=["?on","math","typed"],Yg=T(D$,S$,e=>{var{on:r,math:t,typed:n}=e;function i(o){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");Gu(o)?this.value=o.value:this.value=o}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return dr(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(o){return new i(o.value)};function a(o,u){typeof u=="function"&&(i.prototype[o]=c(u))}function s(o,u){Zu(i.prototype,o,function(){var d=u();if(typeof d=="function")return c(d)})}function c(o){return function(){if(arguments.length===0)return new i(o(this.value));for(var u=[this.value],p=0;po[x])};for(var d in o)p(d)}};var f={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(t),r&&r("import",function(o,u,p){p||s(o,u)}),i},{isClass:!0});var fS={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]};var hT={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};var vT={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]};var gT={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]};var xT={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};var yT={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};var bT={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]};var wT={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]};var DT={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};var ST={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};var NT={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as \`(1 + sqrt(5)) / 2\` and is approximately 1.618034...",examples:["phi"],seealso:[]};var cS={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]};var AT={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]};var CT={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};var ET={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]};var MT={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};var _T={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};var TT={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]};var FT={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]};var OT={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]};var BT={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]};var IT={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]};var PT={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]};var kT={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]};var RT={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]};var LT={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]};var qT={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]};var UT={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]};var zT={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]};var WT={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]};var VT={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]};var YT={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]};var HT={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]};var GT={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]};var $T={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]};var ZT={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]};var QT={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]};var XT={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]};var JT={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]};var KT={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix \`A\` is decomposed in two matrices (\`Q\`, \`R\`) where \`Q\` is an orthogonal matrix and \`R\` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]};var jT={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]};var eF={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]};var rF={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]};var tF={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]};var nF={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]};var iF={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]};var aF={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]};var oF={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]};var sF={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]};var uF={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};var fF={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]};var cF={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When \`x\` is a number or complex number, an optional second argument \`allRoots\` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]};var lF={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]};var pF={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]};var mF={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]};var dF={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]};var hF={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]};var vF={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]};var gF={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]};var xF={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]};var yF={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]};var bF={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]};var wF={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]};var DF={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]};var SF={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]};var NF={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \\u2263 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]};var AF={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]};var CF={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]};var EF={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]};var MF={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a \`value+1\`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]};var _F={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating \`log(x, 2)\`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]};var TF={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]};var FF={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]};var OF={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']};var BF={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]};var IF={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]};var PF={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]};var kF={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]};var RF={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]};var LF={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]};var qF={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix \`X\` of another matrix \`A\` is such that \`X * X = A\`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]};var UF={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]};var zF={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]};var WF={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]};var VF={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]};var YF={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]};var HF={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]};var GF={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};var $F={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]};var ZF={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var QF={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]};var XF={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]};var JF={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]};var KF={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]};var jF={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]};var e3={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]};var r3={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. \`bellNumbers\` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]};var t3={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]};var n3={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]};var i3={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. \`stirlingS2\` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]};var a3={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]};var o3={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]};var s3={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]};var u3={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]};var f3={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]};var c3={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};var l3={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]};var p3={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]};var m3={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]};var d3={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]};var h3={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]};var v3={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]};var g3={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]};var x3={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var y3={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]};var b3={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]};var w3={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var D3={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var S3={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var N3={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]};var A3={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]};var C3={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]};var E3={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]};var M3={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]};var _3={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]};var T3={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]};var F3={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var O3={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]};var B3={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore\\u2013Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]};var I3={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]};var P3={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]};var k3={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]};var R3={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]};var L3={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]};var q3={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]};var U3={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]};var z3={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]};var W3={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]};var V3={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]};var Y3={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]};var H3={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]};var G3={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]};var $3={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]};var Z3={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]};var Q3={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]};var X3={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation \`l:u\`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]};var J3={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]};var K3={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]};var j3={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]};var eO={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};var rO={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};var tO={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]};var nO={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]};var iO={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]};var aO={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]};var oO={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]};var sO={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]};var uO={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from \`n\` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]};var fO={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]};var cO={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]};var lO={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]};var pO={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]};var mO={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]};var dO={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]};var hO={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]};var vO={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]};var gO={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]};var xO={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]};var yO={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]};var bO={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]};var wO={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]};var DO={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]};var SO={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]};var NO={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]};var AO={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]};var CO={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]};var EO={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]};var MO={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]};var _O={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]};var TO={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]};var FO={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]};var OO={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]};var BO={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]};var IO={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]};var PO={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]};var kO={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]};var RO={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]};var LO={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]};var qO={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]};var UO={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]};var zO={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]};var WO={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]};var VO={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]};var YO={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]};var HO={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:\`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. - -In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.\`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]};var GO={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]};var $O={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var ZO={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var QO={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]};var XO={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]};var JO={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]};var KO={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as \`acosh(x) = ln(sqrt(x^2 - 1) + x)\`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]};var jO={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]};var eB={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as \`acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2\`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]};var rB={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]};var tB={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as \`acsch(x) = ln(1/x + sqrt(1/x^2 + 1))\`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]};var nB={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]};var iB={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};var aB={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]};var oB={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as \`asinh(x) = ln(x + sqrt(x^2 + 1))\`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]};var sB={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]};var uB={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]};var fB={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as \`atanh(x) = ln((1 + x)/(1 - x)) / 2\`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]};var cB={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]};var lB={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};var pB={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]};var mB={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]};var dB={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]};var hB={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]};var vB={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]};var gB={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]};var xB={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]};var yB={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};var bB={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]};var wB={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]};var DB={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]};var SB={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};var NB={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]};var AB={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]};var CB={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]};var EB={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};var MB={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var _B={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]};var TB={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]};var FB={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]};var OB={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var BB={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]};var IB={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]};var PB={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]};var kB={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};var RB={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]};var LB={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]};var qB={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]};var UB={bignumber:TT,boolean:FT,complex:OT,createUnit:BT,fraction:IT,index:PT,matrix:kT,number:RT,sparse:LT,splitUnit:qT,string:UT,unit:zT,e:fS,E:fS,false:hT,i:vT,Infinity:gT,LN2:yT,LN10:xT,LOG2E:wT,LOG10E:bT,NaN:DT,null:ST,pi:cS,PI:cS,phi:NT,SQRT1_2:AT,SQRT2:CT,tau:ET,true:MT,version:_T,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:HT,lsolve:$T,lsolveAll:ZT,lup:QT,lusolve:XT,leafCount:GT,polynomialRoot:JT,resolve:eF,simplify:rF,simplifyConstant:tF,simplifyCore:nF,symbolicEqual:aF,rationalize:jT,slu:iF,usolve:oF,usolveAll:sF,qr:KT,abs:uF,add:fF,cbrt:cF,ceil:lF,cube:pF,divide:mF,dotDivide:dF,dotMultiply:hF,dotPow:vF,exp:gF,expm:xF,expm1:yF,fix:bF,floor:wF,gcd:DF,hypot:SF,lcm:AF,log:CF,log2:_F,log1p:MF,log10:EF,mod:TF,multiply:FF,norm:OF,nthRoot:BF,nthRoots:IF,pow:PF,round:kF,sign:RF,sqrt:LF,sqrtm:qF,square:VF,subtract:YF,unaryMinus:HF,unaryPlus:GF,xgcd:$F,invmod:NF,bitAnd:ZF,bitNot:QF,bitOr:XF,bitXor:JF,leftShift:KF,rightArithShift:jF,rightLogShift:e3,bellNumbers:r3,catalan:t3,composition:n3,stirlingS2:i3,config:WT,import:VT,typed:YT,arg:a3,conj:o3,re:u3,im:s3,evaluate:f3,help:c3,distance:l3,intersect:p3,and:m3,not:d3,or:h3,xor:v3,concat:x3,count:y3,cross:b3,column:g3,ctranspose:w3,det:D3,diag:S3,diff:N3,dot:A3,getMatrixDataType:T3,identity:F3,filter:E3,flatten:M3,forEach:_3,inv:O3,pinv:B3,eigs:C3,kron:I3,matrixFromFunction:R3,matrixFromRows:L3,matrixFromColumns:k3,map:P3,ones:q3,partitionSelect:U3,range:z3,resize:V3,reshape:W3,rotate:Y3,rotationMatrix:H3,row:G3,size:$3,sort:Z3,squeeze:Q3,subset:X3,trace:J3,transpose:K3,zeros:j3,fft:eO,ifft:rO,sylvester:UF,schur:zF,lyap:WF,solveODE:qB,combinations:tO,combinationsWithRep:nO,factorial:iO,gamma:aO,kldivergence:sO,lgamma:oO,multinomial:uO,permutations:fO,pickRandom:cO,random:lO,randomInt:pO,compare:mO,compareNatural:dO,compareText:hO,deepEqual:vO,equal:gO,equalText:xO,larger:yO,largerEq:bO,smaller:wO,smallerEq:DO,unequal:SO,setCartesian:NO,setDifference:AO,setDistinct:CO,setIntersect:EO,setIsSubset:MO,setMultiplicity:_O,setPowerset:TO,setSize:FO,setSymDifference:OO,setUnion:BO,zpk2tf:IO,freqz:PO,erf:kO,zeta:RO,cumsum:$O,mad:LO,max:qO,mean:UO,median:zO,min:WO,mode:VO,prod:YO,quantileSeq:HO,std:GO,sum:ZO,variance:QO,corr:XO,acos:JO,acosh:KO,acot:jO,acoth:eB,acsc:rB,acsch:tB,asec:nB,asech:iB,asin:aB,asinh:oB,atan:sB,atanh:fB,atan2:uB,cos:cB,cosh:lB,cot:pB,coth:mB,csc:dB,csch:hB,sec:vB,sech:gB,sin:xB,sinh:yB,tan:bB,tanh:wB,to:DB,clone:NB,format:AB,bin:SB,oct:kB,hex:EB,isNaN:_B,isInteger:MB,isNegative:TB,isNumeric:FB,hasNumericValue:CB,isPositive:OB,isPrime:BB,isZero:IB,print:RB,typeOf:LB,numeric:PB};var zB="help",N$=["typed","mathWithTransform","Help"],Hg=T(zB,N$,e=>{var{typed:r,mathWithTransform:t,Help:n}=e;return r(zB,{any:function(a){var s,c=a;if(typeof a!="string"){for(s in t)if(Je(t,s)&&a===t[s]){c=s;break}}var f=_t(UB,c);if(!f){var o=typeof c=="function"?c.name:c;throw new Error('No documentation found on "'+o+'"')}return new n(f)}})});var WB="chain",A$=["typed","Chain"],Gg=T(WB,A$,e=>{var{typed:r,Chain:t}=e;return r(WB,{"":function(){return new t},any:function(i){return new t(i)}})});var VB="det",C$=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],$g=T(VB,C$,e=>{var{typed:r,matrix:t,subtractScalar:n,multiply:i,divideScalar:a,isZero:s,unaryMinus:c}=e;return r(VB,{any:function(u){return or(u)},"Array | Matrix":function(u){var p;switch(Xe(u)?p=u.size():Array.isArray(u)?(u=t(u),p=u.size()):p=[],p.length){case 0:return or(u);case 1:if(p[0]===1)return or(u.valueOf()[0]);if(p[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+dr(p)+")");case 2:{var d=p[0],h=p[1];if(d===h)return f(u.clone().valueOf(),d,h);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+dr(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+dr(p)+")")}}});function f(o,u,p){if(u===1)return or(o[0][0]);if(u===2)return n(i(o[0][0],o[1][1]),i(o[1][0],o[0][1]));for(var d=!1,h=new Array(u).fill(0).map((O,F)=>F),x=0;x{var{typed:r,matrix:t,divideScalar:n,addScalar:i,multiply:a,unaryMinus:s,det:c,identity:f,abs:o}=e;return r(YB,{"Array | Matrix":function(d){var h=Xe(d)?d.size():cr(d);switch(h.length){case 1:if(h[0]===1)return Xe(d)?t([n(1,d.valueOf()[0])]):[n(1,d[0])];throw new RangeError("Matrix must be square (size: "+dr(h)+")");case 2:{var x=h[0],v=h[1];if(x===v)return Xe(d)?t(u(d.valueOf(),x,v),d.storage()):u(d,x,v);throw new RangeError("Matrix must be square (size: "+dr(h)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+dr(h)+")")}},any:function(d){return n(1,d)}});function u(p,d,h){var x,v,y,w,E;if(d===1){if(w=p[0][0],w===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,w)]]}else if(d===2){var b=c(p);if(b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(p[1][1],b),n(s(p[0][1]),b)],[n(s(p[1][0]),b),n(p[0][0],b)]]}else{var A=p.concat();for(x=0;xO&&(O=o(A[x][S]),F=x),x++;if(O===0)throw Error("Cannot calculate inverse, determinant is zero");x=F,x!==S&&(E=A[S],A[S]=A[x],A[x]=E,E=C[S],C[S]=C[x],C[x]=E);var M=A[S],_=C[S];for(x=0;x{var{typed:r,matrix:t,inv:n,deepEqual:i,equal:a,dotDivide:s,dot:c,ctranspose:f,divideScalar:o,multiply:u,add:p,Complex:d}=e;return r(HB,{"Array | Matrix":function(b){var A=Xe(b)?b.size():cr(b);switch(A.length){case 1:return w(b)?f(b):A[0]===1?n(b):s(f(b),c(b,b));case 2:{if(w(b))return f(b);var C=A[0],S=A[1];if(C===S)try{return n(b)}catch(O){if(!(O instanceof Error&&O.message.match(/Cannot calculate inverse, determinant is zero/)))throw O}return Xe(b)?t(h(b.valueOf(),C,S),b.storage()):h(b,C,S)}default:throw new RangeError("Matrix must be two dimensional (size: "+dr(A)+")")}},any:function(b){return a(b,0)?or(b):o(1,b)}});function h(E,b,A){var{C,F:S}=v(E,b,A),O=u(n(u(f(C),C)),f(C)),F=u(f(S),n(u(S,f(S))));return u(F,O)}function x(E,b,A){for(var C=or(E),S=0,O=0;OF.filter((_,k)=>k!y(c(C[M],C[M])));return{C:S,F:O}}function y(E){return a(p(E,d(1,1)),p(0,d(1,1)))}function w(E){return i(p(E,d(1,1)),p(u(E,0),d(1,1)))}});function GB(e){var{addScalar:r,subtract:t,flatten:n,multiply:i,multiplyScalar:a,divideScalar:s,sqrt:c,abs:f,bignumber:o,diag:u,size:p,reshape:d,inv:h,qr:x,usolve:v,usolveAll:y,equal:w,complex:E,larger:b,smaller:A,matrixFromColumns:C,dot:S}=e;function O(ae,H,pe,_e){var me=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,xe=F(ae,H,pe,_e,me);M(ae,H,pe,_e,me,xe);var{values:Ne,C:ye}=_(ae,H,pe,_e,me);if(me){var we=k(ae,H,ye,xe,Ne,pe,_e);return{values:Ne,eigenvectors:we}}return{values:Ne}}function F(ae,H,pe,_e,me){var xe=_e==="BigNumber",Ne=_e==="Complex",ye=xe?o(0):0,we=xe?o(1):Ne?E(1):1,Se=xe?o(1):1,Ce=xe?o(10):2,Ve=a(Ce,Ce),Ke;me&&(Ke=Array(H).fill(we));for(var K=!1;!K;){K=!0;for(var te=0;te1&&(K=u(Array(Ce-1).fill(ye)))),Ce-=1,we.pop();for(var Me=0;Me2&&(K=u(Array(Ce-2).fill(ye)))),Ce-=2,we.pop(),we.pop();for(var ke=0;ke+t(f(er),f(Lr))),te>100){var lr=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+Se.join(", "));throw lr.values=Se,lr.vectors=[],lr}var ur=me?i(Ke,V(Ve,H)):void 0;return{values:Se,C:ur}}function k(ae,H,pe,_e,me,xe,Ne){var ye=h(pe),we=i(ye,ae,pe),Se=Ne==="BigNumber",Ce=Ne==="Complex",Ve=Se?o(0):Ce?E(0):0,Ke=Se?o(1):Ce?E(1):1,K=[],te=[];for(var be of me){var ee=q(K,be,w);ee===-1?(K.push(be),te.push(1)):te[ee]+=1}for(var ie=[],fe=K.length,Ee=Array(H).fill(Ve),Me=u(Array(H).fill(Ke)),Ue=function(){var ur=K[ke],er=t(we,i(ur,Me)),Lr=y(er,Ee);for(Lr.shift();Lr.lengthi(le,De)),ie.push(...Lr.map(De=>({value:ur,vector:n(De)})))},ke=0;ke=5)return null;for(ye=0;;){var we=v(ae,Ne);if(A(se(U(Ne,[we])),_e))break;if(++ye>=10)return null;Ne=de(we)}return Ne}function j(ae,H,pe){var _e=pe==="BigNumber",me=pe==="Complex",xe=Array(ae).fill(0).map(Ne=>2*Math.random()-1);return _e&&(xe=xe.map(Ne=>o(Ne))),me&&(xe=xe.map(Ne=>E(Ne))),xe=U(xe,H),de(xe,pe)}function U(ae,H){var pe=p(ae);for(var _e of H)_e=d(_e,pe),ae=t(ae,i(s(S(_e,ae),S(_e,_e)),_e));return ae}function se(ae){return f(c(S(ae,ae)))}function de(ae,H){var pe=H==="BigNumber",_e=H==="Complex",me=pe?o(1):_e?E(1):1;return i(s(me,se(ae)),ae)}return O}function $B(e){var{config:r,addScalar:t,subtract:n,abs:i,atan:a,cos:s,sin:c,multiplyScalar:f,inv:o,bignumber:u,multiply:p,add:d}=e;function h(M,_){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.epsilon,L=arguments.length>3?arguments[3]:void 0,Y=arguments.length>4?arguments[4]:void 0;if(L==="number")return x(M,k,Y);if(L==="BigNumber")return v(M,k,Y);throw TypeError("Unsupported data type: "+L)}function x(M,_,k){var L=M.length,Y=Math.abs(_/L),$,V;if(k){V=new Array(L);for(var q=0;q=Math.abs(Y);){var j=R[0][0],U=R[0][1];$=y(M[j][j],M[U][U],M[j][U]),M=C(M,$,j,U),k&&(V=E(V,$,j,U)),R=S(M)}for(var se=Array(L).fill(0),de=0;de=i(Y);){var j=R[0][0],U=R[0][1];$=w(M[j][j],M[U][U],M[j][U]),M=A(M,$,j,U),k&&(V=b(V,$,j,U)),R=O(M)}for(var se=Array(L).fill(0),de=0;de({value:Y[H],vector:ae}));return{values:Y,eigenvectors:de}}return h}var _$="eigs",T$=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],Xg=T(_$,T$,e=>{var{config:r,typed:t,matrix:n,addScalar:i,subtract:a,equal:s,abs:c,atan:f,cos:o,sin:u,multiplyScalar:p,divideScalar:d,inv:h,bignumber:x,multiply:v,add:y,larger:w,column:E,flatten:b,number:A,complex:C,sqrt:S,diag:O,size:F,reshape:M,qr:_,usolve:k,usolveAll:L,im:Y,re:$,smaller:V,matrixFromColumns:q,dot:R}=e,j=$B({config:r,addScalar:i,subtract:a,column:E,flatten:b,equal:s,abs:c,atan:f,cos:o,sin:u,multiplyScalar:p,inv:h,bignumber:x,complex:C,multiply:v,add:y}),U=GB({config:r,addScalar:i,subtract:a,multiply:v,multiplyScalar:p,flatten:b,divideScalar:d,sqrt:S,abs:c,bignumber:x,diag:O,size:F,reshape:M,qr:_,inv:h,usolve:k,usolveAll:L,equal:s,complex:C,larger:w,smaller:V,matrixFromColumns:q,dot:R});return t("eigs",{Array:function(xe){return se(n(xe))},"Array, number|BigNumber":function(xe,Ne){return se(n(xe),{precision:Ne})},"Array, Object"(me,xe){return se(n(me),xe)},Matrix:function(xe){return se(xe,{matricize:!0})},"Matrix, number|BigNumber":function(xe,Ne){return se(xe,{precision:Ne,matricize:!0})},"Matrix, Object":function(xe,Ne){var ye={matricize:!0};return St(ye,Ne),se(xe,ye)}});function se(me){var xe,Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ye="eigenvectors"in Ne?Ne.eigenvectors:!0,we=(xe=Ne.precision)!==null&&xe!==void 0?xe:r.epsilon,Se=de(me,we,ye);return Ne.matricize&&(Se.values=n(Se.values),ye&&(Se.eigenvectors=Se.eigenvectors.map(Ce=>{var{value:Ve,vector:Ke}=Ce;return{value:Ve,vector:n(Ke)}}))),ye&&Object.defineProperty(Se,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),Se}function de(me,xe,Ne){var ye=me.toArray(),we=me.size();if(we.length!==2||we[0]!==we[1])throw new RangeError("Matrix must be square (size: ".concat(dr(we),")"));var Se=we[0];if(H(ye,Se,xe)&&(pe(ye,Se),ae(ye,Se,xe))){var Ce=_e(me,ye,Se);return j(ye,Se,xe,Ce,Ne)}var Ve=_e(me,ye,Se);return U(ye,Se,xe,Ve,Ne)}function ae(me,xe,Ne){for(var ye=0;ye{var{typed:r,abs:t,add:n,identity:i,inv:a,multiply:s}=e;return r(ZB,{Matrix:function(p){var d=p.size();if(d.length!==2||d[0]!==d[1])throw new RangeError("Matrix must be square (size: "+dr(d)+")");for(var h=d[0],x=1e-15,v=c(p),y=f(v,x),w=y.q,E=y.j,b=s(p,Math.pow(2,-E)),A=i(h),C=i(h),S=1,O=b,F=-1,M=1;M<=w;M++)M>1&&(O=s(O,b),F=-F),S=S*(w-M+1)/((2*w-M+1)*M),A=n(A,s(S,O)),C=n(C,s(S*F,O));for(var _=s(a(C),A),k=0;k{var{typed:r,abs:t,add:n,multiply:i,map:a,sqrt:s,subtract:c,inv:f,size:o,max:u,identity:p}=e,d=1e3,h=1e-6;function x(v){var y,w=0,E=v,b=p(o(v));do{var A=E;if(E=i(.5,n(A,f(b))),b=i(.5,n(b,f(A))),y=u(t(c(E,A))),y>h&&++w>d)throw new Error("computing square root of matrix: iterative method could not converge")}while(y>h);return E}return r(QB,{"Array | Matrix":function(y){var w=Xe(y)?y.size():cr(y);switch(w.length){case 1:if(w[0]===1)return a(y,s);throw new RangeError("Matrix must be square (size: "+dr(w)+")");case 2:{var E=w[0],b=w[1];if(E===b)return x(y);throw new RangeError("Matrix must be square (size: "+dr(w)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+dr(w)+")")}}})});var XB="sylvester",B$=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],jg=T(XB,B$,e=>{var{typed:r,schur:t,matrixFromColumns:n,matrix:i,multiply:a,range:s,concat:c,transpose:f,index:o,subset:u,add:p,subtract:d,identity:h,lusolve:x,abs:v}=e;return r(XB,{"Matrix, Matrix, Matrix":y,"Array, Matrix, Matrix":function(E,b,A){return y(i(E),b,A)},"Array, Array, Matrix":function(E,b,A){return y(i(E),i(b),A)},"Array, Matrix, Array":function(E,b,A){return y(i(E),b,i(A))},"Matrix, Array, Matrix":function(E,b,A){return y(E,i(b),A)},"Matrix, Array, Array":function(E,b,A){return y(E,i(b),i(A))},"Matrix, Matrix, Array":function(E,b,A){return y(E,b,i(A))},"Array, Array, Array":function(E,b,A){return y(i(E),i(b),i(A)).toArray()}});function y(w,E,b){for(var A=E.size()[0],C=w.size()[0],S=t(w),O=S.T,F=S.U,M=t(a(-1,E)),_=M.T,k=M.U,L=a(a(f(F),b),k),Y=s(0,C),$=[],V=(Ce,Ve)=>c(Ce,Ve,1),q=(Ce,Ve)=>c(Ce,Ve,0),R=0;R1e-5){for(var j=q(u(L,o(Y,R)),u(L,o(Y,R+1))),U=0;U{var{typed:r,matrix:t,identity:n,multiply:i,qr:a,norm:s,subtract:c}=e;return r(JB,{Array:function(u){var p=f(t(u));return{U:p.U.valueOf(),T:p.T.valueOf()}},Matrix:function(u){return f(u)}});function f(o){var u=o.size()[0],p=o,d=n(u),h=0,x;do{x=p;var v=a(p),y=v.Q,w=v.R;if(p=i(w,y),d=i(d,y),h++>100)break}while(s(c(p,x))>1e-4);return{U:d,T:p}}});var KB="lyap",P$=["typed","matrix","sylvester","multiply","transpose"],r0=T(KB,P$,e=>{var{typed:r,matrix:t,sylvester:n,multiply:i,transpose:a}=e;return r(KB,{"Matrix, Matrix":function(c,f){return n(c,a(c),i(-1,f))},"Array, Matrix":function(c,f){return n(t(c),a(t(c)),i(-1,f))},"Matrix, Array":function(c,f){return n(c,a(t(c)),t(i(-1,f)))},"Array, Array":function(c,f){return n(t(c),a(t(c)),t(i(-1,f))).toArray()}})});var k$="divide",R$=["typed","matrix","multiply","equalScalar","divideScalar","inv"],t0=T(k$,R$,e=>{var{typed:r,matrix:t,multiply:n,equalScalar:i,divideScalar:a,inv:s}=e,c=ot({typed:r,equalScalar:i}),f=$t({typed:r});return r("divide",Kp({"Array | Matrix, Array | Matrix":function(u,p){return n(u,s(p))},"DenseMatrix, any":function(u,p){return f(u,p,a,!1)},"SparseMatrix, any":function(u,p){return c(u,p,a,!1)},"Array, any":function(u,p){return f(t(u),p,a,!1).valueOf()},"any, Array | Matrix":function(u,p){return n(u,s(p))}},a.signatures))});var jB="distance",L$=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],n0=T(jB,L$,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:i,divideScalar:a,deepEqual:s,sqrt:c,abs:f}=e;return r(jB,{"Array, Array, Array":function(C,S,O){if(C.length===2&&S.length===2&&O.length===2){if(!u(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!u(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!u(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(s(S,O))throw new TypeError("LinePoint1 should not be same with LinePoint2");var F=n(O[1],S[1]),M=n(S[0],O[0]),_=n(i(O[0],S[1]),i(S[0],O[1]));return y(C[0],C[1],F,M,_)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(C,S,O){if(Object.keys(C).length===2&&Object.keys(S).length===2&&Object.keys(O).length===2){if(!u(C))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!u(O))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(s(x(S),x(O)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in C&&"pointY"in C&&"lineOnePtX"in S&&"lineOnePtY"in S&&"lineTwoPtX"in O&&"lineTwoPtY"in O){var F=n(O.lineTwoPtY,S.lineOnePtY),M=n(S.lineOnePtX,O.lineTwoPtX),_=n(i(O.lineTwoPtX,S.lineOnePtY),i(S.lineOnePtX,O.lineTwoPtY));return y(C.pointX,C.pointY,F,M,_)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(C,S){if(C.length===2&&S.length===3){if(!u(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return y(C[0],C[1],S[0],S[1],S[2])}else if(C.length===3&&S.length===6){if(!p(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!h(S))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return w(C[0],C[1],C[2],S[0],S[1],S[2],S[3],S[4],S[5])}else if(C.length===S.length&&C.length>0){if(!d(C))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!d(S))throw new TypeError("All values of an array should be numbers or BigNumbers");return E(C,S)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(C,S){if(Object.keys(C).length===2&&Object.keys(S).length===3){if(!u(C))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in C&&"pointY"in C&&"xCoeffLine"in S&&"yCoeffLine"in S&&"constant"in S)return y(C.pointX,C.pointY,S.xCoeffLine,S.yCoeffLine,S.constant);throw new TypeError("Key names do not match")}else if(Object.keys(C).length===3&&Object.keys(S).length===6){if(!p(C))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!h(S))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in C&&"pointY"in C&&"x0"in S&&"y0"in S&&"z0"in S&&"a"in S&&"b"in S&&"c"in S)return w(C.pointX,C.pointY,C.pointZ,S.x0,S.y0,S.z0,S.a,S.b,S.c);throw new TypeError("Key names do not match")}else if(Object.keys(C).length===2&&Object.keys(S).length===2){if(!u(C))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!u(S))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in C&&"pointOneY"in C&&"pointTwoX"in S&&"pointTwoY"in S)return E([C.pointOneX,C.pointOneY],[S.pointTwoX,S.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(C).length===3&&Object.keys(S).length===3){if(!p(C))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(S))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in C&&"pointOneY"in C&&"pointOneZ"in C&&"pointTwoX"in S&&"pointTwoY"in S&&"pointTwoZ"in S)return E([C.pointOneX,C.pointOneY,C.pointOneZ],[S.pointTwoX,S.pointTwoY,S.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(C){if(!v(C))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return b(C)}});function o(A){return typeof A=="number"||nr(A)}function u(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])}function p(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])&&o(A[2])}function d(A){return Array.isArray(A)||(A=x(A)),A.every(o)}function h(A){return A.constructor!==Array&&(A=x(A)),o(A[0])&&o(A[1])&&o(A[2])&&o(A[3])&&o(A[4])&&o(A[5])}function x(A){for(var C=Object.keys(A),S=[],O=0;OC.length!==2||!o(C[0])||!o(C[1])))return!1}else if(A[0].length===3&&o(A[0][0])&&o(A[0][1])&&o(A[0][2])){if(A.some(C=>C.length!==3||!o(C[0])||!o(C[1])||!o(C[2])))return!1}else return!1;return!0}function y(A,C,S,O,F){var M=f(t(t(i(S,A),i(O,C)),F)),_=c(t(i(S,S),i(O,O)));return a(M,_)}function w(A,C,S,O,F,M,_,k,L){var Y=[n(i(n(F,C),L),i(n(M,S),k)),n(i(n(M,S),_),i(n(O,A),L)),n(i(n(O,A),k),i(n(F,C),_))];Y=c(t(t(i(Y[0],Y[0]),i(Y[1],Y[1])),i(Y[2],Y[2])));var $=c(t(t(i(_,_),i(k,k)),i(L,L)));return a(Y,$)}function E(A,C){for(var S=A.length,O=0,F=0,M=0;M{var{typed:r,config:t,abs:n,add:i,addScalar:a,matrix:s,multiply:c,multiplyScalar:f,divideScalar:o,subtract:u,smaller:p,equalScalar:d,flatten:h,isZero:x,isNumeric:v}=e;return r("intersect",{"Array, Array, Array":y,"Array, Array, Array, Array":w,"Matrix, Matrix, Matrix":function(k,L,Y){var $=y(k.valueOf(),L.valueOf(),Y.valueOf());return $===null?null:s($)},"Matrix, Matrix, Matrix, Matrix":function(k,L,Y,$){var V=w(k.valueOf(),L.valueOf(),Y.valueOf(),$.valueOf());return V===null?null:s(V)}});function y(_,k,L){if(_=E(_),k=E(k),L=E(L),!A(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(k))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!C(L))throw new TypeError("Array with 4 numbers expected as third argument");return M(_[0],_[1],_[2],k[0],k[1],k[2],L[0],L[1],L[2],L[3])}function w(_,k,L,Y){if(_=E(_),k=E(k),L=E(L),Y=E(Y),_.length===2){if(!b(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(k))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b(L))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(Y))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return S(_,k,L,Y)}else if(_.length===3){if(!A(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!A(k))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!A(L))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!A(Y))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return F(_[0],_[1],_[2],k[0],k[1],k[2],L[0],L[1],L[2],Y[0],Y[1],Y[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function E(_){return _.length===1?_[0]:_.length>1&&Array.isArray(_[0])&&_.every(k=>Array.isArray(k)&&k.length===1)?h(_):_}function b(_){return _.length===2&&v(_[0])&&v(_[1])}function A(_){return _.length===3&&v(_[0])&&v(_[1])&&v(_[2])}function C(_){return _.length===4&&v(_[0])&&v(_[1])&&v(_[2])&&v(_[3])}function S(_,k,L,Y){var $=_,V=L,q=u($,k),R=u(V,Y),j=u(f(q[0],R[1]),f(R[0],q[1]));if(x(j)||p(n(j),t.epsilon))return null;var U=f(R[0],$[1]),se=f(R[1],$[0]),de=f(R[0],V[1]),ae=f(R[1],V[0]),H=o(a(u(u(U,se),de),ae),j);return i(c(q,H),$)}function O(_,k,L,Y,$,V,q,R,j,U,se,de){var ae=f(u(_,k),u(L,Y)),H=f(u($,V),u(q,R)),pe=f(u(j,U),u(se,de));return a(a(ae,H),pe)}function F(_,k,L,Y,$,V,q,R,j,U,se,de){var ae=O(_,q,U,q,k,R,se,R,L,j,de,j),H=O(U,q,Y,_,se,R,$,k,de,j,V,L),pe=O(_,q,Y,_,k,R,$,k,L,j,V,L),_e=O(U,q,U,q,se,R,se,R,de,j,de,j),me=O(Y,_,Y,_,$,k,$,k,V,L,V,L),xe=u(f(ae,H),f(pe,_e)),Ne=u(f(me,_e),f(H,H));if(x(Ne))return null;var ye=o(xe,Ne),we=o(a(ae,f(ye,H)),_e),Se=a(_,f(ye,u(Y,_))),Ce=a(k,f(ye,u($,k))),Ve=a(L,f(ye,u(V,L))),Ke=a(q,f(we,u(U,q))),K=a(R,f(we,u(se,R))),te=a(j,f(we,u(de,j)));return d(Se,Ke)&&d(Ce,K)&&d(Ve,te)?[Se,Ce,Ve]:null}function M(_,k,L,Y,$,V,q,R,j,U){var se=f(_,q),de=f(Y,q),ae=f(k,R),H=f($,R),pe=f(L,j),_e=f(V,j),me=u(u(u(U,se),ae),pe),xe=u(u(u(a(a(de,H),_e),se),ae),pe),Ne=o(me,xe),ye=a(_,f(Ne,u(Y,_))),we=a(k,f(Ne,u($,k))),Se=a(L,f(Ne,u(V,L)));return[ye,we,Se]}});var eI="sum",z$=["typed","config","add","numeric"],Tf=T(eI,z$,e=>{var{typed:r,config:t,add:n,numeric:i}=e;return r(eI,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":s,"...":function(f){if(Yi(f))throw new TypeError("Scalar values expected in function sum");return a(f)}});function a(c){var f;return Bn(c,function(o){try{f=f===void 0?o:n(f,o)}catch(u){throw kt(u,"sum",o)}}),f===void 0&&(f=i(0,t.number)),typeof f=="string"&&(f=i(f,t.number)),f}function s(c,f){try{var o=ss(c,f,n);return o}catch(u){throw kt(u,"sum")}}});var a0="cumsum",W$=["typed","add","unaryPlus"],Ff=T(a0,W$,e=>{var{typed:r,add:t,unaryPlus:n}=e;return r(a0,{Array:i,Matrix:function(o){return o.create(i(o.valueOf()))},"Array, number | BigNumber":s,"Matrix, number | BigNumber":function(o,u){return o.create(s(o.valueOf(),u))},"...":function(o){if(Yi(o))throw new TypeError("All values expected to be scalar in function cumsum");return i(o)}});function i(f){try{return a(f)}catch(o){throw kt(o,a0)}}function a(f){if(f.length===0)return[];for(var o=[n(f[0])],u=1;u=u.length)throw new pn(o,u.length);try{return c(f,o)}catch(p){throw kt(p,a0)}}function c(f,o){var u,p,d;if(o<=0){var h=f[0][0];if(Array.isArray(h)){for(d=Mm(f),p=[],u=0;u{var{typed:r,add:t,divide:n}=e;return r(rI,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(c){if(Yi(c))throw new TypeError("Scalar values expected in function mean");return a(c)}});function i(s,c){try{var f=ss(s,c,t),o=Array.isArray(s)?cr(s):s.size();return n(f,o[c])}catch(u){throw kt(u,"mean")}}function a(s){var c,f=0;if(Bn(s,function(o){try{c=c===void 0?o:t(c,o),f++}catch(u){throw kt(u,"mean",o)}}),f===0)throw new Error("Cannot calculate the mean of an empty array");return n(c,f)}});var tI="median",Y$=["typed","add","divide","compare","partitionSelect"],o0=T(tI,Y$,e=>{var{typed:r,add:t,divide:n,compare:i,partitionSelect:a}=e;function s(o){try{o=wr(o.valueOf());var u=o.length;if(u===0)throw new Error("Cannot calculate median of an empty array");if(u%2===0){for(var p=u/2-1,d=a(o,p+1),h=o[p],x=0;x0&&(h=o[x]);return f(h,d)}else{var v=a(o,(u-1)/2);return c(v)}}catch(y){throw kt(y,"median")}}var c=r({"number | BigNumber | Complex | Unit":function(u){return u}}),f=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(u,p){return n(t(u,p),2)}});return r(tI,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,p){throw new Error("median(A, dim) is not yet supported")},"...":function(u){if(Yi(u))throw new TypeError("Scalar values expected in function median");return s(u)}})});var nI="mad",H$=["typed","abs","map","median","subtract"],s0=T(nI,H$,e=>{var{typed:r,abs:t,map:n,median:i,subtract:a}=e;return r(nI,{"Array | Matrix":s,"...":function(f){return s(f)}});function s(c){if(c=wr(c.valueOf()),c.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var f=i(c);return i(n(c,function(o){return t(a(o,f))}))}catch(o){throw o instanceof TypeError&&o.message.indexOf("median")!==-1?new TypeError(o.message.replace("median","mad")):kt(o,"mad")}}});var lS="unbiased",iI="variance",G$=["typed","add","subtract","multiply","divide","apply","isNaN"],Bf=T(iI,G$,e=>{var{typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:c}=e;return r(iI,{"Array | Matrix":function(p){return f(p,lS)},"Array | Matrix, string":f,"Array | Matrix, number | BigNumber":function(p,d){return o(p,d,lS)},"Array | Matrix, number | BigNumber, string":o,"...":function(p){return f(p,lS)}});function f(u,p){var d,h=0;if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Bn(u,function(y){try{d=d===void 0?y:t(d,y),h++}catch(w){throw kt(w,"variance",y)}}),h===0)throw new Error("Cannot calculate variance of an empty array");var x=a(d,h);if(d=void 0,Bn(u,function(y){var w=n(y,x);d=d===void 0?i(w,w):t(d,i(w,w))}),c(d))return d;switch(p){case"uncorrected":return a(d,h);case"biased":return a(d,h+1);case"unbiased":{var v=nr(d)?d.mul(0):0;return h===1?v:a(d,h-1)}default:throw new Error('Unknown normalization "'+p+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function o(u,p,d){try{if(u.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return s(u,p,h=>f(h,d))}catch(h){throw kt(h,"variance")}}});var aI="quantileSeq",$$=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],If=T(aI,$$,e=>{var{typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:c,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:d}=e,h=us({typed:r,isInteger:o});return r(aI,{"Array | Matrix, number | BigNumber":(E,b)=>v(E,b,!1),"Array | Matrix, number | BigNumber, number":(E,b,A)=>x(E,b,!1,A,v),"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":(E,b,A,C)=>x(E,b,A,C,v),"Array | Matrix, Array | Matrix":(E,b)=>y(E,b,!1),"Array | Matrix, Array | Matrix, number":(E,b,A)=>x(E,b,!1,A,y),"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":(E,b,A,C)=>x(E,b,A,C,y)});function x(E,b,A,C,S){return h(E,C,O=>S(O,b,A))}function v(E,b,A){var C,S=E.valueOf();if(u(b,0))throw new Error("N/prob must be non-negative");if(p(b,1))return fr(b)?w(S,b,A):t(w(S,b,A));if(d(b,1)){if(!o(b))throw new Error("N must be a positive integer");if(d(b,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var O=n(b,1);C=[];for(var F=0;u(F,b);F++){var M=a(F+1,O);C.push(w(S,M,A))}return fr(b)?C:t(C)}}function y(E,b,A){for(var C=E.valueOf(),S=b.valueOf(),O=[],F=0;F0&&(_=C[L])}return n(s(_,i(1,M)),s(k,M))}});var oI="std",Z$=["typed","map","sqrt","variance"],Pf=T(oI,Z$,e=>{var{typed:r,map:t,sqrt:n,variance:i}=e;return r(oI,{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(c){return a(c)}});function a(s,c){if(s.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var f=i.apply(null,arguments);return Ot(f)?t(f,n):n(f)}catch(o){throw o instanceof TypeError&&o.message.indexOf(" variance")!==-1?new TypeError(o.message.replace(" variance"," std")):o}}});var sI="corr",Q$=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],u0=T(sI,Q$,e=>{var{typed:r,matrix:t,sqrt:n,sum:i,add:a,subtract:s,multiply:c,pow:f,divide:o}=e;return r(sI,{"Array, Array":function(h,x){return u(h,x)},"Matrix, Matrix":function(h,x){var v=u(h.toArray(),x.toArray());return Array.isArray(v)?t(v):v}});function u(d,h){var x=[];if(Array.isArray(d[0])&&Array.isArray(h[0])){if(d.length!==h.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var v=0;va(S,c(O,h[F])),0),E=i(d.map(S=>f(S,2))),b=i(h.map(S=>f(S,2))),A=s(c(x,w),c(v,y)),C=n(c(s(c(x,E),f(v,2)),s(c(x,b),f(y,2))));return o(A,C)}});var uI="combinations",X$=["typed"],f0=T(uI,X$,e=>{var{typed:r}=e;return r(uI,{"number, number":ND,"BigNumber, BigNumber":function(n,i){var a=n.constructor,s,c,f=n.minus(i),o=new a(1);if(!fI(n)||!fI(i))throw new TypeError("Positive integer value expected in function combinations");if(i.gt(n))throw new TypeError("k must be less than n in function combinations");if(s=o,i.lt(f))for(c=o;c.lte(f);c=c.plus(o))s=s.times(i.plus(c)).dividedBy(c);else for(c=o;c.lte(i);c=c.plus(o))s=s.times(f.plus(c)).dividedBy(c);return s}})});function fI(e){return e.isInteger()&&e.gte(0)}var cI="combinationsWithRep",J$=["typed"],c0=T(cI,J$,e=>{var{typed:r}=e;return r(cI,{"number, number":function(n,i){if(!Qe(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Qe(i)||i<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(i{var{typed:r,config:t,multiplyScalar:n,pow:i,BigNumber:a,Complex:s}=e;function c(o){if(o.im===0)return rl(o.re);if(o.re<.5){var u=new s(1-o.re,-o.im),p=new s(Math.PI*o.re,Math.PI*o.im);return new s(Math.PI).div(p.sin()).div(c(u))}o=new s(o.re-1,o.im);for(var d=new s(ru[0],0),h=1;h2;)d-=2,x+=d,h=h.times(x);return new a(h.toPrecision(a.precision))}});var mI="lgamma",j$=["Complex","typed"],p0=T(mI,j$,e=>{var{Complex:r,typed:t}=e,n=7,i=7,a=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(mI,{number:tl,Complex:s,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function s(o){var u=6.283185307179586,p=1.1447298858494002,d=.1;if(o.isNaN())return new r(NaN,NaN);if(o.im===0)return new r(tl(o.re),0);if(o.re>=n||Math.abs(o.im)>=i)return c(o);if(o.re<=d){var h=YA(u,o.im)*Math.floor(.5*o.re+.25),x=o.mul(Math.PI).sin().log(),v=s(new r(1-o.re,-o.im));return new r(p,h).sub(x).sub(v)}else return o.im>=0?f(o):f(o.conjugate()).conjugate()}function c(o){for(var u=o.sub(.5).mul(o.log()).sub(o).add(FD),p=new r(1,0).div(o),d=p.div(o),h=a[0],x=a[1],v=2*d.re,y=d.re*d.re+d.im*d.im,w=2;w<8;w++){var E=x;x=-y*h+a[w],h=v*h+E}var b=p.mul(d.mul(h).add(x));return u.add(b)}function f(o){var u=0,p=0,d=o;for(o=o.add(1);o.re<=n;){d=d.mul(o);var h=d.im<0?1:0;h!==0&&p===0&&u++,p=h,o=o.add(1)}return c(o).sub(d.log()).sub(new r(0,u*2*Math.PI*1))}});var dI="factorial",eZ=["typed","gamma"],m0=T(dI,eZ,e=>{var{typed:r,gamma:t}=e;return r(dI,{number:function(i){if(i<0)throw new Error("Value must be non-negative");return t(i+1)},BigNumber:function(i){if(i.isNegative())throw new Error("Value must be non-negative");return t(i.plus(1))},"Array | Matrix":r.referToSelf(n=>i=>rr(i,n))})});var hI="kldivergence",rZ=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],d0=T(hI,rZ,e=>{var{typed:r,matrix:t,divide:n,sum:i,multiply:a,map:s,dotDivide:c,log:f,isNumeric:o}=e;return r(hI,{"Array, Array":function(d,h){return u(t(d),t(h))},"Matrix, Array":function(d,h){return u(d,t(h))},"Array, Matrix":function(d,h){return u(t(d),h)},"Matrix, Matrix":function(d,h){return u(d,h)}});function u(p,d){var h=d.size().length,x=p.size().length;if(h>1)throw new Error("first object must be one dimensional");if(x>1)throw new Error("second object must be one dimensional");if(h!==x)throw new Error("Length of two vectors must be equal");var v=i(p);if(v===0)throw new Error("Sum of elements in first object must be non zero");var y=i(d);if(y===0)throw new Error("Sum of elements in second object must be non zero");var w=n(p,i(p)),E=n(d,i(d)),b=i(a(w,s(c(w,E),A=>f(A))));return o(b)?b:Number.NaN}});var vI="multinomial",tZ=["typed","add","divide","multiply","factorial","isInteger","isPositive"],h0=T(vI,tZ,e=>{var{typed:r,add:t,divide:n,multiply:i,factorial:a,isInteger:s,isPositive:c}=e;return r(vI,{"Array | Matrix":function(o){var u=0,p=1;return Bn(o,function(d){if(!s(d)||!c(d))throw new TypeError("Positive integer value expected in function multinomial");u=t(u,d),p=i(p,a(d))}),n(a(u),p)}})});var gI="permutations",nZ=["typed","factorial"],v0=T(gI,nZ,e=>{var{typed:r,factorial:t}=e;return r(gI,{"number | BigNumber":t,"number, number":function(i,a){if(!Qe(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(!Qe(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(a>i)throw new TypeError("second argument k must be less than or equal to first argument n");return Ai(i-a+1,i)},"BigNumber, BigNumber":function(i,a){var s,c;if(!xI(i)||!xI(a))throw new TypeError("Positive integer value expected in function permutations");if(a.gt(i))throw new TypeError("second argument k must be less than or equal to first argument n");var f=i.mul(0).add(1);for(s=f,c=i.minus(a).plus(1);c.lte(i);c=c.plus(1))s=s.times(c);return s}})});function xI(e){return e.isInteger()&&e.gte(0)}var xS=Ui(PI(),1),cZ=(0,xS.default)(Date.now());function No(e){var r;function t(i){r=i===null?cZ:(0,xS.default)(String(i))}t(e);function n(){return r()}return n}var kI="pickRandom",lZ=["typed","config","?on"],x0=T(kI,lZ,e=>{var{typed:r,config:t,on:n}=e,i=No(t.randomSeed);return n&&n("config",function(s,c){s.randomSeed!==c.randomSeed&&(i=No(s.randomSeed))}),r(kI,{"Array | Matrix":function(c){return a(c,{})},"Array | Matrix, Object":function(c,f){return a(c,f)},"Array | Matrix, number":function(c,f){return a(c,{number:f})},"Array | Matrix, Array | Matrix":function(c,f){return a(c,{weights:f})},"Array | Matrix, Array | Matrix, number":function(c,f,o){return a(c,{number:o,weights:f})},"Array | Matrix, number, Array | Matrix":function(c,f,o){return a(c,{number:f,weights:o})}});function a(s,c){var{number:f,weights:o,elementWise:u=!0}=c,p=typeof f>"u";p&&(f=1);var d=Xe(s)?s.create:Xe(o)?o.create:null;s=s.valueOf(),o&&(o=o.valueOf()),u===!0&&(s=wr(s),o=wr(o));var h=0;if(typeof o<"u"){if(o.length!==s.length)throw new Error("Weights must have the same length as possibles");for(var x=0,v=o.length;x"u")E=s[Math.floor(i()*y)];else for(var b=i()*h,A=0,C=s.length;A1)for(var n=0,i=e.shift();n{var{typed:r,config:t,on:n}=e,i=No(t.randomSeed);return n&&n("config",function(c,f){c.randomSeed!==f.randomSeed&&(i=No(c.randomSeed))}),r(RI,{"":()=>s(0,1),number:c=>s(0,c),"number, number":(c,f)=>s(c,f),"Array | Matrix":c=>a(c,0,1),"Array | Matrix, number":(c,f)=>a(c,0,f),"Array | Matrix, number, number":(c,f,o)=>a(c,f,o)});function a(c,f,o){var u=sl(c.valueOf(),()=>s(f,o));return Xe(c)?c.create(u):u}function s(c,f){return c+i()*(f-c)}});var LI="randomInt",mZ=["typed","config","?on"],b0=T(LI,mZ,e=>{var{typed:r,config:t,on:n}=e,i=No(t.randomSeed);return n&&n("config",function(c,f){c.randomSeed!==f.randomSeed&&(i=No(c.randomSeed))}),r(LI,{"":()=>s(0,1),number:c=>s(0,c),"number, number":(c,f)=>s(c,f),"Array | Matrix":c=>a(c,0,1),"Array | Matrix, number":(c,f)=>a(c,0,f),"Array | Matrix, number, number":(c,f,o)=>a(c,f,o)});function a(c,f,o){var u=sl(c.valueOf(),()=>s(f,o));return Xe(c)?c.create(u):u}function s(c,f){return Math.floor(c+i()*(f-c))}});var qI="stirlingS2",dZ=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],w0=T(qI,dZ,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:i,divideScalar:a,pow:s,factorial:c,combinations:f,isNegative:o,isInteger:u,number:p,bignumber:d,larger:h}=e,x=[],v=[];return r(qI,{"number | BigNumber, number | BigNumber":function(w,E){if(!u(w)||o(w)||!u(E)||o(E))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(h(E,w))throw new TypeError("k must be less than or equal to n in function stirlingS2");var b=!(fr(w)&&fr(E)),A=b?v:x,C=b?d:p,S=p(w),O=p(E);if(A[S]&&A[S].length>O)return A[S][O];for(var F=0;F<=S;++F)if(A[F]||(A[F]=[C(F===0?1:0)]),F!==0)for(var M=A[F],_=A[F-1],k=M.length;k<=F&&k<=O;++k)k===F?M[k]=1:M[k]=t(i(C(k),_[k]),_[k-1]);return A[S][O]}})});var UI="bellNumbers",hZ=["typed","addScalar","isNegative","isInteger","stirlingS2"],D0=T(UI,hZ,e=>{var{typed:r,addScalar:t,isNegative:n,isInteger:i,stirlingS2:a}=e;return r(UI,{"number | BigNumber":function(c){if(!i(c)||n(c))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var f=0,o=0;o<=c;o++)f=t(f,a(c,o));return f}})});var zI="catalan",vZ=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],S0=T(zI,vZ,e=>{var{typed:r,addScalar:t,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:s,isInteger:c}=e;return r(zI,{"number | BigNumber":function(o){if(!c(o)||s(o))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(o,2),o),t(o,1))}})});var WI="composition",gZ=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],N0=T(WI,gZ,e=>{var{typed:r,addScalar:t,combinations:n,isPositive:i,isNegative:a,isInteger:s,larger:c}=e;return r(WI,{"number | BigNumber, number | BigNumber":function(o,u){if(!s(o)||!i(o)||!s(u)||!i(u))throw new TypeError("Positive integer value expected in function composition");if(c(u,o))throw new TypeError("k must be less than or equal to n in function composition");return n(t(o,-1),t(u,-1))}})});var VI="leafCount",xZ=["parse","typed"],A0=T(VI,xZ,e=>{var{parse:r,typed:t}=e;function n(i){var a=0;return i.forEach(s=>{a+=n(s)}),a||1}return t(VI,{Node:function(a){return n(a)}})});function yS(e){return Sr(e)||xt(e)&&e.isUnary()&&Sr(e.args[0])}function ul(e){return!!(Sr(e)||(En(e)||xt(e))&&e.args.every(ul)||cn(e)&&ul(e.content))}function YI(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function bS(e){for(var r=1;r{var{FunctionNode:r,OperatorNode:t,SymbolNode:n}=e,i=!0,a=!1,s="defaultF",c={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}},f={divide:{total:a},log:{total:a}},o={subtract:{total:a},abs:{trivial:i},log:{total:i}};function u(b,A){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c,S=s;if(typeof b=="string"?S=b:xt(b)?S=b.fn.toString():En(b)?S=b.name:cn(b)&&(S="paren"),Je(C,S)){var O=C[S];if(Je(O,A))return O[A];if(Je(c,S))return c[S][A]}if(Je(C,s)){var F=C[s];return Je(F,A)?F[A]:c[s][A]}if(Je(c,S)){var M=c[S];if(Je(M,A))return M[A]}return c[s][A]}function p(b){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return u(b,"commutative",A)}function d(b){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return u(b,"associative",A)}function h(b,A){var C=bS({},b);for(var S in A)Je(b,S)?C[S]=bS(bS({},A[S]),b[S]):C[S]=A[S];return C}function x(b,A){if(!b.args||b.args.length===0)return b;b.args=v(b,A);for(var C=0;C2&&d(b,A)){for(var F=b.args.pop();b.args.length>0;)F=C([b.args.pop(),F]);b.args=F.args}}}function w(b,A){if(!(!b.args||b.args.length===0)){for(var C=E(b),S=b.args.length,O=0;O2&&d(b,A)){for(var F=b.args.shift();b.args.length>0;)F=C([F,b.args.shift()]);b.args=F.args}}}function E(b){return xt(b)?function(A){try{return new t(b.op,b.fn,A,b.implicit)}catch(C){return console.error(C),[]}}:function(A){return new r(new n(b.name),A)}}return{createMakeNodeFunction:E,hasProperty:u,isCommutative:p,isAssociative:d,mergeContext:h,flatten:x,allChildren:v,unflattenr:y,unflattenl:w,defaultContext:c,realContext:f,positiveContext:o}});var wZ="simplify",DZ=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],C0=T(wZ,DZ,e=>{var{config:r,typed:t,parse:n,add:i,subtract:a,multiply:s,divide:c,pow:f,isZero:o,equal:u,resolve:p,simplifyConstant:d,simplifyCore:h,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:E,ArrayNode:b,ConstantNode:A,FunctionNode:C,IndexNode:S,ObjectNode:O,OperatorNode:F,ParenthesisNode:M,SymbolNode:_}=e,{hasProperty:k,isCommutative:L,isAssociative:Y,mergeContext:$,flatten:V,unflattenr:q,unflattenl:R,createMakeNodeFunction:j,defaultContext:U,realContext:se,positiveContext:de}=kf({FunctionNode:C,OperatorNode:F,SymbolNode:_});t.addConversion({from:"Object",to:"Map",convert:bo});var ae=t("simplify",{Node:ye,"Node, Map":(ee,ie)=>ye(ee,!1,ie),"Node, Map, Object":(ee,ie,fe)=>ye(ee,!1,ie,fe),"Node, Array":ye,"Node, Array, Map":ye,"Node, Array, Map, Object":ye});t.removeConversion({from:"Object",to:"Map",convert:bo}),ae.defaultContext=U,ae.realContext=se,ae.positiveContext=de;function H(ee){return ee.transform(function(ie,fe,Ee){return cn(ie)?H(ie.content):ie})}var pe={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};ae.rules=[h,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},d,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},d,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function _e(ee,ie){var fe={};if(ee.s){var Ee=ee.s.split("->");if(Ee.length===2)fe.l=Ee[0],fe.r=Ee[1];else throw SyntaxError("Could not parse rule: "+ee.s)}else fe.l=ee.l,fe.r=ee.r;fe.l=H(n(fe.l)),fe.r=H(n(fe.r));for(var Me of["imposeContext","repeat","assuming"])Me in ee&&(fe[Me]=ee[Me]);if(ee.evaluate&&(fe.evaluate=n(ee.evaluate)),Y(fe.l,ie)){var Ue=!L(fe.l,ie),ke;Ue&&(ke=Ne());var lr=j(fe.l),ur=Ne();fe.expanded={},fe.expanded.l=lr([fe.l,ur]),V(fe.expanded.l,ie),q(fe.expanded.l,ie),fe.expanded.r=lr([fe.r,ur]),Ue&&(fe.expandedNC1={},fe.expandedNC1.l=lr([ke,fe.l]),fe.expandedNC1.r=lr([ke,fe.r]),fe.expandedNC2={},fe.expandedNC2.l=lr([ke,fe.expanded.l]),fe.expandedNC2.r=lr([ke,fe.expanded.r]))}return fe}function me(ee,ie){for(var fe=[],Ee=0;Ee2&&arguments[2]!==void 0?arguments[2]:ts(),Ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Me=Ee.consoleDebug;ie=me(ie||ae.rules,Ee.context);var Ue=p(ee,fe);Ue=H(Ue);for(var ke={},lr=Ue.toString({parenthesis:"all"});!ke[lr];){ke[lr]=!0,xe=0;var ur=lr;Me&&console.log("Working on: ",lr);for(var er=0;er ").concat(ie[er].r.toString()))),Me){var re=Ue.toString({parenthesis:"all"});re!==ur&&(console.log("Applying",Lr,"produced",re),ur=re)}R(Ue,Ee.context)}lr=Ue.toString({parenthesis:"all"})}return Ue}function we(ee,ie,fe){var Ee=ee;if(ee)for(var Me=0;Me1&&(ur=Ue(ee.args.slice(0,lr))),Me=ee.args.slice(lr),Ee=Me.length===1?Me[0]:Ue(Me),fe.push(Ue([ur,Ee]))}return fe}function Ve(ee,ie){var fe={placeholders:{}};if(!ee.placeholders&&!ie.placeholders)return fe;if(ee.placeholders){if(!ie.placeholders)return ee}else return ie;for(var Ee in ee.placeholders)if(Je(ee.placeholders,Ee)&&(fe.placeholders[Ee]=ee.placeholders[Ee],Je(ie.placeholders,Ee)&&!be(ee.placeholders[Ee],ie.placeholders[Ee])))return null;for(var Me in ie.placeholders)Je(ie.placeholders,Me)&&(fe.placeholders[Me]=ie.placeholders[Me]);return fe}function Ke(ee,ie){var fe=[];if(ee.length===0||ie.length===0)return fe;for(var Ee,Me=0;Me2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var ur=te(ee.args[0],ie.args[1],fe);if(ur.length===0)return[];var er=te(ee.args[1],ie.args[0],fe);if(er.length===0)return[];Ue=[ur,er]}Me=K(Ue)}else if(ie.args.length>=2&&ee.args.length===2){for(var Lr=Ce(ie,fe),re=[],le=0;le2)throw Error("Unexpected non-binary associative function: "+ee.toString());return[]}}else if(ee instanceof _){if(ee.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(pe[ee.name]){if(ee.name!==ie.name)return[]}else switch(ee.name[1]>="a"&&ee.name[1]<="z"?ee.name.substring(0,2):ee.name[0]){case"n":case"_p":Me[0].placeholders[ee.name]=ie;break;case"c":case"cl":if(Sr(ie))Me[0].placeholders[ee.name]=ie;else return[];break;case"v":if(!Sr(ie))Me[0].placeholders[ee.name]=ie;else return[];break;case"vl":if(ct(ie))Me[0].placeholders[ee.name]=ie;else return[];break;case"cd":if(yS(ie))Me[0].placeholders[ee.name]=ie;else return[];break;case"vd":if(!yS(ie))Me[0].placeholders[ee.name]=ie;else return[];break;case"ce":if(ul(ie))Me[0].placeholders[ee.name]=ie;else return[];break;case"ve":if(!ul(ie))Me[0].placeholders[ee.name]=ie;else return[];break;default:throw new Error("Invalid symbol in rule: "+ee.name)}}else if(ee instanceof A){if(!u(ee.value,ie.value))return[]}else return[];return Me}function be(ee,ie){if(ee instanceof A&&ie instanceof A){if(!u(ee.value,ie.value))return!1}else if(ee instanceof _&&ie instanceof _){if(ee.name!==ie.name)return!1}else if(ee instanceof F&&ie instanceof F||ee instanceof C&&ie instanceof C){if(ee instanceof F){if(ee.op!==ie.op||ee.fn!==ie.fn)return!1}else if(ee instanceof C&&ee.name!==ie.name)return!1;if(ee.args.length!==ie.args.length)return!1;for(var fe=0;fe{var{typed:r,config:t,mathWithTransform:n,matrix:i,fraction:a,bignumber:s,AccessorNode:c,ArrayNode:f,ConstantNode:o,FunctionNode:u,IndexNode:p,ObjectNode:d,OperatorNode:h,SymbolNode:x}=e,{isCommutative:v,isAssociative:y,allChildren:w,createMakeNodeFunction:E}=kf({FunctionNode:u,OperatorNode:h,SymbolNode:x}),b=r("simplifyConstant",{Node:V=>O($(V,{})),"Node, Object":function(q,R){return O($(q,R))}});function A(V){return Si(V)?V.valueOf():V instanceof Array?V.map(A):Xe(V)?i(A(V.valueOf())):V}function C(V,q,R){try{return n[V].apply(null,q)}catch{return q=q.map(A),M(n[V].apply(null,q),R)}}var S=r({Fraction:k,number:function(q){return q<0?_(new o(-q)):new o(q)},BigNumber:function(q){return q<0?_(new o(-q)):new o(q)},Complex:function(q){throw new Error("Cannot convert Complex number to Node")},string:function(q){return new o(q)},Matrix:function(q){return new f(q.valueOf().map(R=>S(R)))}});function O(V){return Mr(V)?V:S(V)}function F(V,q){var R=q&&q.exactFractions!==!1;if(R&&isFinite(V)&&a){var j=a(V),U=q&&typeof q.fractionsLimit=="number"?q.fractionsLimit:1/0;if(j.valueOf()===V&&j.n0;)if(Sr(j[0])&&typeof j[0].value!="string"){var U=M(j.shift().value,R);fn(V)?V=V.items[U-1]:(V=V.valueOf()[U-1],V instanceof Array&&(V=i(V)))}else if(j.length>1&&Sr(j[1])&&typeof j[1].value!="string"){var se=M(j[1].value,R),de=[],ae=fn(V)?V.items:V.valueOf();for(var H of ae)if(fn(H))de.push(H.items[se-1]);else if(Xe(V))de.push(H[se-1]);else break;if(de.length===ae.length)fn(V)?V=new f(de):V=i(de),j.splice(1,1);else break}else break;return j.length===q.dimensions.length?new c(O(V),q):j.length>0?(q=new p(j),new c(O(V),q)):V}if(Ha(V)&&q.dimensions.length===1&&Sr(q.dimensions[0])){var pe=q.dimensions[0].value;return pe in V.properties?V.properties[pe]:new o}return new c(O(V),q)}function Y(V,q,R,j){var U=q.shift(),se=q.reduce((de,ae)=>{if(!Mr(ae)){var H=de.pop();if(Mr(H))return[H,ae];try{return de.push(C(V,[H,ae],j)),de}catch{de.push(H)}}de.push(O(de.pop()));var pe=de.length===1?de[0]:R(de);return[R([pe,O(ae)])]},[U]);return se.length===1?se[0]:R([se[0],S(se[1])])}function $(V,q){switch(V.type){case"SymbolNode":return V;case"ConstantNode":switch(typeof V.value){case"number":return M(V.value,q);case"string":return V.value;default:if(!isNaN(V.value))return M(V.value,q)}return V;case"FunctionNode":if(n[V.name]&&n[V.name].rawArgs)return V;{var R=["add","multiply"];if(R.indexOf(V.name)===-1){var j=V.args.map(Se=>$(Se,q));if(!j.some(Mr))try{return C(V.name,j,q)}catch{}if(V.name==="size"&&j.length===1&&fn(j[0])){for(var U=[],se=j[0];fn(se);)U.push(se.items.length),se=se.items[0];return i(U)}return new u(V.name,j.map(O))}}case"OperatorNode":{var de=V.fn.toString(),ae,H,pe=E(V);if(xt(V)&&V.isUnary())ae=[$(V.args[0],q)],Mr(ae[0])?H=pe(ae):H=C(de,ae,q);else if(y(V,q.context))if(ae=w(V,q.context),ae=ae.map(Se=>$(Se,q)),v(de,q.context)){for(var _e=[],me=[],xe=0;xe1?(H=Y(de,_e,pe,q),me.unshift(H),H=Y(de,me,pe,q)):H=Y(de,ae,pe,q)}else H=Y(de,ae,pe,q);else ae=V.args.map(Se=>$(Se,q)),H=Y(de,ae,pe,q);return H}case"ParenthesisNode":return $(V.content,q);case"AccessorNode":return L($(V.object,q),$(V.index,q),q);case"ArrayNode":{var Ne=V.items.map(Se=>$(Se,q));return Ne.some(Mr)?new f(Ne.map(O)):i(Ne)}case"IndexNode":return new p(V.dimensions.map(Se=>b(Se,q)));case"ObjectNode":{var ye={};for(var we in V.properties)ye[we]=b(V.properties[we],q);return new d(ye)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(V.type))}}return b});var HI="simplifyCore",AZ=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],M0=T(HI,AZ,e=>{var{typed:r,parse:t,equal:n,isZero:i,add:a,subtract:s,multiply:c,divide:f,pow:o,AccessorNode:u,ArrayNode:p,ConstantNode:d,FunctionNode:h,IndexNode:x,ObjectNode:v,OperatorNode:y,ParenthesisNode:w,SymbolNode:E}=e,b=new d(0),A=new d(1),C=new d(!0),S=new d(!1);function O(k){return xt(k)&&["and","not","or"].includes(k.op)}var{hasProperty:F,isCommutative:M}=kf({FunctionNode:h,OperatorNode:y,SymbolNode:E});function _(k){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=L?L.context:void 0;if(F(k,"trivial",Y)){if(En(k)&&k.args.length===1)return _(k.args[0],L);var $=!1,V=0;if(k.forEach(me=>{++V,V===1&&($=_(me,L))}),V===1)return $}var q=k;if(En(q)){var R=W_(q.name);if(R){if(q.args.length>2&&F(q,"associative",Y))for(;q.args.length>2;){var j=q.args.pop(),U=q.args.pop();q.args.push(new y(R,q.name,[j,U]))}q=new y(R,q.name,q.args)}else return new h(_(q.fn),q.args.map(me=>_(me,L)))}if(xt(q)&&q.isUnary()){var se=_(q.args[0],L);if(q.op==="~"&&xt(se)&&se.isUnary()&&se.op==="~"||q.op==="not"&&xt(se)&&se.isUnary()&&se.op==="not"&&O(se.args[0]))return se.args[0];var de=!0;if(q.op==="-"&&xt(se)&&(se.isBinary()&&se.fn==="subtract"&&(q=new y("-","subtract",[se.args[1],se.args[0]]),de=!1),se.isUnary()&&se.op==="-"))return se.args[0];if(de)return new y(q.op,q.fn,[se])}if(xt(q)&&q.isBinary()){var ae=_(q.args[0],L),H=_(q.args[1],L);if(q.op==="+"){if(Sr(ae)&&i(ae.value))return H;if(Sr(H)&&i(H.value))return ae;xt(H)&&H.isUnary()&&H.op==="-"&&(H=H.args[0],q=new y("-","subtract",[ae,H]))}if(q.op==="-")return xt(H)&&H.isUnary()&&H.op==="-"?_(new y("+","add",[ae,H.args[0]]),L):Sr(ae)&&i(ae.value)?_(new y("-","unaryMinus",[H])):Sr(H)&&i(H.value)?ae:new y(q.op,q.fn,[ae,H]);if(q.op==="*"){if(Sr(ae)){if(i(ae.value))return b;if(n(ae.value,1))return H}if(Sr(H)){if(i(H.value))return b;if(n(H.value,1))return ae;if(M(q,Y))return new y(q.op,q.fn,[H,ae],q.implicit)}return new y(q.op,q.fn,[ae,H],q.implicit)}if(q.op==="/")return Sr(ae)&&i(ae.value)?b:Sr(H)&&n(H.value,1)?ae:new y(q.op,q.fn,[ae,H]);if(q.op==="^"&&Sr(H)){if(i(H.value))return A;if(n(H.value,1))return ae}if(q.op==="and"){if(Sr(ae))if(ae.value){if(O(H))return H;if(Sr(H))return H.value?C:S}else return S;if(Sr(H))if(H.value){if(O(ae))return ae}else return S}if(q.op==="or"){if(Sr(ae)){if(ae.value)return C;if(O(H))return H}if(Sr(H)){if(H.value)return C;if(O(ae))return ae}}return new y(q.op,q.fn,[ae,H])}if(xt(q))return new y(q.op,q.fn,q.args.map(me=>_(me,L)));if(fn(q))return new p(q.items.map(me=>_(me,L)));if(Gn(q))return new u(_(q.object,L),_(q.index,L));if(oi(q))return new x(q.dimensions.map(me=>_(me,L)));if(Ha(q)){var pe={};for(var _e in q.properties)pe[_e]=_(q.properties[_e],L);return new v(pe)}return q}return r(HI,{Node:_,"Node,Object":_})});var CZ="resolve",EZ=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],_0=T(CZ,EZ,e=>{var{typed:r,parse:t,ConstantNode:n,FunctionNode:i,OperatorNode:a,ParenthesisNode:s}=e;function c(f,o){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!o)return f;if(ct(f)){if(u.has(f.name)){var p=Array.from(u).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(p,"}"))}var d=o.get(f.name);if(Mr(d)){var h=new Set(u);return h.add(f.name),c(d,o,h)}else return typeof d=="number"?t(String(d)):d!==void 0?new n(d):f}else if(xt(f)){var x=f.args.map(function(y){return c(y,o,u)});return new a(f.op,f.fn,x,f.implicit)}else{if(cn(f))return new s(c(f.content,o,u));if(En(f)){var v=f.args.map(function(y){return c(y,o,u)});return new i(f.name,v)}}return f.map(y=>c(y,o,u))}return r("resolve",{Node:c,"Node, Map | null | undefined":c,"Node, Object":(f,o)=>c(f,bo(o)),"Array | Matrix":r.referToSelf(f=>o=>o.map(u=>f(u))),"Array | Matrix, null | undefined":r.referToSelf(f=>o=>o.map(u=>f(u))),"Array, Object":r.referTo("Array,Map",f=>(o,u)=>f(o,bo(u))),"Matrix, Object":r.referTo("Matrix,Map",f=>(o,u)=>f(o,bo(u))),"Array | Matrix, Map":r.referToSelf(f=>(o,u)=>o.map(p=>f(p,u)))})});var GI="symbolicEqual",MZ=["parse","simplify","typed","OperatorNode"],T0=T(GI,MZ,e=>{var{parse:r,simplify:t,typed:n,OperatorNode:i}=e;function a(s,c){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=new i("-","subtract",[s,c]),u=t(o,{},f);return Sr(u)&&!u.value}return n(GI,{"Node, Node":a,"Node, Node, Object":a})});var $I="derivative",_Z=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],F0=T($I,_Z,e=>{var{typed:r,config:t,parse:n,simplify:i,equal:a,isZero:s,numeric:c,ConstantNode:f,FunctionNode:o,OperatorNode:u,ParenthesisNode:p,SymbolNode:d}=e;function h(b,A){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},S={};y(S,b,A.name);var O=w(b,S);return C.simplify?i(O):O}r.addConversion({from:"identifier",to:"SymbolNode",convert:n});var x=r($I,{"Node, SymbolNode":h,"Node, SymbolNode, Object":h});r.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),x._simplify=!0,x.toTex=function(b){return v.apply(null,b.args)};var v=r("_derivTex",{"Node, SymbolNode":function(A,C){return Sr(A)&&Ir(A.value)==="string"?v(n(A.value).toString(),C.toString(),1):v(A.toTex(),C.toString(),1)},"Node, ConstantNode":function(A,C){if(Ir(C.value)==="string")return v(A,n(C.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(A,C,S){return v(A.toString(),C.name,S.value)},"string, string, number":function(A,C,S){var O;return S===1?O="{d\\\\over d"+C+"}":O="{d^{"+S+"}\\\\over d"+C+"^{"+S+"}}",O+"\\\\left[".concat(A,"\\\\right]")}}),y=r("constTag",{"Object, ConstantNode, string":function(A,C){return A[C]=!0,!0},"Object, SymbolNode, string":function(A,C,S){return C.name!==S?(A[C]=!0,!0):!1},"Object, ParenthesisNode, string":function(A,C,S){return y(A,C.content,S)},"Object, FunctionAssignmentNode, string":function(A,C,S){return C.params.indexOf(S)===-1?(A[C]=!0,!0):y(A,C.expr,S)},"Object, FunctionNode | OperatorNode, string":function(A,C,S){if(C.args.length>0){for(var O=y(A,C.args[0],S),F=1;F0){var O=A.args.filter(function(V){return C[V]===void 0}),F=O.length===1?O[0]:new u("*","multiply",O),M=S.concat(w(F,C));return new u("*","multiply",M)}return new u("+","add",A.args.map(function(V){return new u("*","multiply",A.args.map(function(q){return q===V?w(q,C):q.clone()}))}))}if(A.op==="/"&&A.isBinary()){var _=A.args[0],k=A.args[1];return C[k]!==void 0?new u("/","divide",[w(_,C),k]):C[_]!==void 0?new u("*","multiply",[new u("-","unaryMinus",[_]),new u("/","divide",[w(k,C),new u("^","pow",[k.clone(),E(2)])])]):new u("/","divide",[new u("-","subtract",[new u("*","multiply",[w(_,C),k.clone()]),new u("*","multiply",[_.clone(),w(k,C)])]),new u("^","pow",[k.clone(),E(2)])])}if(A.op==="^"&&A.isBinary()){var L=A.args[0],Y=A.args[1];if(C[L]!==void 0)return Sr(L)&&(s(L.value)||a(L.value,1))?E(0):new u("*","multiply",[A,new u("*","multiply",[new o("log",[L.clone()]),w(Y.clone(),C)])]);if(C[Y]!==void 0){if(Sr(Y)){if(s(Y.value))return E(0);if(a(Y.value,1))return w(L,C)}var $=new u("^","pow",[L.clone(),new u("-","subtract",[Y,E(1)])]);return new u("*","multiply",[Y.clone(),new u("*","multiply",[w(L,C),$])])}return new u("*","multiply",[new u("^","pow",[L.clone(),Y.clone()]),new u("+","add",[new u("*","multiply",[w(L,C),new u("/","divide",[Y.clone(),L.clone()])]),new u("*","multiply",[w(Y,C),new o("log",[L.clone()])])])])}throw new Error('Cannot process operator "'+A.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function E(b,A){return new f(c(b,A||t.number))}return x});var ZI="rationalize",TZ=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],O0=T(ZI,TZ,e=>{var{config:r,typed:t,equal:n,isZero:i,add:a,subtract:s,multiply:c,divide:f,pow:o,parse:u,simplifyConstant:p,simplifyCore:d,simplify:h,fraction:x,bignumber:v,mathWithTransform:y,matrix:w,AccessorNode:E,ArrayNode:b,ConstantNode:A,FunctionNode:C,IndexNode:S,ObjectNode:O,OperatorNode:F,SymbolNode:M,ParenthesisNode:_}=e;function k(q){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,U=Y(),se=L(q,R,!0,U.firstRules),de=se.variables.length,ae={exactFractions:!1},H={exactFractions:!0};if(q=se.expression,de>=1){q=$(q);var pe,_e,me=!0,xe=!1;q=h(q,U.firstRules,{},ae);for(var Ne;_e=me?U.distrDivRules:U.sucDivRules,q=h(q,_e,{},H),me=!me,Ne=q.toString(),Ne!==pe;)xe=!0,pe=Ne;xe&&(q=h(q,U.firstRulesAgain,{},ae)),q=h(q,U.finalRules,{},ae)}var ye=[],we={};return q.type==="OperatorNode"&&q.isBinary()&&q.op==="/"?(de===1&&(q.args[0]=V(q.args[0],ye),q.args[1]=V(q.args[1])),j&&(we.numerator=q.args[0],we.denominator=q.args[1])):(de===1&&(q=V(q,ye)),j&&(we.numerator=q,we.denominator=null)),j?(we.coefficients=ye,we.variables=se.variables,we.expression=q,we):q}return t(ZI,{Node:k,"Node, boolean":(q,R)=>k(q,{},R),"Node, Object":k,"Node, Object, boolean":k});function L(q,R,j,U){var se=[],de=h(q,U,R,{exactFractions:!1});j=!!j;var ae="+-*"+(j?"/":"");pe(de);var H={};return H.expression=de,H.variables=se,H;function pe(_e){var me=_e.type;if(me==="FunctionNode")throw new Error("There is an unsolved function call");if(me==="OperatorNode")if(_e.op==="^"){if(_e.args[1].type!=="ConstantNode"||!Qe(parseFloat(_e.args[1].value)))throw new Error("There is a non-integer exponent");pe(_e.args[0])}else{if(ae.indexOf(_e.op)===-1)throw new Error("Operator "+_e.op+" invalid in polynomial expression");for(var xe=0;xe<_e.args.length;xe++)pe(_e.args[xe])}else if(me==="SymbolNode"){var Ne=_e.name,ye=se.indexOf(Ne);ye===-1&&se.push(Ne)}else if(me==="ParenthesisNode")pe(_e.content);else if(me!=="ConstantNode")throw new Error("type "+me+" is not allowed in polynomial expression")}}function Y(){var q=[d,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},p,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],R=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],j=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],U=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],se={};return se.firstRules=q.concat(R,U),se.distrDivRules=j,se.sucDivRules=U,se.firstRulesAgain=q.concat(R),se.finalRules=[d,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},p,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],se}function $(q,R,j){var U=q.type,se=arguments.length>1;if(U==="OperatorNode"&&q.isBinary()){var de=!1,ae;if(q.op==="^"&&(q.args[0].type==="ParenthesisNode"||q.args[0].type==="OperatorNode")&&q.args[1].type==="ConstantNode"&&(ae=parseFloat(q.args[1].value),de=ae>=2&&Qe(ae)),de){if(ae>2){var H=q.args[0],pe=new F("^","pow",[q.args[0].cloneDeep(),new A(ae-1)]);q=new F("*","multiply",[H,pe])}else q=new F("*","multiply",[q.args[0],q.args[0].cloneDeep()]);se&&(j==="content"?R.content=q:R.args[j]=q)}}if(U==="ParenthesisNode")$(q.content,q,"content");else if(U!=="ConstantNode"&&U!=="SymbolNode")for(var _e=0;_e=0;H--)if(R[H]!==0){var pe=new A(de?R[H]:Math.abs(R[H])),_e=R[H]<0?"-":"+";if(H>0){var me=new M(se);if(H>1){var xe=new A(H);me=new F("^","pow",[me,xe])}R[H]===-1&&de?pe=new F("-","unaryMinus",[me]):Math.abs(R[H])===1?pe=me:pe=new F("*","multiply",[pe,me])}de?ae=pe:_e==="+"?ae=new F("+","add",[ae,pe]):ae=new F("-","subtract",[ae,pe]),de=!1}if(de)return new A(0);return ae;function Ne(ye,we,Se){var Ce=ye.type;if(Ce==="FunctionNode")throw new Error("There is an unsolved function call");if(Ce==="OperatorNode"){if("+-*^".indexOf(ye.op)===-1)throw new Error("Operator "+ye.op+" invalid");if(we!==null){if((ye.fn==="unaryMinus"||ye.fn==="pow")&&we.fn!=="add"&&we.fn!=="subtract"&&we.fn!=="multiply")throw new Error("Invalid "+ye.op+" placing");if((ye.fn==="subtract"||ye.fn==="add"||ye.fn==="multiply")&&we.fn!=="add"&&we.fn!=="subtract")throw new Error("Invalid "+ye.op+" placing");if((ye.fn==="subtract"||ye.fn==="add"||ye.fn==="unaryMinus")&&Se.noFil!==0)throw new Error("Invalid "+ye.op+" placing")}(ye.op==="^"||ye.op==="*")&&(Se.fire=ye.op);for(var Ve=0;VeU&&(R[Ke]=0),R[Ke]+=Se.cte*(Se.oper==="+"?1:-1),U=Math.max(Ke,U);return}Se.cte=Ke,Se.fire===""&&(R[0]+=Se.cte*(Se.oper==="+"?1:-1))}else throw new Error("Type "+Ce+" is not allowed")}}});var QI="zpk2tf",FZ=["typed","add","multiply","Complex","number"],B0=T(QI,FZ,e=>{var{typed:r,add:t,multiply:n,Complex:i,number:a}=e;return r(QI,{"Array,Array,number":function(o,u,p){return s(o,u,p)},"Array,Array":function(o,u){return s(o,u,1)},"Matrix,Matrix,number":function(o,u,p){return s(o.valueOf(),u.valueOf(),p)},"Matrix,Matrix":function(o,u){return s(o.valueOf(),u.valueOf(),1)}});function s(f,o,u){f.some(E=>E.type==="BigNumber")&&(f=f.map(E=>a(E))),o.some(E=>E.type==="BigNumber")&&(o=o.map(E=>a(E)));for(var p=[i(1,0)],d=[i(1,0)],h=0;h=0&&p-d{var{typed:r,add:t,multiply:n,Complex:i,divide:a,matrix:s}=e;return r(XI,{"Array, Array":function(u,p){var d=f(512);return c(u,p,d)},"Array, Array, Array":function(u,p,d){return c(u,p,d)},"Array, Array, number":function(u,p,d){if(d<0)throw new Error("w must be a positive number");var h=f(d);return c(u,p,h)},"Matrix, Matrix":function(u,p){var d=f(512),{w:h,h:x}=c(u.valueOf(),p.valueOf(),d);return{w:s(h),h:s(x)}},"Matrix, Matrix, Matrix":function(u,p,d){var{h}=c(u.valueOf(),p.valueOf(),d.valueOf());return{h:s(h),w:s(d)}},"Matrix, Matrix, number":function(u,p,d){if(d<0)throw new Error("w must be a positive number");var h=f(d),{h:x}=c(u.valueOf(),p.valueOf(),h);return{h:s(x),w:s(h)}}});function c(o,u,p){for(var d=[],h=[],x=0;x{var{classes:r}=e;return function(n,i){var a=r[i&&i.mathjs];return a&&typeof a.fromJSON=="function"?a.fromJSON(i):i}});var PZ="replacer",kZ=[],k0=T(PZ,kZ,()=>function(r,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:t});var JI="12.4.1";var R0=T("true",[],()=>!0),L0=T("false",[],()=>!1),q0=T("null",[],()=>null),U0=Ei("Infinity",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1/0):1/0}),z0=Ei("NaN",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(NaN):NaN}),W0=Ei("pi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?al(t):FC}),V0=Ei("tau",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?jM(t):OC}),Y0=Ei("e",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?JM(t):BC}),H0=Ei("phi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?KM(t):IC}),G0=Ei("LN2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).ln():Math.LN2}),$0=Ei("LN10",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(10).ln():Math.LN10}),Z0=Ei("LOG2E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),Q0=Ei("LOG10E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),X0=Ei("SQRT1_2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),J0=Ei("SQRT2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),K0=Ei("i",["Complex"],e=>{var{Complex:r}=e;return r.I}),KI=T("PI",["pi"],e=>{var{pi:r}=e;return r}),jI=T("E",["e"],e=>{var{e:r}=e;return r}),j0=T("version",[],()=>JI);function Ei(e,r,t){return T(e,r,t,{recreateOnConfigChange:!0})}var ex=Or("speedOfLight","299792458","m s^-1"),rx=Or("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),tx=Or("planckConstant","6.62607015e-34","J s"),nx=Or("reducedPlanckConstant","1.0545718176461565e-34","J s"),ix=Or("magneticConstant","1.25663706212e-6","N A^-2"),ax=Or("electricConstant","8.8541878128e-12","F m^-1"),ox=Or("vacuumImpedance","376.730313667","ohm"),sx=Or("coulomb","8.987551792261171e9","N m^2 C^-2"),ux=Or("elementaryCharge","1.602176634e-19","C"),fx=Or("bohrMagneton","9.2740100783e-24","J T^-1"),cx=Or("conductanceQuantum","7.748091729863649e-5","S"),lx=Or("inverseConductanceQuantum","12906.403729652257","ohm"),px=Or("magneticFluxQuantum","2.0678338484619295e-15","Wb"),mx=Or("nuclearMagneton","5.0507837461e-27","J T^-1"),dx=Or("klitzing","25812.807459304513","ohm");var hx=Or("bohrRadius","5.29177210903e-11","m"),vx=Or("classicalElectronRadius","2.8179403262e-15","m"),gx=Or("electronMass","9.1093837015e-31","kg"),xx=Or("fermiCoupling","1.1663787e-5","GeV^-2"),yx=Xx("fineStructure",.0072973525693),bx=Or("hartreeEnergy","4.3597447222071e-18","J"),wx=Or("protonMass","1.67262192369e-27","kg"),Dx=Or("deuteronMass","3.3435830926e-27","kg"),Sx=Or("neutronMass","1.6749271613e-27","kg"),Nx=Or("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),Ax=Or("rydberg","10973731.568160","m^-1"),Cx=Or("thomsonCrossSection","6.6524587321e-29","m^2"),Ex=Xx("weakMixingAngle",.2229),Mx=Xx("efimovFactor",22.7),_x=Or("atomicMass","1.66053906660e-27","kg"),Tx=Or("avogadro","6.02214076e23","mol^-1"),Fx=Or("boltzmann","1.380649e-23","J K^-1"),Ox=Or("faraday","96485.33212331001","C mol^-1"),Bx=Or("firstRadiation","3.7417718521927573e-16","W m^2"),Ix=Or("loschmidt","2.686780111798444e25","m^-3"),Px=Or("gasConstant","8.31446261815324","J K^-1 mol^-1"),kx=Or("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),Rx=Or("molarVolume","0.022413969545014137","m^3 mol^-1"),Lx=Xx("sackurTetrode",-1.16487052358),qx=Or("secondRadiation","0.014387768775039337","m K"),Ux=Or("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),zx=Or("wienDisplacement","2.897771955e-3","m K"),Wx=Or("molarMass","0.99999999965e-3","kg mol^-1"),Vx=Or("molarMassC12","11.9999999958e-3","kg mol^-1"),Yx=Or("gravity","9.80665","m s^-2"),Hx=Or("planckLength","1.616255e-35","m"),Gx=Or("planckMass","2.176435e-8","kg"),$x=Or("planckTime","5.391245e-44","s"),Zx=Or("planckCharge","1.87554603778e-18","C"),Qx=Or("planckTemperature","1.416785e+32","K");function Or(e,r,t){var n=["config","Unit","BigNumber"];return T(e,n,i=>{var{config:a,Unit:s,BigNumber:c}=i,f=a.number==="BigNumber"?new c(r):parseFloat(r),o=new s(f,t);return o.fixPrefix=!0,o})}function Xx(e,r){var t=["config","BigNumber"];return T(e,t,n=>{var{config:i,BigNumber:a}=n;return i.number==="BigNumber"?new a(r):r})}var RZ="apply",LZ=["typed","isInteger"],Jx=T(RZ,LZ,e=>{var{typed:r,isInteger:t}=e,n=us({typed:r,isInteger:t});return r("apply",{"...any":function(a){var s=a[1];fr(s)?a[1]=s-1:nr(s)&&(a[1]=s.minus(1));try{return n.apply(null,a)}catch(c){throw bt(c)}}})},{isTransformFunction:!0});var qZ="column",UZ=["typed","Index","matrix","range"],Kx=T(qZ,UZ,e=>{var{typed:r,Index:t,matrix:n,range:i}=e,a=hf({typed:r,Index:t,matrix:n,range:i});return r("column",{"...any":function(c){var f=c.length-1,o=c[f];fr(o)&&(c[f]=o-1);try{return a.apply(null,c)}catch(u){throw bt(u)}}})},{isTransformFunction:!0});function Rf(e,r,t){var n=e.filter(function(f){return ct(f)&&!(f.name in r)&&!t.has(f.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=new Map,s=new ef(t,a,new Set([i])),c=e.compile();return function(o){return a.set(i,o),c.evaluate(s)}}var zZ="filter",WZ=["typed"],jx=T(zZ,WZ,e=>{var{typed:r}=e;function t(i,a,s){var c,f;return i[0]&&(c=i[0].compile().evaluate(s)),i[1]&&(ct(i[1])||Wi(i[1])?f=i[1].compile().evaluate(s):f=Rf(i[1],a,s)),n(c,f)}t.rawArgs=!0;var n=r("filter",{"Array, function":e4,"Matrix, function":function(a,s){return a.create(e4(a.toArray(),s))},"Array, RegExp":Ku,"Matrix, RegExp":function(a,s){return a.create(Ku(a.toArray(),s))}});return t},{isTransformFunction:!0});function e4(e,r){return um(e,function(t,n,i){return Gi(r,t,[n+1],i,"filter")})}var VZ="forEach",YZ=["typed"],ey=T(VZ,YZ,e=>{var{typed:r}=e;function t(i,a,s){var c,f;return i[0]&&(c=i[0].compile().evaluate(s)),i[1]&&(ct(i[1])||Wi(i[1])?f=i[1].compile().evaluate(s):f=Rf(i[1],a,s)),n(c,f)}t.rawArgs=!0;var n=r("forEach",{"Array | Matrix, function":function(a,s){var c=function f(o,u){if(Array.isArray(o))es(o,function(p,d){f(p,u.concat(d+1))});else return Gi(s,o,u,a,"forEach")};c(a.valueOf(),[])}});return t},{isTransformFunction:!0});var HZ="index",GZ=["Index","getMatrixDataType"],ry=T(HZ,GZ,e=>{var{Index:r,getMatrixDataType:t}=e;return function(){for(var i=[],a=0,s=arguments.length;a0?0:2;else if(c&&c.isSet===!0)c=c.map(function(o){return o-1});else if(Tr(c)||Xe(c))t(c)!=="boolean"&&(c=c.map(function(o){return o-1}));else if(fr(c))c--;else if(nr(c))c=c.toNumber()-1;else if(typeof c!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");i[a]=c}var f=new r;return r.apply(f,i),f}},{isTransformFunction:!0});var $Z="map",ZZ=["typed"],ty=T($Z,ZZ,e=>{var{typed:r}=e;function t(i,a,s){var c,f;return i[0]&&(c=i[0].compile().evaluate(s)),i[1]&&(ct(i[1])||Wi(i[1])?f=i[1].compile().evaluate(s):f=Rf(i[1],a,s)),n(c,f)}t.rawArgs=!0;var n=r("map",{"Array, function":function(a,s){return r4(a,s,a)},"Matrix, function":function(a,s){return a.create(r4(a.valueOf(),s,a))}});return t},{isTransformFunction:!0});function r4(e,r,t){function n(i,a){return Array.isArray(i)?si(i,function(s,c){return n(s,a.concat(c+1))}):Gi(r,i,a,t,"map")}return n(e,[])}function Pn(e){if(e.length===2&&Ot(e[0])){e=e.slice();var r=e[1];fr(r)?e[1]=r-1:nr(r)&&(e[1]=r.minus(1))}return e}var QZ="max",XZ=["typed","config","numeric","larger"],ny=T(QZ,XZ,e=>{var{typed:r,config:t,numeric:n,larger:i}=e,a=Ef({typed:r,config:t,numeric:n,larger:i});return r("max",{"...any":function(c){c=Pn(c);try{return a.apply(null,c)}catch(f){throw bt(f)}}})},{isTransformFunction:!0});var JZ="mean",KZ=["typed","add","divide"],iy=T(JZ,KZ,e=>{var{typed:r,add:t,divide:n}=e,i=Of({typed:r,add:t,divide:n});return r("mean",{"...any":function(s){s=Pn(s);try{return i.apply(null,s)}catch(c){throw bt(c)}}})},{isTransformFunction:!0});var jZ="min",eQ=["typed","config","numeric","smaller"],ay=T(jZ,eQ,e=>{var{typed:r,config:t,numeric:n,smaller:i}=e,a=Mf({typed:r,config:t,numeric:n,smaller:i});return r("min",{"...any":function(c){c=Pn(c);try{return a.apply(null,c)}catch(f){throw bt(f)}}})},{isTransformFunction:!0});var rQ="range",tQ=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],oy=T(rQ,tQ,e=>{var{typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:c,largerEq:f,add:o,isPositive:u}=e,p=xf({typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:s,larger:c,largerEq:f,add:o,isPositive:u});return r("range",{"...any":function(h){var x=h.length-1,v=h[x];return typeof v!="boolean"&&h.push(!0),p.apply(null,h)}})},{isTransformFunction:!0});var nQ="row",iQ=["typed","Index","matrix","range"],sy=T(nQ,iQ,e=>{var{typed:r,Index:t,matrix:n,range:i}=e,a=yf({typed:r,Index:t,matrix:n,range:i});return r("row",{"...any":function(c){var f=c.length-1,o=c[f];fr(o)&&(c[f]=o-1);try{return a.apply(null,c)}catch(u){throw bt(u)}}})},{isTransformFunction:!0});var aQ="subset",oQ=["typed","matrix","zeros","add"],uy=T(aQ,oQ,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e,a=bf({typed:r,matrix:t,zeros:n,add:i});return r("subset",{"...any":function(c){try{return a.apply(null,c)}catch(f){throw bt(f)}}})},{isTransformFunction:!0});var sQ="concat",uQ=["typed","matrix","isInteger"],fy=T(sQ,uQ,e=>{var{typed:r,matrix:t,isInteger:n}=e,i=df({typed:r,matrix:t,isInteger:n});return r("concat",{"...any":function(s){var c=s.length-1,f=s[c];fr(f)?s[c]=f-1:nr(f)&&(s[c]=f.minus(1));try{return i.apply(null,s)}catch(o){throw bt(o)}}})},{isTransformFunction:!0});var t4="diff",fQ=["typed","matrix","subtract","number","bignumber"],cy=T(t4,fQ,e=>{var{typed:r,matrix:t,subtract:n,number:i,bignumber:a}=e,s=vf({typed:r,matrix:t,subtract:n,number:i,bignumber:a});return r(t4,{"...any":function(f){f=Pn(f);try{return s.apply(null,f)}catch(o){throw bt(o)}}})},{isTransformFunction:!0});var cQ="std",lQ=["typed","map","sqrt","variance"],ly=T(cQ,lQ,e=>{var{typed:r,map:t,sqrt:n,variance:i}=e,a=Pf({typed:r,map:t,sqrt:n,variance:i});return r("std",{"...any":function(c){c=Pn(c);try{return a.apply(null,c)}catch(f){throw bt(f)}}})},{isTransformFunction:!0});var n4="sum",pQ=["typed","config","add","numeric"],py=T(n4,pQ,e=>{var{typed:r,config:t,add:n,numeric:i}=e,a=Tf({typed:r,config:t,add:n,numeric:i});return r(n4,{"...any":function(c){c=Pn(c);try{return a.apply(null,c)}catch(f){throw bt(f)}}})},{isTransformFunction:!0});var mQ="quantileSeq",dQ=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],my=T(mQ,dQ,e=>{var{typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:c,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:d}=e,h=If({typed:r,bignumber:t,add:n,subtract:i,divide:a,multiply:s,partitionSelect:c,compare:f,isInteger:o,smaller:u,smallerEq:p,larger:d});return r("quantileSeq",{"Array | Matrix, number | BigNumber":h,"Array | Matrix, number | BigNumber, number":(v,y,w)=>h(v,y,x(w)),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(v,y,w,E)=>h(v,y,w,x(E)),"Array | Matrix, Array | Matrix":h,"Array | Matrix, Array | Matrix, number":(v,y,w)=>h(v,y,x(w)),"Array | Matrix, Array | Matrix, boolean":h,"Array | Matrix, Array | Matrix, boolean, number":(v,y,w,E)=>h(v,y,w,x(E))});function x(v){return Pn([[],v])[1]}},{isTransformFunction:!0});var i4="cumsum",hQ=["typed","add","unaryPlus"],dy=T(i4,hQ,e=>{var{typed:r,add:t,unaryPlus:n}=e,i=Ff({typed:r,add:t,unaryPlus:n});return r(i4,{"...any":function(s){if(s.length===2&&Ot(s[0])){var c=s[1];fr(c)?s[1]=c-1:nr(c)&&(s[1]=c.minus(1))}try{return i.apply(null,s)}catch(f){throw bt(f)}}})},{isTransformFunction:!0});var a4="variance",vQ=["typed","add","subtract","multiply","divide","apply","isNaN"],hy=T(a4,vQ,e=>{var{typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:c}=e,f=Bf({typed:r,add:t,subtract:n,multiply:i,divide:a,apply:s,isNaN:c});return r(a4,{"...any":function(u){u=Pn(u);try{return f.apply(null,u)}catch(p){throw bt(p)}}})},{isTransformFunction:!0});var o4="print",gQ=["typed","matrix","zeros","add"],vy=T(o4,gQ,e=>{var{typed:r,matrix:t,zeros:n,add:i}=e,a=Df({typed:r,matrix:t,zeros:n,add:i});return r(o4,{"string, Object | Array":function(f,o){return a(s(f),o)},"string, Object | Array, number | Object":function(f,o,u){return a(s(f),o,u)}});function s(c){return c.replace(dh,f=>{var o=f.slice(1).split("."),u=o.map(function(p){return!isNaN(p)&&p.length>0?parseInt(p)-1:p});return"$"+u.join(".")})}},{isTransformFunction:!0});var xQ="and",yQ=["typed","matrix","zeros","add","equalScalar","not","concat"],gy=T(xQ,yQ,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,c=Cf({typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s});function f(o,u,p){var d=o[0].compile().evaluate(p);if(!Ot(d)&&!c(d,!0))return!1;var h=o[1].compile().evaluate(p);return c(d,h)}return f.rawArgs=!0,f},{isTransformFunction:!0});var bQ="or",wQ=["typed","matrix","equalScalar","DenseMatrix","concat"],xy=T(bQ,wQ,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=mf({typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a});function c(f,o,u){var p=f[0].compile().evaluate(u);if(!Ot(p)&&s(p,!1))return!0;var d=f[1].compile().evaluate(u);return s(p,d)}return c.rawArgs=!0,c},{isTransformFunction:!0});var DQ="bitAnd",SQ=["typed","matrix","zeros","add","equalScalar","not","concat"],yy=T(DQ,SQ,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s}=e,c=lf({typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:s});function f(o,u,p){var d=o[0].compile().evaluate(p);if(!Ot(d)){if(isNaN(d))return NaN;if(d===0||d===!1)return 0}var h=o[1].compile().evaluate(p);return c(d,h)}return f.rawArgs=!0,f},{isTransformFunction:!0});var NQ="bitOr",AQ=["typed","matrix","equalScalar","DenseMatrix","concat"],by=T(NQ,AQ,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,s=pf({typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a});function c(f,o,u){var p=f[0].compile().evaluate(u);if(!Ot(p)){if(isNaN(p))return NaN;if(p===-1)return-1;if(p===!0)return 1}var d=f[1].compile().evaluate(u);return s(p,d)}return c.rawArgs=!0,c},{isTransformFunction:!0});var $e=bm({config:Be}),wt=wm({}),DS=Y0({BigNumber:$e,config:Be}),s4=L0({}),u4=yx({BigNumber:$e,config:Be}),ls=Dm({}),SS=K0({Complex:wt}),f4=U0({BigNumber:$e,config:Be}),c4=$0({BigNumber:$e,config:Be}),l4=Q0({BigNumber:$e,config:Be}),fl=Nm({}),p4=z0({BigNumber:$e,config:Be}),m4=q0({}),d4=H0({BigNumber:$e,config:Be}),h4=Sm({}),NS=pm({}),v4=X0({BigNumber:$e,config:Be}),g4=Lx({BigNumber:$e,config:Be}),AS=V0({BigNumber:$e,config:Be}),x4=R0({}),y4=j0({}),Pr=Cm({Matrix:fl}),b4=Mx({BigNumber:$e,config:Be}),w4=G0({BigNumber:$e,config:Be}),wy=W0({BigNumber:$e,config:Be}),D4=k0({}),S4=J0({BigNumber:$e,config:Be}),ne=lm({BigNumber:$e,Complex:wt,DenseMatrix:Pr,Fraction:ls}),Dy=ed({BigNumber:$e,config:Be,typed:ne}),N4=Ex({BigNumber:$e,config:Be}),kn=rd({typed:ne}),A4=uv({Complex:wt,config:Be,typed:ne}),C4=cv({BigNumber:$e,typed:ne}),E4=pv({BigNumber:$e,Complex:wt,config:Be,typed:ne}),an=nd({typed:ne}),M4=_d({typed:ne}),_4=hv({BigNumber:$e,Complex:wt,config:Be,typed:ne}),T4=gv({typed:ne}),CS=xv({typed:ne}),F4=bv({Complex:wt,config:Be,typed:ne}),li=Hm({BigNumber:$e,typed:ne}),O4=Ed({typed:ne}),B4=Ym({typed:ne}),I4=Em({typed:ne}),cl=f0({typed:ne}),ll=Gm({Complex:wt,typed:ne}),ps=Td({typed:ne}),Sy=wv({typed:ne}),P4=Sv({BigNumber:$e,typed:ne}),k4=Av({BigNumber:$e,typed:ne}),R4=sd({typed:ne}),qr=Um({config:Be,typed:ne}),L4=oh({typed:ne}),ES=ud({typed:ne}),q4=fd({Complex:wt,typed:ne}),U4=Ld({typed:ne}),z4=Ud({typed:ne}),Lf=ch({typed:ne}),Ny=zd({typed:ne}),W4=mh({format:Lf,typed:ne}),Ay=Fd({typed:ne}),$n=Tm({typed:ne}),Ao=Om({typed:ne}),ms=Pm({typed:ne}),Qi=km({typed:ne}),V4=Z0({BigNumber:$e,config:Be}),Y4=p0({Complex:wt,typed:ne}),H4=md({Complex:wt,config:Be,typed:ne}),MS=dd({Complex:wt,config:Be,typed:ne}),ds=Yd({typed:ne}),zt=hd({typed:ne}),pl=Bd({typed:ne}),Xa=Wm({typed:ne}),G4=ph({format:Lf,typed:ne}),$4=x0({config:Be,typed:ne}),Z4=Df({typed:ne}),Q4=y0({config:Be,typed:ne}),Cy=Od({typed:ne}),X4=Ev({BigNumber:$e,typed:ne}),_S=xd({BigNumber:$e,Fraction:ls,complex:ll,typed:ne}),ml=_v({typed:ne}),Ja=zm({Matrix:fl,equalScalar:qr,typed:ne}),J4=Km({typed:ne}),K4=bd({typed:ne}),j4=Vm({typed:ne}),Mi=id({typed:ne}),eP=Fv({typed:ne}),TS=Lm({typed:ne}),rP=fv({Complex:wt,config:Be,typed:ne}),tP=mv({BigNumber:$e,typed:ne}),Ey=us({isInteger:$n,typed:ne}),nP=dv({BigNumber:$e,Complex:wt,config:Be,typed:ne}),iP=lh({format:Lf,typed:ne}),aP=c0({typed:ne}),oP=Dv({typed:ne}),sP=Cv({BigNumber:$e,typed:ne}),qf=Rm({typed:ne}),uP=vh({typed:ne}),fP=b0({config:Be,typed:ne}),cP=Mv({BigNumber:$e,typed:ne}),lP=Tv({typed:ne}),pP=ov({SparseMatrix:Ja,typed:ne}),Xi=yd({Complex:wt,config:Be,typed:ne}),mP=Ov({typed:ne}),Aa=jm({typed:ne}),dP=lv({BigNumber:$e,Complex:wt,config:Be,typed:ne}),hP=Nv({BigNumber:$e,typed:ne}),au=$m({Fraction:ls,typed:ne}),hs=Bm({typed:ne}),Ge=Zm({DenseMatrix:Pr,Matrix:fl,SparseMatrix:Ja,typed:ne}),vP=Qm({isZero:Qi,matrix:Ge,typed:ne}),gP=uh({isNaN:qf,isNumeric:hs,typed:ne}),Ji=gh({bignumber:li,fraction:au,number:Xa}),FS=fh({config:Be,multiplyScalar:zt,numeric:Ji,typed:ne}),OS=Zd({isInteger:$n,matrix:Ge,typed:ne}),bn=Kd({matrix:Ge,config:Be,typed:ne}),xP=jd({matrix:Ge,typed:ne}),Uf=eh({matrix:Ge,typed:ne}),BS=Dd({BigNumber:$e,config:Be,matrix:Ge,typed:ne}),wn=th({BigNumber:$e,config:Be,matrix:Ge,typed:ne}),yP=vv({Complex:wt,config:Be,typed:ne}),IS=ad({BigNumber:$e,Complex:wt,Fraction:ls,config:Be,isNegative:Ao,matrix:Ge,typed:ne,unaryMinus:Aa}),Xr=df({isInteger:$n,matrix:Ge,typed:ne}),bP=Pd({prod:FS,size:bn,typed:ne}),My=rh({conj:ps,transpose:Uf,typed:ne}),PS=Rd({DenseMatrix:Pr,SparseMatrix:Ja,matrix:Ge,typed:ne}),It=xh({numeric:Ji,typed:ne}),zf=Ah({DenseMatrix:Pr,concat:Xr,divideScalar:It,equalScalar:qr,matrix:Ge,typed:ne}),_i=Lh({DenseMatrix:Pr,concat:Xr,equalScalar:qr,matrix:Ge,typed:ne}),Wf=qd({matrix:Ge,typed:ne}),wP=Im({isNumeric:hs,typed:ne}),Co=Wd({BigNumber:$e,DenseMatrix:Pr,SparseMatrix:Ja,config:Be,matrix:Ge,typed:ne}),DP=Vd({matrix:Ge,multiplyScalar:zt,typed:ne}),dl=$h({DenseMatrix:Pr,concat:Xr,config:Be,matrix:Ge,typed:ne}),SP=Th({DenseMatrix:Pr,concat:Xr,equalScalar:qr,matrix:Ge,typed:ne,zeros:wn}),kS=Ch({DenseMatrix:Pr,divideScalar:It,equalScalar:qr,matrix:Ge,multiplyScalar:zt,subtractScalar:Mi,typed:ne}),_y=Jm({flatten:Wf,matrix:Ge,size:bn,typed:ne}),NP=gd({BigNumber:$e,concat:Xr,equalScalar:qr,matrix:Ge,typed:ne}),AP=Hd({BigNumber:$e,config:Be,matrix:Ge,typed:ne}),Ty=Rg({addScalar:an,complex:ll,conj:ps,divideScalar:It,equal:_i,identity:Co,isZero:Qi,matrix:Ge,multiplyScalar:zt,sign:_S,sqrt:Xi,subtractScalar:Mi,typed:ne,unaryMinus:Aa,zeros:wn}),CP=Qd({config:Be,matrix:Ge}),EP=Fh({DenseMatrix:Pr,concat:Xr,equalScalar:qr,matrix:Ge,typed:ne,zeros:wn}),ou=bh({BigNumber:$e,DenseMatrix:Pr,config:Be,equalScalar:qr,matrix:Ge,typed:ne,zeros:wn}),Rn=zh({DenseMatrix:Pr,concat:Xr,config:Be,matrix:Ge,typed:ne}),Wt=wd({DenseMatrix:Pr,concat:Xr,equalScalar:qr,matrix:Ge,subtractScalar:Mi,typed:ne,unaryMinus:Aa}),MP=hh({concat:Xr,matrix:Ge,typed:ne}),_P=Xh({DenseMatrix:Pr,concat:Xr,config:Be,equalScalar:qr,matrix:Ge,typed:ne}),Fy=Eh({DenseMatrix:Pr,divideScalar:It,equalScalar:qr,matrix:Ge,multiplyScalar:zt,subtractScalar:Mi,typed:ne}),TP=Id({DenseMatrix:Pr,concat:Xr,matrix:Ge,typed:ne}),Vr=Vv({DenseMatrix:Pr,SparseMatrix:Ja,addScalar:an,concat:Xr,equalScalar:qr,matrix:Ge,typed:ne}),FP=yv({BigNumber:$e,DenseMatrix:Pr,concat:Xr,equalScalar:qr,matrix:Ge,typed:ne}),OP=lf({concat:Xr,equalScalar:qr,matrix:Ge,typed:ne}),BP=pf({DenseMatrix:Pr,concat:Xr,equalScalar:qr,matrix:Ge,typed:ne}),IP=Md({DenseMatrix:Pr,concat:Xr,matrix:Ge,typed:ne}),PP=S0({addScalar:an,combinations:cl,divideScalar:It,isInteger:$n,isNegative:Ao,multiplyScalar:zt,typed:ne}),vs=Ih({BigNumber:$e,DenseMatrix:Pr,Fraction:ls,concat:Xr,config:Be,equalScalar:qr,matrix:Ge,typed:ne}),RS=kh({concat:Xr,matrix:Ge,typed:ne}),kP=Ff({add:Vr,typed:ne,unaryPlus:Dy}),Oy=Zh({equal:_i,typed:ne}),RP=vf({matrix:Ge,number:Xa,subtract:Wt,typed:ne}),LP=n0({abs:kn,addScalar:an,deepEqual:Oy,divideScalar:It,multiplyScalar:zt,sqrt:Xi,subtractScalar:Mi,typed:ne}),hl=Gv({addScalar:an,conj:ps,multiplyScalar:zt,size:bn,typed:ne}),qP=qh({compareText:RS,isZero:Qi,typed:ne}),LS=sf({DenseMatrix:Pr,config:Be,equalScalar:qr,matrix:Ge,round:ou,typed:ne,zeros:wn}),UP=ld({BigNumber:$e,DenseMatrix:Pr,concat:Xr,config:Be,equalScalar:qr,matrix:Ge,round:ou,typed:ne,zeros:wn}),zP=Yv({abs:kn,addScalar:an,divideScalar:It,isPositive:ms,multiplyScalar:zt,smaller:Rn,sqrt:Xi,typed:ne}),qS=jh({DenseMatrix:Pr,smaller:Rn}),_n=ev({ImmutableDenseMatrix:qS,getMatrixDataType:Ny}),Ln=Hh({DenseMatrix:Pr,concat:Xr,config:Be,matrix:Ge,typed:ne}),By=wh({Complex:wt,config:Be,divideScalar:It,typed:ne}),WP=Mh({DenseMatrix:Pr,divideScalar:It,equalScalar:qr,matrix:Ge,multiplyScalar:zt,subtractScalar:Mi,typed:ne}),VP=Xm({flatten:Wf,matrix:Ge,size:bn,typed:ne}),YP=Mf({config:Be,numeric:Ji,smaller:Rn,typed:ne}),US=uf({DenseMatrix:Pr,concat:Xr,config:Be,equalScalar:qr,matrix:Ge,round:ou,typed:ne,zeros:wn}),lt=vd({addScalar:an,dot:hl,equalScalar:qr,matrix:Ge,multiplyScalar:zt,typed:ne}),HP=Sh({Complex:wt,config:Be,divideScalar:It,typed:ne}),GP=mf({DenseMatrix:Pr,concat:Xr,equalScalar:qr,matrix:Ge,typed:ne}),vl=Jh({compare:vs,isNaN:qf,isNumeric:hs,typed:ne}),$P=Oh({DenseMatrix:Pr,concat:Xr,equalScalar:qr,matrix:Ge,typed:ne,zeros:wn}),zS=Ug({SparseMatrix:Ja,abs:kn,add:Vr,divideScalar:It,larger:Ln,largerEq:dl,multiply:lt,subtract:Wt,transpose:Uf,typed:ne}),pi=bf({add:Vr,matrix:Ge,typed:ne,zeros:wn}),Iy=Tf({add:Vr,config:Be,numeric:Ji,typed:ne}),ZP=$v({add:Vr,matrix:Ge,typed:ne}),WS=_h({DenseMatrix:Pr,divideScalar:It,equalScalar:qr,matrix:Ge,multiplyScalar:zt,subtractScalar:Mi,typed:ne}),QP=B0({Complex:wt,add:Vr,multiply:lt,number:Xa,typed:ne}),Py=od({DenseMatrix:Pr,config:Be,equalScalar:qr,matrix:Ge,round:ou,typed:ne,zeros:wn}),Ca=Ph({compare:vs,typed:ne}),XP=N0({addScalar:an,combinations:cl,isInteger:$n,isNegative:Ao,isPositive:ms,larger:Ln,typed:ne}),JP=kd({matrix:Ge,multiply:lt,subtract:Wt,typed:ne}),VS=$g({divideScalar:It,isZero:Qi,matrix:Ge,multiply:lt,subtractScalar:Mi,typed:ne,unaryMinus:Aa}),KP=Ad({concat:Xr,equalScalar:qr,matrix:Ge,multiplyScalar:zt,typed:ne}),YS=rv({larger:Ln,smaller:Rn}),HS=cd({Complex:wt,DenseMatrix:Pr,ceil:Py,equalScalar:qr,floor:LS,matrix:Ge,typed:ne,zeros:wn}),GS=Zv({Index:_n,typed:ne}),jP=i0({abs:kn,add:Vr,addScalar:an,config:Be,divideScalar:It,equalScalar:qr,flatten:Wf,isNumeric:hs,isZero:Qi,matrix:Ge,multiply:lt,multiplyScalar:zt,smaller:Rn,subtract:Wt,typed:ne}),e5=Sd({BigNumber:$e,add:Vr,config:Be,equal:_i,isInteger:$n,mod:US,smaller:Rn,typed:ne,xgcd:BS}),r5=pd({concat:Xr,equalScalar:qr,matrix:Ge,typed:ne}),t5=Dh({Complex:wt,config:Be,divideScalar:It,log:By,typed:ne}),ky=Ef({config:Be,larger:Ln,numeric:Ji,typed:ne}),n5=Bv({DenseMatrix:Pr,Index:_n,compareNatural:Ca,size:bn,subset:pi,typed:ne}),i5=Pv({DenseMatrix:Pr,Index:_n,compareNatural:Ca,size:bn,subset:pi,typed:ne}),a5=Rv({Index:_n,compareNatural:Ca,size:bn,subset:pi,typed:ne}),o5=qv({Index:_n,compareNatural:Ca,size:bn,subset:pi,typed:ne}),su=Vh({DenseMatrix:Pr,concat:Xr,config:Be,matrix:Ge,typed:ne}),s5=Kh({compare:vs,compareNatural:Ca,matrix:Ge,typed:ne}),u5=Cf({concat:Xr,equalScalar:qr,matrix:Ge,not:pl,typed:ne,zeros:wn}),uu=xf({bignumber:li,matrix:Ge,add:Vr,config:Be,isPositive:ms,larger:Ln,largerEq:dl,smaller:Rn,smallerEq:su,typed:ne}),f5=yf({Index:_n,matrix:Ge,range:uu,typed:ne}),$S=Iv({DenseMatrix:Pr,Index:_n,compareNatural:Ca,size:bn,subset:pi,typed:ne}),c5=Lv({Index:_n,compareNatural:Ca,size:bn,subset:pi,typed:ne}),ZS=zv({Index:_n,concat:Xr,setDifference:$S,size:bn,subset:pi,typed:ne}),QS=tv({FibonacciHeap:YS,addScalar:an,equalScalar:qr}),XS=hf({Index:_n,matrix:Ge,range:uu,typed:ne}),gs=Zg({abs:kn,addScalar:an,det:VS,divideScalar:It,identity:Co,matrix:Ge,multiply:lt,typed:ne,unaryMinus:Aa}),JS=kg({DenseMatrix:Pr,Spa:QS,SparseMatrix:Ja,abs:kn,addScalar:an,divideScalar:It,equalScalar:qr,larger:Ln,matrix:Ge,multiplyScalar:zt,subtractScalar:Mi,typed:ne,unaryMinus:Aa}),l5=Qg({Complex:wt,add:Vr,ctranspose:My,deepEqual:Oy,divideScalar:It,dot:hl,dotDivide:zf,equal:_i,inv:gs,matrix:Ge,multiply:lt,typed:ne}),Ti=yh({Complex:wt,config:Be,fraction:au,identity:Co,inv:gs,matrix:Ge,multiply:lt,number:Xa,typed:ne}),KS=kv({DenseMatrix:Pr,Index:_n,compareNatural:Ca,size:bn,subset:pi,typed:ne}),p5=Wv({Index:_n,concat:Xr,setIntersect:KS,setSymDifference:ZS,size:bn,subset:pi,typed:ne}),m5=Kg({abs:kn,add:Vr,identity:Co,inv:gs,map:ds,max:ky,multiply:lt,size:bn,sqrt:Xi,subtract:Wt,typed:ne}),Ar=iv({BigNumber:$e,Complex:wt,Fraction:ls,abs:kn,addScalar:an,config:Be,divideScalar:It,equal:_i,fix:HS,format:Lf,isNumeric:hs,multiplyScalar:zt,number:Xa,pow:Ti,round:ou,subtractScalar:Mi}),d5=ox({BigNumber:$e,Unit:Ar,config:Be}),h5=zx({BigNumber:$e,Unit:Ar,config:Be}),v5=_x({BigNumber:$e,Unit:Ar,config:Be}),g5=fx({BigNumber:$e,Unit:Ar,config:Be}),x5=Fx({BigNumber:$e,Unit:Ar,config:Be}),y5=cx({BigNumber:$e,Unit:Ar,config:Be}),b5=sx({BigNumber:$e,Unit:Ar,config:Be}),w5=Dx({BigNumber:$e,Unit:Ar,config:Be}),D5=Nh({DenseMatrix:Pr,concat:Xr,equalScalar:qr,matrix:Ge,pow:Ti,typed:ne}),S5=ax({BigNumber:$e,Unit:Ar,config:Be}),N5=ux({BigNumber:$e,Unit:Ar,config:Be}),A5=Jg({abs:kn,add:Vr,identity:Co,inv:gs,multiply:lt,typed:ne}),C5=Ox({BigNumber:$e,Unit:Ar,config:Be}),jS=nh({addScalar:an,ceil:Py,conj:ps,divideScalar:It,dotDivide:zf,exp:ES,i:SS,log2:MS,matrix:Ge,multiplyScalar:zt,pow:Ti,tau:AS,typed:ne}),Ry=l0({BigNumber:$e,Complex:wt,config:Be,multiplyScalar:zt,pow:Ti,typed:ne}),E5=rx({BigNumber:$e,Unit:Ar,config:Be}),M5=bx({BigNumber:$e,Unit:Ar,config:Be}),_5=ih({conj:ps,dotDivide:zf,fft:jS,typed:ne}),T5=dx({BigNumber:$e,Unit:Ar,config:Be}),F5=Ix({BigNumber:$e,Unit:Ar,config:Be}),O5=ix({BigNumber:$e,Unit:Ar,config:Be}),B5=Wx({BigNumber:$e,Unit:Ar,config:Be}),I5=kx({BigNumber:$e,Unit:Ar,config:Be}),P5=Sx({BigNumber:$e,Unit:Ar,config:Be}),k5=mx({BigNumber:$e,Unit:Ar,config:Be}),R5=Zx({BigNumber:$e,Unit:Ar,config:Be}),L5=Hx({BigNumber:$e,Unit:Ar,config:Be}),q5=Qx({BigNumber:$e,Unit:Ar,config:Be}),U5=wx({BigNumber:$e,Unit:Ar,config:Be}),z5=Nx({BigNumber:$e,Unit:Ar,config:Be}),W5=nx({BigNumber:$e,Unit:Ar,config:Be}),V5=Ax({BigNumber:$e,Unit:Ar,config:Be}),Y5=qx({BigNumber:$e,Unit:Ar,config:Be}),H5=ex({BigNumber:$e,Unit:Ar,config:Be}),G5=Ux({BigNumber:$e,Unit:Ar,config:Be}),$5=Cx({BigNumber:$e,Unit:Ar,config:Be}),Z5=Tx({BigNumber:$e,Unit:Ar,config:Be}),Q5=hx({BigNumber:$e,Unit:Ar,config:Be}),X5=sv({Unit:Ar,typed:ne}),dn=t0({divideScalar:It,equalScalar:qr,inv:gs,matrix:Ge,multiply:lt,typed:ne}),J5=gx({BigNumber:$e,Unit:Ar,config:Be}),Vf=m0({gamma:Ry,typed:ne}),K5=Bx({BigNumber:$e,Unit:Ar,config:Be}),j5=Yx({BigNumber:$e,Unit:Ar,config:Be}),e6=lx({BigNumber:$e,Unit:Ar,config:Be}),eN=zg({DenseMatrix:Pr,lsolve:kS,lup:JS,matrix:Ge,slu:zS,typed:ne,usolve:Fy}),r6=px({BigNumber:$e,Unit:Ar,config:Be}),t6=Vx({BigNumber:$e,Unit:Ar,config:Be}),n6=h0({add:Vr,divide:dn,factorial:Vf,isInteger:$n,isPositive:ms,multiply:lt,typed:ne}),i6=v0({factorial:Vf,typed:ne}),a6=Gx({BigNumber:$e,Unit:Ar,config:Be}),o6=Wg({add:Vr,cbrt:IS,divide:dn,equalScalar:qr,im:Ay,isZero:Qi,multiply:lt,re:Cy,sqrt:Xi,subtract:Wt,typeOf:TS,typed:ne,unaryMinus:Aa}),s6=Uv({compareNatural:Ca,typed:ne}),u6=ah({abs:kn,add:Vr,bignumber:li,divide:dn,isNegative:Ao,isPositive:ms,larger:Ln,map:ds,matrix:Ge,max:ky,multiply:lt,smaller:Rn,subtract:Wt,typed:ne,unaryMinus:Aa}),rN=w0({bignumber:li,addScalar:an,combinations:cl,divideScalar:It,factorial:Vf,isInteger:$n,isNegative:Ao,larger:Ln,multiplyScalar:zt,number:Xa,pow:Ti,subtractScalar:Mi,typed:ne}),f6=av({Unit:Ar,typed:ne}),c6=D0({addScalar:an,isInteger:$n,isNegative:Ao,stirlingS2:rN,typed:ne}),tN=Xg({abs:kn,add:Vr,addScalar:an,atan:CS,bignumber:li,column:XS,complex:ll,config:Be,cos:Sy,diag:PS,divideScalar:It,dot:hl,equal:_i,flatten:Wf,im:Ay,inv:gs,larger:Ln,matrix:Ge,matrixFromColumns:_y,multiply:lt,multiplyScalar:zt,number:Xa,qr:Ty,re:Cy,reshape:OS,sin:ml,size:bn,smaller:Rn,sqrt:Xi,subtract:Wt,typed:ne,usolve:Fy,usolveAll:WS}),l6=xx({BigNumber:$e,Unit:Ar,config:Be}),p6=Px({BigNumber:$e,Unit:Ar,config:Be}),m6=d0({divide:dn,dotDivide:zf,isNumeric:hs,log:By,map:ds,matrix:Ge,multiply:lt,sum:Iy,typed:ne}),nN=Of({add:Vr,divide:dn,typed:ne}),d6=Rx({BigNumber:$e,Unit:Ar,config:Be}),h6=tx({BigNumber:$e,Unit:Ar,config:Be}),v6=If({bignumber:li,add:Vr,compare:vs,divide:dn,isInteger:$n,larger:Ln,multiply:lt,partitionSelect:vl,smaller:Rn,smallerEq:su,subtract:Wt,typed:ne}),Ly=Bf({add:Vr,apply:Ey,divide:dn,isNaN:qf,multiply:lt,subtract:Wt,typed:ne}),g6=vx({BigNumber:$e,Unit:Ar,config:Be}),iN=o0({add:Vr,compare:vs,divide:dn,partitionSelect:vl,typed:ne}),x6=u0({add:Vr,divide:dn,matrix:Ge,mean:nN,multiply:lt,pow:Ti,sqrt:Xi,subtract:Wt,sum:Iy,typed:ne}),y6=I0({Complex:wt,add:Vr,divide:dn,matrix:Ge,multiply:lt,typed:ne}),b6=s0({abs:kn,map:ds,median:iN,subtract:Wt,typed:ne}),w6=Pf({map:ds,sqrt:Xi,typed:ne,variance:Ly}),D6=sh({BigNumber:$e,Complex:wt,add:Vr,config:Be,divide:dn,equal:_i,factorial:Vf,gamma:Ry,isNegative:Ao,multiply:lt,pi:wy,pow:Ti,sin:ml,smallerEq:su,subtract:Wt,typed:ne}),qy=Hv({abs:kn,add:Vr,conj:ps,ctranspose:My,eigs:tN,equalScalar:qr,larger:Ln,matrix:Ge,multiply:lt,pow:Ti,smaller:Rn,sqrt:Xi,typed:ne}),aN=Jd({BigNumber:$e,DenseMatrix:Pr,SparseMatrix:Ja,addScalar:an,config:Be,cos:Sy,matrix:Ge,multiplyScalar:zt,norm:qy,sin:ml,typed:ne,unaryMinus:Aa}),S6=$x({BigNumber:$e,Unit:Ar,config:Be}),oN=e0({identity:Co,matrix:Ge,multiply:lt,norm:qy,qr:Ty,subtract:Wt,typed:ne}),N6=Xd({multiply:lt,rotationMatrix:aN,typed:ne}),sN=jg({abs:kn,add:Vr,concat:Xr,identity:Co,index:GS,lusolve:eN,matrix:Ge,matrixFromColumns:_y,multiply:lt,range:uu,schur:oN,subset:pi,subtract:Wt,transpose:Uf,typed:ne}),A6=r0({matrix:Ge,multiply:lt,sylvester:sN,transpose:Uf,typed:ne});var Yf={},Hf={},C6={},qn=Xv({mathWithTransform:Hf}),Gf=yg({Node:qn}),Eo=wg({Node:qn}),fu=Sg({Node:qn}),E6=Eg({Node:qn}),$f=rg({Node:qn}),M6=sg({Node:qn,ResultSet:NS}),_6=fg({Node:qn}),xs=mg({Node:qn}),T6=Ag({Node:qn}),CQ=P0({classes:C6}),uN=Yg({math:Yf,typed:ne}),F6=hg({Node:qn,typed:ne}),EQ=Gg({Chain:uN,typed:ne}),Zf=gg({Node:qn,size:bn}),Qf=jv({Node:qn,subset:pi}),O6=ag({matrix:Ge,Node:qn,subset:pi}),ys=Mg({Unit:Ar,Node:qn,math:Yf}),bs=Tg({Node:qn,SymbolNode:ys,math:Yf}),Ki=Fg({AccessorNode:Qf,ArrayNode:$f,AssignmentNode:O6,BlockNode:M6,ConditionalNode:_6,ConstantNode:xs,FunctionAssignmentNode:F6,FunctionNode:bs,IndexNode:Zf,ObjectNode:Gf,OperatorNode:Eo,ParenthesisNode:fu,RangeNode:T6,RelationalNode:E6,SymbolNode:ys,config:Be,numeric:Ji,typed:ne}),B6=_0({ConstantNode:xs,FunctionNode:bs,OperatorNode:Eo,ParenthesisNode:fu,parse:Ki,typed:ne}),fN=E0({bignumber:li,fraction:au,AccessorNode:Qf,ArrayNode:$f,ConstantNode:xs,FunctionNode:bs,IndexNode:Zf,ObjectNode:Gf,OperatorNode:Eo,SymbolNode:ys,config:Be,mathWithTransform:Hf,matrix:Ge,typed:ne}),MQ=Og({parse:Ki,typed:ne}),cN=M0({AccessorNode:Qf,ArrayNode:$f,ConstantNode:xs,FunctionNode:bs,IndexNode:Zf,ObjectNode:Gf,OperatorNode:Eo,ParenthesisNode:fu,SymbolNode:ys,add:Vr,divide:dn,equal:_i,isZero:Qi,multiply:lt,parse:Ki,pow:Ti,subtract:Wt,typed:ne}),lN=Bg({parse:Ki,typed:ne}),I6=Vg({evaluate:lN}),P6=Ig({evaluate:lN}),Uy=C0({bignumber:li,fraction:au,AccessorNode:Qf,ArrayNode:$f,ConstantNode:xs,FunctionNode:bs,IndexNode:Zf,ObjectNode:Gf,OperatorNode:Eo,ParenthesisNode:fu,SymbolNode:ys,add:Vr,config:Be,divide:dn,equal:_i,isZero:Qi,mathWithTransform:Hf,matrix:Ge,multiply:lt,parse:Ki,pow:Ti,resolve:B6,simplifyConstant:fN,simplifyCore:cN,subtract:Wt,typed:ne}),_Q=T0({OperatorNode:Eo,parse:Ki,simplify:Uy,typed:ne}),TQ=A0({parse:Ki,typed:ne}),FQ=Pg({Parser:P6,typed:ne}),OQ=O0({bignumber:li,fraction:au,AccessorNode:Qf,ArrayNode:$f,ConstantNode:xs,FunctionNode:bs,IndexNode:Zf,ObjectNode:Gf,OperatorNode:Eo,ParenthesisNode:fu,SymbolNode:ys,add:Vr,config:Be,divide:dn,equal:_i,isZero:Qi,mathWithTransform:Hf,matrix:Ge,multiply:lt,parse:Ki,pow:Ti,simplify:Uy,simplifyConstant:fN,simplifyCore:cN,subtract:Wt,typed:ne}),BQ=F0({ConstantNode:xs,FunctionNode:bs,OperatorNode:Eo,ParenthesisNode:fu,SymbolNode:ys,config:Be,equal:_i,isZero:Qi,numeric:Ji,parse:Ki,simplify:Uy,typed:ne}),IQ=Hg({Help:I6,mathWithTransform:Hf,typed:ne});St(Yf,{e:DS,false:s4,fineStructure:u4,i:SS,Infinity:f4,LN10:c4,LOG10E:l4,NaN:p4,null:m4,phi:d4,SQRT1_2:v4,sackurTetrode:g4,tau:AS,true:x4,E:DS,version:y4,efimovFactor:b4,LN2:w4,pi:wy,replacer:D4,reviver:CQ,SQRT2:S4,typed:ne,unaryPlus:Dy,PI:wy,weakMixingAngle:N4,abs:kn,acos:A4,acot:C4,acsc:E4,addScalar:an,arg:M4,asech:_4,asinh:T4,atan:CS,atanh:F4,bignumber:li,bitNot:O4,boolean:B4,clone:I4,combinations:cl,complex:ll,conj:ps,cos:Sy,cot:P4,csc:k4,cube:R4,equalScalar:qr,erf:L4,exp:ES,expm1:q4,filter:U4,forEach:z4,format:Lf,getMatrixDataType:Ny,hex:W4,im:Ay,isInteger:$n,isNegative:Ao,isPositive:ms,isZero:Qi,LOG2E:V4,lgamma:Y4,log10:H4,log2:MS,map:ds,multiplyScalar:zt,not:pl,number:Xa,oct:G4,pickRandom:$4,print:Z4,random:Q4,re:Cy,sec:X4,sign:_S,sin:ml,splitUnit:J4,square:K4,string:j4,subtractScalar:Mi,tan:eP,typeOf:TS,acosh:rP,acsch:tP,apply:Ey,asec:nP,bin:iP,chain:EQ,combinationsWithRep:aP,cosh:oP,csch:sP,isNaN:qf,isPrime:uP,randomInt:fP,sech:cP,sinh:lP,sparse:pP,sqrt:Xi,tanh:mP,unaryMinus:Aa,acoth:dP,coth:hP,fraction:au,isNumeric:hs,matrix:Ge,matrixFromFunction:vP,mode:gP,numeric:Ji,prod:FS,reshape:OS,size:bn,squeeze:xP,transpose:Uf,xgcd:BS,zeros:wn,asin:yP,cbrt:IS,concat:Xr,count:bP,ctranspose:My,diag:PS,divideScalar:It,dotDivide:zf,equal:_i,flatten:Wf,hasNumericValue:wP,identity:Co,kron:DP,largerEq:dl,leftShift:SP,lsolve:kS,matrixFromColumns:_y,nthRoot:NP,ones:AP,qr:Ty,resize:CP,rightArithShift:EP,round:ou,smaller:Rn,subtract:Wt,to:MP,unequal:_P,usolve:Fy,xor:TP,add:Vr,atan2:FP,bitAnd:OP,bitOr:BP,bitXor:IP,catalan:PP,compare:vs,compareText:RS,cumsum:kP,deepEqual:Oy,diff:RP,distance:LP,dot:hl,equalText:qP,floor:LS,gcd:UP,hypot:zP,larger:Ln,log:By,lsolveAll:WP,matrixFromRows:VP,min:YP,mod:US,multiply:lt,nthRoots:HP,or:GP,partitionSelect:vl,rightLogShift:$P,slu:zS,subset:pi,sum:Iy,trace:ZP,usolveAll:WS,zpk2tf:QP,ceil:Py,compareNatural:Ca,composition:XP,cross:JP,det:VS,dotMultiply:KP,fix:HS,index:GS,intersect:jP,invmod:e5,lcm:r5,log1p:t5,max:ky,setCartesian:n5,setDistinct:i5,setIsSubset:a5,setPowerset:o5,smallerEq:su,sort:s5,and:u5,range:uu,row:f5,setDifference:$S,setMultiplicity:c5,setSymDifference:ZS,column:XS,inv:gs,lup:JS,pinv:l5,pow:Ti,setIntersect:KS,setUnion:p5,sqrtm:m5,vacuumImpedance:d5,wienDisplacement:h5,atomicMass:v5,bohrMagneton:g5,boltzmann:x5,conductanceQuantum:y5,coulomb:b5,deuteronMass:w5,dotPow:D5,electricConstant:S5,elementaryCharge:N5,expm:A5,faraday:C5,fft:jS,gamma:Ry,gravitationConstant:E5,hartreeEnergy:M5,ifft:_5,klitzing:T5,loschmidt:F5,magneticConstant:O5,molarMass:B5,molarPlanckConstant:I5,neutronMass:P5,nuclearMagneton:k5,planckCharge:R5,planckLength:L5,planckTemperature:q5,protonMass:U5,quantumOfCirculation:z5,reducedPlanckConstant:W5,rydberg:V5,secondRadiation:Y5,speedOfLight:H5,stefanBoltzmann:G5,thomsonCrossSection:$5,avogadro:Z5,bohrRadius:Q5,createUnit:X5,divide:dn,electronMass:J5,factorial:Vf,firstRadiation:K5,gravity:j5,inverseConductanceQuantum:e6,lusolve:eN,magneticFluxQuantum:r6,molarMassC12:t6,multinomial:n6,parse:Ki,permutations:i6,planckMass:a6,polynomialRoot:o6,resolve:B6,setSize:s6,simplifyConstant:fN,solveODE:u6,stirlingS2:rN,unit:f6,bellNumbers:c6,compile:MQ,eigs:tN,fermiCoupling:l6,gasConstant:p6,kldivergence:m6,mean:nN,molarVolume:d6,planckConstant:h6,quantileSeq:v6,simplifyCore:cN,variance:Ly,classicalElectronRadius:g6,evaluate:lN,median:iN,simplify:Uy,symbolicEqual:_Q,corr:x6,freqz:y6,leafCount:TQ,mad:b6,parser:FQ,rationalize:OQ,std:w6,zeta:D6,derivative:BQ,norm:qy,rotationMatrix:aN,help:IQ,planckTime:S6,schur:oN,rotate:N6,sylvester:sN,lyap:A6,config:Be});St(Hf,Yf,{filter:jx({typed:ne}),forEach:ey({typed:ne}),map:ty({typed:ne}),apply:Jx({isInteger:$n,typed:ne}),or:xy({DenseMatrix:Pr,concat:Xr,equalScalar:qr,matrix:Ge,typed:ne}),and:gy({add:Vr,concat:Xr,equalScalar:qr,matrix:Ge,not:pl,typed:ne,zeros:wn}),concat:fy({isInteger:$n,matrix:Ge,typed:ne}),max:ny({config:Be,larger:Ln,numeric:Ji,typed:ne}),print:vy({add:Vr,matrix:Ge,typed:ne,zeros:wn}),bitAnd:yy({add:Vr,concat:Xr,equalScalar:qr,matrix:Ge,not:pl,typed:ne,zeros:wn}),diff:cy({bignumber:li,matrix:Ge,number:Xa,subtract:Wt,typed:ne}),min:ay({config:Be,numeric:Ji,smaller:Rn,typed:ne}),subset:uy({add:Vr,matrix:Ge,typed:ne,zeros:wn}),bitOr:by({DenseMatrix:Pr,concat:Xr,equalScalar:qr,matrix:Ge,typed:ne}),cumsum:dy({add:Vr,typed:ne,unaryPlus:Dy}),index:ry({Index:_n,getMatrixDataType:Ny}),sum:py({add:Vr,config:Be,numeric:Ji,typed:ne}),range:oy({bignumber:li,matrix:Ge,add:Vr,config:Be,isPositive:ms,larger:Ln,largerEq:dl,smaller:Rn,smallerEq:su,typed:ne}),row:sy({Index:_n,matrix:Ge,range:uu,typed:ne}),column:Kx({Index:_n,matrix:Ge,range:uu,typed:ne}),mean:iy({add:Vr,divide:dn,typed:ne}),quantileSeq:my({add:Vr,bignumber:li,compare:vs,divide:dn,isInteger:$n,larger:Ln,multiply:lt,partitionSelect:vl,smaller:Rn,smallerEq:su,subtract:Wt,typed:ne}),variance:hy({add:Vr,apply:Ey,divide:dn,isNaN:qf,multiply:lt,subtract:Wt,typed:ne}),std:ly({map:ds,sqrt:Xi,typed:ne,variance:Ly})});St(C6,{BigNumber:$e,Complex:wt,Fraction:ls,Matrix:fl,Node:qn,ObjectNode:Gf,OperatorNode:Eo,ParenthesisNode:fu,Range:h4,RelationalNode:E6,ResultSet:NS,ArrayNode:$f,BlockNode:M6,ConditionalNode:_6,ConstantNode:xs,DenseMatrix:Pr,RangeNode:T6,Chain:uN,FunctionAssignmentNode:F6,SparseMatrix:Ja,IndexNode:Zf,ImmutableDenseMatrix:qS,Index:_n,AccessorNode:Qf,AssignmentNode:O6,FibonacciHeap:YS,Spa:QS,Unit:Ar,SymbolNode:ys,FunctionNode:bs,Help:I6,Parser:P6});uN.createProxy(Yf);var pN=wS;var U6=Ui(rm(),1);var R6=Ui(k6(),1);function L6(e){var r=new R6.default;return e.on=r.on.bind(r),e.off=r.off.bind(r),e.once=r.once.bind(r),e.emit=r.emit.bind(r),e}function q6(e,r,t,n){function i(y,w){var E=arguments.length;if(E!==1&&E!==2)throw new Ci("import",E,1,2);w||(w={});function b(O,F,M){if(Array.isArray(F))F.forEach(L=>b(O,L));else if(typeof F=="object")for(var _ in F)Je(F,_)&&b(O,F[_],_);else if(Js(F)||M!==void 0){var k=Js(F)?x(F)?F.fn+".transform":F.fn:M;if(Je(O,k)&&O[k]!==F&&!w.silent)throw new Error('Cannot import "'+k+'" twice');O[k]=F}else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}var A={};b(A,y);for(var C in A)if(Je(A,C)){var S=A[C];if(Js(S))o(S,w);else if(u(S))a(C,S,w);else if(!w.silent)throw new TypeError("Factory, Object, or Array expected")}}function a(y,w,E){if(E.wrap&&typeof w=="function"&&(w=f(w)),p(w)&&(w=e(y,{[w.signature]:w})),e.isTypedFunction(t[y])&&e.isTypedFunction(w)){E.override?w=e(y,w.signatures):w=e(t[y],w),t[y]=w,delete n[y],s(y,w),t.emit("import",y,function(){return w});return}if(t[y]===void 0||E.override){t[y]=w,delete n[y],s(y,w),t.emit("import",y,function(){return w});return}if(!E.silent)throw new Error('Cannot import "'+y+'": already exists')}function s(y,w){w&&typeof w.transform=="function"?(t.expression.transform[y]=w.transform,d(y)&&(t.expression.mathWithTransform[y]=w.transform)):(delete t.expression.transform[y],d(y)&&(t.expression.mathWithTransform[y]=w))}function c(y){delete t.expression.transform[y],d(y)?t.expression.mathWithTransform[y]=t[y]:delete t.expression.mathWithTransform[y]}function f(y){var w=function(){for(var b=[],A=0,C=arguments.length;A2&&arguments[2]!==void 0?arguments[2]:y.fn;if(Lw(E,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(E));var b=x(y)?t.expression.transform:t,A=E in t.expression.transform,C=Je(b,E)?b[E]:void 0,S=function(){var F={};y.dependencies.map(zw).forEach(_=>{if(Lw(_,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(_));_==="math"?F.math=t:_==="mathWithTransform"?F.mathWithTransform=t.expression.mathWithTransform:_==="classes"?F.classes=t:F[_]=t[_]});var M=y(F);if(M&&typeof M.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(C===void 0||w.override)return M;if(e.isTypedFunction(C)&&e.isTypedFunction(M))return e(C,M);if(w.silent)return C;throw new Error('Cannot import "'+E+'": already exists')};!y.meta||y.meta.lazy!==!1?(Zu(b,E,S),C&&A?c(E):(x(y)||h(y))&&Zu(t.expression.mathWithTransform,E,()=>b[E])):(b[E]=S(),C&&A?c(E):(x(y)||h(y))&&Zu(t.expression.mathWithTransform,E,()=>b[E])),n[E]=y,t.emit("import",E,S)}function u(y){return typeof y=="function"||typeof y=="number"||typeof y=="string"||typeof y=="boolean"||y===null||jt(y)||un(y)||nr(y)||Si(y)||Xe(y)||Array.isArray(y)}function p(y){return typeof y=="function"&&typeof y.signature=="string"}function d(y){return!Je(v,y)}function h(y){return y.fn.indexOf(".")===-1&&!Je(v,y.fn)&&(!y.meta||!y.meta.isClass)}function x(y){return y!==void 0&&y.meta!==void 0&&y.meta.isTransformFunction===!0||!1}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return i}function zy(e,r){var t=St({},Zs,r);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n=L6({isNumber:fr,isComplex:un,isBigNumber:nr,isFraction:Si,isUnit:jt,isString:Ft,isArray:Tr,isMatrix:Xe,isCollection:Ot,isDenseMatrix:xo,isSparseMatrix:Ni,isRange:jo,isIndex:Va,isBoolean:Up,isResultSet:zp,isHelp:Hu,isFunction:Wp,isDate:Vp,isRegExp:Yp,isObject:Ya,isNull:Hp,isUndefined:Gp,isAccessorNode:Gn,isArrayNode:fn,isAssignmentNode:$p,isBlockNode:Zp,isConditionalNode:Qp,isConstantNode:Sr,isFunctionAssignmentNode:Wi,isFunctionNode:En,isIndexNode:oi,isNode:Mr,isObjectNode:Ha,isOperatorNode:xt,isParenthesisNode:cn,isRangeNode:Xp,isRelationalNode:Jp,isSymbolNode:ct,isChain:Gu});n.config=FA(t,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var i=[],a=[];function s(u){if(Js(u))return u(n);var p=u[Object.keys(u)[0]];if(Js(p))return p(n);if(!MA(u))throw console.warn("Factory object with properties \`type\`, \`name\`, and \`factory\` expected",u),new Error("Factory object with properties \`type\`, \`name\`, and \`factory\` expected");var d=i.indexOf(u),h;return d===-1?(u.math===!0?h=u.factory(n.type,t,s,n.typed,n):h=u.factory(n.type,t,s,n.typed),i.push(u),a.push(h)):h=a[d],h}var c={};function f(){for(var u=arguments.length,p=new Array(u),d=0;d{Mw(c).forEach(u=>{u&&u.meta&&u.meta.recreateOnConfigChange&&o(u,{override:!0})})}),n.create=zy.bind(null,e),n.factory=T,n.import(Mw(CA(e))),n.ArgumentsError=Ci,n.DimensionError=vr,n.IndexError=pn,n}var W6=Ui(z6()),vN=class{constructor(){this.lang="en";this.all={en:{hintText:{dragDropModifierKeys:"Hold \${1} to Pin and \${2} to Copy",createListItem:"Select/Create List Item Frame",dragDropProperties:"Drag and drop properties to link them into the list",newItem:"+ New",selectNote:"Select Note...",newFrame:"New"},defaults:{spaceNote:"Current Note",spaceContext:"Current Space"},commands:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",columns:"Columns",button:"Button",label:"Label",column:"Column",idea:"New",group:"Group",paragraph:"Text",card:"Card",progress:"Progress",rating:"Rating",circularProgress:"Circular Progress",list:"Bullet List","ordered-list":"Numbered List",todo:"To-do List",quote:"Quote",divider:"Divider",note:"Link to Note",link:"Link",callout:"Callout",bookmark:"Bookmark",table:"Table",codeblock:"Code Block",toggle:"Toggle",emoji:"Emoji",image:"Image",flow:"Linked Note",newNote:"New Note",tag:"Tag",makeMenu:"Flow Menu",selectStyle:"Style",toggleKeyboard:"Toggle Keyboard",rows:"Rows",masonry:"Gallery"},styles:{bold:"Bold",italics:"Italics",strikethrough:"Strikethrough",code:"Code",link:"Web Link",blocklink:"Link to Note",textColor:"Text Color",highlight:"Highlight"},commandsSuggest:{noResult:"No result"},commandPalette:{enable:"Enable",disabled:"Disable",openFlow:"Open Flow Blocks in Selection",closeFlow:"Close Flow Blocks in Selection",toggleBold:"Toggle Bold",toggleItalics:"Toggle Italics",openSpaces:"Open Spaces",migrateData:"Migrate Spaces From 0.7",blink:"Blink",openFileContext:"Open Explorer",convertPathToSpace:"Convert to Space",revealFile:"Reveal File in Spaces",releaseNotes:"Release Notes",toggleBacklinks:"Toggle Backlinks",collapseAllFolders:"Collapse All Folders",addFileSpace:"Add File to Space",removeFileSpace:"Remove File from Space"},frames:{sections:{kit:"Kit",paths:"Paths"},label:{label:"Label",description:"Label"},note:{label:"Note",description:"Link to a note"},table:{label:"Table",description:"Table"},context:{label:"Context",description:"Display a context view from another space"},calendar:{label:"Calendar View"},field:{label:"Field",description:"Dynamic node that displays a value based on property type"},event:{label:"Event"},divider:{label:"Divider",description:"Divider to separate your content"},button:{label:"Button",description:"Buttons can perform actions and open links"},callout:{label:"Callout",description:"Callout to highlight important information"},toggle:{label:"Toggle",description:"Toggle to show/hide content"}},menu:{newView:"New View",closeSpace:"Close Space",customView:"Custom View",detailsView:"Details View",catalogView:"Catalog View",galleryView:"Gallery View",deleteContext:"Delete Context",openSpace:"Open Space",revealInDefault:"Reveal in Finder",setNone:"None",fileMetadataDescription:"This note only",openFilePane:"Open in a new pane",rename:"Rename",changeToFolderNote:"New Space from Note",moveFile:"Move file to...",moveFolder:"Move folder to...",duplicate:"Make a copy",edit:"Edit",delete:"Delete",getHelp:"Make.md Community",vault:"Vault",openVault:"Open Another Vault",openVaultInFolder:"Open Vault Folder",obSettings:"Obsidian Settings",commandPalette:"Command Palette",backToSpace:"Back to Spaces",collapseAllSections:"Collapse All Spaces",expandAllSections:"Expand All Spaces",collapseAllFolders:"Collapse All Folders",expandAllFolders:"Expand All Folders",spaceTitle:"Add/Remove in Space",home:"Home",waypoints:"Waypoints",none:"None",tableView:"Table View",cardView:"Card View",boardView:"Board View",listView:"List View",flowView:"Flow View",groupBy:"Group By",sortBy:"Sort By",newFilter:"New Filter",clearFilters:"Clear Filters",hide:"Hide",unhideFields:"Unhide All Properties",importDataview:"Import All Dataview Properties",saveAllProperties:"Save All Properties to Files",mergeProperties:"Merge Properties",removeFromSpace:"Unpin from Space",removeFromWaypoints:"Unpin from Waypoints",editCode:"Edit Code",deleteProperty:"Delete Property",hideProperty:"Hide Property",unhideProperty:"Unhide Property",saveProperty:"Save Property",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",deleteRow:"Delete Item",collapseAll:"Collapse All",customSort:"Custom Sort",groupSpaces:"Group Spaces",fileNameSortAlphaAsc:"File Name (A to Z)",fileNameSortAlphaDesc:"File Name (Z to A)",createdTimeSortAsc:"Created Time (new to old)",createdTimeSortDesc:"Created Time (old to new)",modifiedTimeSortAsc:"Modified Time (new to old)",modifiedTimeSortDesc:"Modified Time (old to new)",sizeSortAsc:"Size (smallest to largest)",sizeSortDesc:"Size (largest to smallest)",spaces:"Spaces",tags:"Tags",manageHiddenFiles:"Manage Hidden Files",manageActions:"Manage Actions",deleteSpace:"Delete",changeColor:"Change Color",changePropertyType:"Change Type",deleteFiles:"Delete Files",createFolderSpace:"Create Space from Folder",folder:"Folder",syncToContext:"Add Property to Context",setIcon:"Set Icon",copyEmbedLink:"Copy Embed Link",moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",groupNodes:"Group Nodes",moveFrame:"Move Frame",renameFrame:"Rename Frame",deleteFrame:"Delete Frame"},editor:{rows:"Rows",columns:"Columns",catalog:"Catalog",gallery:"Gallery",grid:"Grid",scaleToFit:"Change to Fit",scaleToFill:"Change to Fill",fit:"Fit",strokeNone:"None",strokeSolid:"Solid",strokeDotted:"Dotted",strokeDashed:"Dashed",size:"Size",gap:"Gap",marginLeft:"Left",marginTop:"Top",marginRight:"Right",marginBottom:"Bottom",minimize:"Minimize",paddingLeft:"Left",paddingTop:"Top",paddingRight:"Right",paddingBottom:"Bottom",unlinkProperty:"Unlink Property",linkedProperty:"Linked Property",linkProperty:"Link Property",currentSpace:"Current Space",linkName:"\${1} Link",linkThumbnail:"\${1} Thumbnail",linkSticker:"\${1} Sticker",opacity:"Opacity",shadowSpread:"Spread",shadowBlur:"Blur",width:"Width",height:"Height",margin:"Margin",padding:"Padding",bold:"Bold",italic:"Italic",underline:"Underline",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right",alignJustify:"Align Justify",numberOfLines:"Lines",createVerticalSection:"Create Vertical Section",createHorizontalSection:"Create Horizontal Section",themeColors:"Theme Colors",uiColors:"UI Colors",hex:"Hex"},buttons:{add:"Add",addFilter:"Add Filter",addCondition:"Add Condition",customize:"Customize",moreOptions:"More Options",saveProperty:"Save Property",newNote:"New Note",changeIcon:"Change Sticker",removeIcon:"Remove Sticker",addIcon:"Add Sticker",addCover:"Add Cover",changeBanner:"Change Cover",changeBannerShort:"Cover",saveChanges:"Save Changes",removeBanner:"Remove Cover",rename:"Change Name",editFrame:"Edit Frame",saveSpace:"Save Space",createSpace:"New Space",createFolder:"New Folder",createNote:"New Note",createCanvas:"New Canvas",addIntoSpace:"New Pin",addSmartSearch:"Add Live Search",addItem:"Add Item",addProperty:"Add Property",addContext:"Add Context",cancel:"Cancel",search:"Search",delete:"Delete",toggleFlow:"Toggle Flow",openFlow:"Open Flow",hideFlow:"Hide Flow",openLink:"Open Link",addToSpace:"Add to Space",addToSpaceShort:"Pin",addTag:"Add Tag",tag:"Tag",syncFields:"Sync Properties",convertTable:"Convert to Markdown",cutTable:"Cut Table",deleteTable:"Delete Table",blink:"Blink",addFile:"Add Item",merge:"Merge",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",deleteView:"Delete View",renameTable:"Rename Table",renameTag:"Rename Tag",createTag:"Create Tag",currentFolder:"Current Folder",sync:"Sync",pasteCSS:"Paste CSS",save:"Save",run:"Run"},metadataTypes:{fileName:"File Name",contexts:"Contexts",path:"Path",folder:"Folder",sticker:"Sticker",color:"Color",created:"Created",lastModified:"Last Modified",extension:"Extension",size:"Size",tags:"Tags",inlinks:"Linked Mentions",outlinks:"Links",label:"Label",fileMetadata:"File Metadata",frontmatter:"Frontmatter"},filterTypes:{contains:"contains",notContains:"does not contain",is:"is",isNot:"is not",before:"before",after:"on or after",anyOf:"is any of",noneOf:"is none of",checked:"is checked",unchecked:"is unchecked",isEmpty:"is empty",isNotEmpty:"is not empty",isSameDate:"is same date",isSameDateAsToday:"today"},sortTypes:{alphaAsc:"A to Z",alphaDesc:"Z to A",earliest:"Earliest",latest:"Latest",checkAsc:"Checked \\u2192 Unchecked",checkDesc:"Unchecked \\u2192 Checked",itemsAsc:"Least Items",itemsDesc:"Most Items"},properties:{defaultField:"Name",audio:{label:"Audio",description:"Audio"},text:{label:"Text",description:"Text field"},number:{label:"Number",description:"Number field with optional unit"},boolean:{label:"Yes/No",description:"Yes or No toggle to indicate the status"},date:{label:"Date",description:"Select a date from a calendar"},option:{label:"Option",description:"Select one or multiple option from a list"},file:{label:"File"},link:{label:"Link",description:"Link to another note or a website"},tags:{label:"Tags",description:"Use tags to quickly organize your items"},object:{label:"Object",description:"Store any complex objects"},context:{label:"Relation",description:"Connect to another context property and create a relation"},image:{label:"Image",description:"Select any image from your system or from the internet"},color:{label:"Color",description:"Use colors to label your items or status"},space:{label:"Context",description:"Link to a context"},icon:{label:"Sticker",description:"Use stickers to uniquely label your items or status"},super:{label:"Super Property",links:"Open Link",properties:"Update Property",api:"API",obsidianCommands:"Run Command",runCommand:"Run Command",performAction:"Perform Action",whenClicked:"When Clicked"},fileProperty:{name:"Name",label:"Formula",createdTime:"Created",modifiedTime:"Last Edited",sticker:"Sticker",links:"Links",tags:"Tags",spaces:"Spaces",extension:"Extension",size:"Size",preview:"Note Preview",parentFolder:"Folder",description:"Use a formula to dynamically display a property"}},views:{navigator:"Navigator",explorer:"Explorer",space:"Space"},subViews:{spaceItems:"Items",spaceContext:"Context",spaceLists:"Lists",spaceActions:"Actions",spaceTemplates:"Templates",smartSearch:"Live Searches",filesAndFolders:"Files and Folders"},labels:{editFormula:"Edit Formula",properties:"Properties",newAction:"New Action",newTable:"New Table",createFolder:"New Folder Name",rename:"Rename",createNew:"New",default:"Default",done:"Done",tables:"Tables",selectDateFormat:"Select/Type Date Format",renameSection:"Edit Space",createSection:"New Folder",createNote:"New Note",contextMaker:"Context Maker",select:"Select",pinnedItems:"Pinned Items",collapse:"Collapse",expand:"Expand",all:"All",none:"None",view:"View",findStickers:"Find Sticker",mergeProperties:"Merge Properties",placeholder:"Type '\${1}' for commands",notePlaceholder:"New Note for \${1}",itemsSelected:"\${1} Selected",selectNote:"Select Note",selectIcon:"Select Icon",selectImage:"Select Image",selectSpace:"Select Space",styleSmall:"Small",styleMedium:"Medium",styleLarge:"Large",hiddenFilePattern:"Name, Suffixes and Extension",hiddenFileSpecific:"Exclude specific files and folders",textPlaceholder:"Enter Text",noFile:"is not created yet. Click to create.",navigatorSearchPlaceholder:"Search by Text or Filters",blinkPlaceholder:"Quickly Search a File, Folder, Tag... Press Tab to Edit",searchPlaceholder:"Type to search...",contextItemSelectPlaceholder:"Find Item",linkItemSelectPlaceholder:"Find or Create Note",pinNotePlaceholder:"Select a Note or Space to Pin",optionItemSelectPlaceholder:"Select Option",viewItemSelectPlaceholder:"Select View",tagItemSelectPlaceholder:"Find Tag",spaceSelectPlaceholder:"Select any Folder or Tag",propertyItemSelectPlaceholder:"Select Property",sortItemSelectPlaceholder:"Select Sort",filterItemSelectPlaceholder:"Select Filter",imageSelectPlaceholder:"Select an image or paste a URL",imageNotFoundPlaceholder:"No Images Found",syncFrontmatterProperty:"Sync Frontmatter Property",newProperty:"New Property",newPropertyShort:"New Property",propertyType:"Type",propertyDynamic:"Dyanmic",propertyValueSpace:"Space",propertyValueProperty:"Property",propertyLookup:"Edit Formula",dateFormat:"Date Format",propertyFileProp:"Property",multiple:"Multiple",filesCount:"{$1} Files",hiddenFiles:"Hidden Files",addExtension:"Add Rule",saveView:"Save View",saveTable:"Save Table",renameView:"Rename View",renameTable:"Rename Table",syncMetadata:"Sync Metadata",syncProperties:"Sync Properties",selectContext:"Select Context",metadata:"Metadata",backlinks:"Backlinks",spaces:"Spaces",context:"Context",content:"Content",deleteSpace:"Delete Space",deleteFiles:"Delete Files",outgoingLinks:"Outgoing Links",moveTo:"Move to",addTo:"Pin to",copyTo:"Copy to",reorderIn:"Reorder in",border:"Border",corners:"Corners",color:"Color",backgroundColor:"Background",cornerRadius:"Radius",onClick:"On Click",layout:"Layout",element:"Element",name:"Name",display:"Display",alignment:"Alignment",margin:"Margin",padding:"Padding",gap:"Gap",width:"Width",height:"Height",opacity:"Opacity",shadow:"Shadow",shadowBlur:"Blur",shadowSpread:"Spread",typography:"Typography",layers:"Layers",fontSize:"Size",props:"Props",styles:"Styles",events:"Events",code:"Code",selectedLayers:"\${1} Layers"},descriptions:{spaceActions:"Create actions that runs when you press a button",spaceLists:"Create lists to track data and organize them in your space",spaceItems:"Add new items to the space or pin items to the space",spaceTemplates:"Create templates to quickly add items to your space",smartSearch:"Automatically pin notes to this space based on a set of searches",hiddenFileOptions:"Exclude any files and folders by name, suffix or extension.",deleteSpace:"Deleting the space will also delete the folder and its contents.",deleteFiles:"Delete \${1} files/folders and their contents?",addContext:"Contexts lets you connect properties from your tags",spaceProperties:"Define Properties for your Space Items",syncMetadata:"Select which fields from your notes to start syncing with the context.",syncProperties:"Contexts defines and syncs the same fields across your notes depending on their folder or tag.",selectContext:"Select which folder or tag context you want to sync the fields."},flowView:{emptyDoc:"Empty Document",itemsCount:" Items",emptyFolder:"This Folder is Empty"},notice:{duplicateFile:"Folder already contains note with same name",addedToSection:"Added to Space",fileExists:"File Already Exists",folderExists:"Folder Already Exists",noPropertyName:"Property Name is Required",duplicatePropertyName:"Duplicate Property Name",newSpaceName:"Enter a name for your space",duplicateSpaceName:"Space name already exists",cantConvertNoteToSpace:"The view is not a note",templateSaved:"Template saved to space: "},settings:{layoutVertical:"Vertical",layoutHorizontal:"Horizontal",sectionSidebar:"Spaces",sectionEditor:"Maker Mode",sectionFlow:"Flow",sectionAdvanced:"Advanced",sectionDataview:"Dataview",sectionContext:"Context",sectionStickers:"Stickers",sectionNavigator:"Navigator",sectionDefault:"Default Spaces",sectionSpaceView:"Space View",sectionBlink:"Blink",sectionInlineContext:"Inline Context",sectionFlowBlock:"Flow Block",sectionFlowMenu:"Flow Menu",sectionFlowStyler:"Flow Styler",experimental:{name:"Experimental",desc:"Experimental features that are subject to change and may not be optimized for performance"},generateThumbnails:{name:"Generate Thumbnails",desc:"Create thumbnails for images to speed up performance"},minimalThemeFix:{name:"Minimal Theme Fix",description:"Apply fixes for the popular theme Minimal"},inlineStickerMenu:{name:"Inline Stickers",desc:"Add inline stickers by typing :"},openSpacesOnLaunch:{name:"Open Spaces as Default Tab",desc:"Open the Spaces tab when Obsidian launches"},defaultSpaceTemplate:{name:"Default Space Template",desc:"Select the default template for new spaces"},defaultDateFormat:{name:"Default Date Format",desc:"Set the default date format, example: yyyy-MM-dd (see https://date-fns.org/v2.30.0/docs/format)"},newNotePlaceholder:{name:"New Note Placeholder",desc:"Default name for new notes"},folderIndentationLines:{name:"Show Folder Indentation Lines",desc:"Turn on to show a line on the left of folders to indicate indentation"},folderNoteLocation:{name:"Folder Note Location Inside Folder",desc:"Turn on to have folder notes inside the folder, turn off to have it outside"},folderViewDefault:{name:"Show Folder Note by Default",desc:"Show the folder note by default when opening a folder"},internalLinkFlowEditor:{name:"Open Flow Blocks on Internal Link Click",desc:"Turn on to toggle Flow Blocks directly by clicking on internal links, otherwise a tooltip will be shown"},syncContextToFrontmatter:{name:"Sync Context Fields to Frontmatter",desc:"Turn on to automatically save all context fields to frontmatter fields, not just existing frontmatter fields."},inlineBacklinks:{name:"Show Inline Backlinks (Inline Context required)",desc:"Show editable backlinks at the bottom of your notes"},dataviewInlineContext:{name:"Show Dataview in Inline Context",desc:"Show dataview when inline context is enabled"},inlineContextExplorer:{name:"Inline Context",desc:"Display the context and a banner at the top of your notes"},inlineContextExpanded:{name:"Auto Expand Inline Context",desc:"Expand the inline context sections when opening a note"},inlineContextHorizontal:{name:"Inline Title and Sticker Layout",desc:"Layout for inline title and sticker in Inline Context"},hideFrontmatter:{name:"Hide Frontmatter Properties",desc:"Hide the frontmatter properties in inline context"},openFileContext:{name:"Auto Open Explorer",desc:"Automatically open explorer panel in the right panel"},folderNote:{name:"Enable Folder Note",desc:"Access the folder note in the folder page and hide the folder note from spaces"},expandFolder:{name:"Auto Expand Folder",desc:"Auto expand folders on click"},hoverPreview:{name:"Preview on Hover",desc:"Preview on Hover while holding Control/Command key"},activeFile:{name:"Reveal Active File",desc:"Automatically reveal the active file in Spaces"},contexts:{name:"Contexts",desc:"Contexts allows you to have full control over the metadata of your files"},spaces:{name:"Navigator",desc:"The navigator lets you create and organize your spaces"},spacesStickers:{name:"Stickers",desc:"Use Emojis to make it easier to find your notes"},spacesAlias:{name:"Alias",desc:"Use the alias metadata to show in Spaces"},spacesFileExplorerDual:{name:"Compatibility Mode",desc:"This will improve the compatibility of plugins while using Spaces"},spacesDeleteOption:{name:"Delete File Option",desc:"Select how you want files to be deleted"},spacesDeleteOptions:{permanant:"Delete Permanently",trash:"Move to Obsidian Trash","system-trash":"Move to System Trash"},hideRibbon:{name:"App Ribbon",desc:"Show/hide the left menu aka. ribbon"},spaceView:{name:"Space View",desc:"Open the space view when you click on a space"},defaultSpaces:{name:"Default Spaces",desc:"Recommended spaces for quickly organizing your vault"},homeSpace:{name:"Home Space",desc:"An easy-to-access space where you can add/organize your other spaces"},tagSpaces:{name:"Tag Spaces",desc:"Automatically create spaces for each of your tags"},readableLineWidth:{name:"Readable Line Width",desc:"Use Readable Line Width"},sidebarTabs:{name:"Sidebar Tabs",desc:"Show/hide other sidebar tabs"},spacesPerformance:{name:"Performance Mode",desc:"Turn on performance mode for Spaces, may affect scrolling appearance. Requires Restart"},indexSVG:{name:"Use SVGs as Stickers",desc:"Use any svg file in your vault as a sticker"},inlineStyler:{name:"Flow Styler",desc:"Select text to add styling"},inlineStylerColor:{name:"Text and Highlight Colors \\u{1F9EA}",desc:"Select text color and highlight color, (this may change in the future because of the limitations with HTML and Obsidian)"},spaceRowHeight:{name:"Row Height",desc:"The height for each row in spaces (in pixels), default is 28"},makeChar:{name:"Flow Menu Trigger",desc:"Character to open the Flow Menu"},mobileMakeBar:{name:"Flow Styler (Mobile)",desc:"Replaces the mobile toolbar"},editorMarkSans:{name:"Mark Sans \\u{1F9EA}",desc:"Use the editor without Markdown."},editorMakerMode:{name:"Flow (Beta)",desc:"An integrated and intuitive editor experience"},editorMakePlacholder:{name:"Flow Menu Hint Text",desc:"Show a hint text on how to open the Flow Menu Shortcut"},blink:{name:"Blink",desc:"A faster way to search and edit your notes"},editorMakeMenu:{name:"Flow Menu",desc:"Open the Flow menu to quickly add content"},editorMakeMenuTrigger:{name:"Flow Menu Shortcut",desc:"Trigger key to use flow menu"},editorFlowReplace:{name:"Flow Block",desc:"Open your internal links or toggle your embeds in the flow block."},editorFlowStyle:{name:"Flow Block Style",desc:"Select a theme for your flow block",seamless:"Seamless",classic:"Classic",minimal:"Minimal"}}}};this.lang="en";let r=W6.default.locale();["en"].includes(r)&&(this.lang=r)}get texts(){return this.all.en}},Kr=new vN().texts;var V6=(e,r)=>r==Wa?Jf.find(t=>t.type=="file"):r=="tags"?Jf.find(t=>t.type=="tags"):r=="aliases"?Jf.find(t=>t.type=="option-multi"):r=="sticker"?Jf.find(t=>e=="icon"):Jf.find(t=>e==t.type)||Jf.find(t=>e==t.multiType),Jf=[{type:"unknown",label:"",restricted:!0,icon:"ui//file-question"},{type:"text",label:Kr.properties.text.label,metadata:!0,icon:"ui//text",primative:!0,description:Kr.properties.text.description},{type:"number",label:Kr.properties.number.label,metadata:!0,icon:"ui//binary",configKeys:["unit"],primative:!0,description:Kr.properties.number.description},{type:"boolean",label:Kr.properties.boolean.label,metadata:!0,icon:"ui//check-square",primative:!0,description:Kr.properties.boolean.description},{type:"date",label:Kr.properties.date.label,metadata:!0,icon:"ui//calendar",configKeys:["format"],primative:!0,description:Kr.properties.date.description},{type:"option",label:Kr.properties.option.label,multi:!0,multiType:"option-multi",icon:"ui//list",configKeys:["options","source"],description:Kr.properties.option.description},{type:"tags",label:Kr.properties.tags.label,icon:"ui//tags",description:Kr.properties.tags.description},{type:"file",label:Kr.properties.file.label,restricted:!0,icon:"ui//mk-make-h3"},{type:"fileprop",label:Kr.properties.fileProperty.label,icon:"ui//formula",configKeys:["field","value","type"],description:Kr.properties.fileProperty.description},{type:"link",label:Kr.properties.link.label,multi:!0,multiType:"link-multi",metadata:!0,icon:"ui//file-text",primative:!0,description:Kr.properties.link.description},{type:"context",label:Kr.properties.context.label,icon:"ui//mk-make-note",multi:!0,multiType:"context-multi",configKeys:["space"],description:Kr.properties.context.description},{type:"object",label:Kr.properties.object.label,multi:!0,multiType:"object-multi",metadata:!0,icon:"ui//list-tree",configKeys:["type"],description:Kr.properties.object.description},{type:"icon",label:Kr.properties.icon.label,multi:!0,multiType:"icon-multi",icon:"ui//gem",restricted:!0,primative:!0,description:Kr.properties.icon.description},{type:"image",label:Kr.properties.image.label,multi:!0,multiType:"image-multi",metadata:!0,icon:"ui//mk-make-image",primative:!0,description:Kr.properties.image.description},{type:"color",label:Kr.properties.color.label,icon:"ui//mk-make-image",restricted:!0,description:Kr.properties.color.description},{type:"space",label:Kr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Kr.properties.space.description},{type:"table",label:Kr.properties.space.label,icon:"ui//layout-grid",restricted:!0,description:Kr.properties.space.description},{type:"super",label:Kr.properties.super.label,icon:"ui//zap",restricted:!0,configKeys:["dynamic","field"]},{type:"input",label:Kr.properties.super.label,icon:"ui//input",restricted:!0}];var gl="files",Yy={id:gl,name:"Files",type:"db",primary:"true"},kQ="filesView",RQ={id:kQ,name:"All",type:"view",def:JSON.stringify({db:gl,icon:"ui//file-stack"})},LQ="main",qQ=e=>({id:e,name:e,type:"frame",def:"",predicate:"",primary:"true"}),$5e={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[qQ(LQ),RQ]},Wy={uniques:[],cols:["id","name","type","def","predicate","primary"],rows:[Yy]},Y6={uniques:["name,schemaId"],cols:["name","schemaId","type","value","attrs","hidden","unique","primary"]},Vy={...Y6,rows:[{name:Wa,schemaId:gl,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""},{name:Kr.properties.fileProperty.createdTime,schemaId:gl,type:"fileprop",value:Wa+".ctime",hidden:"",unique:"",attrs:"",primary:"true"}]};var Z5e=[{name:Kr.properties.defaultField,schemaId:"",type:"text",primary:"true"}],gN={...Y6,rows:[{name:Wa,schemaId:gl,type:"file",primary:"true",hidden:"",unique:"",attrs:"",value:""}]};var Q5e={schema:Yy,cols:Vy.rows,rows:[]},X5e={schema:Yy,cols:Vy.rows,rows:[]},J5e={schema:Yy,cols:gN.rows,rows:[]},H6=(e,r)=>e.filter(t=>r.find(n=>n.id==t.schemaId&&n.type=="db")).reduce((t,n)=>({...t,...t[n.schemaId]?{[n.schemaId]:{uniques:n.unique=="true"?[...t[n.schemaId].uniques,n.name]:t[n.schemaId].uniques,cols:[...t[n.schemaId].cols,n.name],rows:[]}}:{[n.schemaId]:{uniques:n.unique=="true"?[n.name]:[],cols:[n.name],rows:[]}}}),{});var K5e={m_schema:Wy,m_fields:Vy,...H6(Vy.rows,Wy.rows)},j5e={m_schema:Wy,m_fields:gN,...H6(gN.rows,Wy.rows)};var UQ=(e,r)=>{let t=n=>n=="builtin"?"Builtin":n=="api"?"Spaces":"Action";return[...(e.actionsIndex.get(r)??[]).map(n=>({name:n.schema.name,description:"Action",value:\`\${r}/#;\${n.schema.id}\`,section:"Action"}))??[],...[...e.cli.allCommands()].map(n=>({name:n.schema.name,description:t(n.schema.type),value:n.path,section:t(n.schema.type)}))]};var G6=({field:e,value:r})=>r=="ctime"?{value:\`parseDate(prop('\${e}')['metadata']['file']['\${r}'])\`,type:"date"}:{value:\`prop('\${e}')['metadata']['file']['\${r}']\`,type:"string"},xl=(e,r,t,n)=>{let i=Lp(e);if(i)return r=="fileprop"&&i.field?G6(i):(r=="option"&&i.source?.length>0&&(i.source=="$commands"?i.options=t.cli.allCommands():i.source=="$links"?i.options=t.spaceManager.allPaths().map(a=>({name:a,value:a})):i.source=="$super"?i.options=UQ(t,n):i.source=="$properties"&&(i.options=t.contextsIndex.get(n)?.cols?.map(a=>({name:a.name,value:a.name}))??[])),[...V6(r).configKeys??[],"alias","default"].reduce((a,s)=>({...a,[s]:i[s]}),{}));if(!r)return{};if(!i)if(r=="context")e?.length>0?i={space:e}:i={};else if(r.startsWith("date"))e?.length>0?i={format:e}:i={};else if(r.startsWith("fileprop"))if(e?.length>0){let[a,s]=e.split(".");i=G6({field:a,value:s})}else i={};else r.startsWith("option")&&(e?.length>0?i={options:$s(e).map(s=>({name:s,value:s}))}:i={});return i??{}};var $6=(e,r,t,n,i,a)=>{if(!t)return"";let s=new Map;Object.keys(i).forEach(f=>s.set(f,i[f])),s.set("$properties",n),s.set("$paths",r),a&&s.set("$current",a);let c;try{c=e.evaluate(t,s),c=qp("",c)}catch{}return c};var zQ=e=>{let r=new Map;e.filter(s=>s.type=="fileprop"||s.name=="tags").forEach(s=>{let{value:c}=xl(s.value,s.type),f=[];try{let u=Ki(c).filter(p=>p.type=="FunctionNode").filter(p=>p.fn.name=="prop"&&p.args[0].type=="ConstantNode").map(p=>p.args[0]?.value);f.push(...u)}catch(u){console.log(u)}let o=s.name;r.has(o)||r.set(o,new Set);for(let u of f){let p=u;p!==o&&r.get(o).add(p)}});let t=new Set,n=[],i=new Set,a=s=>{if(i.has(s))throw new Error("Circular dependency detected");if(!t.has(s)){i.add(s);let c=r.get(s)||new Set;for(let f of c)a(f);t.add(s),i.delete(s),n.push(s)}};for(let s of e)t.has(s.name)||a(s.name);return n},Z6=(e,r,t,n,i,a)=>{let s=a??zQ(n),c=r.get(t[Wa])?.metadata?.property??{},f=Object.keys(c).filter(p=>n.some(d=>d.name==p)).reduce((p,d)=>({...p,[d]:qp(d,c[d])}),{}),o=s.map(p=>n.find(d=>d.name==p)).filter(p=>p&&(p.type=="fileprop"||p.name=="tags")),u=n.reduce((p,d)=>({...p,[d.name]:d}),{});return{...t,...f,...o.reduce((p,d)=>{let{value:h}=xl(d.value,d.type);return{...p,[d.name]:$6(e,r,h,u,{...t,...p},i)}},{})}};var WQ=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],e8=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],VQ="\\u200C\\u200D\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0898-\\u089F\\u08CA-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3C\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0CF3\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D81-\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EBC\\u0EC8-\\u0ECE\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u180F-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1ABF-\\u1ACE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\u30FB\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA82C\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F\\uFF65",r8="\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC",xN={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},yN="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",YQ={5:yN,"5module":yN+" export import",6:yN+" const class extends export import super"},HQ=/^in(stanceof)?$/,GQ=new RegExp("["+r8+"]"),$Q=new RegExp("["+r8+VQ+"]");function wN(e,r){for(var t=65536,n=0;ne)return!1;if(t+=r[n+1],t>=e)return!0}return!1}function Mo(e,r){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&GQ.test(String.fromCharCode(e)):r===!1?!1:wN(e,e8)}function Kf(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&$Q.test(String.fromCharCode(e)):r===!1?!1:wN(e,e8)||wN(e,WQ)}var pt=function(r,t){t===void 0&&(t={}),this.label=r,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function ji(e,r){return new pt(e,{beforeExpr:!0,binop:r})}var ea={beforeExpr:!0},mi={startsExpr:!0},NN={};function tt(e,r){return r===void 0&&(r={}),r.keyword=e,NN[e]=new pt(e,r)}var X={num:new pt("num",mi),regexp:new pt("regexp",mi),string:new pt("string",mi),name:new pt("name",mi),privateId:new pt("privateId",mi),eof:new pt("eof"),bracketL:new pt("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new pt("]"),braceL:new pt("{",{beforeExpr:!0,startsExpr:!0}),braceR:new pt("}"),parenL:new pt("(",{beforeExpr:!0,startsExpr:!0}),parenR:new pt(")"),comma:new pt(",",ea),semi:new pt(";",ea),colon:new pt(":",ea),dot:new pt("."),question:new pt("?",ea),questionDot:new pt("?."),arrow:new pt("=>",ea),template:new pt("template"),invalidTemplate:new pt("invalidTemplate"),ellipsis:new pt("...",ea),backQuote:new pt("\`",mi),dollarBraceL:new pt("\${",{beforeExpr:!0,startsExpr:!0}),eq:new pt("=",{beforeExpr:!0,isAssign:!0}),assign:new pt("_=",{beforeExpr:!0,isAssign:!0}),incDec:new pt("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new pt("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:ji("||",1),logicalAND:ji("&&",2),bitwiseOR:ji("|",3),bitwiseXOR:ji("^",4),bitwiseAND:ji("&",5),equality:ji("==/!=/===/!==",6),relational:ji("/<=/>=",7),bitShift:ji("<>/>>>",8),plusMin:new pt("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:ji("%",10),star:ji("*",10),slash:ji("/",10),starstar:new pt("**",{beforeExpr:!0}),coalesce:ji("??",1),_break:tt("break"),_case:tt("case",ea),_catch:tt("catch"),_continue:tt("continue"),_debugger:tt("debugger"),_default:tt("default",ea),_do:tt("do",{isLoop:!0,beforeExpr:!0}),_else:tt("else",ea),_finally:tt("finally"),_for:tt("for",{isLoop:!0}),_function:tt("function",mi),_if:tt("if"),_return:tt("return",ea),_switch:tt("switch"),_throw:tt("throw",ea),_try:tt("try"),_var:tt("var"),_const:tt("const"),_while:tt("while",{isLoop:!0}),_with:tt("with"),_new:tt("new",{beforeExpr:!0,startsExpr:!0}),_this:tt("this",mi),_super:tt("super",mi),_class:tt("class",mi),_extends:tt("extends",ea),_export:tt("export"),_import:tt("import",mi),_null:tt("null",mi),_true:tt("true",mi),_false:tt("false",mi),_in:tt("in",{beforeExpr:!0,binop:7}),_instanceof:tt("instanceof",{beforeExpr:!0,binop:7}),_typeof:tt("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:tt("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:tt("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},na=/\\r\\n?|\\n|\\u2028|\\u2029/,ZQ=new RegExp(na.source,"g");function jf(e){return e===10||e===13||e===8232||e===8233}function t8(e,r,t){t===void 0&&(t=e.length);for(var n=r;n>10)+55296,(e&1023)+56320))}var JQ=/(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/,bl=function(r,t){this.line=r,this.column=t};bl.prototype.offset=function(r){return new bl(this.line,this.column+r)};var Qy=function(r,t,n){this.start=t,this.end=n,r.sourceFile!==null&&(this.source=r.sourceFile)};function a8(e,r){for(var t=1,n=0;;){var i=t8(e,n,r);if(i<0)return new bl(t,r-n);++t,n=i}}var DN={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},J6=!1;function KQ(e){var r={};for(var t in DN)r[t]=e&&Dl(e,t)?e[t]:DN[t];if(r.ecmaVersion==="latest"?r.ecmaVersion=1e8:r.ecmaVersion==null?(!J6&&typeof console=="object"&&console.warn&&(J6=!0,console.warn(\`Since Acorn 8.0.0, options.ecmaVersion is required. -Defaulting to 2020, but this will stop working in the future.\`)),r.ecmaVersion=11):r.ecmaVersion>=2015&&(r.ecmaVersion-=2009),r.allowReserved==null&&(r.allowReserved=r.ecmaVersion<5),(!e||e.allowHashBang==null)&&(r.allowHashBang=r.ecmaVersion>=14),Q6(r.onToken)){var n=r.onToken;r.onToken=function(i){return n.push(i)}}return Q6(r.onComment)&&(r.onComment=jQ(r,r.onComment)),r}function jQ(e,r){return function(t,n,i,a,s,c){var f={type:t?"Block":"Line",value:n,start:i,end:a};e.locations&&(f.loc=new Qy(this,s,c)),e.ranges&&(f.range=[i,a]),r.push(f)}}var wl=1,ec=2,AN=4,o8=8,s8=16,u8=32,CN=64,f8=128,Sl=256,EN=wl|ec|Sl;function MN(e,r){return ec|(e?AN:0)|(r?o8:0)}var Gy=0,_N=1,To=2,c8=3,l8=4,p8=5,hn=function(r,t,n){this.options=r=KQ(r),this.sourceFile=r.sourceFile,this.keywords=ws(YQ[r.ecmaVersion>=6?6:r.sourceType==="module"?"5module":5]);var i="";r.allowReserved!==!0&&(i=xN[r.ecmaVersion>=6?6:r.ecmaVersion===5?5:3],r.sourceType==="module"&&(i+=" await")),this.reservedWords=ws(i);var a=(i?i+" ":"")+xN.strict;this.reservedWordsStrict=ws(a),this.reservedWordsStrictBind=ws(a+" "+xN.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(\` -\`,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(na).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=X.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=r.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&r.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(wl),this.regexpState=null,this.privateNameStack=[]},Ka={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};hn.prototype.parse=function(){var r=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(r)};Ka.inFunction.get=function(){return(this.currentVarScope().flags&ec)>0};Ka.inGenerator.get=function(){return(this.currentVarScope().flags&o8)>0&&!this.currentVarScope().inClassFieldInit};Ka.inAsync.get=function(){return(this.currentVarScope().flags&AN)>0&&!this.currentVarScope().inClassFieldInit};Ka.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var r=this.scopeStack[e];if(r.inClassFieldInit||r.flags&Sl)return!1;if(r.flags&ec)return(r.flags&AN)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Ka.allowSuper.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&CN)>0||t||this.options.allowSuperOutsideMethod};Ka.allowDirectSuper.get=function(){return(this.currentThisScope().flags&f8)>0};Ka.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Ka.allowNewDotTarget.get=function(){var e=this.currentThisScope(),r=e.flags,t=e.inClassFieldInit;return(r&(ec|Sl))>0||t};Ka.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Sl)>0};hn.extend=function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];for(var n=this,i=0;i=,?^&]/.test(i)||i==="!"&&this.input.charAt(n+1)==="=")}e+=r[0].length,ra.lastIndex=e,e+=ra.exec(this.input)[0].length,this.input[e]===";"&&e++}};Zn.eat=function(e){return this.type===e?(this.next(),!0):!1};Zn.isContextual=function(e){return this.type===X.name&&this.value===e&&!this.containsEsc};Zn.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};Zn.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};Zn.canInsertSemicolon=function(){return this.type===X.eof||this.type===X.braceR||na.test(this.input.slice(this.lastTokEnd,this.start))};Zn.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};Zn.semicolon=function(){!this.eat(X.semi)&&!this.insertSemicolon()&&this.unexpected()};Zn.afterTrailingComma=function(e,r){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),r||this.next(),!0};Zn.expect=function(e){this.eat(e)||this.unexpected()};Zn.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Xy=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Zn.checkPatternErrors=function(e,r){if(!!e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var t=r?e.parenthesizedAssign:e.parenthesizedBind;t>-1&&this.raiseRecoverable(t,r?"Assigning to rvalue":"Parenthesized pattern")}};Zn.checkExpressionErrors=function(e,r){if(!e)return!1;var t=e.shorthandAssign,n=e.doubleProto;if(!r)return t>=0||n>=0;t>=0&&this.raise(t,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")};Zn.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos55295&&n<56320)return!0;if(Mo(n,!0)){for(var i=t+1;Kf(n=this.input.charCodeAt(i),!0);)++i;if(n===92||n>55295&&n<56320)return!0;var a=this.input.slice(t,i);if(!HQ.test(a))return!0}return!1};xr.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;ra.lastIndex=this.pos;var e=ra.exec(this.input),r=this.pos+e[0].length,t;return!na.test(this.input.slice(this.pos,r))&&this.input.slice(r,r+8)==="function"&&(r+8===this.input.length||!(Kf(t=this.input.charCodeAt(r+8))||t>55295&&t<56320))};xr.parseStatement=function(e,r,t){var n=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(n=X._var,a="let"),n){case X._break:case X._continue:return this.parseBreakContinueStatement(i,n.keyword);case X._debugger:return this.parseDebuggerStatement(i);case X._do:return this.parseDoStatement(i);case X._for:return this.parseForStatement(i);case X._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case X._class:return e&&this.unexpected(),this.parseClass(i,!0);case X._if:return this.parseIfStatement(i);case X._return:return this.parseReturnStatement(i);case X._switch:return this.parseSwitchStatement(i);case X._throw:return this.parseThrowStatement(i);case X._try:return this.parseTryStatement(i);case X._const:case X._var:return a=a||this.value,e&&a!=="var"&&this.unexpected(),this.parseVarStatement(i,a);case X._while:return this.parseWhileStatement(i);case X._with:return this.parseWithStatement(i);case X.braceL:return this.parseBlock(!0,i);case X.semi:return this.parseEmptyStatement(i);case X._export:case X._import:if(this.options.ecmaVersion>10&&n===X._import){ra.lastIndex=this.pos;var s=ra.exec(this.input),c=this.pos+s[0].length,f=this.input.charCodeAt(c);if(f===40||f===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(r||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===X._import?this.parseImport(i):this.parseExport(i,t);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var o=this.value,u=this.parseExpression();return n===X.name&&u.type==="Identifier"&&this.eat(X.colon)?this.parseLabeledStatement(i,o,u,e):this.parseExpressionStatement(i,u)}};xr.parseBreakContinueStatement=function(e,r){var t=r==="break";this.next(),this.eat(X.semi)||this.insertSemicolon()?e.label=null:this.type!==X.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n=6?this.eat(X.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};xr.parseForStatement=function(e){this.next();var r=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(TN),this.enterScope(0),this.expect(X.parenL),this.type===X.semi)return r>-1&&this.unexpected(r),this.parseFor(e,null);var t=this.isLet();if(this.type===X._var||this.type===X._const||t){var n=this.startNode(),i=t?"let":this.value;return this.next(),this.parseVar(n,!0,i),this.finishNode(n,"VariableDeclaration"),(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&n.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===X._in?r>-1&&this.unexpected(r):e.await=r>-1),this.parseForIn(e,n)):(r>-1&&this.unexpected(r),this.parseFor(e,n))}var a=this.isContextual("let"),s=!1,c=new Xy,f=this.parseExpression(r>-1?"await":!0,c);return this.type===X._in||(s=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===X._in?r>-1&&this.unexpected(r):e.await=r>-1),a&&s&&this.raise(f.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(f,!1,c),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(c,!0),r>-1&&this.unexpected(r),this.parseFor(e,f))};xr.parseFunctionStatement=function(e,r,t){return this.next(),this.parseFunction(e,yl|(t?0:SN),!1,r)};xr.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(X._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};xr.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(X.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};xr.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(X.braceL),this.labels.push(rX),this.enterScope(0);for(var r,t=!1;this.type!==X.braceR;)if(this.type===X._case||this.type===X._default){var n=this.type===X._case;r&&this.finishNode(r,"SwitchCase"),e.cases.push(r=this.startNode()),r.consequent=[],this.next(),n?r.test=this.parseExpression():(t&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),t=!0,r.test=null),this.expect(X.colon)}else r||this.unexpected(),r.consequent.push(this.parseStatement(null));return this.exitScope(),r&&this.finishNode(r,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};xr.parseThrowStatement=function(e){return this.next(),na.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var tX=[];xr.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),r=e.type==="Identifier";return this.enterScope(r?u8:0),this.checkLValPattern(e,r?l8:To),this.expect(X.parenR),e};xr.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===X._catch){var r=this.startNode();this.next(),this.eat(X.parenL)?r.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),r.param=null,this.enterScope(0)),r.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(r,"CatchClause")}return e.finalizer=this.eat(X._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};xr.parseVarStatement=function(e,r,t){return this.next(),this.parseVar(e,!1,r,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")};xr.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(TN),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};xr.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};xr.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};xr.parseLabeledStatement=function(e,r,t,n){for(var i=0,a=this.labels;i=0;f--){var o=this.labels[f];if(o.statementStart===e.start)o.statementStart=this.start,o.kind=c;else break}return this.labels.push({name:r,kind:c,statementStart:this.start}),e.body=this.parseStatement(n?n.indexOf("label")===-1?n+"label":n:"label"),this.labels.pop(),e.label=t,this.finishNode(e,"LabeledStatement")};xr.parseExpressionStatement=function(e,r){return e.expression=r,this.semicolon(),this.finishNode(e,"ExpressionStatement")};xr.parseBlock=function(e,r,t){for(e===void 0&&(e=!0),r===void 0&&(r=this.startNode()),r.body=[],this.expect(X.braceL),e&&this.enterScope(0);this.type!==X.braceR;){var n=this.parseStatement(null);r.body.push(n)}return t&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(r,"BlockStatement")};xr.parseFor=function(e,r){return e.init=r,this.expect(X.semi),e.test=this.type===X.semi?null:this.parseExpression(),this.expect(X.semi),e.update=this.type===X.parenR?null:this.parseExpression(),this.expect(X.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};xr.parseForIn=function(e,r){var t=this.type===X._in;return this.next(),r.type==="VariableDeclaration"&&r.declarations[0].init!=null&&(!t||this.options.ecmaVersion<8||this.strict||r.kind!=="var"||r.declarations[0].id.type!=="Identifier")&&this.raise(r.start,(t?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=r,e.right=t?this.parseExpression():this.parseMaybeAssign(),this.expect(X.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,t?"ForInStatement":"ForOfStatement")};xr.parseVar=function(e,r,t,n){for(e.declarations=[],e.kind=t;;){var i=this.startNode();if(this.parseVarId(i,t),this.eat(X.eq)?i.init=this.parseMaybeAssign(r):!n&&t==="const"&&!(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!n&&i.id.type!=="Identifier"&&!(r&&(this.type===X._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):i.init=null,e.declarations.push(this.finishNode(i,"VariableDeclarator")),!this.eat(X.comma))break}return e};xr.parseVarId=function(e,r){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,r==="var"?_N:To,!1)};var yl=1,SN=2,m8=4;xr.parseFunction=function(e,r,t,n,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===X.star&&r&SN&&this.unexpected(),e.generator=this.eat(X.star)),this.options.ecmaVersion>=8&&(e.async=!!n),r&yl&&(e.id=r&m8&&this.type!==X.name?null:this.parseIdent(),e.id&&!(r&SN)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?_N:To:c8));var a=this.yieldPos,s=this.awaitPos,c=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(MN(e.async,e.generator)),r&yl||(e.id=this.type===X.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,t,!1,i),this.yieldPos=a,this.awaitPos=s,this.awaitIdentPos=c,this.finishNode(e,r&yl?"FunctionDeclaration":"FunctionExpression")};xr.parseFunctionParams=function(e){this.expect(X.parenL),e.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};xr.parseClass=function(e,r){this.next();var t=this.strict;this.strict=!0,this.parseClassId(e,r),this.parseClassSuper(e);var n=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(X.braceL);this.type!==X.braceR;){var s=this.parseClassElement(e.superClass!==null);s&&(i.body.push(s),s.type==="MethodDefinition"&&s.kind==="constructor"?(a&&this.raiseRecoverable(s.start,"Duplicate constructor in the same class"),a=!0):s.key&&s.key.type==="PrivateIdentifier"&&nX(n,s)&&this.raiseRecoverable(s.key.start,"Identifier '#"+s.key.name+"' has already been declared"))}return this.strict=t,this.next(),e.body=this.finishNode(i,"ClassBody"),this.exitClassBody(),this.finishNode(e,r?"ClassDeclaration":"ClassExpression")};xr.parseClassElement=function(e){if(this.eat(X.semi))return null;var r=this.options.ecmaVersion,t=this.startNode(),n="",i=!1,a=!1,s="method",c=!1;if(this.eatContextual("static")){if(r>=13&&this.eat(X.braceL))return this.parseClassStaticBlock(t),t;this.isClassElementNameStart()||this.type===X.star?c=!0:n="static"}if(t.static=c,!n&&r>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===X.star)&&!this.canInsertSemicolon()?a=!0:n="async"),!n&&(r>=9||!a)&&this.eat(X.star)&&(i=!0),!n&&!a&&!i){var f=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?s=f:n=f)}if(n?(t.computed=!1,t.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),t.key.name=n,this.finishNode(t.key,"Identifier")):this.parseClassElementName(t),r<13||this.type===X.parenL||s!=="method"||i||a){var o=!t.static&&$y(t,"constructor"),u=o&&e;o&&s!=="method"&&this.raise(t.key.start,"Constructor can't have get/set modifier"),t.kind=o?"constructor":s,this.parseClassMethod(t,i,a,u)}else this.parseClassField(t);return t};xr.isClassElementNameStart=function(){return this.type===X.name||this.type===X.privateId||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword};xr.parseClassElementName=function(e){this.type===X.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};xr.parseClassMethod=function(e,r,t,n){var i=e.key;e.kind==="constructor"?(r&&this.raise(i.start,"Constructor can't be a generator"),t&&this.raise(i.start,"Constructor can't be an async method")):e.static&&$y(e,"prototype")&&this.raise(i.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(r,t,n);return e.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),e.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),e.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};xr.parseClassField=function(e){if($y(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&$y(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(X.eq)){var r=this.currentThisScope(),t=r.inClassFieldInit;r.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),r.inClassFieldInit=t}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};xr.parseClassStaticBlock=function(e){e.body=[];var r=this.labels;for(this.labels=[],this.enterScope(Sl|CN);this.type!==X.braceR;){var t=this.parseStatement(null);e.body.push(t)}return this.next(),this.exitScope(),this.labels=r,this.finishNode(e,"StaticBlock")};xr.parseClassId=function(e,r){this.type===X.name?(e.id=this.parseIdent(),r&&this.checkLValSimple(e.id,To,!1)):(r===!0&&this.unexpected(),e.id=null)};xr.parseClassSuper=function(e){e.superClass=this.eat(X._extends)?this.parseExprSubscripts(null,!1):null};xr.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};xr.exitClassBody=function(){var e=this.privateNameStack.pop(),r=e.declared,t=e.used;if(!!this.options.checkPrivateFields)for(var n=this.privateNameStack.length,i=n===0?null:this.privateNameStack[n-1],a=0;a=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(r,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};xr.parseExport=function(e,r){if(this.next(),this.eat(X.star))return this.parseExportAllDeclaration(e,r);if(this.eat(X._default))return this.checkExport(r,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(r,e.declaration.declarations):this.checkExport(r,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(r),this.eatContextual("from"))this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var t=0,n=e.specifiers;t=13&&this.type===X.string){var e=this.parseLiteral(this.value);return JQ.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};xr.adaptDirectivePrologue=function(e){for(var r=0;r=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var ia=hn.prototype;ia.toAssignable=function(e,r,t){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",t&&this.checkPatternErrors(t,!0);for(var n=0,i=e.properties;n=8&&!c&&f.name==="async"&&!this.canInsertSemicolon()&&this.eat(X._function))return this.overrideContext(Rt.f_expr),this.parseFunction(this.startNodeAt(a,s),0,!1,!0,r);if(i&&!this.canInsertSemicolon()){if(this.eat(X.arrow))return this.parseArrowExpression(this.startNodeAt(a,s),[f],!1,r);if(this.options.ecmaVersion>=8&&f.name==="async"&&this.type===X.name&&!c&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return f=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(X.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,s),[f],!0,r)}return f;case X.regexp:var o=this.value;return n=this.parseLiteral(o.value),n.regex={pattern:o.pattern,flags:o.flags},n;case X.num:case X.string:return this.parseLiteral(this.value);case X._null:case X._true:case X._false:return n=this.startNode(),n.value=this.type===X._null?null:this.type===X._true,n.raw=this.type.keyword,this.next(),this.finishNode(n,"Literal");case X.parenL:var u=this.start,p=this.parseParenAndDistinguishExpression(i,r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(p)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),p;case X.bracketL:return n=this.startNode(),this.next(),n.elements=this.parseExprList(X.bracketR,!0,!0,e),this.finishNode(n,"ArrayExpression");case X.braceL:return this.overrideContext(Rt.b_expr),this.parseObj(!1,e);case X._function:return n=this.startNode(),this.next(),this.parseFunction(n,0);case X._class:return this.parseClass(this.startNode(),!1);case X._new:return this.parseNew();case X.backQuote:return this.parseTemplate();case X._import:return this.options.ecmaVersion>=11?this.parseExprImport(t):this.unexpected();default:return this.parseExprAtomDefault()}};Br.parseExprAtomDefault=function(){this.unexpected()};Br.parseExprImport=function(e){var r=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===X.parenL&&!e)return this.parseDynamicImport(r);if(this.type===X.dot){var t=this.startNodeAt(r.start,r.loc&&r.loc.start);return t.name="import",r.meta=this.finishNode(t,"Identifier"),this.parseImportMeta(r)}else this.unexpected()};Br.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(X.parenR)){var r=this.start;this.eat(X.comma)&&this.eat(X.parenR)?this.raiseRecoverable(r,"Trailing comma is not allowed in import()"):this.unexpected(r)}return this.finishNode(e,"ImportExpression")};Br.parseImportMeta=function(e){this.next();var r=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),r&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};Br.parseLiteral=function(e){var r=this.startNode();return r.value=e,r.raw=this.input.slice(this.start,this.end),r.raw.charCodeAt(r.raw.length-1)===110&&(r.bigint=r.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(r,"Literal")};Br.parseParenExpression=function(){this.expect(X.parenL);var e=this.parseExpression();return this.expect(X.parenR),e};Br.shouldParseArrow=function(e){return!this.canInsertSemicolon()};Br.parseParenAndDistinguishExpression=function(e,r){var t=this.start,n=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s=this.start,c=this.startLoc,f=[],o=!0,u=!1,p=new Xy,d=this.yieldPos,h=this.awaitPos,x;for(this.yieldPos=0,this.awaitPos=0;this.type!==X.parenR;)if(o?o=!1:this.expect(X.comma),a&&this.afterTrailingComma(X.parenR,!0)){u=!0;break}else if(this.type===X.ellipsis){x=this.start,f.push(this.parseParenItem(this.parseRestBinding())),this.type===X.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else f.push(this.parseMaybeAssign(!1,p,this.parseParenItem));var v=this.lastTokEnd,y=this.lastTokEndLoc;if(this.expect(X.parenR),e&&this.shouldParseArrow(f)&&this.eat(X.arrow))return this.checkPatternErrors(p,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=h,this.parseParenArrowList(t,n,f,r);(!f.length||u)&&this.unexpected(this.lastTokStart),x&&this.unexpected(x),this.checkExpressionErrors(p,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=h||this.awaitPos,f.length>1?(i=this.startNodeAt(s,c),i.expressions=f,this.finishNodeAt(i,"SequenceExpression",v,y)):i=f[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var w=this.startNodeAt(t,n);return w.expression=i,this.finishNode(w,"ParenthesizedExpression")}else return i};Br.parseParenItem=function(e){return e};Br.parseParenArrowList=function(e,r,t,n){return this.parseArrowExpression(this.startNodeAt(e,r),t,!1,n)};var iX=[];Br.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===X.dot){var r=this.startNodeAt(e.start,e.loc&&e.loc.start);r.name="new",e.meta=this.finishNode(r,"Identifier"),this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),t&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var n=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),n,i,!0,!1),this.eat(X.parenL)?e.arguments=this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1):e.arguments=iX,this.finishNode(e,"NewExpression")};Br.parseTemplateElement=function(e){var r=e.isTagged,t=this.startNode();return this.type===X.invalidTemplate?(r||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),t.value={raw:this.value,cooked:null}):t.value={raw:this.input.slice(this.start,this.end).replace(/\\r\\n?/g,\` -\`),cooked:this.value},this.next(),t.tail=this.type===X.backQuote,this.finishNode(t,"TemplateElement")};Br.parseTemplate=function(e){e===void 0&&(e={});var r=e.isTagged;r===void 0&&(r=!1);var t=this.startNode();this.next(),t.expressions=[];var n=this.parseTemplateElement({isTagged:r});for(t.quasis=[n];!n.tail;)this.type===X.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(X.dollarBraceL),t.expressions.push(this.parseExpression()),this.expect(X.braceR),t.quasis.push(n=this.parseTemplateElement({isTagged:r}));return this.next(),this.finishNode(t,"TemplateLiteral")};Br.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===X.name||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===X.star)&&!na.test(this.input.slice(this.lastTokEnd,this.start))};Br.parseObj=function(e,r){var t=this.startNode(),n=!0,i={};for(t.properties=[],this.next();!this.eat(X.braceR);){if(n)n=!1;else if(this.expect(X.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(X.braceR))break;var a=this.parseProperty(e,r);e||this.checkPropClash(a,i,r),t.properties.push(a)}return this.finishNode(t,e?"ObjectPattern":"ObjectExpression")};Br.parseProperty=function(e,r){var t=this.startNode(),n,i,a,s;if(this.options.ecmaVersion>=9&&this.eat(X.ellipsis))return e?(t.argument=this.parseIdent(!1),this.type===X.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(t,"RestElement")):(t.argument=this.parseMaybeAssign(!1,r),this.type===X.comma&&r&&r.trailingComma<0&&(r.trailingComma=this.start),this.finishNode(t,"SpreadElement"));this.options.ecmaVersion>=6&&(t.method=!1,t.shorthand=!1,(e||r)&&(a=this.start,s=this.startLoc),e||(n=this.eat(X.star)));var c=this.containsEsc;return this.parsePropertyName(t),!e&&!c&&this.options.ecmaVersion>=8&&!n&&this.isAsyncProp(t)?(i=!0,n=this.options.ecmaVersion>=9&&this.eat(X.star),this.parsePropertyName(t)):i=!1,this.parsePropertyValue(t,e,n,i,a,s,r,c),this.finishNode(t,"Property")};Br.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var r=e.kind==="get"?0:1;if(e.value.params.length!==r){var t=e.value.start;e.kind==="get"?this.raiseRecoverable(t,"getter should have no params"):this.raiseRecoverable(t,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};Br.parsePropertyValue=function(e,r,t,n,i,a,s,c){(t||n)&&this.type===X.colon&&this.unexpected(),this.eat(X.colon)?(e.value=r?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,s),e.kind="init"):this.options.ecmaVersion>=6&&this.type===X.parenL?(r&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(t,n)):!r&&!c&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==X.comma&&this.type!==X.braceR&&this.type!==X.eq?((t||n)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((t||n)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=i),e.kind="init",r?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===X.eq&&s?(s.shorthandAssign<0&&(s.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};Br.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(X.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(X.bracketR),e.key;e.computed=!1}return e.key=this.type===X.num||this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Br.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};Br.parseMethod=function(e,r,t){var n=this.startNode(),i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(MN(r,n.generator)|CN|(t?f8:0)),this.expect(X.parenL),n.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(n,"FunctionExpression")};Br.parseArrowExpression=function(e,r,t,n){var i=this.yieldPos,a=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(MN(t,!1)|s8),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(r,!0),this.parseFunctionBody(e,!0,!1,n),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")};Br.parseFunctionBody=function(e,r,t,n){var i=r&&this.type!==X.braceL,a=this.strict,s=!1;if(i)e.body=this.parseMaybeAssign(n),e.expression=!0,this.checkParams(e,!1);else{var c=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||c)&&(s=this.strictDirective(this.end),s&&c&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var f=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!a&&!s&&!r&&!t&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,p8),e.body=this.parseBlock(!1,void 0,s&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=f}this.exitScope()};Br.isSimpleParamList=function(e){for(var r=0,t=e;r-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&wl&&delete this.undefinedExports[e]}else if(r===l8){var a=this.currentScope();a.lexical.push(e)}else if(r===c8){var s=this.currentScope();this.treatFunctionsAsVar?n=s.lexical.indexOf(e)>-1:n=s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var c=this.scopeStack.length-1;c>=0;--c){var f=this.scopeStack[c];if(f.lexical.indexOf(e)>-1&&!(f.flags&u8&&f.lexical[0]===e)||!this.treatFunctionsAsVarInScope(f)&&f.functions.indexOf(e)>-1){n=!0;break}if(f.var.push(e),this.inModule&&f.flags&wl&&delete this.undefinedExports[e],f.flags&EN)break}n&&this.raiseRecoverable(t,"Identifier '"+e+"' has already been declared")};Ss.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Ss.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Ss.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&EN)return r}};Ss.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var r=this.scopeStack[e];if(r.flags&EN&&!(r.flags&s8))return r}};var Jy=function(r,t,n){this.type="",this.start=t,this.end=0,r.options.locations&&(this.loc=new Qy(r,n)),r.options.directSourceFile&&(this.sourceFile=r.options.directSourceFile),r.options.ranges&&(this.range=[t,0])},Nl=hn.prototype;Nl.startNode=function(){return new Jy(this,this.start,this.startLoc)};Nl.startNodeAt=function(e,r){return new Jy(this,e,r)};function h8(e,r,t,n){return e.type=r,e.end=t,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=t),e}Nl.finishNode=function(e,r){return h8.call(this,e,r,this.lastTokEnd,this.lastTokEndLoc)};Nl.finishNodeAt=function(e,r,t,n){return h8.call(this,e,r,t,n)};Nl.copyNode=function(e){var r=new Jy(this,e.start,this.startLoc);for(var t in e)r[t]=e[t];return r};var v8="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",g8=v8+" Extended_Pictographic",x8=g8,y8=x8+" EBase EComp EMod EPres ExtPict",b8=y8,oX=b8,sX={9:v8,10:g8,11:x8,12:y8,13:b8,14:oX},uX="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",fX={9:"",10:"",11:"",12:"",13:"",14:uX},K6="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",w8="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",D8=w8+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",S8=D8+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",N8=S8+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",A8=N8+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",cX=A8+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",lX={9:w8,10:D8,11:S8,12:N8,13:A8,14:cX},C8={};function pX(e){var r=C8[e]={binary:ws(sX[e]+" "+K6),binaryOfStrings:ws(fX[e]),nonBinary:{General_Category:ws(K6),Script:ws(lX[e])}};r.nonBinary.Script_Extensions=r.nonBinary.Script,r.nonBinary.gc=r.nonBinary.General_Category,r.nonBinary.sc=r.nonBinary.Script,r.nonBinary.scx=r.nonBinary.Script_Extensions}for(Hy=0,bN=[9,10,11,12,13,14];Hy=6?"uy":"")+(r.options.ecmaVersion>=9?"s":"")+(r.options.ecmaVersion>=13?"d":"")+(r.options.ecmaVersion>=15?"v":""),this.unicodeProperties=C8[r.options.ecmaVersion>=14?14:r.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};ja.prototype.reset=function(r,t,n){var i=n.indexOf("v")!==-1,a=n.indexOf("u")!==-1;this.start=r|0,this.source=t+"",this.flags=n,i&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=a&&this.parser.options.ecmaVersion>=9)};ja.prototype.raise=function(r){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+r)};ja.prototype.at=function(r,t){t===void 0&&(t=!1);var n=this.source,i=n.length;if(r>=i)return-1;var a=n.charCodeAt(r);if(!(t||this.switchU)||a<=55295||a>=57344||r+1>=i)return a;var s=n.charCodeAt(r+1);return s>=56320&&s<=57343?(a<<10)+s-56613888:a};ja.prototype.nextIndex=function(r,t){t===void 0&&(t=!1);var n=this.source,i=n.length;if(r>=i)return i;var a=n.charCodeAt(r),s;return!(t||this.switchU)||a<=55295||a>=57344||r+1>=i||(s=n.charCodeAt(r+1))<56320||s>57343?r+1:r+2};ja.prototype.current=function(r){return r===void 0&&(r=!1),this.at(this.pos,r)};ja.prototype.lookahead=function(r){return r===void 0&&(r=!1),this.at(this.nextIndex(this.pos,r),r)};ja.prototype.advance=function(r){r===void 0&&(r=!1),this.pos=this.nextIndex(this.pos,r)};ja.prototype.eat=function(r,t){return t===void 0&&(t=!1),this.current(t)===r?(this.advance(t),!0):!1};ja.prototype.eatChars=function(r,t){t===void 0&&(t=!1);for(var n=this.pos,i=0,a=r;i-1&&this.raise(e.start,"Duplicate regular expression flag"),s==="u"&&(n=!0),s==="v"&&(i=!0)}this.options.ecmaVersion>=15&&n&&i&&this.raise(e.start,"Invalid regular expression flag")};pr.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};pr.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var r=0,t=e.backReferenceNames;r=9&&(t=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!t,!0}return e.pos=r,!1};pr.regexp_eatQuantifier=function(e,r){return r===void 0&&(r=!1),this.regexp_eatQuantifierPrefix(e,r)?(e.eat(63),!0):!1};pr.regexp_eatQuantifierPrefix=function(e,r){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,r)};pr.regexp_eatBracedQuantifier=function(e,r){var t=e.pos;if(e.eat(123)){var n=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};pr.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};pr.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};pr.regexp_eatSyntaxCharacter=function(e){var r=e.current();return E8(r)?(e.lastIntValue=r,e.advance(),!0):!1};function E8(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}pr.regexp_eatPatternCharacters=function(e){for(var r=e.pos,t=0;(t=e.current())!==-1&&!E8(t);)e.advance();return e.pos!==r};pr.regexp_eatExtendedPatternCharacter=function(e){var r=e.current();return r!==-1&&r!==36&&!(r>=40&&r<=43)&&r!==46&&r!==63&&r!==91&&r!==94&&r!==124?(e.advance(),!0):!1};pr.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};pr.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};pr.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Ds(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Ds(e.lastIntValue);return!0}return!1};pr.regexp_eatRegExpIdentifierStart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,n=e.current(t);return e.advance(t),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(n=e.lastIntValue),mX(n)?(e.lastIntValue=n,!0):(e.pos=r,!1)};function mX(e){return Mo(e,!0)||e===36||e===95}pr.regexp_eatRegExpIdentifierPart=function(e){var r=e.pos,t=this.options.ecmaVersion>=11,n=e.current(t);return e.advance(t),n===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,t)&&(n=e.lastIntValue),dX(n)?(e.lastIntValue=n,!0):(e.pos=r,!1)};function dX(e){return Kf(e,!0)||e===36||e===95||e===8204||e===8205}pr.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};pr.regexp_eatBackReference=function(e){var r=e.pos;if(this.regexp_eatDecimalEscape(e)){var t=e.lastIntValue;if(e.switchU)return t>e.maxBackReference&&(e.maxBackReference=t),!0;if(t<=e.numCapturingParens)return!0;e.pos=r}return!1};pr.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};pr.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};pr.regexp_eatCControlLetter=function(e){var r=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=r}return!1};pr.regexp_eatZero=function(e){return e.current()===48&&!Ky(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};pr.regexp_eatControlEscape=function(e){var r=e.current();return r===116?(e.lastIntValue=9,e.advance(),!0):r===110?(e.lastIntValue=10,e.advance(),!0):r===118?(e.lastIntValue=11,e.advance(),!0):r===102?(e.lastIntValue=12,e.advance(),!0):r===114?(e.lastIntValue=13,e.advance(),!0):!1};pr.regexp_eatControlLetter=function(e){var r=e.current();return M8(r)?(e.lastIntValue=r%32,e.advance(),!0):!1};function M8(e){return e>=65&&e<=90||e>=97&&e<=122}pr.regexp_eatRegExpUnicodeEscapeSequence=function(e,r){r===void 0&&(r=!1);var t=e.pos,n=r||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(n&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(s>=56320&&s<=57343)return e.lastIntValue=(i-55296)*1024+(s-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(n&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&hX(e.lastIntValue))return!0;n&&e.raise("Invalid unicode escape"),e.pos=t}return!1};function hX(e){return e>=0&&e<=1114111}pr.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var r=e.current();return r!==99&&(!e.switchN||r!==107)?(e.lastIntValue=r,e.advance(),!0):!1};pr.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var r=e.current();if(r>=49&&r<=57){do e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();while((r=e.current())>=48&&r<=57);return!0}return!1};var _8=0,_o=1,ta=2;pr.regexp_eatCharacterClassEscape=function(e){var r=e.current();if(vX(r))return e.lastIntValue=-1,e.advance(),_o;var t=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((t=r===80)||r===112)){e.lastIntValue=-1,e.advance();var n;if(e.eat(123)&&(n=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return t&&n===ta&&e.raise("Invalid property name"),n;e.raise("Invalid property name")}return _8};function vX(e){return e===100||e===68||e===115||e===83||e===119||e===87}pr.regexp_eatUnicodePropertyValueExpression=function(e){var r=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var t=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,t,n),_o}}if(e.pos=r,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return _8};pr.regexp_validateUnicodePropertyNameAndValue=function(e,r,t){Dl(e.unicodeProperties.nonBinary,r)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[r].test(t)||e.raise("Invalid property value")};pr.regexp_validateUnicodePropertyNameOrValue=function(e,r){if(e.unicodeProperties.binary.test(r))return _o;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(r))return ta;e.raise("Invalid property name")};pr.regexp_eatUnicodePropertyName=function(e){var r=0;for(e.lastStringValue="";T8(r=e.current());)e.lastStringValue+=Ds(r),e.advance();return e.lastStringValue!==""};function T8(e){return M8(e)||e===95}pr.regexp_eatUnicodePropertyValue=function(e){var r=0;for(e.lastStringValue="";gX(r=e.current());)e.lastStringValue+=Ds(r),e.advance();return e.lastStringValue!==""};function gX(e){return T8(e)||Ky(e)}pr.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};pr.regexp_eatCharacterClass=function(e){if(e.eat(91)){var r=e.eat(94),t=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),r&&t===ta&&e.raise("Negated character class may contain strings"),!0}return!1};pr.regexp_classContents=function(e){return e.current()===93?_o:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),_o)};pr.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var r=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var t=e.lastIntValue;e.switchU&&(r===-1||t===-1)&&e.raise("Invalid character class"),r!==-1&&t!==-1&&r>t&&e.raise("Range out of order in character class")}}};pr.regexp_eatClassAtom=function(e){var r=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var t=e.current();(t===99||B8(t))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=r}var n=e.current();return n!==93?(e.lastIntValue=n,e.advance(),!0):!1};pr.regexp_eatClassEscape=function(e){var r=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=r}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};pr.regexp_classSetExpression=function(e){var r=_o,t;if(!this.regexp_eatClassSetRange(e))if(t=this.regexp_eatClassSetOperand(e)){t===ta&&(r=ta);for(var n=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(t=this.regexp_eatClassSetOperand(e))){t!==ta&&(r=_o);continue}e.raise("Invalid character in character class")}if(n!==e.pos)return r;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(n!==e.pos)return r}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(t=this.regexp_eatClassSetOperand(e),!t)return r;t===ta&&(r=ta)}};pr.regexp_eatClassSetRange=function(e){var r=e.pos;if(this.regexp_eatClassSetCharacter(e)){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;return t!==-1&&n!==-1&&t>n&&e.raise("Range out of order in character class"),!0}e.pos=r}return!1};pr.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?_o:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};pr.regexp_eatNestedClass=function(e){var r=e.pos;if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);if(e.eat(93))return t&&n===ta&&e.raise("Negated character class may contain strings"),n;e.pos=r}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=r}return null};pr.regexp_eatClassStringDisjunction=function(e){var r=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var t=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return t}else e.raise("Invalid escape");e.pos=r}return null};pr.regexp_classStringDisjunctionContents=function(e){for(var r=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===ta&&(r=ta);return r};pr.regexp_classString=function(e){for(var r=0;this.regexp_eatClassSetCharacter(e);)r++;return r===1?_o:ta};pr.regexp_eatClassSetCharacter=function(e){var r=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=r,!1);var t=e.current();return t<0||t===e.lookahead()&&xX(t)||yX(t)?!1:(e.advance(),e.lastIntValue=t,!0)};function xX(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function yX(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}pr.regexp_eatClassSetReservedPunctuator=function(e){var r=e.current();return bX(r)?(e.lastIntValue=r,e.advance(),!0):!1};function bX(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}pr.regexp_eatClassControlLetter=function(e){var r=e.current();return Ky(r)||r===95?(e.lastIntValue=r%32,e.advance(),!0):!1};pr.regexp_eatHexEscapeSequence=function(e){var r=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=r}return!1};pr.regexp_eatDecimalDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;Ky(t=e.current());)e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();return e.pos!==r};function Ky(e){return e>=48&&e<=57}pr.regexp_eatHexDigits=function(e){var r=e.pos,t=0;for(e.lastIntValue=0;F8(t=e.current());)e.lastIntValue=16*e.lastIntValue+O8(t),e.advance();return e.pos!==r};function F8(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function O8(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}pr.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;r<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=r*64+t*8+e.lastIntValue:e.lastIntValue=r*8+t}else e.lastIntValue=r;return!0}return!1};pr.regexp_eatOctalDigit=function(e){var r=e.current();return B8(r)?(e.lastIntValue=r-48,e.advance(),!0):(e.lastIntValue=0,!1)};function B8(e){return e>=48&&e<=55}pr.regexp_eatFixedHexDigits=function(e,r){var t=e.pos;e.lastIntValue=0;for(var n=0;n=this.input.length)return this.finishToken(X.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};jr.readToken=function(e){return Mo(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};jr.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var r=this.input.charCodeAt(this.pos+1);return r<=56319||r>=57344?e:(e<<10)+r-56613888};jr.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),r=this.pos,t=this.input.indexOf("*/",this.pos+=2);if(t===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=t+2,this.options.locations)for(var n=void 0,i=r;(n=t8(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=n;this.options.onComment&&this.options.onComment(!0,this.input.slice(r+2,t),r,this.pos,e,this.curPosition())};jr.skipLineComment=function(e){for(var r=this.pos,t=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos8&&e<14||e>=5760&&n8.test(String.fromCharCode(e)))++this.pos;else break e}}};jr.finishToken=function(e,r){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var t=this.type;this.type=e,this.value=r,this.updateContext(t)};jr.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var r=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&r===46?(this.pos+=3,this.finishToken(X.ellipsis)):(++this.pos,this.finishToken(X.dot))};jr.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(X.assign,2):this.finishOp(X.slash,1)};jr.readToken_mult_modulo_exp=function(e){var r=this.input.charCodeAt(this.pos+1),t=1,n=e===42?X.star:X.modulo;return this.options.ecmaVersion>=7&&e===42&&r===42&&(++t,n=X.starstar,r=this.input.charCodeAt(this.pos+2)),r===61?this.finishOp(X.assign,t+1):this.finishOp(n,t)};jr.readToken_pipe_amp=function(e){var r=this.input.charCodeAt(this.pos+1);if(r===e){if(this.options.ecmaVersion>=12){var t=this.input.charCodeAt(this.pos+2);if(t===61)return this.finishOp(X.assign,3)}return this.finishOp(e===124?X.logicalOR:X.logicalAND,2)}return r===61?this.finishOp(X.assign,2):this.finishOp(e===124?X.bitwiseOR:X.bitwiseAND,1)};jr.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(X.assign,2):this.finishOp(X.bitwiseXOR,1)};jr.readToken_plus_min=function(e){var r=this.input.charCodeAt(this.pos+1);return r===e?r===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||na.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(X.incDec,2):r===61?this.finishOp(X.assign,2):this.finishOp(X.plusMin,1)};jr.readToken_lt_gt=function(e){var r=this.input.charCodeAt(this.pos+1),t=1;return r===e?(t=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+t)===61?this.finishOp(X.assign,t+1):this.finishOp(X.bitShift,t)):r===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(r===61&&(t=2),this.finishOp(X.relational,t))};jr.readToken_eq_excl=function(e){var r=this.input.charCodeAt(this.pos+1);return r===61?this.finishOp(X.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&r===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(X.arrow)):this.finishOp(e===61?X.eq:X.prefix,1)};jr.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var r=this.input.charCodeAt(this.pos+1);if(r===46){var t=this.input.charCodeAt(this.pos+2);if(t<48||t>57)return this.finishOp(X.questionDot,2)}if(r===63){if(e>=12){var n=this.input.charCodeAt(this.pos+2);if(n===61)return this.finishOp(X.assign,3)}return this.finishOp(X.coalesce,2)}}return this.finishOp(X.question,1)};jr.readToken_numberSign=function(){var e=this.options.ecmaVersion,r=35;if(e>=13&&(++this.pos,r=this.fullCharCodeAtPos(),Mo(r,!0)||r===92))return this.finishToken(X.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Ds(r)+"'")};jr.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(X.parenL);case 41:return++this.pos,this.finishToken(X.parenR);case 59:return++this.pos,this.finishToken(X.semi);case 44:return++this.pos,this.finishToken(X.comma);case 91:return++this.pos,this.finishToken(X.bracketL);case 93:return++this.pos,this.finishToken(X.bracketR);case 123:return++this.pos,this.finishToken(X.braceL);case 125:return++this.pos,this.finishToken(X.braceR);case 58:return++this.pos,this.finishToken(X.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(X.backQuote);case 48:var r=this.input.charCodeAt(this.pos+1);if(r===120||r===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(r===111||r===79)return this.readRadixNumber(8);if(r===98||r===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(X.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Ds(e)+"'")};jr.finishOp=function(e,r){var t=this.input.slice(this.pos,this.pos+r);return this.pos+=r,this.finishToken(e,t)};jr.readRegexp=function(){for(var e,r,t=this.pos;;){this.pos>=this.input.length&&this.raise(t,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(na.test(n)&&this.raise(t,"Unterminated regular expression"),e)e=!1;else{if(n==="[")r=!0;else if(n==="]"&&r)r=!1;else if(n==="/"&&!r)break;e=n==="\\\\"}++this.pos}var i=this.input.slice(t,this.pos);++this.pos;var a=this.pos,s=this.readWord1();this.containsEsc&&this.unexpected(a);var c=this.regexpState||(this.regexpState=new ja(this));c.reset(t,i,s),this.validateRegExpFlags(c),this.validateRegExpPattern(c);var f=null;try{f=new RegExp(i,s)}catch{}return this.finishToken(X.regexp,{pattern:i,flags:s,value:f})};jr.readInt=function(e,r,t){for(var n=this.options.ecmaVersion>=12&&r===void 0,i=t&&this.input.charCodeAt(this.pos)===48,a=this.pos,s=0,c=0,f=0,o=r??1/0;f=97?p=u-97+10:u>=65?p=u-65+10:u>=48&&u<=57?p=u-48:p=1/0,p>=e)break;c=u,s=s*e+p}return n&&c===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||r!=null&&this.pos-a!==r?null:s};function wX(e,r){return r?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function I8(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}jr.readRadixNumber=function(e){var r=this.pos;this.pos+=2;var t=this.readInt(e);return t==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(t=I8(this.input.slice(r,this.pos)),++this.pos):Mo(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(X.num,t)};jr.readNumber=function(e){var r=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(r,"Invalid number");var t=this.pos-r>=2&&this.input.charCodeAt(r)===48;t&&this.strict&&this.raise(r,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!t&&!e&&this.options.ecmaVersion>=11&&n===110){var i=I8(this.input.slice(r,this.pos));return++this.pos,Mo(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(X.num,i)}t&&/[89]/.test(this.input.slice(r,this.pos))&&(t=!1),n===46&&!t&&(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),(n===69||n===101)&&!t&&(n=this.input.charCodeAt(++this.pos),(n===43||n===45)&&++this.pos,this.readInt(10)===null&&this.raise(r,"Invalid number")),Mo(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=wX(this.input.slice(r,this.pos),t);return this.finishToken(X.num,a)};jr.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),r;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;r=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,r>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else r=this.readHexChar(4);return r};jr.readString=function(e){for(var r="",t=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;n===92?(r+=this.input.slice(t,this.pos),r+=this.readEscapedChar(!1),t=this.pos):n===8232||n===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(jf(n)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return r+=this.input.slice(t,this.pos++),this.finishToken(X.string,r)};var P8={};jr.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===P8)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};jr.invalidStringToken=function(e,r){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw P8;this.raise(e,r)};jr.readTmplToken=function(){for(var e="",r=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var t=this.input.charCodeAt(this.pos);if(t===96||t===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===X.template||this.type===X.invalidTemplate)?t===36?(this.pos+=2,this.finishToken(X.dollarBraceL)):(++this.pos,this.finishToken(X.backQuote)):(e+=this.input.slice(r,this.pos),this.finishToken(X.template,e));if(t===92)e+=this.input.slice(r,this.pos),e+=this.readEscapedChar(!0),r=this.pos;else if(jf(t)){switch(e+=this.input.slice(r,this.pos),++this.pos,t){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=\` -\`;break;default:e+=String.fromCharCode(t);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),r=this.pos}else++this.pos}};jr.readInvalidTemplateToken=function(){for(;this.pos=48&&r<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,r=this.input.charCodeAt(this.pos),(n!=="0"||r===56||r===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return jf(r)?"":String.fromCharCode(r)}};jr.readHexChar=function(e){var r=this.pos,t=this.readInt(16,e);return t===null&&this.invalidStringToken(r,"Bad character escape sequence"),t};jr.readWord1=function(){this.containsEsc=!1;for(var e="",r=!0,t=this.pos,n=this.options.ecmaVersion>=6;this.pos{let r=/^["'](?:[^"\\\\]|\\\\.)*["'](?:;)?$/.test(e),t=e?.replace(/;+$/,""),n=!isNaN(parseFloat(t))&&!isNaN(t);return r||n||t=="false"||t=="true"||e==null||e==""};var ON=(e,r)=>{let t=r?\`($event, $value, $state, $saveState, $api) => { \${e} }\`:e,n=typeof t=="string"||t instanceof String?t.includes(\` -\`):!1,i;try{i=n&&!r&&!t.startsWith("(")?new Function(\`with(this) { \${t} }\`):new Function(\`with(this) { return \${t}; }\`)}catch(a){console.log(a,e)}return i},BN=e=>{let r={...e,execActions:{},execProps:{},execStyles:{},execPropsOptions:{}},{sortedKeys:t,dependencies:n}=L8(r.node.props,\`\${r.id}.props\`),{sortedKeys:i,dependencies:a}=L8(r.node.styles,\`\${r.id}.styles\`);r.execPropsOptions.props=t.map(c=>({name:c,isConst:R8(r.node.props[c]),deps:n.get(c)||[]})),r.execProps=e1(r.node.props,c=>ON(c,!1)),r.execStyles=e1(r.node.styles,c=>ON(c,!1)),r.execActions=e1(r.node.actions,c=>ON(c,!0)),r.children=r.children.map(c=>BN(c)),r.execPropsOptions.children=[...r.children.flatMap(c=>c.execPropsOptions.children),...r.children.map(c=>c.id)];let s=[...r.children.flatMap(c=>c.execPropsOptions.deps),...r.execPropsOptions.props.flatMap(c=>c.deps),...[...a.values()].flat()];return r.execPropsOptions.deps=s.filter(c=>c[0]!=r.id),r.node.type=="list"&&(r.execPropsOptions.template=r.children),r};function NX(e){let r=[];function t(i,a=[]){if(i.type==="Identifier")return a.push(i.name),a;if(i.type==="MemberExpression"){let s=t(i.object,a);if(s&&i.computed)return i.property.type==="Literal"?(s.push(String(i.property.value)),s):i.property.type==="Identifier"?(s.push(i.property.name),s):i.property.type==="MemberExpression"?(n(i.property),s):null;if(s)return t(i.property,s)}else{if(i.type==="Literal")return a.push(String(i.value)),a;if(i.type==="ChainExpression"||i.type=="ExpressionStatement"){n(i.expression);return}else if(i.type==="CallExpression"){n(i);return}}return null}function n(i){if(i.type==="MemberExpression"){let a=t(i);a&&r.push(a);return}for(let a in i)if(typeof i[a]=="object"&&i[a]!==null)n(i[a]);else if(Array.isArray(i[a]))for(let s of i[a])typeof s=="object"&&s!==null&&n(s)}try{let i=jy(e.replace("return ",""),{ecmaVersion:2020});n(i)}catch{return[]}return r}function L8(e,r){let t=new Map,n=new Map,i=new Map;for(let o in e){let u=e[o],p=NX(u),d=p.filter(h=>h.slice(0,-1).join(".")===r);n.set(o,d),i.set(o,p),t.has(o)||t.set(o,new Set);for(let h of d){let x=h[h.length-1];x!==o&&t.get(o).add(x)}}let a=new Set,s=[],c=new Set,f=o=>{if(c.has(o))throw new Error("Circular dependency detected");if(!a.has(o)){c.add(o);let u=t.get(o)||new Set;for(let p of u)f(p);a.add(o),c.delete(o),s.push(o)}};for(let o in e)a.has(o)||f(o);return{sortedKeys:s,dependencies:i}}function q8(e,r,t,n,i){var a=[];t||(t=je),function s(c,f,o){var u=o||c.type,p=c!==a[a.length-1];p&&a.push(c),t[u](c,f,s),r[u]&&r[u](c,f||a,a),p&&a.pop()}(e,n,i)}function IN(e,r,t){t(e,r)}function cu(e,r,t){}var je={};je.Program=je.BlockStatement=je.StaticBlock=function(e,r,t){for(var n=0,i=e.body;n":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},Ma=17,CX={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:Ma,ClassExpression:Ma,FunctionExpression:Ma,ObjectExpression:Ma,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};function tc(e,r){let{generator:t}=e;if(e.write("("),r!=null&&r.length>0){t[r[0].type](r[0],e);let{length:n}=r;for(let i=1;i0){e.write(n);for(let s=1;s0){t.VariableDeclarator(n[0],e);for(let a=1;a0){r.write(n),i&&e.comments!=null&&Qn(r,e.comments,a,n);let{length:c}=s;for(let f=0;f0){for(;i0&&r.write(", ");let a=t[i],s=a.type[6];if(s==="D")r.write(a.local.name,a),i++;else if(s==="N")r.write("* as "+a.local.name,a),i++;else break}if(i0)for(let i=0;;){let a=t[i],{name:s}=a.local;if(r.write(s,a),s!==a.exported.name&&r.write(" as "+a.exported.name),++i "),e.body.type[0]==="O"?(r.write("("),this.ObjectExpression(e.body,r),r.write(")")):this[e.body.type](e.body,r)},ThisExpression(e,r){r.write("this",e)},Super(e,r){r.write("super",e)},RestElement:W8=function(e,r){r.write("..."),this[e.argument.type](e.argument,r)},SpreadElement:W8,YieldExpression(e,r){r.write(e.delegate?"yield*":"yield"),e.argument&&(r.write(" "),this[e.argument.type](e.argument,r))},AwaitExpression(e,r){r.write("await ",e),t1(r,e.argument,e)},TemplateLiteral(e,r){let{quasis:t,expressions:n}=e;r.write("\`");let{length:i}=n;for(let s=0;s0){let{elements:t}=e,{length:n}=t;for(let i=0;;){let a=t[i];if(a!=null&&this[a.type](a,r),++i0){r.write(n),i&&e.comments!=null&&Qn(r,e.comments,a,n);let s=","+n,{properties:c}=e,{length:f}=c;for(let o=0;;){let u=c[o];if(i&&u.comments!=null&&Qn(r,u.comments,a,n),r.write(a),this[u.type](u,r),++o0){let{properties:t}=e,{length:n}=t;for(let i=0;this[t[i].type](t[i],r),++i1||i[0]==="U"&&(i[1]==="n"||i[1]==="p")&&n.prefix&&n.operator[0]===t&&(t==="+"||t==="-"))&&r.write(" "),a?(r.write(t.length>1?" (":"("),this[i](n,r),r.write(")")):this[i](n,r)}else this[e.argument.type](e.argument,r),r.write(e.operator)},UpdateExpression(e,r){e.prefix?(r.write(e.operator),this[e.argument.type](e.argument,r)):(this[e.argument.type](e.argument,r),r.write(e.operator))},AssignmentExpression(e,r){this[e.left.type](e.left,r),r.write(" "+e.operator+" "),this[e.right.type](e.right,r)},AssignmentPattern(e,r){this[e.left.type](e.left,r),r.write(" = "),this[e.right.type](e.right,r)},BinaryExpression:V8=function(e,r){let t=e.operator==="in";t&&r.write("("),t1(r,e.left,e,!1),r.write(" "+e.operator+" "),t1(r,e.right,e,!0),t&&r.write(")")},LogicalExpression:V8,ConditionalExpression(e,r){let{test:t}=e,n=r.expressionsPrecedence[t.type];n===Ma||n<=r.expressionsPrecedence.ConditionalExpression?(r.write("("),this[t.type](t,r),r.write(")")):this[t.type](t,r),r.write(" ? "),this[e.consequent.type](e.consequent,r),r.write(" : "),this[e.alternate.type](e.alternate,r)},NewExpression(e,r){r.write("new ");let t=r.expressionsPrecedence[e.callee.type];t===Ma||t0&&(this.lineEndSize>0&&(i.length===1?r[n-1]===i:r.endsWith(i))?(this.line+=this.lineEndSize,this.column=0):this.column+=n)}toString(){return this.output}};function $8(e,r){let t=new kN(r);return t.generator[e.type](e,t),t.output}var RN=(e,r,t)=>{let n,i=yA(e),a=i.includes(\` -\`),s=!1;if(a){let c=i.split(\` -\`).filter(f=>f.trim()!=="");c[c.length-1].includes("return")&&(s=!0),c[c.length-1]=\`\${c[c.length-1].replace("return ","")}\`,i=c.join(\` -\`)}try{let c=jy(i,{ecmaVersion:2020,locations:!0});q8(c,{Identifier(f,o){let u=o[o.length-2];(u.type!=="MemberExpression"||u.object===f)&&f.name==r&&(f.name=t)},Property(f){f.key.type==="Identifier"&&f.key.name===r&&(f.key.name=t)},ObjectExpression(f){f.properties.forEach(o=>{o.key.type==="Identifier"&&o.key.name===r&&(o.key.name=t)})}}),n=$8(c).trimEnd()}catch(c){console.log(c,e,name),n='"error"'}if(a&&s){let c=n.split(\` -\`).filter(f=>f.trim()!=="");c[c.length-1]=\`return \${c[c.length-1]}\`,n=c.join(\` -\`)}return n};var Z8=(e,r)=>{let t=(i,a,s)=>{let c,f=s.node;return s.children&&(c=s.children.map(o=>t(i,a,o))),{...s,children:c,node:{...s.node,parentId:f.parentId==i?a:f.parentId,props:Object.keys(f?.props??{}).reduce((o,u)=>({...o,[u]:RN(f.props[u],i,a)}),f.props),actions:Object.keys(f?.actions??{}).reduce((o,u)=>({...o,[u]:RN(f.actions[u],i,a)}),f.actions),styles:Object.keys(f?.styles??{}).reduce((o,u)=>({...o,[u]:RN(f.styles[u],i,a)}),f.styles)}}};return((i,a,s)=>{let c=(f,o,u)=>{let p=o.node.parentId?o.id+u:f.id,d={...o,node:{...o.node,id:p},id:p};if(d=t(o.id,p,d),d.children){let[h,x]=d.children.reduce((v,y,w)=>{let[E,b]=c(d,y,u+w+1);return v[0].push(E),[v[0],b]},[[],u]);d.children=h,u=x}return[d,u+1]};return c(i,a,s)})(e,e,r)};var LN=async(e,r,t)=>{let n=e;if(r.prevState[n.id]&&n.node.type!="content"){let a=!1;if(n.node.type=="slides"||n.node.type=="slide"||n.node.type=="delta")a=!1;else{let s=(n.execPropsOptions.children??[]).some(u=>Object.keys(r.newState).includes(u)),c=Object.keys(r.newState[n.id]?.props??{}).every(u=>r.newState[n.id]?.props[u]==r.prevState[n.id]?.props[u]),f=Object.keys(r.newState[n.id]?.styles??{}).every(u=>r.newState[n.id]?.styles[u]==r.prevState[n.id]?.styles[u]),o=n.execPropsOptions.deps.every(u=>u[0]=="$api"||r.newState[u[0]]?.[u[1]]?.[u[2]]===void 0?!0:r.newState[u[0]]?.[u[1]]?.[u[2]]===r.prevState[u[0]]?.[u[1]]?.[u[2]]);c&&f&&o&&!s&&(a=!0)}if(a)return{id:t.runID,root:t.root,exec:n,state:r.state,slides:r.slides,newState:r.newState,prevState:r.prevState}}let i=await FX(n,r,t.contexts,t.api);if(n.node.type=="list"){let a=0;n.children=xA(i.state[n.id].props.value).flatMap((s,c)=>n.execPropsOptions.template.map(f=>{let[o,u]=Z8({...f,node:{...f.node,props:{...f.node.props,value:\`\${n.id}.props.value[\${c}]\`}}},a);return a=u,BN(o)}))}typeof i.state[n.id]?.actions?.onRun=="function"&&i.state[n.id].actions?.onRun(null,null,i,a=>{t.saveState(a,{state:i.state,slides:i.slides,root:t.root,exec:t.exec,id:t.runID})},t.api),n.children=[...n.children.filter(a=>a.node.type=="slides"),...n.children.filter(a=>a.node.type!="slides")];for(let a=0;a[{state:f.state,newState:f.newState,slides:f.slides,prevState:f.prevState},f.exec]);if(i=s,n.children[a]=c,c.node.type=="slides"){let f=s.state[c.id].props.value,o=s.state[c.node.parentId]?.props[f],u;t.selectedSlide&&(u=c.children.find(p=>p.id==t.selectedSlide)),o!==null&&!u&&(u=c.children.find(p=>s.state[p.id].props.value==o)),u&&u.children.forEach(p=>{i.newState[p.node.ref]||(i.newState[p.node.ref]={props:{},styles:{},actions:{}}),p.node.ref==n.id?(i.state[p.node.ref].props={...i.state[p.node.ref].props,...i.state[p.node.id].props},i.state[p.node.ref].styles={...i.state[p.node.ref].styles,...i.state[p.node.id].styles},i.state[p.node.ref].actions={...i.state[p.node.ref].actions,...i.state[p.node.id].actions}):(i.newState[p.node.ref].props={...i.newState[p.node.ref].props,...i.state[p.node.id].props},i.newState[p.node.ref].styles={...i.newState[p.node.ref].styles,...i.state[p.node.id].styles},i.newState[p.node.ref].actions={...i.newState[p.node.ref].actions,...i.state[p.node.id].actions})})}}return{id:t.runID,root:t.root,exec:n,state:i.state,slides:i.slides,newState:i.newState,prevState:i.prevState}},FX=async(e,r,t,n)=>{let i=await OX(e,r,t,n),a=Q8(e.node,"styles",e.execStyles,i);return Q8(e.node,"actions",e.execActions,a)};var OX=async(e,r,t,n)=>{let{id:i}=e.node,a=e.execProps??{},s=r.state;s[i]={props:r.state[i]?.props??{},actions:r.state[i]?.actions??{},styles:r.state[i]?.styles??{}},s.$contexts=t,s.$api=n;for(let{name:c,isConst:f}of e.execPropsOptions.props)try{let o;c in(r.newState?.[i]?.props||{})&&f?o=r.newState[i].props[c]:o=a[c]?.call(s),o!==null?(s[i].props[c]=o,r.state[i].props[c]=o,r.newState&&(r.newState[i]=r.newState[i]??{props:{},styles:{},actions:{}},r.newState[i].props[c]=o)):(delete s[i].props[c],delete r.state[i].props[c],r.newState?.[i]&&delete r.newState[i].props[c])}catch(o){console.log(c,o,a[c])}return r};function Q8(e,r,t,n){let{id:i}=e;for(let a of Object.keys(t)){let s;try{a in(n.newState?.[i]?.[r]||{})?s=n.newState[i][r][a]:s=t[a]?.call(n.state),s!==null?n.state[e.id][r][a]=s:delete n.state[e.id][r][a]}catch(c){console.log(c,a)}}return n}function X8(e,r){return e.table.rows.map(t=>Z6(r,e.paths,t,e.table.cols,e.paths.get(t[Wa])))}function J8(e){let{root:r,store:t,context:n}=e;return LN(r,t,n)}var BX=self,IX={...pN,createAdd:T("add",[],()=>function(r,t){return r+t})},K8=zy(IX);K8.import(Cw,{override:!0});BX.onmessage=async e=>{let{payload:r,job:t}=e.data,n;t.type=="table"?n=X8(r,K8):t.type=="instance"&&(n=J8(r));try{postMessage({job:t,result:n})}catch(i){console.log(i),postMessage({job:t,result:{$error:\`Failed to run \${t.type} \${t.path}: \${i}\`}})}}; -/*! - * decimal.js v10.4.3 - * An arbitrary-precision Decimal type for JavaScript. - * https://github.com/MikeMcl/decimal.js - * Copyright (c) 2022 Michael Mclaughlin - * MIT Licence - */ -/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -/** - * @license Complex.js v2.1.1 12/05/2020 - * - * Copyright (c) 2020, Robert Eisele (robert@xarg.org) - * Dual licensed under the MIT or GPL Version 2 licenses. - **/ -/** - * @license Fraction.js v4.3.0 20/08/2023 - * https://www.xarg.org/2014/03/rational-numbers-in-javascript/ - * - * Copyright (c) 2023, Robert Eisele (robert@raw.org) - * Dual licensed under the MIT or GPL Version 2 licenses. - **/ -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! moment.js -//! momentjs.com -//! version : 2.29.4 -`, { "name": "Superstate Runner" }); -} - -// src/core/superstate/workers/runner/runner.ts -var Runner = class { - constructor(numWorkers, cache2) { - this.numWorkers = numWorkers; - this.cache = cache2; - this.workers = []; - this.busy = []; - this.reloadQueue = []; - this.reloadSet = /* @__PURE__ */ new Set(); - this.callbacks = /* @__PURE__ */ new Map(); - for (let index2 = 0; index2 < numWorkers; index2++) { - const worker = new Worker3({ name: "Make.md Superstate Indexer " + (index2 + 1) }); - worker.onmessage = (evt) => this.finish(evt.data.job, evt.data.result, index2); - this.workers.push(worker); - this.busy.push(false); - } - } - run(jerb) { - const jobKey = stringifyJob(jerb); - const promise = new Promise((resolve2, reject) => { - if (this.callbacks.has(jobKey)) - this.callbacks.get(jobKey)?.push([resolve2, reject]); - else - this.callbacks.set(jobKey, [[resolve2, reject]]); - }); - if (this.reloadSet.has(jobKey)) - return promise; - this.reloadSet.add(jobKey); - const workerId = this.nextAvailableWorker(); - if (workerId !== void 0) { - this.send(jerb, workerId); - } else { - this.reloadQueue.push(jerb); - } - return promise; - } - finish(jerb, data2, index2) { - const jobKey = stringifyJob(jerb); - const calls = [].concat(this.callbacks.get(jobKey) ?? []); - this.reloadSet.delete(jobKey); - this.callbacks.delete(jobKey); - this.busy[index2] = false; - const job = this.reloadQueue.shift(); - if (job !== void 0) - this.send(job, index2); - if ("$error" in data2) { - for (const [_18, reject] of calls) - reject(data2["$error"]); - } else { - for (const [callback, _18] of calls) - callback(data2); - } - } - async send(job, workerId) { - if (job.type == "table") { - this.message(workerId, { - job, - payload: { - table: job.payload.table, - paths: this.cache.pathsIndex - } - }); - this.busy[workerId] = true; - return; - } - if (job.type == "instance") { - this.message(workerId, { - job, - payload: { - root: job.payload.root, - paths: this.cache.pathsIndex, - store: job.payload.store, - context: job.payload.context - } - }); - this.busy[workerId] = true; - return; - } - } - message(workerId, message) { - this.workers[workerId].postMessage( - message - ); - } - nextAvailableWorker() { - const index2 = this.busy.indexOf(false); - return index2 == -1 ? void 0 : index2; - } -}; - // src/core/superstate/workers/search/search.worker.ts -function Worker4() { +function Worker3() { return inlineWorker('"use strict";var he=(t,e)=>e.indexOf(t)>0?e.indexOf(t):e.length;function k(t){return k=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(t)}function x(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function f(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function m(t){f(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||k(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn\'t accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function J(t,e){f(2,arguments);var r=m(t).getTime(),a=x(e);return new Date(r+a)}var Je={};function T(){return Je}function z(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function K(t){return f(1,arguments),t instanceof Date||k(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Z(t){if(f(1,arguments),!K(t)&&typeof t!="number")return!1;var e=m(t);return!isNaN(Number(e))}function ee(t,e){f(2,arguments);var r=x(e);return J(t,-r)}var ze=864e5;function te(t){f(1,arguments);var e=m(t),r=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var a=e.getTime(),n=r-a;return Math.floor(n/ze)+1}function O(t){f(1,arguments);var e=1,r=m(t),a=r.getUTCDay(),n=(a=n.getTime()?r+1:e.getTime()>=i.getTime()?r:r-1}function re(t){f(1,arguments);var e=_(t),r=new Date(0);r.setUTCFullYear(e,0,4),r.setUTCHours(0,0,0,0);var a=O(r);return a}var Ke=6048e5;function ae(t){f(1,arguments);var e=m(t),r=O(e).getTime()-re(e).getTime();return Math.round(r/Ke)+1}function S(t,e){var r,a,n,o,i,s,d,l;f(1,arguments);var p=T(),c=x((r=(a=(n=(o=e?.weekStartsOn)!==null&&o!==void 0?o:e==null||(i=e.locale)===null||i===void 0||(s=i.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&n!==void 0?n:p.weekStartsOn)!==null&&a!==void 0?a:(d=p.locale)===null||d===void 0||(l=d.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&r!==void 0?r:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=m(t),g=h.getUTCDay(),v=(g=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(c+1,0,g),v.setUTCHours(0,0,0,0);var E=S(v,e),D=new Date(0);D.setUTCFullYear(c,0,g),D.setUTCHours(0,0,0,0);var N=S(D,e);return p.getTime()>=E.getTime()?c+1:p.getTime()>=N.getTime()?c:c-1}function ne(t,e){var r,a,n,o,i,s,d,l;f(1,arguments);var p=T(),c=x((r=(a=(n=(o=e?.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(i=e.locale)===null||i===void 0||(s=i.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&n!==void 0?n:p.firstWeekContainsDate)!==null&&a!==void 0?a:(d=p.locale)===null||d===void 0||(l=d.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&r!==void 0?r:1),h=L(t,e),g=new Date(0);g.setUTCFullYear(h,0,c),g.setUTCHours(0,0,0,0);var v=S(g,e);return v}var Ze=6048e5;function oe(t,e){f(1,arguments);var r=m(t),a=S(r,e).getTime()-ne(r,e).getTime();return Math.round(a/Ze)+1}function u(t,e){for(var r=t<0?"-":"",a=Math.abs(t).toString();a.length0?a:1-a;return u(r==="yy"?n%100:n,r.length)},M:function(e,r){var a=e.getUTCMonth();return r==="M"?String(a+1):u(a+1,2)},d:function(e,r){return u(e.getUTCDate(),r.length)},a:function(e,r){var a=e.getUTCHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h:function(e,r){return u(e.getUTCHours()%12||12,r.length)},H:function(e,r){return u(e.getUTCHours(),r.length)},m:function(e,r){return u(e.getUTCMinutes(),r.length)},s:function(e,r){return u(e.getUTCSeconds(),r.length)},S:function(e,r){var a=r.length,n=e.getUTCMilliseconds(),o=Math.floor(n*Math.pow(10,a-3));return u(o,r.length)}},b=et;var F={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tt={G:function(e,r,a){var n=e.getUTCFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return a.era(n,{width:"abbreviated"});case"GGGGG":return a.era(n,{width:"narrow"});case"GGGG":default:return a.era(n,{width:"wide"})}},y:function(e,r,a){if(r==="yo"){var n=e.getUTCFullYear(),o=n>0?n:1-n;return a.ordinalNumber(o,{unit:"year"})}return b.y(e,r)},Y:function(e,r,a,n){var o=L(e,n),i=o>0?o:1-o;if(r==="YY"){var s=i%100;return u(s,2)}return r==="Yo"?a.ordinalNumber(i,{unit:"year"}):u(i,r.length)},R:function(e,r){var a=_(e);return u(a,r.length)},u:function(e,r){var a=e.getUTCFullYear();return u(a,r.length)},Q:function(e,r,a){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(r){case"Q":return String(n);case"QQ":return u(n,2);case"Qo":return a.ordinalNumber(n,{unit:"quarter"});case"QQQ":return a.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,r,a){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(r){case"q":return String(n);case"qq":return u(n,2);case"qo":return a.ordinalNumber(n,{unit:"quarter"});case"qqq":return a.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,r,a){var n=e.getUTCMonth();switch(r){case"M":case"MM":return b.M(e,r);case"Mo":return a.ordinalNumber(n+1,{unit:"month"});case"MMM":return a.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(n,{width:"wide",context:"formatting"})}},L:function(e,r,a){var n=e.getUTCMonth();switch(r){case"L":return String(n+1);case"LL":return u(n+1,2);case"Lo":return a.ordinalNumber(n+1,{unit:"month"});case"LLL":return a.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(n,{width:"wide",context:"standalone"})}},w:function(e,r,a,n){var o=oe(e,n);return r==="wo"?a.ordinalNumber(o,{unit:"week"}):u(o,r.length)},I:function(e,r,a){var n=ae(e);return r==="Io"?a.ordinalNumber(n,{unit:"week"}):u(n,r.length)},d:function(e,r,a){return r==="do"?a.ordinalNumber(e.getUTCDate(),{unit:"date"}):b.d(e,r)},D:function(e,r,a){var n=te(e);return r==="Do"?a.ordinalNumber(n,{unit:"dayOfYear"}):u(n,r.length)},E:function(e,r,a){var n=e.getUTCDay();switch(r){case"E":case"EE":case"EEE":return a.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(n,{width:"short",context:"formatting"});case"EEEE":default:return a.day(n,{width:"wide",context:"formatting"})}},e:function(e,r,a,n){var o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(r){case"e":return String(i);case"ee":return u(i,2);case"eo":return a.ordinalNumber(i,{unit:"day"});case"eee":return a.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(o,{width:"short",context:"formatting"});case"eeee":default:return a.day(o,{width:"wide",context:"formatting"})}},c:function(e,r,a,n){var o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(r){case"c":return String(i);case"cc":return u(i,r.length);case"co":return a.ordinalNumber(i,{unit:"day"});case"ccc":return a.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(o,{width:"narrow",context:"standalone"});case"cccccc":return a.day(o,{width:"short",context:"standalone"});case"cccc":default:return a.day(o,{width:"wide",context:"standalone"})}},i:function(e,r,a){var n=e.getUTCDay(),o=n===0?7:n;switch(r){case"i":return String(o);case"ii":return u(o,r.length);case"io":return a.ordinalNumber(o,{unit:"day"});case"iii":return a.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(n,{width:"short",context:"formatting"});case"iiii":default:return a.day(n,{width:"wide",context:"formatting"})}},a:function(e,r,a){var n=e.getUTCHours(),o=n/12>=1?"pm":"am";switch(r){case"a":case"aa":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,r,a){var n=e.getUTCHours(),o;switch(n===12?o=F.noon:n===0?o=F.midnight:o=n/12>=1?"pm":"am",r){case"b":case"bb":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,r,a){var n=e.getUTCHours(),o;switch(n>=17?o=F.evening:n>=12?o=F.afternoon:n>=4?o=F.morning:o=F.night,r){case"B":case"BB":case"BBB":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,r,a){if(r==="ho"){var n=e.getUTCHours()%12;return n===0&&(n=12),a.ordinalNumber(n,{unit:"hour"})}return b.h(e,r)},H:function(e,r,a){return r==="Ho"?a.ordinalNumber(e.getUTCHours(),{unit:"hour"}):b.H(e,r)},K:function(e,r,a){var n=e.getUTCHours()%12;return r==="Ko"?a.ordinalNumber(n,{unit:"hour"}):u(n,r.length)},k:function(e,r,a){var n=e.getUTCHours();return n===0&&(n=24),r==="ko"?a.ordinalNumber(n,{unit:"hour"}):u(n,r.length)},m:function(e,r,a){return r==="mo"?a.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):b.m(e,r)},s:function(e,r,a){return r==="so"?a.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):b.s(e,r)},S:function(e,r){return b.S(e,r)},X:function(e,r,a,n){var o=n._originalDate||e,i=o.getTimezoneOffset();if(i===0)return"Z";switch(r){case"X":return ye(i);case"XXXX":case"XX":return M(i);case"XXXXX":case"XXX":default:return M(i,":")}},x:function(e,r,a,n){var o=n._originalDate||e,i=o.getTimezoneOffset();switch(r){case"x":return ye(i);case"xxxx":case"xx":return M(i);case"xxxxx":case"xxx":default:return M(i,":")}},O:function(e,r,a,n){var o=n._originalDate||e,i=o.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+xe(i,":");case"OOOO":default:return"GMT"+M(i,":")}},z:function(e,r,a,n){var o=n._originalDate||e,i=o.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+xe(i,":");case"zzzz":default:return"GMT"+M(i,":")}},t:function(e,r,a,n){var o=n._originalDate||e,i=Math.floor(o.getTime()/1e3);return u(i,r.length)},T:function(e,r,a,n){var o=n._originalDate||e,i=o.getTime();return u(i,r.length)}};function xe(t,e){var r=t>0?"-":"+",a=Math.abs(t),n=Math.floor(a/60),o=a%60;if(o===0)return r+String(n);var i=e||"";return r+String(n)+i+u(o,2)}function ye(t,e){if(t%60===0){var r=t>0?"-":"+";return r+u(Math.abs(t)/60,2)}return M(t,e)}function M(t,e){var r=e||"",a=t>0?"-":"+",n=Math.abs(t),o=u(Math.floor(n/60),2),i=u(n%60,2);return a+o+r+i}var ve=tt;var be=function(e,r){switch(e){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},we=function(e,r){switch(e){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},rt=function(e,r){var a=e.match(/(P+)(p+)?/)||[],n=a[1],o=a[2];if(!o)return be(e,r);var i;switch(n){case"P":i=r.dateTime({width:"short"});break;case"PP":i=r.dateTime({width:"medium"});break;case"PPP":i=r.dateTime({width:"long"});break;case"PPPP":default:i=r.dateTime({width:"full"});break}return i.replace("{{date}}",be(n,r)).replace("{{time}}",we(o,r))},at={p:we,P:rt},Te=at;var nt=["D","DD"],ot=["YY","YYYY"];function Oe(t){return nt.indexOf(t)!==-1}function Se(t){return ot.indexOf(t)!==-1}function ie(t,e,r){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var it={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},st=function(e,r,a){var n,o=it[e];return typeof o=="string"?n=o:r===1?n=o.one:n=o.other.replace("{{count}}",r.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+n:n+" ago":n},De=st;function $(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.width?String(e.width):t.defaultWidth,a=t.formats[r]||t.formats[t.defaultWidth];return a}}var ut={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ft={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lt={full:"{{date}} \'at\' {{time}}",long:"{{date}} \'at\' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dt={date:$({formats:ut,defaultWidth:"full"}),time:$({formats:ft,defaultWidth:"full"}),dateTime:$({formats:lt,defaultWidth:"full"})},ke=dt;var mt={lastWeek:"\'last\' eeee \'at\' p",yesterday:"\'yesterday at\' p",today:"\'today at\' p",tomorrow:"\'tomorrow at\' p",nextWeek:"eeee \'at\' p",other:"P"},ct=function(e,r,a,n){return mt[e]},Me=ct;function W(t){return function(e,r){var a=r!=null&&r.context?String(r.context):"standalone",n;if(a==="formatting"&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,i=r!=null&&r.width?String(r.width):o;n=t.formattingValues[i]||t.formattingValues[o]}else{var s=t.defaultWidth,d=r!=null&&r.width?String(r.width):t.defaultWidth;n=t.values[d]||t.values[s]}var l=t.argumentCallback?t.argumentCallback(e):e;return n[l]}}var pt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},gt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ht={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},xt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},yt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},vt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},bt=function(e,r){var a=Number(e),n=a%100;if(n>20||n<10)switch(n%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},wt={ordinalNumber:bt,era:W({values:pt,defaultWidth:"wide"}),quarter:W({values:gt,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:W({values:ht,defaultWidth:"wide"}),day:W({values:xt,defaultWidth:"wide"}),dayPeriod:W({values:yt,defaultWidth:"wide",formattingValues:vt,defaultFormattingWidth:"wide"})},We=wt;function C(t){return function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.width,n=a&&t.matchPatterns[a]||t.matchPatterns[t.defaultMatchWidth],o=e.match(n);if(!o)return null;var i=o[0],s=a&&t.parsePatterns[a]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(s)?Ot(s,function(c){return c.test(i)}):Tt(s,function(c){return c.test(i)}),l;l=t.valueCallback?t.valueCallback(d):d,l=r.valueCallback?r.valueCallback(l):l;var p=e.slice(i.length);return{value:l,rest:p}}}function Tt(t,e){for(var r in t)if(t.hasOwnProperty(r)&&e(t[r]))return r}function Ot(t,e){for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{},a=e.match(t.matchPattern);if(!a)return null;var n=a[0],o=e.match(t.parsePattern);if(!o)return null;var i=t.valueCallback?t.valueCallback(o[0]):o[0];i=r.valueCallback?r.valueCallback(i):i;var s=e.slice(n.length);return{value:i,rest:s}}}var St=/^(\\d+)(th|st|nd|rd)?/i,Dt=/\\d+/i,kt={narrow:/^(b|a)/i,abbreviated:/^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Mt={any:[/^b/i,/^(a|c)/i]},Wt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ct={any:[/1/i,/2/i,/3/i,/4/i]},Pt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ft={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},It={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Yt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ut={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Et={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Nt={ordinalNumber:se({matchPattern:St,parsePattern:Dt,valueCallback:function(e){return parseInt(e,10)}}),era:C({matchPatterns:kt,defaultMatchWidth:"wide",parsePatterns:Mt,defaultParseWidth:"any"}),quarter:C({matchPatterns:Wt,defaultMatchWidth:"wide",parsePatterns:Ct,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:C({matchPatterns:Pt,defaultMatchWidth:"wide",parsePatterns:Ft,defaultParseWidth:"any"}),day:C({matchPatterns:It,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any"}),dayPeriod:C({matchPatterns:Ut,defaultMatchWidth:"any",parsePatterns:Et,defaultParseWidth:"any"})},Ce=Nt;var At={code:"en-US",formatDistance:De,formatLong:ke,formatRelative:Me,localize:We,match:Ce,options:{weekStartsOn:0,firstWeekContainsDate:1}},Pe=At;var Fe=Pe;var qt=/[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|\'\'|\'(\'\'|[^\'])+(\'|$)|./g,_t=/P+p+|P+|p+|\'\'|\'(\'\'|[^\'])+(\'|$)|./g,Lt=/^\'([^]*?)\'?$/,$t=/\'\'/g,Qt=/[a-zA-Z]/;function R(t,e,r){var a,n,o,i,s,d,l,p,c,h,g,v,E,D,N,B,j,G;f(2,arguments);var Be=String(e),A=T(),q=(a=(n=r?.locale)!==null&&n!==void 0?n:A.locale)!==null&&a!==void 0?a:Fe,V=x((o=(i=(s=(d=r?.firstWeekContainsDate)!==null&&d!==void 0?d:r==null||(l=r.locale)===null||l===void 0||(p=l.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&s!==void 0?s:A.firstWeekContainsDate)!==null&&i!==void 0?i:(c=A.locale)===null||c===void 0||(h=c.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(V>=1&&V<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var X=x((g=(v=(E=(D=r?.weekStartsOn)!==null&&D!==void 0?D:r==null||(N=r.locale)===null||N===void 0||(B=N.options)===null||B===void 0?void 0:B.weekStartsOn)!==null&&E!==void 0?E:A.weekStartsOn)!==null&&v!==void 0?v:(j=A.locale)===null||j===void 0||(G=j.options)===null||G===void 0?void 0:G.weekStartsOn)!==null&&g!==void 0?g:0);if(!(X>=0&&X<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!q.localize)throw new RangeError("locale must contain localize property");if(!q.formatLong)throw new RangeError("locale must contain formatLong property");var Q=m(t);if(!Z(Q))throw new RangeError("Invalid time value");var je=z(Q),Ge=ee(Q,je),Ve={firstWeekContainsDate:V,weekStartsOn:X,locale:q,_originalDate:Q},Xe=Be.match(_t).map(function(y){var w=y[0];if(w==="p"||w==="P"){var H=Te[w];return H(y,q.formatLong)}return y}).join("").match(qt).map(function(y){if(y==="\'\'")return"\'";var w=y[0];if(w==="\'")return Ht(y);var H=ve[w];if(H)return!(r!=null&&r.useAdditionalWeekYearTokens)&&Se(y)&&ie(y,e,String(t)),!(r!=null&&r.useAdditionalDayOfYearTokens)&&Oe(y)&&ie(y,e,String(t)),H(Ge,y,q.localize,Ve);if(w.match(Qt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return y}).join("");return Xe}function Ht(t){var e=t.match(Lt);return e?e[1].replace($t,"\'"):t}var Ie=t=>[...new Set(t)];var ue=(t,e)=>{if(t instanceof Date)return"date";if(typeof t=="string"){if(/\\/\\/(\\S+?(?:jpe?g|png|gif|svg))/gi.test(t)||t.includes("unsplash"))return"image";if(/^\\d{4}-\\d{2}-\\d{2}$/.test(t))return"date";if(e=="tag"||e=="tags")return"tag";if(/\\[\\[.*?\\]\\]/.test(t))return"link"}else{if(typeof t=="number")return"number";if(typeof t=="boolean")return"boolean";if(t)if(Array.isArray(t)||typeof t=="string"&&t.indexOf(",")>-1){let r=Array.isArray(t)?t:[];if(typeof t=="string"&&t.indexOf(",")>-1&&(r=P(t)),e=="tag"||e=="tags")return"tag-multi";if(r.length==1&&Array.isArray(r[0])&&r[0].length==1&&typeof r[0][0]=="string")return"link";let a=Ie(r.map(n=>ue(n,e)));return a.length==1&&a[0]=="link"?"link-multi":a.some(n=>n=="object")?"object-multi":"option-multi"}else{if(t.isLuxonDateTime)return"date";if(t.isLuxonDuration)return"duration";if(t.type=="file")return"link";if(typeof t=="object"&&!Array.isArray(t)&&t!==null)return"object"}else return"unknown"}return"text"};var Ye=t=>t.map(e=>e.replace(",","\\\\,")).join(", "),I=t=>t?.map(e=>e.replace(",","\\\\,")).join(", ")??"";var P=t=>(t?.replace("\\\\,",",")?.match(/(\\\\.|[^,])+/g)??[]).map(e=>e.trim()),le=(t,e)=>{switch(ue(e,t)){case"object":return JSON.stringify(e);case"number":return e.toString();case"boolean":return e?"true":"false";case"date":{if(e instanceof Date){let a=R(e,"yyyy-MM-dd");if(typeof a=="string")return a}return typeof e!="string"?"":e}break;case"duration":return Ye(Object.keys(e.values).reduce((a,n)=>[...a,...e.values[n]>0?[e.values[n]+" "+n]:[]],[]));case"option-multi":case"link-multi":return typeof e=="string"?fe(e):I(e.map(a=>a?typeof a=="string"?fe(a):a.path?a.path:Array.isArray(e)&&a.length==1&&Array.isArray(a[0])&&a[0].length==1&&typeof a[0][0]=="string"?a[0][0]:JSON.stringify(a):""));case"link":return Array.isArray(e)&&e.length==1&&Array.isArray(e[0])&&e[0].length==1&&typeof e[0][0]=="string"?e[0][0]:typeof e=="string"?fe(e):e.path;case"text":case"tag":case"image":return e}return""};var fe=t=>{if(!t)return"";let e=/\\[\\[(.*?)\\]\\]/g.exec(t),r=e?.length>1?e[1].substring(0,he("|",e[1])):t;return r||t};var Ue=(t,e)=>{let r=t?P(t):[],a=e?P(e):[];return a.every(n=>r.some(o=>o==n))&&r.every(n=>a.some(o=>o==n))},Y=(t,e)=>t==e,de=(t,e)=>(t??"").length==0,me=(t,e)=>(t??"").toLowerCase().includes((e??"").toLowerCase()),ce=(t,e)=>parseFloat(t)>parseFloat(e),pe=(t,e)=>parseInt(t){let r=isNaN(Date.parse(t))?new Date(parseInt(t)):new Date(t),a=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e);return r.valueOf()>=a.valueOf()},Ne=(t,e)=>{let r=isNaN(Date.parse(t))?new Date(parseInt(t)):new Date(t),a=isNaN(Date.parse(e))?new Date(parseInt(e)):new Date(e);return r.valueOf(){let r=t?P(t):[],a=e?P(e):[];return r.length==0?!1:a.some(n=>r.some(o=>o==n))},Ae=(t,e)=>{if(!t)return!1;let r=new Date(`${t.toString().replace(".",":")}`),a=new Date(`${e}`);return r.getMonth()===a.getMonth()&&r.getDate()===a.getDate()},qe=t=>{if(!t)return!1;let e=new Date(`${t.toString()}T00:00`),r=new Date;return e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()};var U={isNotEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(t,e)=>!de(t,""),valueType:"none"},isEmpty:{type:["text","file","number","option","option-multi","link","link-multi","image"],fn:(t,e)=>de(t,""),valueType:"none"},include:{fn:(t,e)=>me(t,e),type:["text","file","link","image"],valueType:"text"},notInclude:{type:["text","file","link","image"],fn:(t,e)=>!me(t,e),valueType:"text"},is:{type:["text"],fn:(t,e)=>Y(t,e),valueType:"text"},isNot:{type:["text"],fn:(t,e)=>!Y(t,e),valueType:"text"},equal:{type:["number"],fn:(t,e)=>Y(t,e),valueType:"number"},isLink:{type:["link","context"],fn:(t,e)=>Y(t,e),valueType:"link"},isNotLink:{type:["link","context"],fn:(t,e)=>!Y(t,e),valueType:"link"},isGreatThan:{type:["number"],fn:(t,e)=>ce(t,e),valueType:"number"},isLessThan:{type:["number"],fn:(t,e)=>pe(t,e),valueType:"number"},isLessThanOrEqual:{type:["number"],fn:(t,e)=>!ce(t,e),valueType:"number"},isGreatThanOrEqual:{type:["number"],fn:(t,e)=>!pe(t,e),valueType:"number"},dateBefore:{type:["date"],fn:(t,e)=>Ne(t,e),valueType:"date"},dateAfter:{type:["date"],fn:(t,e)=>Ee(t,e),valueType:"date"},isSameDate:{type:["date"],fn:(t,e)=>Ae(t,e),valueType:"date"},isSameDateAsToday:{type:["date"],fn:(t,e)=>qe(t,e),valueType:"none"},isExactList:{type:["option","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(t,e)=>Ue(t,e),valueType:"list"},isAnyInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(t,e)=>ge(t,e),valueType:"list"},isNoneInList:{type:["option","context","link","option-multi","link-multi","context-multi","tags-multi","tags"],fn:(t,e)=>!ge(t,e),valueType:"list"},isTrue:{type:["boolean"],fn:(t,e)=>t=="true",valueType:"none"},isFalse:{type:["boolean"],fn:(t,e)=>t!="true",valueType:"none"}};var Rt=(t,e,r)=>e.reduce((n,o)=>{let[i,s]=n,d=o.type=="context"?_e(s,o,r):o.type=="path"?$e(s,o,r):o.type=="frontmatter"?Le(s,o,r):Qe(s,o,r),l=s.filter(p=>!d.includes(p));return[[...i,...d],l]},[[],t])[0],Bt=(t,e,r)=>e.reduce((a,n)=>n.type=="context"?_e(a,n,r):n.type=="path"?$e(a,n,r):n.type=="frontmatter"?Le(a,n,r):Qe(a,n,r),t),_e=(t,e,r)=>{let a=U[e.fn];return!a||a.valueType!="none"&&e.value.length==0?[]:t.filter(n=>{let[o,i]=e.field.split("."),s=n.metadata?.property;if(!n.spaces?.includes(o)||!s||!s[i])return!1;let d=!0;if(a){let l=e.fType=="property"?r[e.value]:e.value;d=a.fn(le(i,s[i]),l)}return d})},Le=(t,e,r)=>{let a=U[e.fn];return!a||a.valueType!="none"&&e.value.length==0?[]:t.filter(n=>{let o=n.metadata?.property;if(!o||!o[e.field])return!1;let i=!0;if(a){let s=e.fType=="property"?r[e.value]:e.value;i=a.fn(le(e.field,o[e.field]),s)}return i})},$e=(t,e,r)=>{let a=U[e.fn];return!a||a.valueType!="none"&&e.value.length==0?[]:t.filter(n=>{let o="";e.field=="outlinks"?o=I(n.outlinks??[]):e.field=="inlinks"?o=I(n.inlinks??[]):e.field=="tags"&&(o=I(n.tags??[]));let i=!0;if(a){let s=e.fType=="property"?r[e.value]:e.value;i=a.fn(o,s)}return i})},Qe=(t,e,r)=>{let a=U[e.fn];return!a||a.valueType!="none"&&e.value.length==0?[]:t.filter(n=>{let o=!0;if(a){let i=e.fType=="property"?r[e.value]:e.value;o=a.fn(n.metadata?.[e.type]?.[e.field],i)}return o})},He=(t,e,r)=>t.reduce((n,o)=>!n||o.filters.length==0?!1:o.type=="any"?Rt([e],o.filters,r).length>0:Bt([e],o.filters,r).length>0,!0);function Re(t){let{queries:e,pathsIndex:r,count:a}=t,n=[];for(let[o,i]of r)!i.hidden&&He(e,i,{})&&n.push(i);return n.slice(0,a)}var jt=self;jt.onmessage=async t=>{let{payload:e,job:r}=t.data,a;r.type=="search"&&(a=Re(e));try{postMessage({job:r,result:a})}catch(n){console.log(n),postMessage({job:r,result:{$error:`Failed to run ${r.type} ${r.path}: ${n}`}})}};\n', { "name": "Superstate Search" }); } @@ -91726,7 +91504,7 @@ var Searcher = class { this.reloadSet = /* @__PURE__ */ new Set(); this.callbacks = /* @__PURE__ */ new Map(); for (let index2 = 0; index2 < numWorkers; index2++) { - const worker = new Worker4({ name: "Make.md Superstate Indexer " + (index2 + 1) }); + const worker = new Worker3({ name: "Make.md Superstate Indexer " + (index2 + 1) }); worker.onmessage = (evt) => this.finish(evt.data.job, evt.data.result, index2); this.workers.push(worker); this.busy.push(false); @@ -91761,10 +91539,10 @@ var Searcher = class { if (job !== void 0) this.send(job, index2); if ("$error" in data2) { - for (const [_18, reject] of calls) + for (const [_17, reject] of calls) reject(data2["$error"]); } else { - for (const [callback, _18] of calls) + for (const [callback, _17] of calls) callback(data2); } } @@ -91867,7 +91645,6 @@ var Superstate2 = class { this.contextStateQueue = Promise.resolve(); this.vaultDBCache = []; this.indexer = new Indexer(2, this); - this.runner = new Runner(1, this); this.searcher = new Searcher(1, this); } static create(indexVersion, onChange, spaceManager, uiManager, commandsManager) { @@ -92149,11 +91926,9 @@ var Superstate2 = class { this.dispatchEvent("pathStateUpdated", { path }); } onMetadataChange(path) { - const pathState = this.pathsIndex.get(path); - if (!pathState) - return; this.reloadPath(path).then( (f2) => { + const pathState = this.pathsIndex.get(path); const spaceState = this.spacesIndex.get(path); if (spaceState) { this.reloadSpace(spaceState.space).then((f3) => this.onSpaceDefinitionChanged(f3, spaceState.metadata)); @@ -92214,6 +91989,10 @@ var Superstate2 = class { } async onPathCreated(path) { await this.reloadPath(path, true); + const parent = getParentPathFromString(path); + if (this.spacesIndex.has(parent) && this.spacesIndex.get(parent).defPath == path) { + await this.reloadSpace(this.spacesIndex.get(parent).space); + } this.dispatchEvent("pathCreated", { path }); } onPathDeleted(path) { @@ -94272,7 +94051,7 @@ var ExtendedSearch = class { this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase(); this.query = parseQuery(this.pattern, this.options); } - static condition(_18, options) { + static condition(_17, options) { return options.useExtendedSearch; } searchIn(text2) { @@ -95360,7 +95139,7 @@ var SelectMenu = import_react17.default.forwardRef( ); const onDelete = (0, import_react17.useCallback)( (tagIndex) => { - const newTags = tags3.filter((_18, i4) => i4 !== tagIndex); + const newTags = tags3.filter((_17, i4) => i4 !== tagIndex); setTags(newTags); if (props.saveOptions) props.saveOptions( @@ -95736,7 +95515,7 @@ var sortReturnForCol = (col, sort2, row2, row22) => { }; // src/core/react/context/ContextEditorContext.tsx -var import_lodash11 = __toESM(require_lodash()); +var import_lodash10 = __toESM(require_lodash()); var import_react24 = __toESM(require_react()); // src/core/utils/contexts/predicate/predicate.tsx @@ -95794,7 +95573,6 @@ var defaultPredicate = { // src/core/react/context/ContextMDBContext.tsx var import_react22 = __toESM(require_react()); -var import_lodash10 = __toESM(require_lodash()); // src/core/react/context/SpaceContext.tsx var import_react21 = __toESM(require_react()); @@ -96088,21 +95866,6 @@ var ContextMDBProvider = (props) => { ] : [], [tableData, contextTable, contexts, dbSchema] ); - const calculateTableData = async (newTable) => { - if (dbSchema) - props.superstate.runner.run({ - type: "table", - path: spaceInfo.path + "/#^" + dbSchema.id, - payload: { table: newTable } - }).then((g) => { - console.log(g); - if (import_lodash10.default.isEqual(g, data2)) - return; - if (g) { - setTableData({ ...newTable, rows: g }); - } - }); - }; const data2 = (0, import_react22.useMemo)( () => tableData?.rows.map((r2, index2) => ({ _index: index2.toString(), @@ -96663,8 +96426,8 @@ var ContextEditorProvider = (props) => { } return r2; }); - const rowsChanged = !import_lodash11.default.isEqual(newRows, tableData?.rows); - const colsChanged = !import_lodash11.default.isEqual(tableData?.cols, f2.cols); + const rowsChanged = !import_lodash10.default.isEqual(newRows, tableData?.rows); + const colsChanged = !import_lodash10.default.isEqual(tableData?.cols, f2.cols); if (rowsChanged || colsChanged) { saveDB({ ...f2, @@ -96863,7 +96626,7 @@ var ContextEditorProvider = (props) => { var import_react80 = __toESM(require_react()); // src/core/react/components/SpaceView/Contexts/DataTypeView/DataTypeView.tsx -var import_lodash15 = __toESM(require_lodash()); +var import_lodash14 = __toESM(require_lodash()); var import_react78 = __toESM(require_react()); // node_modules/@tanstack/react-table/build/lib/index.mjs @@ -97969,7 +97732,7 @@ var ColumnSizing = { column2.resetSize = () => { table.setColumnSizing((_ref2) => { let { - [column2.id]: _18, + [column2.id]: _17, ...rest } = _ref2; return rest; @@ -98430,7 +98193,7 @@ var RowExpanding = { } if (exists && !expanded) { const { - [row2.id]: _18, + [row2.id]: _17, ...rest } = oldExpanded; return rest; @@ -98564,7 +98327,7 @@ var RowPagination = { table.getPageOptions = memo2(() => [table.getPageCount()], (pageCount) => { let pageOptions = []; if (pageCount && pageCount > 0) { - pageOptions = [...new Array(pageCount)].fill(null).map((_18, i4) => i4); + pageOptions = [...new Array(pageCount)].fill(null).map((_17, i4) => i4); } return pageOptions; }, getMemoOptions(table.options, "debugTable", "getPageOptions")); @@ -99886,7 +99649,7 @@ var PathCrumb = (props) => { var import_react29 = __toESM(require_react()); // src/core/react/components/SpaceView/Contexts/DataTypeView/OptionCell.tsx -var import_lodash12 = __toESM(require_lodash()); +var import_lodash11 = __toESM(require_lodash()); var import_react28 = __toESM(require_react()); var OptionCell = (props) => { const parsedValue = (0, import_react28.useMemo)( @@ -99976,7 +99739,7 @@ var OptionCell = (props) => { ); }; const saveOptions = (_options, _value) => { - const newOptions = (0, import_lodash12.uniq)([..._options, ..._value]).filter((f2) => f2.length > 0).map( + const newOptions = (0, import_lodash11.uniq)([..._options, ..._value]).filter((f2) => f2.length > 0).map( (t5) => options.find((f2) => f2.value == t5) ?? { name: t5, value: t5 @@ -99992,7 +99755,7 @@ var OptionCell = (props) => { serializeMultiString(_value) ); } else { - const newValues = (0, import_lodash12.uniq)([...value, _value[0]]); + const newValues = (0, import_lodash11.uniq)([...value, _value[0]]); if (props.editMode >= 2 /* EditModeView */) setOptions(newOptions); setValue(newValues); @@ -102997,7 +102760,7 @@ var Stack = class { this.parent = parent; } toString() { - return `[${this.stack.filter((_18, i4) => i4 % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? "!" + this.score : ""}`; + return `[${this.stack.filter((_17, i4) => i4 % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? "!" + this.score : ""}`; } static start(p, state, pos = 0) { let cx = p.parser.context; @@ -103708,7 +103471,7 @@ var TokenCache = class { this.tokens = []; this.mainToken = null; this.actions = []; - this.tokens = parser3.tokenizers.map((_18) => new CachedToken()); + this.tokens = parser3.tokenizers.map((_17) => new CachedToken()); } getActions(stack) { let actionIndex = 0; @@ -108492,7 +108255,7 @@ var LinkCell = (props) => { setValue(newValues); props.saveValue(serializeMultiString(newValues)); }; - const saveOptions = (_18, _value) => { + const saveOptions = (_17, _value) => { if (!props.multi) { setValue(_value); props.saveValue(serializeMultiString(_value)); @@ -108844,7 +108607,7 @@ var PropertyValueComponent = (props) => { multi: false, editable: true, searchable: true, - saveOptions: (_18, v2) => { + saveOptions: (_17, v2) => { if (saveProperty) { saveProperty(v2[0]); } else { @@ -108865,7 +108628,7 @@ var PropertyValueComponent = (props) => { multi: false, editable: false, searchable: false, - saveOptions: (_18, v2) => saveParsedValue("type", v2[0]), + saveOptions: (_17, v2) => saveParsedValue("type", v2[0]), value: [], showAll: true, options: fieldTypes.filter((f2) => f2.primative).map((f2, i4) => ({ @@ -109036,13 +108799,13 @@ var NewPropertyMenuComponent = (props) => { ); return options2; }, [spaceCaches]); - const selectedType = (_18, value) => { + const selectedType = (_17, value) => { setFieldType(value[0]); }; const selectedValue = (value) => { setFieldValue(value); }; - const selectedSource = (_18, value) => { + const selectedSource = (_17, value) => { setFieldSource(value[0]); }; const toggleMulti = () => { @@ -109212,7 +108975,7 @@ var selectPropertyTypeMenu = (e5, ui, selectedType) => { }; var PropertyMenuComponent = (props) => { const [field, setField] = (0, import_react47.useState)(props.field); - const selectedType = (_18, value) => { + const selectedType = (_17, value) => { const newField = { ...field, type: value[0], @@ -109622,7 +109385,7 @@ var SpacePropertyEditor = (props) => { editable: true, value: [], options: f2.map((m4) => ({ name: m4, value: m4 })), - saveOptions: (_18, value) => addTag2(value[0]), + saveOptions: (_17, value) => addTag2(value[0]), placeholder: i18n_default.labels.contextItemSelectPlaceholder, searchable: true, showAll: true @@ -109772,7 +109535,7 @@ function SortableItem(props) { transition }; const icon = stickerForField(props.field); - const selectedType = (_18, value) => { + const selectedType = (_17, value) => { const newField = { ...props.field, type: value[0] @@ -109972,7 +109735,7 @@ var showLinkMenu = (e5, superstate, saveLink, options) => { editable: true, value: [], options: suggestions, - saveOptions: (_18, value) => { + saveOptions: (_17, value) => { saveLink(value[0]); }, placeholder: i18n_default.labels.linkItemSelectPlaceholder, @@ -110783,7 +110546,7 @@ var FilterBar = (props) => { defaultMenu(props.superstate.ui, menuOptions) ); }; - const addSort = (_18, sort2) => { + const addSort = (_17, sort2) => { const field = sort2[0]; const fieldObject = filteredCols.find((f2) => f2.name + f2.table == field); const fieldType = fieldTypeForField(fieldObject); @@ -110801,7 +110564,7 @@ var FilterBar = (props) => { }); } }; - const saveGroupBy = (_18, groupBy2) => { + const saveGroupBy = (_17, groupBy2) => { savePredicate({ groupBy: groupBy2 }); @@ -110814,7 +110577,7 @@ var FilterBar = (props) => { sort: newSort }); }; - const addFilter = (_18, filter3) => { + const addFilter = (_17, filter3) => { const field = filter3[0]; const fieldObject = filteredCols.find((f2) => f2.name + f2.table == field); const fieldType = fieldTypeForField(fieldObject); @@ -110838,7 +110601,7 @@ var FilterBar = (props) => { }; const changeSortMenu = (e5, sort2) => { const offset2 = e5.target.getBoundingClientRect(); - const saveSort = (_18, newType) => { + const saveSort = (_17, newType) => { const type = newType[0]; const newSort = { ...sort2, @@ -110904,7 +110667,7 @@ var FilterBar = (props) => { }; const changeFilterMenu = (e5, filter3, index2) => { const offset2 = e5.target.getBoundingClientRect(); - const saveFilter = (_18, newType) => { + const saveFilter = (_17, newType) => { const type = newType[0]; const newFilter = { ...filter3, @@ -111567,7 +111330,7 @@ var SpaceQuery = (props) => { name: f2 == "any" ? "or" : "and", value: f2 })), - saveOptions: (_18, value) => setGroupType(i4, value[0]), + saveOptions: (_17, value) => setGroupType(i4, value[0]), searchable: false, showAll: true }); @@ -111582,7 +111345,7 @@ var SpaceQuery = (props) => { editable: true, value: [], options: _filters.map((f2) => ({ name: filterFnLabels[f2], value: f2 })), - saveOptions: (_18, value) => setDefFilterFn(value[0], i4, k2), + saveOptions: (_17, value) => setDefFilterFn(value[0], i4, k2), placeholder: i18n_default.labels.contextItemSelectPlaceholder, searchable: true, showAll: true @@ -111601,7 +111364,7 @@ var SpaceQuery = (props) => { section: f2.type, description: f2.description })), - saveOptions: (_18, value) => setDefFilter(value[0], i4, k2), + saveOptions: (_17, value) => setDefFilter(value[0], i4, k2), placeholder: i18n_default.labels.contextItemSelectPlaceholder, searchable: true, showAll: true, @@ -111685,7 +111448,7 @@ var DefFilter = (props) => { value: f2.name, section: f2.type })), - saveOptions: (_18, value) => selectFilterValue( + saveOptions: (_17, value) => selectFilterValue( e5, { ...filter3, @@ -112686,7 +112449,7 @@ var selectRange = (currSel, newSel, array) => { }; // src/core/react/components/SpaceView/Contexts/TableView/TableView.tsx -var import_lodash14 = __toESM(require_lodash()); +var import_lodash13 = __toESM(require_lodash()); // src/core/react/components/UI/Menus/properties/propertiesMenu.tsx var showPropertiesMenu = (superstate, rect, property, deleteProperty2, syncProperty, renameProperty2, changeType) => { @@ -112804,7 +112567,7 @@ var ContextListEditSelector = (props) => { value: `spaces://$kit/#*${mdbSchemaToFrameSchema(f2.schema).def.id}` })) ], - saveOptions: (_18, value, isNew) => { + saveOptions: (_17, value, isNew) => { selectFrame(value[0], frame); }, placeholder: i18n_default.hintText.createListItem, @@ -113196,7 +112959,7 @@ var PropertiesView = (props) => { editable: false, value: [], options, - saveOptions: (_18, value) => { + saveOptions: (_17, value) => { saveMetadata(property, value[0]); }, placeholder: i18n_default.labels.spaceSelectPlaceholder, @@ -113231,7 +112994,7 @@ var PropertiesView = (props) => { multi: false, editable: false, searchable: false, - saveOptions: (_18, v2) => selectedType(v2, key2), + saveOptions: (_17, v2) => selectedType(v2, key2), value: [], showAll: true, options: fieldTypes.filter((f2) => f2.metadata).map((f2, i4) => ({ @@ -113389,7 +113152,7 @@ var PropertyView = (props) => { }; // src/core/react/components/SpaceView/Contexts/DataTypeView/ObjectCell.tsx -var import_lodash13 = __toESM(require_lodash()); +var import_lodash12 = __toESM(require_lodash()); var import_react71 = __toESM(require_react()); var ObjectEditor = (props) => { const { value, saveValue, saveType } = props; @@ -113426,7 +113189,7 @@ var ObjectEditor = (props) => { key: i4, superstate: props.superstate, savePropertyValue: (v2, f3) => saveVal(f3.name, v2), - showMenu: import_lodash13.default.noop, + showMenu: import_lodash12.default.noop, values: value, columns: props.columns, path: null, @@ -113615,7 +113378,7 @@ var ParameterSetter = (props) => { superstate: props.superstate, initialValue: removeQuotes(value?.[field.name]), compactMode: true, - updateFieldValue: (_18, f2) => saveValue(field.name, wrapQuotes(f2)), + updateFieldValue: (_17, f2) => saveValue(field.name, wrapQuotes(f2)), updateValue: (value2) => saveValue(field.name, wrapQuotes(value2)), column: { ...field, table: "" }, editMode: 5 /* EditModeAlways */ @@ -113733,7 +113496,7 @@ var TableView = (props) => { debouncedSavePredicate(newColSize); }; const debouncedSavePredicate = (0, import_react74.useCallback)( - (0, import_lodash14.debounce)( + (0, import_lodash13.debounce)( (nextValue) => savePredicate({ colsSize: nextValue }), @@ -114348,7 +114111,7 @@ var PropertySelectCell = (props) => { const [value, setValue] = (0, import_react76.useState)( parseLinkedPropertyToValue(props.initialValue) ); - const saveOptions = (_18, _value) => { + const saveOptions = (_17, _value) => { setValue(parseLinkedPropertyToValue(_value[0])); props.saveValue(serializeMultiString(_value)); }; @@ -114402,7 +114165,7 @@ var SpaceCell = (props) => { value: f2.path, description: f2.name })), - saveOptions: (_18, value) => props.saveValue(value[0]), + saveOptions: (_17, value) => props.saveValue(value[0]), removeOption: () => { }, placeholder: i18n_default.labels.optionItemSelectPlaceholder, @@ -114420,7 +114183,7 @@ var SpaceCell = (props) => { value: f2.id, description: f2.name })), - saveOptions: (_18, value) => props.saveValue(`${spaceObject?.space}/#^${value[0]}`), + saveOptions: (_17, value) => props.saveValue(`${spaceObject?.space}/#^${value[0]}`), removeOption: () => { }, placeholder: i18n_default.labels.optionItemSelectPlaceholder, @@ -114479,7 +114242,7 @@ var DataTypeView = (props) => { initialValue, saveValue, editMode: props.editMode, - setEditMode: import_lodash15.default.noop, + setEditMode: import_lodash14.default.noop, superstate: props.superstate, propertyValue: column2.value, path: props.source ?? row2?.[PathPropertyName], @@ -115039,11 +114802,11 @@ var import_react151 = __toESM(require_react()); var import_react85 = __toESM(require_react()); // src/core/react/context/FrameInstanceContext.tsx -var import_lodash17 = __toESM(require_lodash()); +var import_lodash16 = __toESM(require_lodash()); var import_react84 = __toESM(require_react()); // src/core/react/context/FrameEditorRootContext.tsx -var import_lodash16 = __toESM(require_lodash()); +var import_lodash15 = __toESM(require_lodash()); var import_react82 = __toESM(require_react()); var FramesEditorRootContext = (0, import_react82.createContext)({ root: null, @@ -115269,7 +115032,7 @@ var FrameEditorProvider = (props) => { ...newUniqueNode(groupNode, parentId, nodes, frameSchema.id) }; const newNodes = treeNodes.map((f2) => { - const node = import_lodash16.default.cloneDeep(f2); + const node = import_lodash15.default.cloneDeep(f2); node.parentId = group.id; return node; }); @@ -115506,7 +115269,7 @@ var FrameInstanceProvider = (props) => { const [rootProps, setRootProps] = (0, import_react84.useState)(props.props); (0, import_react84.useEffect)(() => { setRootProps((p) => { - if (import_lodash17.default.isEqual(p, props.props)) + if (import_lodash16.default.isEqual(p, props.props)) return p; return props.props; }); @@ -115535,7 +115298,7 @@ var FrameInstanceProvider = (props) => { { state, newState: applyPropsToState(newState, rootProps, _exec.id), - prevState: import_lodash17.default.cloneDeep(prevState), + prevState: import_lodash16.default.cloneDeep(prevState), slides: {} }, { @@ -115578,8 +115341,8 @@ var FrameInstanceProvider = (props) => { ); const runRoot = () => { if (root) { - const newRoot = import_lodash17.default.cloneDeep(root); - const runID = (0, import_lodash17.uniqueId)(); + const newRoot = import_lodash16.default.cloneDeep(root); + const runID = (0, import_lodash16.uniqueId)(); activeRunID.current = runID; executeTreeNode( newRoot, @@ -115737,11 +115500,11 @@ var FrameSelectionProvider = (props) => { }; // src/core/react/components/SpaceView/Contexts/ContextListContainer.tsx -var import_lodash22 = __toESM(require_lodash()); +var import_lodash21 = __toESM(require_lodash()); var import_react150 = __toESM(require_react()); // src/core/react/components/SpaceView/Contexts/ContextBuilder/ContextListInstance.tsx -var import_lodash21 = __toESM(require_lodash()); +var import_lodash20 = __toESM(require_lodash()); var import_react147 = __toESM(require_react()); // src/core/utils/frames/editor/dropFrame.ts @@ -116070,7 +115833,7 @@ var showNewFrameMenu = (rect, superstate, space2, addNode, options = { searchabl editable: false, value: [], options: selectOptions, - saveOptions: (_18, value) => insertNode(value[0]), + saveOptions: (_17, value) => insertNode(value[0]), searchable: options.searchable, showAll: true }); @@ -116106,7 +115869,7 @@ var ColorSetter = (props) => { var import_react90 = __toESM(require_react()); // src/core/react/components/SpaceView/Frames/Setters/StepSetter.tsx -var import_lodash18 = __toESM(require_lodash()); +var import_lodash17 = __toESM(require_lodash()); var import_react88 = __toESM(require_react()); function countDecimals(value) { if (Math.floor(value) === value) @@ -116143,7 +115906,7 @@ function InputDrag({ setValue(+newValue); onChange?.(+newValue, inputRef.current); }; - const handleDragEnd = (0, import_lodash18.debounce)((newValue) => { + const handleDragEnd = (0, import_lodash17.debounce)((newValue) => { onChange?.(newValue, inputRef.current); }, 200); const handleInput = (0, import_react88.useCallback)( @@ -117098,7 +116861,7 @@ var TextSubmenu = (props) => { multi: false, editable: false, searchable: true, - saveOptions: (_18, v2) => { + saveOptions: (_17, v2) => { saveStyleValue("--font-text", `'${v2[0]}'`); }, value: [selectedNode.styles?.["--font-text"] ?? ""], @@ -117508,25 +117271,25 @@ var import_react113 = __toESM(require_react()); var import_react_error_boundary_cjs = __toESM(require_react_error_boundary_cjs(), 1); // src/core/react/components/Navigator/SpaceTree/SpaceTreeView.tsx -var import_lodash20 = __toESM(require_lodash()); +var import_lodash19 = __toESM(require_lodash()); // src/core/react/context/SidebarContext.tsx -var import_lodash19 = __toESM(require_lodash()); +var import_lodash18 = __toESM(require_lodash()); var import_react104 = __toESM(require_react()); var NavigatorContext = (0, import_react104.createContext)({ dragPaths: [], - setDragPaths: import_lodash19.default.noop, + setDragPaths: import_lodash18.default.noop, selectedPaths: [], - setSelectedPaths: import_lodash19.default.noop, + setSelectedPaths: import_lodash18.default.noop, activePath: null, - setActivePath: import_lodash19.default.noop, + setActivePath: import_lodash18.default.noop, activeViewSpaces: [], waypoints: [], - setWaypoints: import_lodash19.default.noop, - saveActiveSpace: import_lodash19.default.noop, - closeActiveSpace: import_lodash19.default.noop, + setWaypoints: import_lodash18.default.noop, + saveActiveSpace: import_lodash18.default.noop, + closeActiveSpace: import_lodash18.default.noop, modifier: null, - setModifier: import_lodash19.default.noop + setModifier: import_lodash18.default.noop }); var SidebarProvider = (props) => { const [modifier, setModifier] = (0, import_react104.useState)(null); @@ -117783,7 +117546,7 @@ function __awaiter(thisArg, _arguments, P3, generator) { }); } function __generator(thisArg, body) { - var _18 = { label: 0, sent: function() { + var _17 = { label: 0, sent: function() { if (t5[0] & 1) throw t5[1]; return t5[1]; @@ -117799,7 +117562,7 @@ function __generator(thisArg, body) { function step(op) { if (f2) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_18 = 0)), _18) + while (g && (g = 0, op[0] && (_17 = 0)), _17) try { if (f2 = 1, y3 && (t5 = op[0] & 2 ? y3["return"] : op[0] ? y3["throw"] || ((t5 = y3["return"]) && t5.call(y3), 0) : y3.next) && !(t5 = t5.call(y3, op[1])).done) return t5; @@ -117811,42 +117574,42 @@ function __generator(thisArg, body) { t5 = op; break; case 4: - _18.label++; + _17.label++; return { value: op[1], done: false }; case 5: - _18.label++; + _17.label++; y3 = op[1]; op = [0]; continue; case 7: - op = _18.ops.pop(); - _18.trys.pop(); + op = _17.ops.pop(); + _17.trys.pop(); continue; default: - if (!(t5 = _18.trys, t5 = t5.length > 0 && t5[t5.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _18 = 0; + if (!(t5 = _17.trys, t5 = t5.length > 0 && t5[t5.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _17 = 0; continue; } if (op[0] === 3 && (!t5 || op[1] > t5[0] && op[1] < t5[3])) { - _18.label = op[1]; + _17.label = op[1]; break; } - if (op[0] === 6 && _18.label < t5[1]) { - _18.label = t5[1]; + if (op[0] === 6 && _17.label < t5[1]) { + _17.label = t5[1]; t5 = op; break; } - if (t5 && _18.label < t5[2]) { - _18.label = t5[2]; - _18.ops.push(op); + if (t5 && _17.label < t5[2]) { + _17.label = t5[2]; + _17.ops.push(op); break; } if (t5[2]) - _18.ops.pop(); - _18.trys.pop(); + _17.ops.pop(); + _17.trys.pop(); continue; } - op = body.call(thisArg, _18); + op = body.call(thisArg, _17); } catch (e5) { op = [6, e5]; y3 = 0; @@ -120541,7 +120304,7 @@ var SpaceTreeComponent = (props) => { modifier, active?.space ) : null; - setProjected((p) => !(0, import_lodash20.isEqual)(p, _projected) ? _projected : p); + setProjected((p) => !(0, import_lodash19.isEqual)(p, _projected) ? _projected : p); }, [ active, flattenedTree, @@ -125784,7 +125547,7 @@ var FrameEditorInstance = (props) => { var ContextListInstance = (props) => { const [contexts, setContexts] = (0, import_react147.useState)(props.contexts); (0, import_react147.useEffect)( - () => setContexts((p) => import_lodash21.default.isEqual(props.contexts, p) ? p : props.contexts), + () => setContexts((p) => import_lodash20.default.isEqual(props.contexts, p) ? p : props.contexts), [props.contexts] ); const { spaceInfo } = (0, import_react147.useContext)(SpaceContext); @@ -126141,7 +125904,7 @@ var ContextListContainer = (props) => { initiateString(predicate.listItem, "spaces://$kit/#*rowItem") ) }; - setURIs((p) => !import_lodash22.default.isEqual(newURIs, p) ? newURIs : p); + setURIs((p) => !import_lodash21.default.isEqual(newURIs, p) ? newURIs : p); }, [predicate]); return /* @__PURE__ */ import_react150.default.createElement("div", { className: "mk-context-container" @@ -126545,7 +126308,7 @@ var TitleComponent = (props) => { ); const contentEditable = !props.readOnly && spaceState?.type != "default"; const onBlur = (e5) => { - const newValue = e5.target.innerHTML; + const newValue = e5.target.innerText; if (newValue != name317) { if (pathState.path == "/") { props.superstate.settings.systemName = newValue; @@ -126673,7 +126436,7 @@ var BannerView = (props) => { setBanner(null); } }, [pathState]); - const offset2 = pathState?.metadata.property?.banner_y ? `calc(50% + ${pathState?.metadata.property?.banner_y.toString()}px)` : "center"; + const offset2 = pathState?.metadata.property?.banner_y ? `${(parseFloat(pathState?.metadata.property?.banner_y) * 100).toString()}%` : "center"; const triggerBannerContextMenu = (e5) => { e5.preventDefault(); const menuOptions = [ @@ -126722,13 +126485,14 @@ var BannerView = (props) => { className: `mk-space-banner`, onContextMenu: triggerBannerContextMenu, style: { + "--mk-banner-height": props.superstate.settings.bannerHeight + "px", backgroundImage: `url("${banner.scheme == "vault" ? props.superstate.ui.getUIPath(banner.basePath) : banner.fullPath}")`, backgroundPositionY: offset2 } }), /* @__PURE__ */ import_react156.default.createElement("div", { className: `mk-spacer`, style: { - "--mk-header-height": ((isTouchScreen(props.superstate.ui) ? 1 : 0) * 26 + 138 + (!props.superstate.settings.spacesStickers || props.superstate.settings.inlineContextNameLayout == "horizontal" ? 50 : hasSticker ? 0 : 30)).toString() + "px" + "--mk-header-height": ((isTouchScreen(props.superstate.ui) ? 1 : 0) * 26 + (props.superstate.settings.bannerHeight - 62) + (!props.superstate.settings.spacesStickers || props.superstate.settings.inlineContextNameLayout == "horizontal" ? 50 : hasSticker ? 0 : 30)).toString() + "px" }, onContextMenu: (e5) => e5.preventDefault() })) : /* @__PURE__ */ import_react156.default.createElement(import_react156.default.Fragment, null); @@ -130495,6 +130259,7 @@ var DEFAULT_SETTINGS = { revealActiveFile: false, spacesStickers: true, spaceRowHeight: 29, + bannerHeight: 200, spacesDisablePatch: false, folderNoteInsideFolder: true, sidebarTabs: true, @@ -130718,6 +130483,13 @@ var MakeMDPluginSettingsTab = class extends import_obsidian10.PluginSettingTab { }) ); } + new import_obsidian10.Setting(containerEl).setName(i18n_default.settings.coverHeight.name).setDesc(i18n_default.settings.coverHeight.desc).addText((text2) => { + text2.setValue(this.plugin.superstate.settings.bannerHeight.toString()).onChange(async (value) => { + text2.setValue(parseInt(value).toString()); + this.plugin.superstate.settings.bannerHeight = parseInt(value); + await this.plugin.saveSettings(); + }); + }); if (this.plugin.superstate.settings.spaceViewEnabled) { containerEl.createEl("h3", { text: i18n_default.settings.sectionSpaceView }); new import_obsidian10.Setting(containerEl).setName(i18n_default.settings.defaultSpaceTemplate.name).setDesc(i18n_default.settings.defaultSpaceTemplate.desc).addText((text2) => { @@ -132871,7 +132643,7 @@ var mdbSchemaToCommandSchema = (schema) => { }; // src/adapters/mdb/mdbAdapter.ts -var import_lodash23 = __toESM(require_lodash()); +var import_lodash22 = __toESM(require_lodash()); // src/adapters/mdb/db/sqljs.js var import_sql = __toESM(require_sql_wasm()); @@ -133091,7 +132863,7 @@ var MDBFileTypeAdapter = class { const schema = schemas.find((t5) => t5.id == fragmentId); const newCommand = content3(mdbTable); const newSchema = frameSchemaToTableSchema(newCommand.schema); - if (!import_lodash23.default.isEqual(newSchema, schema)) { + if (!import_lodash22.default.isEqual(newSchema, schema)) { const dbTables = saveSchemaToDBTables(newSchema, schemas); await saveDBToPath(this, file.path, dbTables); } @@ -133118,7 +132890,7 @@ var MDBFileTypeAdapter = class { }; // src/adapters/obsidian/filesystem/rebuildIndex.ts -var import_lodash24 = __toESM(require_lodash()); +var import_lodash23 = __toESM(require_lodash()); // src/adapters/obsidian/filesystem/indexCurrentFileTree.ts var import_obsidian17 = require("obsidian"); @@ -133142,7 +132914,7 @@ var indexCurrentFileTree = (plugin, vaultDB) => { var rebuildIndex = async (filesystem, plugin, save) => { const start = Date.now(); const newTables = indexCurrentFileTree(plugin, filesystem.vaultDBCache ?? []); - if (save && !import_lodash24.default.isEqual(newTables.vault.rows, filesystem.vaultDBCache)) { + if (save && !import_lodash23.default.isEqual(newTables.vault.rows, filesystem.vaultDBCache)) { await filesystem.saveSpacesDatabaseToDisk(newTables, save); } plugin.superstate.ui.notify(`Make.md - Vault Reindexed in ${(Date.now() - start) / 1e3} seconds`, "console"); @@ -133328,11 +133100,11 @@ var editTagInFileBody = async (plugin, oldTag, newTag, positions, file) => { }; // src/adapters/obsidian/filesystem/filesystem.ts -var import_lodash27 = __toESM(require_lodash()); +var import_lodash26 = __toESM(require_lodash()); var import_obsidian20 = require("obsidian"); // src/adapters/mdb/localCache/localCache.ts -var import_lodash25 = __toESM(require_lodash()); +var import_lodash24 = __toESM(require_lodash()); // src/schemas/cache.ts var CacheDBSchema = { uniques: ["path"], cols: ["path", "cache", "version"], rows: [] }; @@ -133343,7 +133115,7 @@ var LocalStorageCache = class { this.storageDBPath = storageDBPath; this.mdbAdapter = mdbAdapter; this.indexVersion = Date.now().toString(); - this.debounceSaveSpaceDatabase = (0, import_lodash25.debounce)( + this.debounceSaveSpaceDatabase = (0, import_lodash24.debounce)( () => { saveZippedDBFile(this.mdbAdapter, this.storageDBPath, this.db.export().buffer); }, @@ -133404,14 +133176,14 @@ var LocalStorageCache = class { }; // src/adapters/mdb/localCache/localCacheMobile.ts -var import_lodash26 = __toESM(require_lodash()); +var import_lodash25 = __toESM(require_lodash()); var MobileCachePersister = class { constructor(storageDBPath, mdbAdapter, types2) { this.storageDBPath = storageDBPath; this.mdbAdapter = mdbAdapter; this.types = types2; this.indexVersion = Date.now().toString(); - this.debounceSaveSpaceDatabase = (0, import_lodash26.debounce)( + this.debounceSaveSpaceDatabase = (0, import_lodash25.debounce)( (maps) => { const tables = Object.keys(maps).reduce((p, c3) => { return { @@ -133504,7 +133276,7 @@ var ObsidianFileSystem = class { this.spacesDBPath = (0, import_obsidian20.normalizePath)( this.plugin.app.vault.configDir + "/plugins/make-md/Spaces.mdb" ); - this.debounceSaveSpaceDatabase = (0, import_lodash27.debounce)( + this.debounceSaveSpaceDatabase = (0, import_lodash26.debounce)( (tables) => { saveDBToPath(this.plugin.mdbFileAdapter, this.spacesDBPath, tables); }, @@ -133612,7 +133384,7 @@ var ObsidianFileSystem = class { return; const oldCache = this.cache.get(path); const newCache = { ...oldCache, ...cache2 }; - if (oldCache && import_lodash27.default.isEqual(newCache, oldCache)) { + if (oldCache && import_lodash26.default.isEqual(newCache, oldCache)) { return; } this.cache.set(path, newCache); @@ -140158,7 +139930,7 @@ var HiddenPaths = (props) => { superstate.saveSettings(); superstate.initializePaths(); }; - const saveFile = (_18, value) => { + const saveFile = (_17, value) => { superstate.settings.hiddenFiles = [ ...superstate.settings.hiddenFiles, ...value @@ -140921,7 +140693,7 @@ var CLIManager = class { var import_react197 = __toESM(require_react()); // src/core/react/components/Blink/BlinkComponent.tsx -var import_lodash28 = __toESM(require_lodash()); +var import_lodash27 = __toESM(require_lodash()); var import_react196 = __toESM(require_react()); var BlinkComponent = (props) => { const [previewPath, setPreviewPath] = (0, import_react196.useState)(null); @@ -140984,7 +140756,7 @@ var BlinkComponent = (props) => { ) ); }; - (0, import_lodash28.debounce)(() => runQuery(query, queries), 300)(); + (0, import_lodash27.debounce)(() => runQuery(query, queries), 300)(); }, [query, queries]); (0, import_react196.useEffect)(() => { const path = suggestions[index2]?.value; diff --git a/manifest.json b/manifest.json index cfd8911..59cd1f7 100755 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "make-md", "name": "MAKE.md", - "version": "0.9.19", + "version": "0.9.20", "minAppVersion": "0.16.0", "description": "Make.md brings powerful and modern note-taking features to Obsidian. Capture, organize and connect information with more flexibility without any code.", "author": "MAKE.md", diff --git a/styles.css b/styles.css index 3abe429..d08b3b6 100644 --- a/styles.css +++ b/styles.css @@ -2471,6 +2471,7 @@ body:not(.is-mobile) .mk-main-menu-button:hover { } body .markdown-reading-view .mk-path-context-label .mk-inline-title.inline-title, body .markdown-source-view.mod-cm6.mod-cm6.is-readable-line-width .mk-inline-title.inline-title { + max-width: 100%; padding-bottom: 0; margin-left: 0 !important; margin-top: 8px; @@ -2733,12 +2734,12 @@ body:not(.is-mobile) .mk-inline-button:hover { right: 0; width: 100%; user-select: none; - height: 200px; + height: var(--mk-banner-height); background-size: cover; background-position-y: center; } .mk-space-banner img { - height: 200px; + height: var(--mk-banner-height); width: 100%; object-fit: cover; opacity: 1 !important;