UNPKG

@nfdi4plants/swate-components

Version:

Customizable React components for ontology annotation, based on Swate and the ARC.

1,792 lines 516 kB
import * as L from "react"; import Jd, { createElement as f, useLayoutEffect as Zd, useEffect as Qd, useState as Zl } from "react"; import { useFloating as Qi, useClick as vf, useDismiss as Yi, useInteractions as Xi, useRole as el, useTransitionStatus as Yd, useId as xi, FloatingPortal as tl, FloatingOverlay as Sf, FloatingFocusManager as nl, offset as kc, flip as rl, shift as bf, size as Xd, autoUpdate as Mc, useListNavigation as Fc, useTypeahead as Tf, FloatingList as eh, useListItem as xf } from "@floating-ui/react"; import { createPortal as th } from "react-dom"; import { useVirtualizer as Ya, defaultRangeExtractor as Xa } from "@tanstack/react-virtual"; function $n(e) { return Array.isArray(e) || ArrayBuffer.isView(e); } function nh(e) { return e != null && typeof e == "object" && Symbol.iterator in e; } function rh(e) { return e != null && typeof e.GetEnumerator == "function"; } function sh(e) { return e != null && typeof e.CompareTo == "function"; } function oh(e) { return e != null && typeof e.Equals == "function"; } function Af(e) { return e != null && typeof e.GetHashCode == "function"; } function ih(e) { return e != null && typeof e.Dispose == "function"; } function ae(e) { ih(e) && e.Dispose(); } function U() { return null; } function Ai(e, t) { var n, r; return ((n = Object.getPrototypeOf(e)) == null ? void 0 : n.constructor) === ((r = Object.getPrototypeOf(t)) == null ? void 0 : r.constructor); } class lh { constructor(t) { this.iter = t, this.current = U(); } "System.Collections.Generic.IEnumerator`1.get_Current"() { return this.current; } "System.Collections.IEnumerator.get_Current"() { return this.current; } "System.Collections.IEnumerator.MoveNext"() { const t = this.iter.next(); return this.current = t.value, !t.done; } "System.Collections.IEnumerator.Reset"() { throw new Error("JS iterators cannot be reset"); } Dispose() { } } function ce(e) { return rh(e) ? e.GetEnumerator() : new lh(e[Symbol.iterator]()); } function ls(e) { return { next() { const t = e["System.Collections.IEnumerator.MoveNext"](), n = t ? e["System.Collections.Generic.IEnumerator`1.get_Current"]() : void 0; return { done: !t, value: n }; } }; } class At { constructor(t) { this.factory = t, this.isValueCreated = !1; } get Value() { return this.isValueCreated || (this.createdValue = this.factory(), this.isValueCreated = !0), this.createdValue; } get IsValueCreated() { return this.isValueCreated; } } function Ye(e, t) { return e.toString(10).padStart(t, "0"); } function eu(e) { const t = e; return typeof t.offset == "number" ? t.offset : e.kind === 1 ? 0 : e.getTimezoneOffset() * -6e4; } function Dc(e, t) { return e = e, e.toString(t); } function ch(e, t) { return e = e, e.toString(t); } class mr { static id(t) { return mr.idMap.has(t) || mr.idMap.set(t, ++mr.count), mr.idMap.get(t); } } mr.idMap = /* @__PURE__ */ new WeakMap(); mr.count = 0; function Tn(e) { let t = 0, n = 5381; const r = e.length; for (; t < r; ) n = n * 33 ^ e.charCodeAt(t++); return n; } function Kn(e) { return e * 2654435761 | 0; } function Ef(e) { return Tn(e.toString(32)); } function js(e) { let t = 0; const n = e.length; for (let r = 0; r < n; r++) { const s = e[r]; t = (t << 5) + t ^ s; } return t; } function ah(e) { if (e == null) return 0; switch (typeof e) { case "boolean": return e ? 1 : 0; case "number": return Kn(e); case "bigint": return Ef(e); case "string": return Tn(e); default: return Kn(mr.id(e)); } } function Hc(e) { return Af(e) ? e.GetHashCode() : ah(e); } function uh(e) { return e.getTime(); } function fh(e) { const t = e.length, n = new Array(t); for (let r = 0; r < t; r++) n[r] = it(e[r]); return js(n); } function it(e) { var t; if (e == null) return 0; switch (typeof e) { case "boolean": return e ? 1 : 0; case "number": return Kn(e); case "bigint": return Ef(e); case "string": return Tn(e); default: { if (Af(e)) return e.GetHashCode(); if ($n(e)) return fh(e); if (e instanceof Date) return uh(e); if (((t = Object.getPrototypeOf(e)) == null ? void 0 : t.constructor) === Object) { const n = Object.values(e).map((r) => it(r)); return js(n); } else return Kn(mr.id(e)); } } } function dn(e) { return Hc(e); } function Ql(e, t, n) { if (e == null) return t == null; if (t == null || e.length !== t.length) return !1; for (let r = 0; r < e.length; r++) if (!n(e[r], t[r])) return !1; return !0; } function $f(e, t) { return Ql(e, t, Q); } function dh(e, t) { const n = Object.keys(e), r = Object.keys(t); if (n.length !== r.length) return !1; n.sort(), r.sort(); for (let s = 0; s < n.length; s++) if (n[s] !== r[s] || !Q(e[n[s]], t[r[s]])) return !1; return !0; } function Q(e, t) { var n; return e === t ? !0 : e == null ? t == null : t == null ? !1 : oh(e) ? e.Equals(t) : $n(e) ? $n(t) && $f(e, t) : typeof e != "object" ? !1 : e instanceof Date ? t instanceof Date && If(e, t) === 0 : ((n = Object.getPrototypeOf(e)) == null ? void 0 : n.constructor) === Object && dh(e, t); } function If(e, t) { let n, r; return "offset" in e && "offset" in t ? (n = e.getTime(), r = t.getTime()) : (n = e.getTime() + eu(e), r = t.getTime() + eu(t)), n === r ? 0 : n < r ? -1 : 1; } function Je(e, t) { return e === t ? 0 : e < t ? -1 : 1; } function hh(e, t, n) { if (e == null) return t == null ? 0 : 1; if (t == null) return -1; if (e.length !== t.length) return e.length < t.length ? -1 : 1; for (let r = 0, s = 0; r < e.length; r++) if (s = n(e[r], t[r]), s !== 0) return s; return 0; } function Oc(e, t) { return hh(e, t, at); } function mh(e, t) { const n = Object.keys(e), r = Object.keys(t); if (n.length !== r.length) return n.length < r.length ? -1 : 1; n.sort(), r.sort(); for (let s = 0, o = 0; s < n.length; s++) { const i = n[s]; if (i !== r[s]) return i < r[s] ? -1 : 1; if (o = at(e[i], t[i]), o !== 0) return o; } return 0; } function at(e, t) { var n; return e === t ? 0 : e == null ? t == null ? 0 : -1 : t == null ? 1 : sh(e) ? e.CompareTo(t) : $n(e) ? $n(t) ? Oc(e, t) : -1 : typeof e != "object" ? e < t ? -1 : 1 : e instanceof Date ? t instanceof Date ? If(e, t) : -1 : ((n = Object.getPrototypeOf(e)) == null ? void 0 : n.constructor) === Object ? mh(e, t) : -1; } function b(e) { const t = {}; for (const n of e) t[n[0]] = n[1]; return t; } function Rf(e, t = 0) { const n = Math.pow(10, t), r = +(t ? e * n : e).toFixed(8), s = Math.floor(r), o = r - s, i = 1e-8, l = o > 0.5 - i && o < 0.5 + i ? s % 2 === 0 ? s : s + 1 : Math.round(r); return t ? l / n : l; } const Nf = /* @__PURE__ */ new WeakMap(); function kf(e) { if (e == null) return null; const t = (n, r) => e(n)(r); return Nf.set(t, e), t; } function Hn(e) { return Nf.get(e) ?? ((t) => (n) => e(t, n)); } class rs { constructor(t) { this.value = t; } toJSON() { return this.value; } // Don't add "Some" for consistency with erased options toString() { return String(this.value); } GetHashCode() { return it(this.value); } Equals(t) { return t == null ? !1 : Q(this.value, t instanceof rs ? t.value : t); } CompareTo(t) { return t == null ? 1 : at(this.value, t instanceof rs ? t.value : t); } } function d(e) { if (e == null) throw new Error("Option has no value"); return e instanceof rs ? e.value : e; } function v(e) { return e instanceof rs ? e.value : e; } function ue(e) { return e == null || e instanceof rs ? new rs(e) : e; } function ve(e) { return e == null ? [] : [d(e)]; } function $(e, t) { return e != null ? d(e) : t; } function ws(e, t) { return e ?? t; } function Ce(e, t) { return t != null ? ue(e(d(t))) : void 0; } function Qr(e, t) { return t != null ? e(d(t)) : void 0; } function tt(e, t) { if (!e(t)) return ue(t); } var je = {}, wh = 28, gh = 1, Ws = 1e6, Ch = 1e6, ph = -29, yh = 29, _h = !1, Mo = "[big.js] ", cs = Mo + "Invalid ", sl = cs + "decimal places", vh = cs + "rounding mode", Mf = Mo + "Division by zero", rr = void 0, Sh = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i; function Ff() { function e(t) { var n = this; if (!(n instanceof e)) return t === rr ? Ff() : new e(t); if (t instanceof e) n.s = t.s, n.e = t.e, n.c = t.c.slice(), bh(n); else { if (typeof t != "string") { if (e.strict === !0) throw TypeError(cs + "number"); t = t === 0 && 1 / t < 0 ? "-0" : String(t); } Th(n, t); } n.constructor = e; } return e.prototype = je, e.DP = wh, e.RM = gh, e.NE = ph, e.PE = yh, e.strict = _h, e; } function bh(e) { if (e.c.length > 1 && !e.c[0]) { let t = e.c.findIndex((n) => n); e.c = e.c.slice(t), e.e = e.e - t; } } function Th(e, t) { var n, r, s; if (!Sh.test(t)) throw Error(cs + "number"); for (e.s = t.charAt(0) == "-" ? (t = t.slice(1), -1) : 1, (n = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (r = t.search(/e/i)) > 0 ? (n < 0 && (n = r), n += +t.slice(r + 1), t = t.substring(0, r)) : n < 0 && (n = t.length), s = t.length, r = 0; r < n && r < s && t.charAt(r) == "0"; ) ++r; if (r == s) e.c = [e.e = 0]; else for (e.e = n - r - 1, e.c = [], n = 0; r < s; ) e.c[n++] = +t.charAt(r++); return e = Hr(e, Jt.DP + 1, Jt.RM), e; } function Hr(e, t, n, r) { var s = e.c; if (n === rr && (n = Jt.RM), n !== 0 && n !== 1 && n !== 2 && n !== 3) throw Error(vh); if (t < 1) r = n === 3 && (r || !!s[0]) || t === 0 && (n === 1 && s[0] >= 5 || n === 2 && (s[0] > 5 || s[0] === 5 && (r || s[1] !== rr))), s.length = 1, r ? (e.e = e.e - t + 1, s[0] = 1) : s[0] = e.e = 0; else if (t < s.length) { const o = s.findIndex((i, l) => l >= t && i > 0) < 0; if (r = n === 1 && s[t] >= 5 || n === 2 && (s[t] > 5 || s[t] === 5 && (r || s[t + 1] !== rr || s[t - 1] & 1)) || n === 3 && (r || !o), s.length = t--, r) for (; ++s[t] > 9; ) s[t] = 0, t-- || (++e.e, s.unshift(1)); for (t = s.length; !s[--t]; ) s.pop(); } return e; } function Ks(e, t, n) { var r = e.e, s = e.c.join(""), o = s.length; if (t) s = s.charAt(0) + (o > 1 ? "." + s.slice(1) : "") + (r < 0 ? "e" : "e+") + r; else if (r < 0) { for (; ++r; ) s = "0" + s; s = "0." + s; } else if (r > 0) if (++r > o) for (r -= o; r--; ) s += "0"; else r < o && (s = s.slice(0, r) + "." + s.slice(r)); else o > 1 && (s = s.charAt(0) + "." + s.slice(1)); return e.s < 0 && n ? "-" + s : s; } je.abs = function() { var e = new this.constructor(this); return e.s = 1, e; }; je.cmp = function(s) { var t, n = this.constructor, r = new n(this), s = new n(s), o = r.c, i = s.c, l = r.s, c = s.s, a = r.e, u = s.e; if (!o[0] || !i[0]) return o[0] ? l : i[0] ? -c : 0; if (l != c) return l; if (t = l < 0, a != u) return a > u ^ t ? 1 : -1; for (c = Math.max(o.length, i.length), l = 0; l < c; l++) if (a = l < o.length ? o[l] : 0, u = l < i.length ? i[l] : 0, a != u) return a > u ^ t ? 1 : -1; return 0; }; je.div = function(r) { var t = this.constructor, n = new t(this), r = new t(r), s = n.c, o = r.c, i = n.s == r.s ? 1 : -1, l = t.DP; if (l !== ~~l || l < 0 || l > Ws) throw Error(sl); if (!o[0]) throw Error(Mf); if (!s[0]) return r.s = i, r.c = [r.e = 0], r; var c, a, u, w, g, C = o.slice(), p = c = o.length, T = s.length, S = s.slice(0, c), A = S.length, E = r, N = E.c = [], M = 0, F = l + (E.e = n.e - r.e) + 1; for (E.s = i, i = F < 0 ? 0 : F, C.unshift(0); A++ < c; ) S.push(0); do { for (u = 0; u < 10; u++) { if (c != (A = S.length)) w = c > A ? 1 : -1; else for (g = -1, w = 0; ++g < c; ) if (o[g] != S[g]) { w = o[g] > S[g] ? 1 : -1; break; } if (w < 0) { for (a = A == c ? o : C; A; ) { if (S[--A] < a[A]) { for (g = A; g && !S[--g]; ) S[g] = 9; --S[g], S[A] += 10; } S[A] -= a[A]; } for (; !S[0]; ) S.shift(); } else break; } N[M++] = w ? u : ++u, S[0] && w ? S[A] = s[p] || 0 : S = [s[p]]; } while ((p++ < T || S[0] !== rr) && i--); return !N[0] && M != 1 && (N.shift(), E.e--, F--), M > F && Hr(E, F, t.RM, S[0] !== rr), E; }; je.eq = function(e) { return this.cmp(e) === 0; }; je.gt = function(e) { return this.cmp(e) > 0; }; je.gte = function(e) { return this.cmp(e) > -1; }; je.lt = function(e) { return this.cmp(e) < 0; }; je.lte = function(e) { return this.cmp(e) < 1; }; je.minus = je.sub = function(l) { var t, n, r, s, o = this.constructor, i = new o(this), l = new o(l), c = i.s, a = l.s; if (c != a) return l.s = -a, i.plus(l); var u = i.c.slice(), w = i.e, g = l.c, C = l.e; if (!u[0] || !g[0]) return g[0] ? l.s = -a : u[0] ? l = new o(i) : l.s = 1, l; if (c = w - C) { for ((s = c < 0) ? (c = -c, r = u) : (C = w, r = g), r.reverse(), a = c; a--; ) r.push(0); r.reverse(); } else for (n = ((s = u.length < g.length) ? u : g).length, c = a = 0; a < n; a++) if (u[a] != g[a]) { s = u[a] < g[a]; break; } if (s && (r = u, u = g, g = r, l.s = -l.s), (a = (n = g.length) - (t = u.length)) > 0) for (; a--; ) u[t++] = 0; for (a = t; n > c; ) { if (u[--n] < g[n]) { for (t = n; t && !u[--t]; ) u[t] = 9; --u[t], u[n] += 10; } u[n] -= g[n]; } for (; u[--a] === 0; ) u.pop(); for (; u[0] === 0; ) u.shift(), --C; return u[0] || (l.s = 1, u = [C = 0]), l.c = u, l.e = C, l; }; je.mod = function(s) { var t, n = this.constructor, r = new n(this), s = new n(s), o = r.s, i = s.s; if (!s.c[0]) throw Error(Mf); return r.s = s.s = 1, t = s.cmp(r) == 1, r.s = o, s.s = i, t ? new n(r) : (o = n.DP, i = n.RM, n.DP = n.RM = 0, r = r.div(s), n.DP = o, n.RM = i, this.minus(r.times(s))); }; je.plus = je.add = function(i) { var t, n, r, s = this.constructor, o = new s(this), i = new s(i); if (o.s != i.s) return i.s = -i.s, o.minus(i); var l = o.e, c = o.c, a = i.e, u = i.c; if (!c[0] || !u[0]) return u[0] || (c[0] ? i = new s(o) : i.s = o.s), i; if (c = c.slice(), t = l - a) { for (t > 0 ? (a = l, r = u) : (t = -t, r = c), r.reverse(); t--; ) r.push(0); r.reverse(); } for (c.length - u.length < 0 && (r = u, u = c, c = r), t = u.length, n = 0; t; c[t] %= 10) n = (c[--t] = c[t] + u[t] + n) / 10 | 0; for (n && (c.unshift(n), ++a), t = c.length; c[--t] === 0; ) c.pop(); return i.c = c, i.e = a, i; }; je.pow = function(e) { var t = this.constructor, n = new t(this), r = new t("1"), s = new t("1"), o = e < 0; if (e !== ~~e || e < -1e6 || e > Ch) throw Error(cs + "exponent"); for (o && (e = -e); e & 1 && (r = r.times(n)), e >>= 1, !!e; ) n = n.times(n); return o ? s.div(r) : r; }; je.prec = function(e, t) { if (e !== ~~e || e < 1 || e > Ws) throw Error(cs + "precision"); return Hr(new this.constructor(this), e, t); }; je.round = function(e, t) { if (e === rr) e = 0; else if (e !== ~~e || e < -1e6 || e > Ws) throw Error(sl); return Hr(new this.constructor(this), e + this.e + 1, t); }; je.sqrt = function() { var e, t, n, r = this.constructor, s = new r(this), o = s.s, i = s.e, l = new r("0.5"); if (!s.c[0]) return new r(s); if (o < 0) throw Error(Mo + "No square root"); o = Math.sqrt(s + ""), o === 0 || o === 1 / 0 ? (t = s.c.join(""), t.length + i & 1 || (t += "0"), o = Math.sqrt(t), i = ((i + 1) / 2 | 0) - (i < 0 || i & 1), e = new r((o == 1 / 0 ? "5e" : (o = o.toExponential()).slice(0, o.indexOf("e") + 1)) + i)) : e = new r(o + ""), i = e.e + (r.DP += 4); do n = e, e = l.times(n.plus(s.div(n))); while (n.c.slice(0, i).join("") !== e.c.slice(0, i).join("")); return Hr(e, (r.DP -= 4) + e.e + 1, r.RM); }; je.times = je.mul = function(s) { var t, n = this.constructor, r = new n(this), s = new n(s), o = r.c, i = s.c, l = o.length, c = i.length, a = r.e, u = s.e; if (s.s = r.s == s.s ? 1 : -1, !o[0] || !i[0]) return s.c = [s.e = 0], s; for (s.e = a + u, l < c && (t = o, o = i, i = t, u = l, l = c, c = u), t = new Array(u = l + c); u--; ) t[u] = 0; for (a = c; a--; ) { for (c = 0, u = l + a; u > a; ) c = t[u] + i[a] * o[u - a - 1] + c, t[u--] = c % 10, c = c / 10 | 0; t[u] = c; } for (c ? ++s.e : t.shift(), a = t.length; !t[--a]; ) t.pop(); return s.c = t, s; }; je.toExponential = function(e, t) { var n = this, r = n.c[0]; if (e !== rr) { if (e !== ~~e || e < 0 || e > Ws) throw Error(sl); for (n = Hr(new n.constructor(n), ++e, t); n.c.length < e; ) n.c.push(0); } return Ks(n, !0, !!r); }; je.toFixed = function(e, t) { var n = this, r = n.c[0]; if (e !== rr) { if (e !== ~~e || e < 0 || e > Ws) throw Error(sl); for (n = Hr(new n.constructor(n), e + n.e + 1, t), e = e + n.e + 1; n.c.length < e; ) n.c.push(0); } return Ks(n, !1, !!r); }; je.toJSON = je.toString = function() { var e = this, t = e.constructor; return Ks(e, e.e <= t.NE || e.e >= t.PE, !!e.c[0]); }; je.toNumber = function() { var e = Number(Ks(this, !0, !0)); if (this.constructor.strict === !0 && !this.eq(e.toString())) throw Error(Mo + "Imprecise conversion"); return e; }; je.toPrecision = function(e, t) { var n = this, r = n.constructor, s = n.c[0]; if (e !== rr) { if (e !== ~~e || e < 1 || e > Ws) throw Error(cs + "precision"); for (n = Hr(new r(n), e, t); n.c.length < e; ) n.c.push(0); } return Ks(n, e <= n.e || n.e <= r.NE || n.e >= r.PE, !!s); }; je.valueOf = function() { var e = this, t = e.constructor; if (t.strict === !0) throw Error(Mo + "valueOf disallowed"); return Ks(e, e.e <= t.NE || e.e >= t.PE, !0); }; var Jt = Ff(); const as = Symbol("numeric"); function Df(e) { return typeof e == "number" || typeof e == "bigint" || (e == null ? void 0 : e[as]); } function xh(e, t) { return typeof e == "number" || typeof e == "bigint" ? e < t ? -1 : e > t ? 1 : 0 : e.CompareTo(t); } function Yl(e, t) { return typeof e == "number" ? e * t : typeof e == "bigint" ? e * BigInt(t) : e[as]().multiply(t); } function Ci(e, t) { return typeof e == "number" ? e.toFixed(t) : typeof e == "bigint" ? e : e[as]().toFixed(t); } function Ei(e, t) { return typeof e == "number" ? e.toPrecision(t) : typeof e == "bigint" ? e : e[as]().toPrecision(t); } function $i(e, t) { return typeof e == "number" ? e.toExponential(t) : typeof e == "bigint" ? e : e[as]().toExponential(t); } function Ii(e) { return typeof e == "number" ? (Number(e) >>> 0).toString(16) : typeof e == "bigint" ? BigInt.asUintN(64, e).toString(16) : e[as]().toHex(); } function Ah(e) { let t = 0, n = "["; for (const r of e) { if (t === 0) n += J(r); else if (t === 100) { n += "; ..."; break; } else n += "; " + J(r); t++; } return n + "]"; } function J(e, t = 0) { var n; if (e != null && typeof e == "object") { if (typeof e.toString == "function") return e.toString(); if (Symbol.iterator in e) return Ah(e); { const r = (n = Object.getPrototypeOf(e)) == null ? void 0 : n.constructor; return r === Object && t < 10 ? "{ " + Object.entries(e).map(([s, o]) => s + " = " + J(o, t + 1)).join(` `) + " }" : (r == null ? void 0 : r.name) ?? ""; } } return String(e); } function Eh(e, t) { if (t.length === 0) return e; { let n, r = !0; return t.length === 1 ? (n = J(t[0]), r = n.indexOf(" ") >= 0) : n = t.map((s) => J(s)).join(", "), e + (r ? " (" : " ") + n + (r ? ")" : ""); } } class bt { get name() { return this.cases()[this.tag]; } toJSON() { return this.fields.length === 0 ? this.name : [this.name].concat(this.fields); } toString() { return Eh(this.name, this.fields); } GetHashCode() { const t = this.fields.map((n) => it(n)); return t.splice(0, 0, Kn(this.tag)), js(t); } Equals(t) { return this === t ? !0 : Ai(this, t) && this.tag === t.tag ? $f(this.fields, t.fields) : !1; } CompareTo(t) { return this === t ? 0 : Ai(this, t) ? this.tag === t.tag ? Oc(this.fields, t.fields) : this.tag < t.tag ? -1 : 1 : -1; } } function $h(e) { const t = {}, n = Object.keys(e); for (let r = 0; r < n.length; r++) t[n[r]] = e[n[r]]; return t; } function Ih(e) { return "{ " + Object.entries(e).map(([t, n]) => t + " = " + J(n)).join(` `) + " }"; } function Rh(e) { const t = Object.values(e).map((n) => it(n)); return js(t); } function Nh(e, t) { if (e === t) return !0; if (Ai(e, t)) { const n = Object.keys(e); for (let r = 0; r < n.length; r++) if (!Q(e[n[r]], t[n[r]])) return !1; return !0; } else return !1; } function kh(e, t) { if (e === t) return 0; if (Ai(e, t)) { const n = Object.keys(e); for (let r = 0; r < n.length; r++) { const s = at(e[n[r]], t[n[r]]); if (s !== 0) return s; } return 0; } else return -1; } class rt { toJSON() { return $h(this); } toString() { return Ih(this); } GetHashCode() { return Rh(this); } Equals(t) { return Nh(this, t); } CompareTo(t) { return kh(this, t); } } class wt { get contents() { return this.getter(); } set contents(t) { this.setter(t); } constructor(t, n) { typeof n == "function" ? (this.getter = t, this.setter = n) : (this.getter = () => t, this.setter = (r) => { t = r; }); } } class Mh { constructor(t) { this.message = t; } } function Fh(e) { return e instanceof Mh || e instanceof Error; } function Dh(e) { return e instanceof Promise; } function Ri(e) { return Fh(e) || Dh(e) ? e : new Error(String(e)); } Jt.prototype.GetHashCode = function() { return js([this.s, this.e].concat(this.c)); }; Jt.prototype.Equals = function(e) { return !this.cmp(e); }; Jt.prototype.CompareTo = function(e) { return this.cmp(e); }; Jt.prototype[as] = function() { const e = this; return { multiply: (t) => e.mul(t), toPrecision: (t) => e.toPrecision(t), toExponential: (t) => e.toExponential(t), toFixed: (t) => e.toFixed(t), toHex: () => (Number(e) >>> 0).toString(16) }; }; new Jt(0); new Jt(1); new Jt(-1); new Jt("79228162514264337593543950335"); new Jt("-79228162514264337593543950335"); function Hh(e) { return e.toString(); } function Oh(e, t) { const n = new Uint8Array(t * 301 / 1e3 + 1 | 0); let r = 1; for (let s = e.length - 1; s >= 0; s--) { let o = e[s]; for (let i = 0; i < r; i++) { const l = n[i] * 16 + o | 0; n[i] = l % 10 | 0, o = l / 10 | 0; } for (; o > 0; ) n[r++] = o % 10 | 0, o = o / 10 | 0; } return n.slice(0, r); } function xl(e, t, n) { for (let r = 0; r < 8; r++) e[n + r] = t >> r * 4 & 15; } function Lh(e, t, n, r, s) { const i = new Uint8Array(24); xl(i, e, 0), xl(i, t, 8), xl(i, n, 16); const l = Oh(i, 96); s = s & 127; const c = new Jt(0); return c.c = Array.from(l.reverse()), c.e = l.length - s - 1, c.s = r ? -1 : 1, new Jt(c); } BigInt.prototype.toJSON = function() { return `${this.toString()}`; }; const Hf = 0n; function Bh(e) { return e < Hf ? -e : e; } function Vh(e) { return BigInt(e); } function Al(e) { return BigInt(Math.trunc(e)); } function Ph(e) { return BigInt(e); } function El(e) { return BigInt.asIntN(64, e); } function tu(e) { return BigInt.asUintN(64, e); } function Gh(e) { return Number(e); } function nu(e) { const t = e < Hf, n = Bh(e), r = Number(BigInt.asUintN(32, n)), s = Number(BigInt.asUintN(32, n >> 32n)), o = Number(BigInt.asUintN(32, n >> 64n)); return Lh(r, s, o, t, 0); } function zh(e) { return e.toString(); } function Uh(e) { return BigInt(e); } const qh = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], jh = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], Wh = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], Kh = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; function Cn(e, t, n) { let r = 0, s = t; for (; s < e.length && e[s] === n; ) s++, r++; return r; } function ru(e, t) { return t >= e.length - 1 ? -1 : e.charCodeAt(t + 1); } function Jh(e, t) { let n = t; const r = e[t]; let s = "", o = !1; for (; t < e.length; ) { t++; const i = e[t]; if (i === r) { o = !0; break; } else if (i === "\\") if (t < e.length) t++, s += e[t]; else throw new Error("Invalid string format"); else s += i; } if (!o) throw new Error(`Invalid string format could not find matching quote for ${r}`); return [s, t - n + 1]; } function Lc(e, t, n) { let r = 0, s = 0, o = ""; const i = n ? Bc( e.getTime(), 1 /* DateKind.UTC */ ) : e; for (; r < t.length; ) { const l = t[r]; switch (l) { case "d": switch (s = Cn(t, r, "d"), r += s, s) { case 1: o += ou(i); break; case 2: o += Ye(ou(i), 2); break; case 3: o += qh[cu(i)]; break; case 4: o += jh[cu(i)]; break; } break; case "f": if (s = Cn(t, r, "f"), r += s, s <= 3) { const S = 10 ** (3 - s); o += Ye(Math.floor(ti(i) / S), s); } else s <= 7 && (o += ("" + ti(i)).padEnd(s, "0")); break; case "F": if (s = Cn(t, r, "F"), r += s, s <= 3) { const S = 10 ** (3 - s), A = Math.floor(ti(i) / S); A != 0 && (o += Ye(A, s)); } else if (s <= 7) { const S = ti(i); S != 0 && (o += Ye(S, 3)); } break; case "g": s = Cn(t, r, "g"), r += s, s <= 2 && (o += "A.D."); break; case "h": switch (s = Cn(t, r, "h"), r += s, s) { case 1: o += ei(i) % 12; break; case 2: o += Ye(ei(i) % 12, 2); break; } break; case "H": switch (s = Cn(t, r, "H"), r += s, s) { case 1: o += ei(i); break; case 2: o += Ye(ei(i), 2); break; } break; case "K": switch (s = Cn(t, r, "K"), r += s, s) { case 1: switch (su(i)) { case 1: o += "Z"; break; case 2: o += $s(i.getTimezoneOffset() * -6e4); break; } break; } break; case "m": switch (s = Cn(t, r, "m"), r += s, s) { case 1: o += iu(i); break; case 2: o += Ye(iu(i), 2); break; } break; case "M": switch (s = Cn(t, r, "M"), r += s, s) { case 1: o += ni(i); break; case 2: o += Ye(ni(i), 2); break; case 3: o += Wh[ni(i) - 1]; break; case 4: o += Kh[ni(i) - 1]; break; } break; case "s": switch (s = Cn(t, r, "s"), r += s, s) { case 1: o += lu(i); break; case 2: o += Ye(lu(i), 2); break; } break; case "t": switch (s = Cn(t, r, "t"), r += s, s) { case 1: o += i.getHours() < 12 ? "A" : "P"; break; case 2: o += i.getHours() < 12 ? "AM" : "PM"; break; } break; case "y": switch (s = Cn(t, r, "y"), r += s, s) { case 1: o += i.getFullYear() % 100; break; case 2: o += Ye(i.getFullYear() % 100, 2); break; case 3: o += Ye(i.getFullYear(), 3); break; case 4: o += Ye(i.getFullYear(), 4); break; case 5: o += Ye(i.getFullYear(), 5); break; } break; case "z": s = Cn(t, r, "z"), r += s; let c = ""; switch (su(i)) { case 1: c = "+00:00"; break; case 2: c = $s(i.getTimezoneOffset() * -6e4); break; case 0: c = $s(tm(i).getTimezoneOffset() * -6e4); break; } const a = c[0] === "-" ? "-" : "+", u = parseInt(c.substring(1, 3), 10), w = parseInt(c.substring(4, 6), 10); switch (s) { case 1: o += `${a}${u}`; break; case 2: o += `${a}${Ye(u, 2)}`; break; default: o += `${a}${Ye(u, 2)}:${Ye(w, 2)}`; break; } break; case ":": o += ":", r++; break; case "/": o += "/", r++; break; case "'": case '"': const [g, C] = Jh(t, r); o += g, r += C; break; case "%": const p = ru(t, r); if (p >= 0 && p !== 37) r += 2, o += Lc(i, String.fromCharCode(p), n); else throw new Error("Invalid format string"); break; case "\\": const T = ru(t, r); if (T >= 0) r += 2, o += String.fromCharCode(T); else throw new Error("Invalid format string"); break; default: r++, o += l; break; } } return o; } function su(e) { return e.kind || 0; } function $s(e) { const t = e < 0; e = Math.abs(e); const n = ~~(e / 36e5), r = e % 36e5 / 6e4; return (t ? "-" : "+") + Ye(n, 2) + ":" + Ye(r, 2); } function Ni(e, t) { const n = e.toISOString(); return t === "first" ? n.substring(0, n.indexOf("T")) : n.substring(n.indexOf("T") + 1, n.length - 1); } function Zh(e, t) { if (t) return e.toISOString(); { const n = e.kind == null ? !0 : e.kind === 2; return Ye(e.getFullYear(), 4) + "-" + Ye(e.getMonth() + 1, 2) + "-" + Ye(e.getDate(), 2) + "T" + Ye(e.getHours(), 2) + ":" + Ye(e.getMinutes(), 2) + ":" + Ye(e.getSeconds(), 2) + "." + Ye(e.getMilliseconds(), 3) + (n ? $s(e.getTimezoneOffset() * -6e4) : ""); } } function Qh(e, t) { const n = e.toISOString(); return n.substring(0, n.length - 1) + $s(t); } function Yh(e, t) { const n = new Date(e.getTime() + (e.offset ?? 0)); if (typeof t != "string") return n.toISOString().replace(/\.\d+/, "").replace(/[A-Z]|\.\d+/g, " ") + $s(e.offset ?? 0); if (t.length === 1) switch (t) { case "D": case "d": return Ni(n, "first"); case "T": case "t": return Ni(n, "second"); case "O": case "o": return Qh(n, e.offset ?? 0); default: throw new Error("Unrecognized Date print format"); } else return Lc(n, t, !0); } function Xh(e, t) { const n = e.kind === 1; if (typeof t != "string") return n ? e.toUTCString() : e.toLocaleString(); if (t.length === 1) switch (t) { case "D": case "d": return n ? Ni(e, "first") : e.toLocaleDateString(); case "T": case "t": return n ? Ni(e, "second") : e.toLocaleTimeString(); case "O": case "o": return Zh(e, n); default: throw new Error("Unrecognized Date print format"); } else return Lc(e, t, n); } function ks(e, t, n) { return e.offset != null ? Yh(e, t) : Xh(e, t); } function Bc(e, t) { const n = new Date(e); return n.kind = (t ?? 0) | 0, n; } function Of(e) { function t() { throw new Error(`The string is not a valid Date: ${e}`); } (e == null || e.trim() === "") && t(), e.length === 10 && e[4] === "-" && e[7] === "-" && (e += "T00:00:00"); let n = new Date(e), r = null; if (isNaN(n.getTime())) { const s = /^\s*(\d+[^\w\s:]\d+[^\w\s:]\d+)?\s*(\d+:\d+(?::\d+(?:\.\d+)?)?)?\s*([AaPp][Mm])?\s*(Z|[+-]([01]?\d):?([0-5]?\d)?)?\s*$/.exec(e); if (s != null) { let o, i = 0; if (s[2] != null) { const l = s[2].split(":"), c = parseInt(l[0], 10); i = c * 3600 + parseInt(l[1] || "0", 10) * 60 + parseFloat(l[2] || "0"), s[3] != null && s[3].toUpperCase() === "PM" && c < 12 && (i += 720); } if (s[4] != null) { if (s[1] != null) o = /* @__PURE__ */ new Date(s[1] + " UTC"); else { const l = /* @__PURE__ */ new Date(); o = /* @__PURE__ */ new Date(l.getUTCFullYear() + "/" + (l.getUTCMonth() + 1) + "/" + l.getUTCDate()); } if (s[4] === "Z") r = "Z"; else { let l = parseInt(s[5], 10) * 60 + parseInt(s[6] || "0", 10); s[4][0] === "-" && (l *= -1), r = l, i -= l * 60; } } else if (s[1] != null) o = new Date(s[1]); else { const l = /* @__PURE__ */ new Date(); o = /* @__PURE__ */ new Date(l.getFullYear() + "/" + (l.getMonth() + 1) + "/" + l.getDate()); } n = new Date(o.getTime() + i * 1e3), n = new Date(n.getTime() + (n.getTimezoneOffset() - o.getTimezoneOffset()) * 6e4); } else t(); isNaN(n.getTime()) && t(); } return [n, r]; } function em(e, t = !1) { const [n, r] = Of(e), s = r != null ? t && r === "Z" ? 1 : 2 : 0; return Bc(n.getTime(), s); } function tm(e) { return e.kind === 2 ? e : Bc( e.getTime(), 2 /* DateKind.Local */ ); } function ou(e) { return e.kind === 1 ? e.getUTCDate() : e.getDate(); } function ei(e) { return e.kind === 1 ? e.getUTCHours() : e.getHours(); } function ti(e) { return e.kind === 1 ? e.getUTCMilliseconds() : e.getMilliseconds(); } function iu(e) { return e.kind === 1 ? e.getUTCMinutes() : e.getMinutes(); } function ni(e) { return (e.kind === 1 ? e.getUTCMonth() : e.getMonth()) + 1; } function lu(e) { return e.kind === 1 ? e.getUTCSeconds() : e.getSeconds(); } function cu(e) { return e.kind === 1 ? e.getUTCDay() : e.getDay(); } function So(e, t = 0) { if ((t & -284) !== 0) throw new Error("RegexOptions only supports: IgnoreCase, Multiline, Compiled, Singleline and ECMAScript"); let n = "gu"; return n += t & 1 ? "i" : "", n += t & 2 ? "m" : "", n += t & 16 ? "s" : "", new RegExp(e, n); } function Fo(e) { return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); } function bo(e, t, n = 0) { return e.lastIndex = n, e.exec(t); } function nm(e, t, n = 0) { if (t == null) throw new Error("Input cannot ve null"); if (!e.global) throw new Error("Non-global RegExp"); e.lastIndex = n; const r = []; let s, o = -1; for (; (s = e.exec(t)) != null; ) s.index === o ? e.lastIndex++ : (o = s.index, r.push(s)); return r; } const so = /(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g, rm = /\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g; function Lf(e, t) { return xh(e, t) < 0; } function gs(e, t, n) { function r(o) { return o === !0 || o === 1 || o === 3 || o === 5; } function s(o) { return o === 4 || o === 5; } return e == null ? t == null ? 0 : -1 : t == null ? 1 : s(n) ? (r(n) && (e = e.toLowerCase(), t = t.toLowerCase()), e === t ? 0 : e < t ? -1 : 1) : (r(n) && (e = e.toLocaleLowerCase(), t = t.toLocaleLowerCase()), e.localeCompare(t)); } function sm(...e) { switch (e.length) { case 2: return gs(e[0], e[1], !1); case 3: return gs(e[0], e[1], e[2]); case 4: return gs(e[0], e[1], e[2] === !0); case 5: return gs(e[0].substr(e[1], e[4]), e[2].substr(e[3], e[4]), !1); case 6: return gs(e[0].substr(e[1], e[4]), e[2].substr(e[3], e[4]), e[5]); case 7: return gs(e[0].substr(e[1], e[4]), e[2].substr(e[3], e[4]), e[5] === !0); default: throw new Error("String.compare: Unsupported number of parameters"); } } function V(e) { return { input: e, cont: im(e) }; } function Vc(e, t) { return typeof t == "string" ? e(t) : t.cont(e); } function Bf(e) { return Vc((t) => console.log(t), e); } function De(e) { return Vc((t) => t, e); } function ge(e) { return Vc((t) => { throw new Error(t); }, e); } function om(e, t, n, r, s) { let o = ""; if (t = t || "", s = s || "", Df(e)) switch (s.toLowerCase() !== "x" && (Lf(e, 0) ? (e = Yl(e, -1), o = "-") : t.indexOf(" ") >= 0 ? o = " " : t.indexOf("+") >= 0 && (o = "+")), r = r == null ? null : parseInt(r, 10), s) { case "f": case "F": r = r ?? 6, e = Ci(e, r); break; case "g": case "G": e = r != null ? Ei(e, r) : Ei(e); break; case "e": case "E": e = r != null ? $i(e, r) : $i(e); break; case "x": e = Ii(e); break; case "X": e = Ii(e).toUpperCase(); break; default: e = String(e); break; } else e instanceof Date ? e = ks(e) : e = J(e); if (n = typeof n == "number" ? n : parseInt(n, 10), isNaN(n)) e = o + e; else { const i = t.indexOf("0") >= 0, l = t.indexOf("-") >= 0, c = l || !i ? " " : "0"; c === "0" ? (e = To(e, n - o.length, c, l), e = o + e) : e = To(o + e, n, c, l); } return e; } function Vf(e, t, n, r = "", s = -1) { return (...o) => { let i = r; const l = t.slice(), c = n.slice(); for (const a of o) { const [, , u, w, g, C] = c[0]; let p = w; if (s >= 0) p = s, s = -1; else if (p === "*") { if (a < 0) throw new Error("Non-negative number required"); s = a; continue; } i += l[0], i += om(a, u, p, g, C), l.splice(0, 1), c.splice(0, 1); } return c.length === 0 ? (i += l[0], e(i)) : Vf(e, l, c, i, s); }; } function im(e) { return (t) => { so.lastIndex = 0; const n = [], r = []; let s = 0, o = so.exec(e); for (; o; ) { const i = o.index + (o[1] || "").length; n.push(e.substring(s, i).replace(/%%/g, "%")), r.push(o), s = so.lastIndex, so.lastIndex -= 1, o = so.exec(e); } return n.length === 0 ? t(e.replace(/%%/g, "%")) : (n.push(e.substring(s).replace(/%%/g, "%")), Vf(t, n, r)); }; } function Pf(e, ...t) { let n; return typeof e == "object" ? (n = String(t[0]), t.shift()) : n = e, n.replace(rm, (r, s, o, i, l, c) => { if (s < 0 || s >= t.length) throw new Error("Index must be greater or equal to zero and less than the arguments' length."); let a = t[s]; if (Df(a)) switch (l = l == null ? null : parseInt(l, 10), i) { case "f": case "F": l = l ?? 2, a = Ci(a, l); break; case "g": case "G": a = l != null ? Ei(a, l) : Ei(a); break; case "e": case "E": a = l != null ? $i(a, l) : $i(a); break; case "p": case "P": l = l ?? 2, a = Ci(Yl(a, 100), l) + " %"; break; case "d": case "D": a = l != null ? $l(String(a), l, "0") : String(a); break; case "x": case "X": a = l != null ? $l(Ii(a), l, "0") : Ii(a), i === "X" && (a = a.toUpperCase()); break; default: if (c) { let u = ""; a = c.replace(/([0#,]+)(\.[0#]+)?/, (w, g, C) => { Lf(a, 0) && (a = Yl(a, -1), u = "-"), C = C == null ? "" : C.substring(1), a = Ci(a, Math.max(C.length, 0)); let [p, T] = a.split("."); T || (T = ""); const S = g.replace(/,/g, "").replace(/^#+/, "").length; p = $l(p, S, "0"); const A = C.replace(/#+$/, "").length; if (A > T.length ? T = am(T, A, "0") : A < T.length && (T = T.substring(0, A) + T.substring(A).replace(/0+$/, "")), g.indexOf(",") > 0) { const E = p.length % 3, N = Math.floor(p.length / 3); let M = E > 0 ? p.substr(0, E) + (N > 0 ? "," : "") : ""; for (let F = 0; F < N; F++) M += p.substr(E + F * 3, 3) + (F < N - 1 ? "," : ""); p = M; } return T.length > 0 ? p + "." + T : p; }), a = u + a; } } else a instanceof Date ? a = ks(a, c || i) : a = J(a); return o = parseInt((o || " ").substring(1), 10), isNaN(o) || (a = To(String(a), Math.abs(o), " ", o < 0)), a; }); } function ol(e) { return typeof e != "string" || e.length === 0; } function He(e) { return typeof e != "string" || /^\s*$/.test(e); } function P(e, t) { return Array.isArray(t) ? t.join(e) : Array.from(t).join(e); } function lm(e) { throw new Error("The environment doesn't support '" + e + "', please use a polyfill."); } function cm(e) { const t = typeof atob == "function" ? atob(e) : lm("atob"), n = new Uint8Array(t.length); for (let r = 0; r < t.length; r++) n[r] = t.charCodeAt(r); return n; } function To(e, t, n, r) { n = n || " ", t = t - e.length; for (let s = 0; s < t; s++) e = r ? e + n : n + e; return e; } function $l(e, t, n) { return To(e, t, n); } function am(e, t, n) { return To(e, t, n, !0); } function Ss(e, t, n) { return e.replace(new RegExp(Fo(t), "g"), n); } function um(e, t, n, r) { if (n = typeof n == "number" ? n : void 0, r = typeof r == "number" ? r : 0, n && n < 0) throw new Error("Count cannot be less than zero"); if (n === 0) return []; const s = (r & 1) === 1, o = (r & 2) === 2; t = t || [], t = t.filter((u) => u).map(Fo), t = t.length > 0 ? t : ["\\s"]; const i = [], l = new RegExp(t.join("|"), "g"); let c = !0, a = 0; do { const u = l.exec(e); if (u === null) { const w = o ? e.substring(a).trim() : e.substring(a); (!s || w.length > 0) && i.push(w), c = !1; } else { const w = o ? e.substring(a, u.index).trim() : e.substring(a, u.index); (!s || w.length > 0) && (n != null && i.length + 1 === n ? (i.push(o ? e.substring(a).trim() : e.substring(a)), c = !1) : i.push(w)), a = l.lastIndex; } } while (c); return i; } function Gf(e, ...t) { if (t.length === 0) return e.trim(); const n = "[" + Fo(t.join("")) + "]+"; return e.replace(new RegExp("^" + n), "").replace(new RegExp(n + "$"), ""); } function Il(e, ...t) { return t.length === 0 ? e.trimStart() : e.replace(new RegExp("^[" + Fo(t.join("")) + "]+"), ""); } function fm(e, ...t) { return t.length === 0 ? e.trimEnd() : e.replace(new RegExp("[" + Fo(t.join("")) + "]+$"), ""); } function zf(e, t, n) { if (t + (n || 0) > e.length) throw new Error("Invalid startIndex and/or length"); return n != null ? e.substr(t, n) : e.substr(t); } class dm { constructor(t, n, r, s) { this.declaringType = t, this.tag = n, this.name = r, this.fields = s; } } let mn = class { constructor(t, n, r, s, o, i, l) { this.fullname = t, this.generics = n, this.construct = r, this.parent = s, this.fields = o, this.cases = i, this.enumCases = l; } toString() { return ut(this); } GetHashCode() { return Uf(this); } Equals(t) { return ki(this, t); } }; function Zt(e) { return e.generics != null ? e.generics : []; } function Uf(e) { const t = Tn(e.fullname), n = Zt(e).map(Uf); return js([t, ...n]); } function ki(e, t) { return e.fullname === "" ? t.fullname === "" && Ql(xo(e), xo(t), ([n, r], [s, o]) => n === s && ki(r, o)) : e.fullname === t.fullname && Ql(Zt(e), Zt(t), ki); } function Gr(e, t, n, r) { return new mn(e, t, n, r); } function us(e, t, n, r) { return new mn(e, t, n, void 0, r); } function Pc(e, t, n, r) { const s = new mn(e, t, n, void 0, void 0, () => { const o = n.prototype.cases(); return r().map((i, l) => new dm(s, l, o[l], i)); }); return s; } function Cs(e, t) { return new mn("Microsoft.FSharp.Core.FSharpFunc`2", [e, t]); } function Jr(e) { return new mn("Microsoft.FSharp.Core.FSharpOption`1", [e]); } function hm(e) { return new mn("Microsoft.FSharp.Collections.FSharpList`1", [e]); } function bs(e) { return new mn("[]", [e]); } const mm = new mn("Microsoft.FSharp.Core.Unit"), nn = new mn("System.String"), qf = new mn("System.Boolean"), Gc = new mn("System.Int32"); function ot(e) { if (Array.isArray(e)) return e[0]; if (e instanceof mn) { const t = il(e); if (t != null) return ot(t) + "[]"; { const n = e.fullname.lastIndexOf("."); return n === -1 ? e.fullname : e.fullname.substr(n + 1); } } else return e.name; } function ut(e) { const t = il(e); return t != null ? ut(t) + "[]" : e.generics == null || e.generics.length === 0 ? e.fullname : e.fullname + "[" + e.generics.map((n) => ut(n)).join(",") + "]"; } function wm(e) { return il(e) != null; } function il(e) { var t; return e.fullname === "[]" && ((t = e.generics) == null ? void 0 : t.length) === 1 ? e.generics[0] : void 0; } function gm(e) { return e.generics != null && e.generics.length > 0; } function Cm(e) { return e.enumCases != null && e.enumCases.length > 0; } function pm(e) { var t; return (t = e.generics) == null ? void 0 : t[0]; } function ll(e) { if (e.cases != null) return e.cases(); throw new Error(`${e.fullname} is not an F# union type`); } function xo(e) { if (e.fields != null) return e.fields(); throw new Error(`${e.fullname} is not an F# record type`); } function ym(e) { if (Wf(e) && e.generics != null) return e.generics; throw new Error(`${e.fullname} is not a tuple type`); } function jf(e) { if (cl(e) && e.generics != null) { const t = e.generics; return [t[0], t[1]]; } else throw new Error(`${e.fullname} is not an F# function type`); } function _m(e) { return e instanceof mn ? e.cases != null : e instanceof bt; } function vm(e) { return e instanceof mn ? e.fields != null : e instanceof rt; } function Wf(e) { return e.fullname.startsWith("System.Tuple"); } function cl(e) { return e.fullname === "Microsoft.FSharp.Core.FSharpFunc`2"; } function Sm(e, t) { const r = ll(t)[e.tag]; if (r == null) throw new Error(`Cannot find case ${e.name} in union type`); return [r, e.fields]; } function bm(e) { return e.fields == null ? [] : e.fields; } function Tm(e, t) { return e[t[0]]; } function Qn(e, t) { const n = (e.fields || []).length; if (t.length !== n) throw new Error(`Expected an array of length ${n} but got ${t.length}`); const r = e.declaringType.construct; return r == null ? {} : (e.declaringType.cases ? e.declaringType.cases().length == 1 : !1) ? new r(...t) : new r(e.tag, t); } function Kf(e, t) { const n = xo(e); if (n.length !== t.length) throw new Error(`Expected an array of length ${n.length} but got ${t.length}`); return e.construct != null ? new e.construct(...t) : n.reduce((r, [s, o], i) => (r[s] = t[i], r), {}); } class xm extends bt { constructor(t, n) { super(), this.tag = t, this.fields = n; } cases() { return ["Exact", "Complete", "PerformanceComplete", "Fuzzy"]; } } function Am() { return Pc("Swate.Components.Shared.Database.FullTextSearch", [], xm, () => [[], [], [], []]); } class Em extends rt { constructor(t, n, r, s, o) { super(), this.Accession = t, this.Name = n, this.Description = r, this.IsObsolete = s, this.FK_Ontology = o; } } function fo() { return us("Swate.Components.Shared.Database.Term", [], Em, () => [["Accession", nn], ["Name", nn], ["Description", nn], ["IsObsolete", qf], ["FK_Ontology", nn]]); } function On(e, t) { return typeof e == "function" ? new e(t) : new Array(t); } function Jf(e, t) { if (e != null && /\S/.test(e)) { const n = +e.replace("_", ""); if (!Number.isNaN(n)) return t.contents = n, !0; } return !1; } function Mi(e) { const t = new wt(0); if (Jf(e, t)) return t.contents; throw new Error(`The input string ${e} was not in a correct format.`); } function ss(e, t) { return e > t ? e : t; } function Fi(e, t) { return e < t ? e : t; } const Xl = "The index was outside the range of elements in the collection.", zc = "Collection was empty.", Zf = "The input must be non-negative.", $m = "An index satisfying the predicate was not found in the collection.", Uc = "The input sequence has an insufficient number of elements."; function Qf() { throw new Error("An index satisfying the predicate was not found in the collection."); } function Yf() { throw new Error("Arrays had different lengths"); } function Im(e, t, n) { const r = e.length | 0, s = t.length | 0, o = On(n, r + s); for (let i = 0; i <= r - 1; i++) qe(o, i, x(i, e)); for (let i = 0; i <= s - 1; i++) qe(o, i + r, x(i, t)); return o; } function qc(e, t, n, r) { const s = t | 0; return e.fill(r, s, s + n); } function Rm(e, t, n) { const r = t | 0; return e.slice(r, r + n); } function Nm(e) { if (e.length === 0) throw new Error("The input array was empty\\nParameter name: array"); return x(e.length - 1, e); } function os(e, t, n) { const r = t.length | 0, s = On(n, r); for (let o = 0; o <= r - 1; o++) qe(s, o, e(o, x(o, t))); return s; } function q(e, t, n) { const r = t.length | 0, s = On(n, r); for (let o = 0; o <= r - 1; o++) qe(s, o, e(x(o, t))); return s; } function km(e, t, n, r) { if (t.length !== n.length) throw new Error("Arrays had different lengths"); const s = On(r, t.length); for (let o = 0; o <= t.length - 1; o++) qe