@nfdi4plants/swate-components
Version:
Customizable React components for ontology annotation, based on Swate and the ARC.
4 lines • 371 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),he=require("@floating-ui/react"),Md=require("react-dom"),nl=require("@tanstack/react-virtual");function kd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const L=kd(f);function In(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function Fd(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e}function Dd(e){return e!=null&&typeof e.GetEnumerator=="function"}function Hd(e){return e!=null&&typeof e.CompareTo=="function"}function Od(e){return e!=null&&typeof e.Equals=="function"}function uf(e){return e!=null&&typeof e.GetHashCode=="function"}function Ld(e){return e!=null&&typeof e.Dispose=="function"}function ie(e){Ld(e)&&e.Dispose()}function U(){return null}function $l(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 Bd{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 Dd(e)?e.GetEnumerator():new Bd(e[Symbol.iterator]())}function cs(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 Xe(e,t){return e.toString(10).padStart(t,"0")}function zi(e){const t=e;return typeof t.offset=="number"?t.offset:e.kind===1?0:e.getTimezoneOffset()*-6e4}function Tc(e,t){return e=e,e.toString(t)}function Vd(e,t){return e=e,e.toString(t)}class wr{static id(t){return wr.idMap.has(t)||wr.idMap.set(t,++wr.count),wr.idMap.get(t)}}wr.idMap=new WeakMap;wr.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 Jn(e){return e*2654435761|0}function ff(e){return Tn(e.toString(32))}function Ks(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 Pd(e){if(e==null)return 0;switch(typeof e){case"boolean":return e?1:0;case"number":return Jn(e);case"bigint":return ff(e);case"string":return Tn(e);default:return Jn(wr.id(e))}}function xc(e){return uf(e)?e.GetHashCode():Pd(e)}function Gd(e){return e.getTime()}function zd(e){const t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=at(e[r]);return Ks(n)}function at(e){var t;if(e==null)return 0;switch(typeof e){case"boolean":return e?1:0;case"number":return Jn(e);case"bigint":return ff(e);case"string":return Tn(e);default:{if(uf(e))return e.GetHashCode();if(In(e))return zd(e);if(e instanceof Date)return Gd(e);if(((t=Object.getPrototypeOf(e))==null?void 0:t.constructor)===Object){const n=Object.values(e).map(r=>at(r));return Ks(n)}else return Jn(wr.id(e))}}}function mn(e){return xc(e)}function Ua(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 df(e,t){return Ua(e,t,Q)}function Ud(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:Od(e)?e.Equals(t):In(e)?In(t)&&df(e,t):typeof e!="object"?!1:e instanceof Date?t instanceof Date&&mf(e,t)===0:((n=Object.getPrototypeOf(e))==null?void 0:n.constructor)===Object&&Ud(e,t)}function mf(e,t){let n,r;return"offset"in e&&"offset"in t?(n=e.getTime(),r=t.getTime()):(n=e.getTime()+zi(e),r=t.getTime()+zi(t)),n===r?0:n<r?-1:1}function Ze(e,t){return e===t?0:e<t?-1:1}function qd(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 Ac(e,t){return qd(e,t,ut)}function jd(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 l=n[s];if(l!==r[s])return l<r[s]?-1:1;if(o=ut(e[l],t[l]),o!==0)return o}return 0}function ut(e,t){var n;return e===t?0:e==null?t==null?0:-1:t==null?1:Hd(e)?e.CompareTo(t):In(e)?In(t)?Ac(e,t):-1:typeof e!="object"?e<t?-1:1:e instanceof Date?t instanceof Date?mf(e,t):-1:((n=Object.getPrototypeOf(e))==null?void 0:n.constructor)===Object?jd(e,t):-1}function b(e){const t={};for(const n of e)t[n[0]]=n[1];return t}function hf(e,t=0){const n=Math.pow(10,t),r=+(t?e*n:e).toFixed(8),s=Math.floor(r),o=r-s,l=1e-8,a=o>.5-l&&o<.5+l?s%2===0?s:s+1:Math.round(r);return t?a/n:a}const wf=new WeakMap;function gf(e){if(e==null)return null;const t=(n,r)=>e(n)(r);return wf.set(t,e),t}function On(e){return wf.get(e)??(t=>n=>e(t,n))}class ss{constructor(t){this.value=t}toJSON(){return this.value}toString(){return String(this.value)}GetHashCode(){return at(this.value)}Equals(t){return t==null?!1:Q(this.value,t instanceof ss?t.value:t)}CompareTo(t){return t==null?1:ut(this.value,t instanceof ss?t.value:t)}}function d(e){if(e==null)throw new Error("Option has no value");return e instanceof ss?e.value:e}function v(e){return e instanceof ss?e.value:e}function ue(e){return e==null||e instanceof ss?new ss(e):e}function Se(e){return e==null?[]:[d(e)]}function $(e,t){return e!=null?d(e):t}function gs(e,t){return e??t}function pe(e,t){return t!=null?ue(e(d(t))):void 0}function Yr(e,t){return t!=null?e(d(t)):void 0}function nt(e,t){if(!e(t))return ue(t)}var We={},Wd=28,Kd=1,Js=1e6,Jd=1e6,Zd=-29,Qd=29,Yd=!1,Fo="[big.js] ",is=Fo+"Invalid ",Xl=is+"decimal places",Xd=is+"rounding mode",Cf=Fo+"Division by zero",sr=void 0,em=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function pf(){function e(t){var n=this;if(!(n instanceof e))return t===sr?pf():new e(t);if(t instanceof e)n.s=t.s,n.e=t.e,n.c=t.c.slice(),tm(n);else{if(typeof t!="string"){if(e.strict===!0)throw TypeError(is+"number");t=t===0&&1/t<0?"-0":String(t)}nm(n,t)}n.constructor=e}return e.prototype=We,e.DP=Wd,e.RM=Kd,e.NE=Zd,e.PE=Qd,e.strict=Yd,e}function tm(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 nm(e,t){var n,r,s;if(!em.test(t))throw Error(is+"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=Or(e,Zt.DP+1,Zt.RM),e}function Or(e,t,n,r){var s=e.c;if(n===sr&&(n=Zt.RM),n!==0&&n!==1&&n!==2&&n!==3)throw Error(Xd);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]!==sr))),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((l,a)=>a>=t&&l>0)<0;if(r=n===1&&s[t]>=5||n===2&&(s[t]>5||s[t]===5&&(r||s[t+1]!==sr||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 Zs(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}We.abs=function(){var e=new this.constructor(this);return e.s=1,e};We.cmp=function(s){var t,n=this.constructor,r=new n(this),s=new n(s),o=r.c,l=s.c,a=r.s,c=s.s,i=r.e,u=s.e;if(!o[0]||!l[0])return o[0]?a:l[0]?-c:0;if(a!=c)return a;if(t=a<0,i!=u)return i>u^t?1:-1;for(c=Math.max(o.length,l.length),a=0;a<c;a++)if(i=a<o.length?o[a]:0,u=a<l.length?l[a]:0,i!=u)return i>u^t?1:-1;return 0};We.div=function(r){var t=this.constructor,n=new t(this),r=new t(r),s=n.c,o=r.c,l=n.s==r.s?1:-1,a=t.DP;if(a!==~~a||a<0||a>Js)throw Error(Xl);if(!o[0])throw Error(Cf);if(!s[0])return r.s=l,r.c=[r.e=0],r;var c,i,u,w,g,C=o.slice(),p=c=o.length,E=s.length,S=s.slice(0,c),x=S.length,A=r,N=A.c=[],k=0,F=a+(A.e=n.e-r.e)+1;for(A.s=l,l=F<0?0:F,C.unshift(0);x++<c;)S.push(0);do{for(u=0;u<10;u++){if(c!=(x=S.length))w=c>x?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(i=x==c?o:C;x;){if(S[--x]<i[x]){for(g=x;g&&!S[--g];)S[g]=9;--S[g],S[x]+=10}S[x]-=i[x]}for(;!S[0];)S.shift()}else break}N[k++]=w?u:++u,S[0]&&w?S[x]=s[p]||0:S=[s[p]]}while((p++<E||S[0]!==sr)&&l--);return!N[0]&&k!=1&&(N.shift(),A.e--,F--),k>F&&Or(A,F,t.RM,S[0]!==sr),A};We.eq=function(e){return this.cmp(e)===0};We.gt=function(e){return this.cmp(e)>0};We.gte=function(e){return this.cmp(e)>-1};We.lt=function(e){return this.cmp(e)<0};We.lte=function(e){return this.cmp(e)<1};We.minus=We.sub=function(a){var t,n,r,s,o=this.constructor,l=new o(this),a=new o(a),c=l.s,i=a.s;if(c!=i)return a.s=-i,l.plus(a);var u=l.c.slice(),w=l.e,g=a.c,C=a.e;if(!u[0]||!g[0])return g[0]?a.s=-i:u[0]?a=new o(l):a.s=1,a;if(c=w-C){for((s=c<0)?(c=-c,r=u):(C=w,r=g),r.reverse(),i=c;i--;)r.push(0);r.reverse()}else for(n=((s=u.length<g.length)?u:g).length,c=i=0;i<n;i++)if(u[i]!=g[i]){s=u[i]<g[i];break}if(s&&(r=u,u=g,g=r,a.s=-a.s),(i=(n=g.length)-(t=u.length))>0)for(;i--;)u[t++]=0;for(i=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[--i]===0;)u.pop();for(;u[0]===0;)u.shift(),--C;return u[0]||(a.s=1,u=[C=0]),a.c=u,a.e=C,a};We.mod=function(s){var t,n=this.constructor,r=new n(this),s=new n(s),o=r.s,l=s.s;if(!s.c[0])throw Error(Cf);return r.s=s.s=1,t=s.cmp(r)==1,r.s=o,s.s=l,t?new n(r):(o=n.DP,l=n.RM,n.DP=n.RM=0,r=r.div(s),n.DP=o,n.RM=l,this.minus(r.times(s)))};We.plus=We.add=function(l){var t,n,r,s=this.constructor,o=new s(this),l=new s(l);if(o.s!=l.s)return l.s=-l.s,o.minus(l);var a=o.e,c=o.c,i=l.e,u=l.c;if(!c[0]||!u[0])return u[0]||(c[0]?l=new s(o):l.s=o.s),l;if(c=c.slice(),t=a-i){for(t>0?(i=a,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),++i),t=c.length;c[--t]===0;)c.pop();return l.c=c,l.e=i,l};We.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>Jd)throw Error(is+"exponent");for(o&&(e=-e);e&1&&(r=r.times(n)),e>>=1,!!e;)n=n.times(n);return o?s.div(r):r};We.prec=function(e,t){if(e!==~~e||e<1||e>Js)throw Error(is+"precision");return Or(new this.constructor(this),e,t)};We.round=function(e,t){if(e===sr)e=0;else if(e!==~~e||e<-1e6||e>Js)throw Error(Xl);return Or(new this.constructor(this),e+this.e+1,t)};We.sqrt=function(){var e,t,n,r=this.constructor,s=new r(this),o=s.s,l=s.e,a=new r("0.5");if(!s.c[0])return new r(s);if(o<0)throw Error(Fo+"No square root");o=Math.sqrt(s+""),o===0||o===1/0?(t=s.c.join(""),t.length+l&1||(t+="0"),o=Math.sqrt(t),l=((l+1)/2|0)-(l<0||l&1),e=new r((o==1/0?"5e":(o=o.toExponential()).slice(0,o.indexOf("e")+1))+l)):e=new r(o+""),l=e.e+(r.DP+=4);do n=e,e=a.times(n.plus(s.div(n)));while(n.c.slice(0,l).join("")!==e.c.slice(0,l).join(""));return Or(e,(r.DP-=4)+e.e+1,r.RM)};We.times=We.mul=function(s){var t,n=this.constructor,r=new n(this),s=new n(s),o=r.c,l=s.c,a=o.length,c=l.length,i=r.e,u=s.e;if(s.s=r.s==s.s?1:-1,!o[0]||!l[0])return s.c=[s.e=0],s;for(s.e=i+u,a<c&&(t=o,o=l,l=t,u=a,a=c,c=u),t=new Array(u=a+c);u--;)t[u]=0;for(i=c;i--;){for(c=0,u=a+i;u>i;)c=t[u]+l[i]*o[u-i-1]+c,t[u--]=c%10,c=c/10|0;t[u]=c}for(c?++s.e:t.shift(),i=t.length;!t[--i];)t.pop();return s.c=t,s};We.toExponential=function(e,t){var n=this,r=n.c[0];if(e!==sr){if(e!==~~e||e<0||e>Js)throw Error(Xl);for(n=Or(new n.constructor(n),++e,t);n.c.length<e;)n.c.push(0)}return Zs(n,!0,!!r)};We.toFixed=function(e,t){var n=this,r=n.c[0];if(e!==sr){if(e!==~~e||e<0||e>Js)throw Error(Xl);for(n=Or(new n.constructor(n),e+n.e+1,t),e=e+n.e+1;n.c.length<e;)n.c.push(0)}return Zs(n,!1,!!r)};We.toJSON=We.toString=function(){var e=this,t=e.constructor;return Zs(e,e.e<=t.NE||e.e>=t.PE,!!e.c[0])};We.toNumber=function(){var e=Number(Zs(this,!0,!0));if(this.constructor.strict===!0&&!this.eq(e.toString()))throw Error(Fo+"Imprecise conversion");return e};We.toPrecision=function(e,t){var n=this,r=n.constructor,s=n.c[0];if(e!==sr){if(e!==~~e||e<1||e>Js)throw Error(is+"precision");for(n=Or(new r(n),e,t);n.c.length<e;)n.c.push(0)}return Zs(n,e<=n.e||n.e<=r.NE||n.e>=r.PE,!!s)};We.valueOf=function(){var e=this,t=e.constructor;if(t.strict===!0)throw Error(Fo+"valueOf disallowed");return Zs(e,e.e<=t.NE||e.e>=t.PE,!0)};var Zt=pf();const us=Symbol("numeric");function yf(e){return typeof e=="number"||typeof e=="bigint"||(e==null?void 0:e[us])}function rm(e,t){return typeof e=="number"||typeof e=="bigint"?e<t?-1:e>t?1:0:e.CompareTo(t)}function qa(e,t){return typeof e=="number"?e*t:typeof e=="bigint"?e*BigInt(t):e[us]().multiply(t)}function _l(e,t){return typeof e=="number"?e.toFixed(t):typeof e=="bigint"?e:e[us]().toFixed(t)}function Il(e,t){return typeof e=="number"?e.toPrecision(t):typeof e=="bigint"?e:e[us]().toPrecision(t)}function Rl(e,t){return typeof e=="number"?e.toExponential(t):typeof e=="bigint"?e:e[us]().toExponential(t)}function Nl(e){return typeof e=="number"?(Number(e)>>>0).toString(16):typeof e=="bigint"?BigInt.asUintN(64,e).toString(16):e[us]().toHex()}function sm(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 sm(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 om(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 Et{get name(){return this.cases()[this.tag]}toJSON(){return this.fields.length===0?this.name:[this.name].concat(this.fields)}toString(){return om(this.name,this.fields)}GetHashCode(){const t=this.fields.map(n=>at(n));return t.splice(0,0,Jn(this.tag)),Ks(t)}Equals(t){return this===t?!0:$l(this,t)&&this.tag===t.tag?df(this.fields,t.fields):!1}CompareTo(t){return this===t?0:$l(this,t)?this.tag===t.tag?Ac(this.fields,t.fields):this.tag<t.tag?-1:1:-1}}function lm(e){const t={},n=Object.keys(e);for(let r=0;r<n.length;r++)t[n[r]]=e[n[r]];return t}function am(e){return"{ "+Object.entries(e).map(([t,n])=>t+" = "+J(n)).join(`
`)+" }"}function cm(e){const t=Object.values(e).map(n=>at(n));return Ks(t)}function im(e,t){if(e===t)return!0;if($l(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 um(e,t){if(e===t)return 0;if($l(e,t)){const n=Object.keys(e);for(let r=0;r<n.length;r++){const s=ut(e[n[r]],t[n[r]]);if(s!==0)return s}return 0}else return-1}class st{toJSON(){return lm(this)}toString(){return am(this)}GetHashCode(){return cm(this)}Equals(t){return im(this,t)}CompareTo(t){return um(this,t)}}class gt{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 fm{constructor(t){this.message=t}}function dm(e){return e instanceof fm||e instanceof Error}function mm(e){return e instanceof Promise}function Ml(e){return dm(e)||mm(e)?e:new Error(String(e))}Zt.prototype.GetHashCode=function(){return Ks([this.s,this.e].concat(this.c))};Zt.prototype.Equals=function(e){return!this.cmp(e)};Zt.prototype.CompareTo=function(e){return this.cmp(e)};Zt.prototype[us]=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 Zt(0);new Zt(1);new Zt(-1);new Zt("79228162514264337593543950335");new Zt("-79228162514264337593543950335");function hm(e){return e.toString()}function wm(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 l=0;l<r;l++){const a=n[l]*16+o|0;n[l]=a%10|0,o=a/10|0}for(;o>0;)n[r++]=o%10|0,o=o/10|0}return n.slice(0,r)}function ya(e,t,n){for(let r=0;r<8;r++)e[n+r]=t>>r*4&15}function gm(e,t,n,r,s){const l=new Uint8Array(24);ya(l,e,0),ya(l,t,8),ya(l,n,16);const a=wm(l,96);s=s&127;const c=new Zt(0);return c.c=Array.from(a.reverse()),c.e=a.length-s-1,c.s=r?-1:1,new Zt(c)}BigInt.prototype.toJSON=function(){return`${this.toString()}`};const _f=0n;function Cm(e){return e<_f?-e:e}function pm(e){return BigInt(e)}function _a(e){return BigInt(Math.trunc(e))}function ym(e){return BigInt(e)}function va(e){return BigInt.asIntN(64,e)}function Ui(e){return BigInt.asUintN(64,e)}function _m(e){return Number(e)}function qi(e){const t=e<_f,n=Cm(e),r=Number(BigInt.asUintN(32,n)),s=Number(BigInt.asUintN(32,n>>32n)),o=Number(BigInt.asUintN(32,n>>64n));return gm(r,s,o,t,0)}function vm(e){return e.toString()}function Sm(e){return BigInt(e)}const bm=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Em=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Tm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],xm=["January","February","March","April","May","June","July","August","September","October","November","December"];function pn(e,t,n){let r=0,s=t;for(;s<e.length&&e[s]===n;)s++,r++;return r}function ji(e,t){return t>=e.length-1?-1:e.charCodeAt(t+1)}function Am(e,t){let n=t;const r=e[t];let s="",o=!1;for(;t<e.length;){t++;const l=e[t];if(l===r){o=!0;break}else if(l==="\\")if(t<e.length)t++,s+=e[t];else throw new Error("Invalid string format");else s+=l}if(!o)throw new Error(`Invalid string format could not find matching quote for ${r}`);return[s,t-n+1]}function $c(e,t,n){let r=0,s=0,o="";const l=n?Ic(e.getTime(),1):e;for(;r<t.length;){const a=t[r];switch(a){case"d":switch(s=pn(t,r,"d"),r+=s,s){case 1:o+=Ki(l);break;case 2:o+=Xe(Ki(l),2);break;case 3:o+=bm[Qi(l)];break;case 4:o+=Em[Qi(l)];break}break;case"f":if(s=pn(t,r,"f"),r+=s,s<=3){const S=10**(3-s);o+=Xe(Math.floor(sl(l)/S),s)}else s<=7&&(o+=(""+sl(l)).padEnd(s,"0"));break;case"F":if(s=pn(t,r,"F"),r+=s,s<=3){const S=10**(3-s),x=Math.floor(sl(l)/S);x!=0&&(o+=Xe(x,s))}else if(s<=7){const S=sl(l);S!=0&&(o+=Xe(S,3))}break;case"g":s=pn(t,r,"g"),r+=s,s<=2&&(o+="A.D.");break;case"h":switch(s=pn(t,r,"h"),r+=s,s){case 1:o+=rl(l)%12;break;case 2:o+=Xe(rl(l)%12,2);break}break;case"H":switch(s=pn(t,r,"H"),r+=s,s){case 1:o+=rl(l);break;case 2:o+=Xe(rl(l),2);break}break;case"K":switch(s=pn(t,r,"K"),r+=s,s){case 1:switch(Wi(l)){case 1:o+="Z";break;case 2:o+=Rs(l.getTimezoneOffset()*-6e4);break}break}break;case"m":switch(s=pn(t,r,"m"),r+=s,s){case 1:o+=Ji(l);break;case 2:o+=Xe(Ji(l),2);break}break;case"M":switch(s=pn(t,r,"M"),r+=s,s){case 1:o+=ol(l);break;case 2:o+=Xe(ol(l),2);break;case 3:o+=Tm[ol(l)-1];break;case 4:o+=xm[ol(l)-1];break}break;case"s":switch(s=pn(t,r,"s"),r+=s,s){case 1:o+=Zi(l);break;case 2:o+=Xe(Zi(l),2);break}break;case"t":switch(s=pn(t,r,"t"),r+=s,s){case 1:o+=l.getHours()<12?"A":"P";break;case 2:o+=l.getHours()<12?"AM":"PM";break}break;case"y":switch(s=pn(t,r,"y"),r+=s,s){case 1:o+=l.getFullYear()%100;break;case 2:o+=Xe(l.getFullYear()%100,2);break;case 3:o+=Xe(l.getFullYear(),3);break;case 4:o+=Xe(l.getFullYear(),4);break;case 5:o+=Xe(l.getFullYear(),5);break}break;case"z":s=pn(t,r,"z"),r+=s;let c="";switch(Wi(l)){case 1:c="+00:00";break;case 2:c=Rs(l.getTimezoneOffset()*-6e4);break;case 0:c=Rs(km(l).getTimezoneOffset()*-6e4);break}const i=c[0]==="-"?"-":"+",u=parseInt(c.substring(1,3),10),w=parseInt(c.substring(4,6),10);switch(s){case 1:o+=`${i}${u}`;break;case 2:o+=`${i}${Xe(u,2)}`;break;default:o+=`${i}${Xe(u,2)}:${Xe(w,2)}`;break}break;case":":o+=":",r++;break;case"/":o+="/",r++;break;case"'":case'"':const[g,C]=Am(t,r);o+=g,r+=C;break;case"%":const p=ji(t,r);if(p>=0&&p!==37)r+=2,o+=$c(l,String.fromCharCode(p),n);else throw new Error("Invalid format string");break;case"\\":const E=ji(t,r);if(E>=0)r+=2,o+=String.fromCharCode(E);else throw new Error("Invalid format string");break;default:r++,o+=a;break}}return o}function Wi(e){return e.kind||0}function Rs(e){const t=e<0;e=Math.abs(e);const n=~~(e/36e5),r=e%36e5/6e4;return(t?"-":"+")+Xe(n,2)+":"+Xe(r,2)}function kl(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 $m(e,t){if(t)return e.toISOString();{const n=e.kind==null?!0:e.kind===2;return Xe(e.getFullYear(),4)+"-"+Xe(e.getMonth()+1,2)+"-"+Xe(e.getDate(),2)+"T"+Xe(e.getHours(),2)+":"+Xe(e.getMinutes(),2)+":"+Xe(e.getSeconds(),2)+"."+Xe(e.getMilliseconds(),3)+(n?Rs(e.getTimezoneOffset()*-6e4):"")}}function Im(e,t){const n=e.toISOString();return n.substring(0,n.length-1)+Rs(t)}function Rm(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," ")+Rs(e.offset??0);if(t.length===1)switch(t){case"D":case"d":return kl(n,"first");case"T":case"t":return kl(n,"second");case"O":case"o":return Im(n,e.offset??0);default:throw new Error("Unrecognized Date print format")}else return $c(n,t,!0)}function Nm(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?kl(e,"first"):e.toLocaleDateString();case"T":case"t":return n?kl(e,"second"):e.toLocaleTimeString();case"O":case"o":return $m(e,n);default:throw new Error("Unrecognized Date print format")}else return $c(e,t,n)}function Fs(e,t,n){return e.offset!=null?Rm(e,t):Nm(e,t)}function Ic(e,t){const n=new Date(e);return n.kind=(t??0)|0,n}function vf(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,l=0;if(s[2]!=null){const a=s[2].split(":"),c=parseInt(a[0],10);l=c*3600+parseInt(a[1]||"0",10)*60+parseFloat(a[2]||"0"),s[3]!=null&&s[3].toUpperCase()==="PM"&&c<12&&(l+=720)}if(s[4]!=null){if(s[1]!=null)o=new Date(s[1]+" UTC");else{const a=new Date;o=new Date(a.getUTCFullYear()+"/"+(a.getUTCMonth()+1)+"/"+a.getUTCDate())}if(s[4]==="Z")r="Z";else{let a=parseInt(s[5],10)*60+parseInt(s[6]||"0",10);s[4][0]==="-"&&(a*=-1),r=a,l-=a*60}}else if(s[1]!=null)o=new Date(s[1]);else{const a=new Date;o=new Date(a.getFullYear()+"/"+(a.getMonth()+1)+"/"+a.getDate())}n=new Date(o.getTime()+l*1e3),n=new Date(n.getTime()+(n.getTimezoneOffset()-o.getTimezoneOffset())*6e4)}else t();isNaN(n.getTime())&&t()}return[n,r]}function Mm(e,t=!1){const[n,r]=vf(e),s=r!=null?t&&r==="Z"?1:2:0;return Ic(n.getTime(),s)}function km(e){return e.kind===2?e:Ic(e.getTime(),2)}function Ki(e){return e.kind===1?e.getUTCDate():e.getDate()}function rl(e){return e.kind===1?e.getUTCHours():e.getHours()}function sl(e){return e.kind===1?e.getUTCMilliseconds():e.getMilliseconds()}function Ji(e){return e.kind===1?e.getUTCMinutes():e.getMinutes()}function ol(e){return(e.kind===1?e.getUTCMonth():e.getMonth())+1}function Zi(e){return e.kind===1?e.getUTCSeconds():e.getSeconds()}function Qi(e){return e.kind===1?e.getUTCDay():e.getDay()}function bo(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 Do(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function Eo(e,t,n=0){return e.lastIndex=n,e.exec(t)}function Fm(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 lo=/(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g,Dm=/\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g;function Sf(e,t){return rm(e,t)<0}function Cs(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 Hm(...e){switch(e.length){case 2:return Cs(e[0],e[1],!1);case 3:return Cs(e[0],e[1],e[2]);case 4:return Cs(e[0],e[1],e[2]===!0);case 5:return Cs(e[0].substr(e[1],e[4]),e[2].substr(e[3],e[4]),!1);case 6:return Cs(e[0].substr(e[1],e[4]),e[2].substr(e[3],e[4]),e[5]);case 7:return Cs(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:Lm(e)}}function Rc(e,t){return typeof t=="string"?e(t):t.cont(e)}function bf(e){return Rc(t=>console.log(t),e)}function He(e){return Rc(t=>t,e)}function Ce(e){return Rc(t=>{throw new Error(t)},e)}function Om(e,t,n,r,s){let o="";if(t=t||"",s=s||"",yf(e))switch(s.toLowerCase()!=="x"&&(Sf(e,0)?(e=qa(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=_l(e,r);break;case"g":case"G":e=r!=null?Il(e,r):Il(e);break;case"e":case"E":e=r!=null?Rl(e,r):Rl(e);break;case"x":e=Nl(e);break;case"X":e=Nl(e).toUpperCase();break;default:e=String(e);break}else e instanceof Date?e=Fs(e):e=J(e);if(n=typeof n=="number"?n:parseInt(n,10),isNaN(n))e=o+e;else{const l=t.indexOf("0")>=0,a=t.indexOf("-")>=0,c=a||!l?" ":"0";c==="0"?(e=To(e,n-o.length,c,a),e=o+e):e=To(o+e,n,c,a)}return e}function Ef(e,t,n,r="",s=-1){return(...o)=>{let l=r;const a=t.slice(),c=n.slice();for(const i of o){const[,,u,w,g,C]=c[0];let p=w;if(s>=0)p=s,s=-1;else if(p==="*"){if(i<0)throw new Error("Non-negative number required");s=i;continue}l+=a[0],l+=Om(i,u,p,g,C),a.splice(0,1),c.splice(0,1)}return c.length===0?(l+=a[0],e(l)):Ef(e,a,c,l,s)}}function Lm(e){return t=>{lo.lastIndex=0;const n=[],r=[];let s=0,o=lo.exec(e);for(;o;){const l=o.index+(o[1]||"").length;n.push(e.substring(s,l).replace(/%%/g,"%")),r.push(o),s=lo.lastIndex,lo.lastIndex-=1,o=lo.exec(e)}return n.length===0?t(e.replace(/%%/g,"%")):(n.push(e.substring(s).replace(/%%/g,"%")),Ef(t,n,r))}}function Tf(e,...t){let n;return typeof e=="object"?(n=String(t[0]),t.shift()):n=e,n.replace(Dm,(r,s,o,l,a,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 i=t[s];if(yf(i))switch(a=a==null?null:parseInt(a,10),l){case"f":case"F":a=a??2,i=_l(i,a);break;case"g":case"G":i=a!=null?Il(i,a):Il(i);break;case"e":case"E":i=a!=null?Rl(i,a):Rl(i);break;case"p":case"P":a=a??2,i=_l(qa(i,100),a)+" %";break;case"d":case"D":i=a!=null?Sa(String(i),a,"0"):String(i);break;case"x":case"X":i=a!=null?Sa(Nl(i),a,"0"):Nl(i),l==="X"&&(i=i.toUpperCase());break;default:if(c){let u="";i=c.replace(/([0#,]+)(\.[0#]+)?/,(w,g,C)=>{Sf(i,0)&&(i=qa(i,-1),u="-"),C=C==null?"":C.substring(1),i=_l(i,Math.max(C.length,0));let[p,E]=i.split(".");E||(E="");const S=g.replace(/,/g,"").replace(/^#+/,"").length;p=Sa(p,S,"0");const x=C.replace(/#+$/,"").length;if(x>E.length?E=Pm(E,x,"0"):x<E.length&&(E=E.substring(0,x)+E.substring(x).replace(/0+$/,"")),g.indexOf(",")>0){const A=p.length%3,N=Math.floor(p.length/3);let k=A>0?p.substr(0,A)+(N>0?",":""):"";for(let F=0;F<N;F++)k+=p.substr(A+F*3,3)+(F<N-1?",":"");p=k}return E.length>0?p+"."+E:p}),i=u+i}}else i instanceof Date?i=Fs(i,c||l):i=J(i);return o=parseInt((o||" ").substring(1),10),isNaN(o)||(i=To(String(i),Math.abs(o)," ",o<0)),i})}function ea(e){return typeof e!="string"||e.length===0}function Oe(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 Bm(e){throw new Error("The environment doesn't support '"+e+"', please use a polyfill.")}function Vm(e){const t=typeof atob=="function"?atob(e):Bm("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 Sa(e,t,n){return To(e,t,n)}function Pm(e,t,n){return To(e,t,n,!0)}function bs(e,t,n){return e.replace(new RegExp(Do(t),"g"),n)}function Gm(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(Do),t=t.length>0?t:["\\s"];const l=[],a=new RegExp(t.join("|"),"g");let c=!0,i=0;do{const u=a.exec(e);if(u===null){const w=o?e.substring(i).trim():e.substring(i);(!s||w.length>0)&&l.push(w),c=!1}else{const w=o?e.substring(i,u.index).trim():e.substring(i,u.index);(!s||w.length>0)&&(n!=null&&l.length+1===n?(l.push(o?e.substring(i).trim():e.substring(i)),c=!1):l.push(w)),i=a.lastIndex}}while(c);return l}function xf(e,...t){if(t.length===0)return e.trim();const n="["+Do(t.join(""))+"]+";return e.replace(new RegExp("^"+n),"").replace(new RegExp(n+"$"),"")}function ba(e,...t){return t.length===0?e.trimStart():e.replace(new RegExp("^["+Do(t.join(""))+"]+"),"")}function zm(e,...t){return t.length===0?e.trimEnd():e.replace(new RegExp("["+Do(t.join(""))+"]+$"),"")}function Af(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 Um{constructor(t,n,r,s){this.declaringType=t,this.tag=n,this.name=r,this.fields=s}}let wn=class{constructor(t,n,r,s,o,l,a){this.fullname=t,this.generics=n,this.construct=r,this.parent=s,this.fields=o,this.cases=l,this.enumCases=a}toString(){return ft(this)}GetHashCode(){return $f(this)}Equals(t){return Fl(this,t)}};function Qt(e){return e.generics!=null?e.generics:[]}function $f(e){const t=Tn(e.fullname),n=Qt(e).map($f);return Ks([t,...n])}function Fl(e,t){return e.fullname===""?t.fullname===""&&Ua(xo(e),xo(t),([n,r],[s,o])=>n===s&&Fl(r,o)):e.fullname===t.fullname&&Ua(Qt(e),Qt(t),Fl)}function zr(e,t,n,r){return new wn(e,t,n,r)}function fs(e,t,n,r){return new wn(e,t,n,void 0,r)}function Nc(e,t,n,r){const s=new wn(e,t,n,void 0,void 0,()=>{const o=n.prototype.cases();return r().map((l,a)=>new Um(s,a,o[a],l))});return s}function ps(e,t){return new wn("Microsoft.FSharp.Core.FSharpFunc`2",[e,t])}function Zr(e){return new wn("Microsoft.FSharp.Core.FSharpOption`1",[e])}function qm(e){return new wn("Microsoft.FSharp.Collections.FSharpList`1",[e])}function Es(e){return new wn("[]",[e])}const jm=new wn("Microsoft.FSharp.Core.Unit"),rn=new wn("System.String"),If=new wn("System.Boolean"),Mc=new wn("System.Int32");function lt(e){if(Array.isArray(e))return e[0];if(e instanceof wn){const t=ta(e);if(t!=null)return lt(t)+"[]";{const n=e.fullname.lastIndexOf(".");return n===-1?e.fullname:e.fullname.substr(n+1)}}else return e.name}function ft(e){const t=ta(e);return t!=null?ft(t)+"[]":e.generics==null||e.generics.length===0?e.fullname:e.fullname+"["+e.generics.map(n=>ft(n)).join(",")+"]"}function Wm(e){return ta(e)!=null}function ta(e){var t;return e.fullname==="[]"&&((t=e.generics)==null?void 0:t.length)===1?e.generics[0]:void 0}function Km(e){return e.generics!=null&&e.generics.length>0}function Jm(e){return e.enumCases!=null&&e.enumCases.length>0}function Zm(e){var t;return(t=e.generics)==null?void 0:t[0]}function na(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 Qm(e){if(Nf(e)&&e.generics!=null)return e.generics;throw new Error(`${e.fullname} is not a tuple type`)}function Rf(e){if(ra(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 Ym(e){return e instanceof wn?e.cases!=null:e instanceof Et}function Xm(e){return e instanceof wn?e.fields!=null:e instanceof st}function Nf(e){return e.fullname.startsWith("System.Tuple")}function ra(e){return e.fullname==="Microsoft.FSharp.Core.FSharpFunc`2"}function eh(e,t){const r=na(t)[e.tag];if(r==null)throw new Error(`Cannot find case ${e.name} in union type`);return[r,e.fields]}function th(e){return e.fields==null?[]:e.fields}function nh(e,t){return e[t[0]]}function Yn(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 Mf(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],l)=>(r[s]=t[l],r),{})}class rh extends Et{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Exact","Complete","PerformanceComplete","Fuzzy"]}}function sh(){return Nc("Swate.Components.Shared.Database.FullTextSearch",[],rh,()=>[[],[],[],[]])}class oh extends st{constructor(t,n,r,s,o){super(),this.Accession=t,this.Name=n,this.Description=r,this.IsObsolete=s,this.FK_Ontology=o}}function mo(){return fs("Swate.Components.Shared.Database.Term",[],oh,()=>[["Accession",rn],["Name",rn],["Description",rn],["IsObsolete",If],["FK_Ontology",rn]])}function Ln(e,t){return typeof e=="function"?new e(t):new Array(t)}function kf(e,t){if(e!=null&&/\S/.test(e)){const n=+e.replace("_","");if(!Number.isNaN(n))return t.contents=n,!0}return!1}function Dl(e){const t=new gt(0);if(kf(e,t))return t.contents;throw new Error(`The input string ${e} was not in a correct format.`)}function os(e,t){return e>t?e:t}function Hl(e,t){return e<t?e:t}const ja="The index was outside the range of elements in the collection.",kc="Collection was empty.",Ff="The input must be non-negative.",lh="An index satisfying the predicate was not found in the collection.",Fc="The input sequence has an insufficient number of elements.";function Df(){throw new Error("An index satisfying the predicate was not found in the collection.")}function Hf(){throw new Error("Arrays had different lengths")}function ah(e,t,n){const r=e.length|0,s=t.length|0,o=Ln(n,r+s);for(let l=0;l<=r-1;l++)je(o,l,T(l,e));for(let l=0;l<=s-1;l++)je(o,l+r,T(l,t));return o}function Dc(e,t,n,r){const s=t|0;return e.fill(r,s,s+n)}function ch(e,t,n){const r=t|0;return e.slice(r,r+n)}function ih(e){if(e.length===0)throw new Error("The input array was empty\\nParameter name: array");return T(e.length-1,e)}function ls(e,t,n){const r=t.length|0,s=Ln(n,r);for(let o=0;o<=r-1;o++)je(s,o,e(o,T(o,t)));return s}function q(e,t,n){const r=t.length|0,s=Ln(n,r);for(let o=0;o<=r-1;o++)je(s,o,e(T(o,t)));return s}function uh(e,t,n,r){if(t.length!==n.length)throw new Error("Arrays had different lengths");const s=Ln(r,t.length);for(let o=0;o<=t.length-1;o++)je(s,o,e(T(o,t),T(o,n)));return s}function Ol(e,t){const n=os(0,e)|0;return t.slice(0,0+n)}function Hc(e,t){const n=Array.isArray(e)?e:Array.from(e);switch(n.length|0){case 0:return Ln(t,0);case 1:return T(0,n);default:{let s=0,o=0;for(let a=0;a<=n.length-1;a++){const c=T(a,n);o=o+c.length|0}const l=Ln(t,o);for(let a=0;a<=n.length-1;a++){const c=T(a,n);for(let i=0;i<=c.length-1;i++)je(l,s,T(i,c)),s=s+1|0}return l}}}function Oc(e,t,n){return Hc(q(e,t,U()),n)}function Of(e,t,n,r,s){const o=$(n,0)|0,l=$(pe(c=>o+c,r),e.length)|0;return(c=>{e:for(;;){const i=c;if(i>=l)return-1;if(s.Equals(t,T(i,e)))return i|0;c=i+1;continue e}})(o)|0}function Ao(e,t,n){return Of(t,e,void 0,void 0,n)>=0}function fh(e,t){const n=Ln(t,1);return je(n,0,e),n}function Lf(e,t,n){if(e>t.length)throw new Error("count is greater than array length\\nParameter name: count");if(e===t.length)return Ln(n,0);{const r=e|0;return t.slice(r)}}function Yi(e,t,n){if(e<0)throw new Error("The input must be non-negative\\nParameter name: count");if(e>t.length)throw new Error("count is greater than array length\\nParameter name: count");return e===0?Ln(n,0):t.slice(0,0+e)}function dh(e,t){t.push(e)}function Bf(e,t){const n=ce(e);try{for(;n["System.Collections.IEnumerator.MoveNext"]();)dh(n["System.Collections.Generic.IEnumerator`1.get_Current"](),t)}finally{ie(n)}}function mh(e,t,n){const r=Of(t,e,void 0,void 0,n)|0;return r>-1?(t.splice(r,1),!0):!1}function hh(e,t,n){const r=t.length|0,s=Ln(n,r),o=Ln(n,r);let l=0,a=0;for(let c=0;c<=r-1;c++)e(T(c,t))?(je(s,l,T(c,t)),l=l+1|0):(je(o,a,T(c,t)),a=a+1|0);return[Ol(l,s),Ol(a,o)]}function wh(e,t){const n=t.find(e);return n==null?Df():d(n)}function Ur(e,t){return t.find(e)}function Ds(e,t){const n=t.findIndex(e)|0;if(n>-1)return n}function gh(e,t){return(r=>{e:for(;;){const s=r;if(s>=t.length)return Df();{const o=e(T(s,t));if(o!=null)return d(o);r=s+1;continue e}}})(0)}function Ch(e,t,n){const r=[];for(let s=0;s<=t.length-1;s++){const o=e(T(s,t));if(o!=null){const l=d(o);r.push(l)}}return Q(n,U())?r:q(s=>s,r,n)}function Vf(e,t,n){const r=e;return n.reduce(r,t)}function Ll(e,t){for(let n=0;n<=t.length-1;n++)e(n,T(n,t))}function ph(e,t){return t.every(e)}function yh(e,t){const n=e.slice();return n.sort((r,s)=>t.Compare(r,s)),n}function _h(e,t,n){const r=t.slice();return r.sort((s,o)=>n.Compare(e(s),e(o))),r}function Xi(e,t){const n=e.slice();return n.sort((r,s)=>t.Compare(r,s)*-1),n}function vh(e){const t=e.length|0,n=new Array(t),r=new Array(t);return Ll((s,o)=>{je(n,s,o[0]),je(r,s,o[1])},e),[n,r]}function Ea(e,t){e.length!==t.length&&Hf();const n=new Array(e.length);for(let r=0;r<=e.length-1;r++)je(n,r,[T(r,e),T(r,t)]);return n}function Ht(e,t,n){return t==null}function Sh(e){if(e.length===0)throw new Error("The input array was empty\\nParameter name: array");return T(0,e)}function bh(e){if(e.length!==0)return ue(T(0,e))}function T(e,t){if(e<0||e>=t.length)throw new Error("Index was outside the bounds of the array.\\nParameter name: index");return t[e]}function je(e,t,n){if(t<0||t>=e.length)throw new Error("Index was outside the bounds of the array.\\nParameter name: index");e[t]=n}function Lc(e,t){if(!(e<0||e>=t.length))return ue(t[e])}function Hs(e,t){const n=Array.isArray(e)?e:Array.from(e),r=n.length|0;if(r===0)return new Array(0);{const o=T(0,n).length|0;ph(a=>a.length===o,n)||Hf();const l=new Array(o);for(let a=0;a<=o-1;a++){je(l,a,Ln(t,r));for(let c=0;c<=r-1;c++)T(a,l)[c]=T(a,T(c,n))}return l}}class Eh{constructor(t,n){this.buf=[],ea(t)||this.buf.push(t)}toString(){return P("",this.buf)}}function Th(e,t){return new Eh(e,t)}function Bl(){return Th("",16)}function Ns(e,t){return e.buf.push(t),e}function ll(e,t){return e.buf.push(t),e.buf.push(`
`),e}function xh(e){throw new Error(e)}class jt extends st{constructor(t,n){super(),this.head=t,this.tail=n}toString(){return"["+P("; ",this)+"]"}Equals(t){const n=this;return n===t?!0:((s,o)=>{e:for(;;){const l=s,a=o,c=l.tail,i=a.tail;if(c!=null)if(i!=null){const u=d(c),w=d(i);if(Q(l.head,a.head)){s=u,o=w;continue e}else return!1}else return!1;else return i==null}})(n,t)}GetHashCode(){return((r,s,o)=>{e:for(;;){const l=r,a=s,c=o,i=c.tail;if(i!=null){const u=d(i);if(l>18)return a|0;r=l+1,s=(a<<1)+at(c.head)+631*l,o=u;continue e}else return a|0}})(0,0,this)|0}toJSON(){const t=this;return Array.from(t)}CompareTo(t){return((s,o)=>{e:for(;;){const l=s,a=o,c=l.tail,i=a.tail;if(c!=null)if(i!=null){const u=d(c),w=d(i),g=ut(l.head,a.head)|0;if(g===0){s=u,o=w;continue e}else return g|0}else return 1;else return i!=null?-1:0}})(this,t)|0}GetEnumerator(){return $h(this)}[Symbol.iterator](){return cs(ce(this))}"System.Collections.IEnumerable.GetEnumerator"(){return ce(this)}}class Ah{constructor(t){this.xs=t,this.it=this.xs,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,n=t.it.tail;if(n!=null){const r=d(n);return t.current=t.it.head,t.it=r,!0}else return!1}"System.Collections.IEnumerator.Reset"(){const t=this;t.it=t.xs,t.current=U()}Dispose(){}}function $h(e){return new Ah(e)}function $t(){return new jt(U(),void 0)}function Ho(e,t){return new jt(e,t)}function Rn(e){return e.tail==null}function Bc(e){return((n,r)=>{e:for(;;){const s=n,l=r.tail;if(l!=null){n=s+1,r=d(l);continue e}else return s|0}})(0,e)|0}function cr(e){if(e.tail!=null)return e.head;throw new Error(kc+"\\nParameter name: list")}function qt(e){const t=e.tail;if(t!=null)return d(t);throw new Error(kc+"\\nParameter name: list")}function Ih(e,t){return((r,s)=>{e:for(;;){const o=r,l=s,a=l.tail;if(a!=null){if(o===t)return l.head;r=o+1,s=d(a);continue e}else throw new Error(ja+"\\nParameter name: index")}})(0,e)}function Rh(){throw new Error(lh)}function sn(){return $t()}function zt(e,t){return Ho(e,t)}function H(e){return Ho(e,$t())}function ae(e){return Rn(e)}function pr(e){return Bc(e)}function j(e){return cr(e)}function Nh(e){if(!Rn(e))return ue(cr(e))}function O(e){return qt(e)}function Fn(e){const t=Bc(e)|0,n=Dc(new Array(t),0,t,null);return((s,o)=>{e:for(;;){const l=s,a=o;if(!Rn(a)){je(n,l,cr(a)),s=l+1,o=qt(a);continue e}break}})(0,e),n}function ir(e,t,n){let r=t,s=n;for(;!Rn(s);)r=e(r,j(s)),s=qt(s);return r}function $o(e){return ir((t,n)=>Ho(n,t),$t(),e)}function Mh(e,t,n){return((s,o,l)=>{e:for(;;){const a=s,c=o,i=l;if(Rn(i))return c;s=a+1,o=e(a,c,cr(i)),l=qt(i);continue e}})(0,t,n)}function eu(e,t){ir((n,r)=>{e(r)},void 0,t)}function ot(e,t){let n=t;for(let r=e.length-1;r>=0;r--)n=Ho(T(r,e),n);return n}function I(e){return ot(e,$t())}function Vc(e){let t,n;if(In(e))return I(e);if(e instanceof jt)return e;{const r=$t();let s=r;const o=ce(e);try{for(;o["System.Collections.IEnumerator.MoveNext"]();){const c=o["System.Collections.Generic.IEnumerator`1.get_Current"]();s=(t=s,n=new jt(c,void 0),t.tail=n,n)}}finally{ie(o)}const l=s,a=$t();return l.tail=a,qt(r)}}function Vl(e,t){return ir((n,r)=>Ho(r,n),t,$o(e))}function kh(e,t){let n,r;const s=$t();let o=s,l=t;for(;!Rn(l);){let i=e(cr(l));for(;!Rn(i);)o=(n=o,r=new jt(cr(i),void 0),n.tail=r,r),i=qt(i);l=qt(l)}const a=o,c=$t();return a.tail=c,qt(s)}function Fh(e,t){const n=$t(),r=Mh((o,l,a)=>{const c=new jt(e(o,a),void 0);return l.tail=c,c},n,t),s=$t();return r.tail=s,qt(n)}function Ft(e,t){const n=$t(),r=ir((o,l)=>{const a=new jt(e(l),void 0);return o.tail=a,a},n,t),s=$t();return r.tail=s,qt(n)}function Pf(e,t){return(r=>{e:for(;;){const s=r;if(Rn(s))return;{const o=e(cr(s));if(o==null){r=qt(s);continue e}else return o}}})(t)}function Dh(e,t){const n=Pf(e,t);return n==null?Rh():d(n)}function tu(e,t){return Pf(n=>e(n)?ue(n):void 0,t)}function Hh(e,t){return((r,s)=>{e:for(;;){const o=r,l=s;if(Rn(l))return;if(e(cr(l)))return o;r=o+1,s=qt(l);continue e}})(0,t)}function Oh(e,t){return((r,s)=>{for(;;){const o=s;return Rn(o)?void 0:ue(cr(o))}})(0,t)}function Wa(e,t){return Ih(t,e)}function sa(e,t){const n=$t(),r=ir((o,l)=>{const a=e(l);if(a==null)return o;{const c=new jt(d(a),void 0);return o.tail=c,c}},n,t),s=$t();return r.tail=s,qt(n)}function Lh(e,t){let n,r;const s=$t();let o=s;for(let c=0;c<=e-1;c++)o=(n=o,r=new jt(t(c),void 0),n.tail=r,r);const l=o,a=$t();return l.tail=a,qt(s)}function Bh(e,t){if(Rn(t))throw new Error(kc);return ir(e,j(t),O(t))}function Gf(e,t){return Hh(e,t)!=null}function zf(e,t){const n=Fn(t);return n.sort(e),I(n)}function Vh(e,t,n){return zf((r,s)=>n.Compare(e(r),e(s)),t)}function Ph(e,t){return zf((n,r)=>t.Compare(n,r)*-1,e)}function Uf(e,t){e:for(;;){const n=e,r=t;if(n<=0)return r;if(Rn(r))throw new Error(Fc+"\\nParameter name: list");e=n-1,t=qt(r);continue e}}function qf(e,t){if(e<0)throw new Error(Ff+"\\nParameter name: count");const n=(l,a,c)=>{let i;e:for(;;){const u=l,w=a,g=c;if(u<=0)return w;if(Rn(g))throw new Error(Fc+"\\nParameter name: list");l=u-1,a=(i=new jt(cr(g),void 0),w.tail=i,i),c=qt(g);continue e}},r=$t(),s=n(e,r,t),o=$t();return s.tail=o,qt(r)}function Gh(e,t,n){const r=pr(n)|0;let s;const o=$(e,0)|0;s=o<0?0:o;let l;const a=$(t,r-1)|0;return l=a>=r?r-1:a,l<s?$t():qf(l-s+1,Uf(s,n))}function nu(e,t){if(e<0)throw new Error(Ff+"\\nParameter name: index");if(e>Bc(t))throw new Error(Fc+"\\nParameter name: index");return[qf(e,t),Uf(e,t)]}function zh(e){return I(q(I,Hs(q(Fn,Array.from(e)))))}const Uh="Enumeration already finished.",qh="Enumeration has not started. Call MoveNext.",jh="The input sequence was empty.",jf="The input sequence has an insufficient number of elements.",Wh="Reset is not supported on this enumerator.";function Kh(){throw new Error(Wh)}function Pc(){throw new Error(qh)}function Ka(){throw new Error(Uh)}class Jh{constructor(t){this.f=t}toString(){const t=this;let n=0,r="seq [";const s=ce(t);try{for(;n<4&&s["System.Collections.IEnumerator.MoveNext"]();)n>0&&(r=r+"; "),r=r+J(s["System.Collections.Generic.IEnumerator`1.get_Current"]()),n=n+1|0;return n===4&&(r=r+"; ..."),r+"]"}finally{ie(s)}}GetEnumerator(){return this.f()}[Symbol.iterator](){return cs(ce(this))}"System.Collections.IEnumerable.GetEnumerator"(){return this.f()}}function Zh(e){return new Jh(e)}class Qh{constructor(t,n,r){this.current=t,this.next=n,this.dispose=r}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current()}"System.Collections.IEnumerator.get_Current"(){return this.current()}"System.Collections.IEnumerator.MoveNext"(){return this.next()}"System.Collections.IEnumerator.Reset"(){Kh()}Dispose(){this.dispose()}}function Gc(e,t,n){return new Qh(e,t,n)}function Yh(e){let t,n,r=!1,s=!1,o;const l=()=>{if(s=!0,n!=null){const a=d(n);try{ie(a)}finally{n=void 0}}if(t!=null){const a=d(t);try{ie(a)}finally{t=void 0}}};return Gc(()=>(r?s&&Ka():Pc(),o!=null?d(o):Ka()),()=>{let a;if(r||(r=!0),s)return!1;{let c;for(;c==null;){const i=t,u=n;if(i!=null)if(u!=null){const w=d(u);if(w["System.Collections.IEnumerator.MoveNext"]())o=ue(w["System.Collections.Generic.IEnumerator`1.get_Current"]()),c=!0;else try{ie(w)}finally{n=void 0}}else{const w=d(i);w["System.Collections.IEnumerator.MoveNext"]()?n=(a=w["System.Collections.Generic.IEnumerator`1.get_Current"](),ce(a)):(l(),c=!1)}else t=ce(e)}return d(c)}},()=>{s||l()})}function Wf(e,t,n){let r=!1,s,o=ue(e());const l=()=>{if(o!=null){const c=d(o);try{n(c)}finally{o=void 0}}},a=()=>{try{l()}finally{s=void 0}};return Gc(()=>(r||Pc(),s!=null?d(s):Ka()),()=>{if(r||(r=!0),o!=null){const c=d(o);let i;try{i=t(c)}catch(u){throw a(),u}return i!=null?(s=i,!0):(a(),!1)}else return!1},l)}function Xh(e,t){let n,r=t;return Gc(()=>{if(n!=null){const s=d(n)[0];return d(n)[1],s}else return Pc()},()=>(n=e(r),n!=null?(d(n)[0],r=d(n)[1],!0):!1),()=>{})}function e2(e,t){t==null&&xh(e)}function Oo(e){return Zh(e)}function on(e){return e2("source",e),ce(e)}function m(e){return Oo(()=>ce(e()))}function oa(e){return Oo(()=>Yh(e))}function t2(e,t){return Oo(()=>Xh(e,t))}function M(){return m(()=>new Array(0))}function h(e){return m(()=>fh(e))}function n2(e){return e}function Ge(e){return e instanceof jt?Fn(e):Array.from(e)}function R(e){return In(e)?I(e):e instanceof jt?e:Vc(e)}function Kf(e,t,n){return Oo(()=>Wf(e,t,n))}function Jf(e,t,n){return Oo(()=>{let r=-1;return Wf(e,s=>(r=r+1|0,t(r,s)),n)})}function y(e,t){return oa([e,t])}function zc(e,t){return Kf(()=>on(t),n=>{let r;for(;r==null&&n["System.Collections.IEnumerator.MoveNext"]();)r=e(n["System.Collections.Generic.IEnumerator`1.get_Current"]());return r},n=>{ie(n)})}function r2(e,t,n){const r=on(t);try{const s=on(n);try{let o=0,l=r["System.Collections.IEnumerator.MoveNext"](),a=s["System.Collections.IEnumerator.MoveNext"]();for(;o===0&&l&&a;)o=e(r["System.Collections.Generic.IEnumerator`1.get_Current"](),s["System.Collections.Generic.IEnumerator`1.get_Current"]())|0,o===0&&(l=r["System.Collections.IEnumerator.MoveNext"](),a=s["System.Collections.IEnumerator.MoveNext"]());return(o!==0?o:l?1:a?-1:0)|0}finally{ie(s)}}finally{ie(r)}}function Uc(e,t){return zc(n=>{if(e(n))return ue(n)},t)}function gr(e,t){const n=on(t);try{let r=!1;for(;!r&&n["System.Collections.IEnumerator.MoveNext"]();)r=e(n["System.Collections.Generic.IEnumerator`1.get_Current"]());return r}finally{ie(n)}}function vl(e,t){const n=on(t);try{let r;for(;r==null&&n["System.Collections.IEnumerator.MoveNext"]();){const s=n["System.Collections.Generic.IEnumerator`1.get_Current"]();e(s)&&(r=ue(s))}return r}finally{ie(n)}}function Tr(e,t){const n=on(t);try{return(s=>{e:for(;;){const o=s;if(n["System.Collections.IEnumerator.MoveNext"]()){if(e(n["System.Collections.Generic.IEnumerator`1.get_Current"]()))return o;s=o+1;continue e}else return;break}})(0)}finally{ie(n)}}function la(e,t,n){const r=on(n);try{let s=t;for(;r["System.Collections.IEnumerator.MoveNext"]();)s=e(s,r["System.Collections.Generic.IEnumerator`1.get_Current"]());return s}finally{ie(r)}}function qc(e,t){return!gr(n=>!e(n),t)}function aa(e){if(In(e))return e.length===0;if(e instanceof jt)return ae(e);{const t=on(e);try{return!t["System.Collections.IEnumerator.MoveNext"]()}finally{ie(t)}}}function s2(e,t){if(In(t))return Lc(e,t);if(t instanceof jt)return Oh(e,t);{const n=on(t);try{return(s=>{e:for(;;){const o=s;if(n["System.Collections.IEnumerator.MoveNext"]()){if(o===0)return ue(n["System.Collections.Generic.IEnumerator`1.get_Current"]());s=o-1;continue e}else return;break}})(e)}finally{ie(n)}}}function o2(e,t){const n=s2(e,t);if(n==null)throw new Error(jf+"\\nParameter name: index");return d(n)}function le(e,t){la((n,r)=>{e(r)},void 0,t)}function Io(e,t){la((n,r)=>(e(n,r),n+1|0),0,t)}function l2(e){const t=on(e);try{const n=r=>{e:for(;;){const s=r;if(t["System.Collecti