@datagrok/bio 2.22.4 → 2.22.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var bio_test;(()=>{var e={8924:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var r=n(7362);class o extends r.e{static get Lesk(){return void 0===this.lesk&&(this.lesk=this.makePalette([[["G","A","S","T"],"orange"],[["C","V","I","L","P","F","Y","M","W"],"all_green"],[["N","Q","H"],"magenta"],[["D","E"],"red"],[["K","R"],"all_blue"]],!1,o)),this.lesk}static get GrokGroups(){return void 0===this.grokGroups&&(this.grokGroups=this.makePalette([[["C","U"],"yellow"],[["G","P"],"red"],[["A","V","I","L","M","F","Y","W"],"all_green"],[["R","H","K"],"light_blue"],[["D","E"],"dark_blue"],[["S","T","N","Q"],"orange"]],!1,o)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new o({D:"#E60A0A",E:"#E60A0A",C:"#E6E600",M:"#E6E600",K:"#145AFF",R:"#145AFF",S:"#FA9600",T:"#FA9600",F:"#3232AA",Y:"#3232AA",N:"#00DCDC",Q:"#00DCDC",G:"#EBEBEB",L:"#0F820F",V:"#0F820F",I:"#0F820F",A:"#C8C8C8",W:"#B45AB4",H:"#8282D2",P:"#DC9682",others:"#BEA06E"})),this.rasMol}get(e){const t=e in o.aaSynonyms?o.aaSynonyms[e]:e;return super.get(t)}}o.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class s{static getPalette(e="grok"){switch(e){case"grok":return o.GrokGroups;case"lesk":return o.Lesk;default:throw new Error(`ChemPalette: scheme \`${e}\` does not exist`)}}static getInnerOuter(e){let t=0,n="",r="";for(const o of e)"("==o?t++:")"==o?t--:t?n+=o:r+=o;return isNaN(parseInt(n))?[r,n]:[r,""]}static getColorAAPivot(e="",t="grok"){const n=this.getPalette(t);let[r,o]=this.getInnerOuter(e);if(r=r.length>6?`${r.slice(0,3)}...`:r,o=o.length>6?`${o.slice(0,3)}...`:o,1==e.length||"("==e[1]){const t=e[0]?.toUpperCase();return t in n?[n.get(t),t,o,1]:[this.undefinedColor,r,o,1]}if("d"==e[0]&&e[1]in n&&(2==e.length||"("==e[2])){const t=e[1]?.toUpperCase();return t in n?[n.get(t),t,o,2]:[this.undefinedColor,r,o,2]}if(e.substring(0,3)in this.AAFullNames&&(3==e.length||"("==e[3])){const t=this.AAFullNames[e.substring(0,3)];return t in n?[n.get(t),t,o,3]:[this.undefinedColor,r,o,3]}if(e[0]?.toLowerCase()==e[0]&&e.substring(1,3)in this.AAFullNames&&(4==e.length||"("==e[4])){const t=this.AAFullNames[e.substring(1,3)];return t in n?[n.get(t),t,o,4]:[this.undefinedColor,r,o,4]}return[this.undefinedColor,r,o,0]}}s.SemType="Aminoacids",s.SemTypeMultipleAlignment="AminoacidsMultipleAlignment",s.undefinedColor="rgb(100,100,100)",s.Names={G:"Glycine",L:"Leucine",Y:"Tyrosine",S:"Serine",E:"Glutamic acid",Q:"Glutamine",D:"Aspartic acid",N:"Asparagine",F:"Phenylalanine",A:"Alanine",K:"Lysine",R:"Arginine",H:"Histidine",C:"Cysteine",V:"Valine",P:"Proline",W:"Tryptophan",I:"Isoleucine",M:"Methionine",T:"Threonine"},s.AASmiles={G:"NCC(=O)O",L:"N[C@H](CC(C)C)C(=O)O",Y:"NC(CC1=CC=C(O)C=C1)C(=O)O",S:"NC(CO)C(=O)O",E:"N[C@@H](CCC(O)=O)C(=O)O",Q:"N[C@@H](CCC(N)=O)C(=O)O",D:"N[C@@H](CC(O)=O)C(=O)O",N:"N[C@@H](CC(N)=O)C(=O)O",F:"NC(CC1=CC=CC=C1)C(=O)O",A:"N[C@H](C)C(=O)O",K:"NC(CCCCN)C(=O)O",R:"N[C@H](CCCNC(=N)C)C(=O)O",H:"NC(CC1=CN=C[N]1)C(=O)O",C:"N[C@@H](CS)C(=O)O",V:"NC(C(C)C)C(=O)O",P:"N(CCC1)C1C(=O)O",W:"N[C@@H](Cc1c2ccccc2n([H])c1)C(=O)O",I:"N[C@H]([C@H](C)CC)C(=O)O",M:"NC(CCSC)C(=O)O",T:"NC(C(O)C)C(=O)O"},s.AASmilesTruncated={G:"*C*",L:"CC(C)C[C@H](*)*",Y:"C1=CC(=CC=C1CC(*)*)O",S:"OCC(*)C*",E:"*[C@@H](CCC(O)=O)*",Q:"*N[C@@H](CCC(N)=O)*",D:"*[C@@H](CC(O)=O)*",N:"*[C@@H](CC(N)=O)*",F:"C1=CC=C(C=C1)CC(*)*",A:"C[C@H](*)*",K:"C(CCN)CC(*)*",R:"*[C@H](CCCNC(=N)C)*",H:"C1=C(NC=N1)CC(*)*",C:"C([C@@H](*)*)S",V:"CC(C)C(*)*",P:"C1CCN(*)C1*",W:"*[C@@H](Cc1c2ccccc2n([H])c1)*",I:"CC[C@H](C)[C@H](*)*",M:"CSCCC(*)*",T:"CC(O)C(*)*"},s.AAFullNames={Ala:"A",Arg:"R",Asn:"N",Asp:"D",Cys:"C",Gln:"Q",Glu:"E",Gly:"G",His:"H",Ile:"I",Leu:"L",Lys:"K",Met:"M",Phe:"F",Pro:"P",Ser:"S",Thr:"T",Trp:"W",Tyr:"Y",Val:"V"}},6717:(e,t,n)=>{"use strict";n.d(t,{j:()=>o});var r=n(6082);async function o(){const e=r.Func.find({package:"Chem",name:"getRdKitModule"});if(0===e.length)throw new Error('Package "Chem" must be installed for getRdKitModule.');return(await e[0].prepare().call()).getOutputParamValue()}},3599:(e,t,n)=>{"use strict";n.d(t,{o:()=>r.o});var r=n(6869)},9124:(e,t,n)=>{"use strict";n.d(t,{b2:()=>s,fA:()=>i});var r=n(7389),o=n(6082);async function s(){const e="Helm",t=o.Func.find({package:e,name:"getHelmHelper"});if(0===t.length)throw new Error(`Package '${e}' must be installed for HelmHelper.`);return(await t[0].prepare().call()).getOutputParamValue()}function i(e,t){if(!e)throw new Error("Argument 'a' of type Atom or HelmType is mandatory.");let n,r;const o=e;return"ATOM"===o.T?(n=o.biotype(),r=o.elem):(n=e,r=t),[n,r]}o.JsInputBase,Error,r.input.helmAsync=async function(e,t){return(await s()).createHelmInput(e,t)}},8438:(e,t,n)=>{"use strict";function r(e){return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e}n.d(t,{D:()=>r})},8123:(e,t,n)=>{"use strict";n.d(t,{u:()=>r});const r={V2K_RGP_SHIFT:8,V2K_RGP_LINE:"M RGP",V2K_A_LINE:"A ",V3K_COUNTS_SHIFT:14,V3K_IDX_SHIFT:7,V3K_HEADER_FIRST_LINE:"\nDatagrok macromolecule handler\n\n",V3K_HEADER_SECOND_LINE:" 0 0 0 0 0 0 999 V3000\n",V3K_BEGIN_CTAB_BLOCK:"M V30 BEGIN CTAB\n",V3K_END_CTAB_BLOCK:"M V30 END CTAB\n",V3K_BEGIN_COUNTS_LINE:"M V30 COUNTS ",V3K_COUNTS_LINE_ENDING:" 0 0 0\n",V3K_BEGIN_ATOM_BLOCK:"M V30 BEGIN ATOM\n",V3K_END_ATOM_BLOCK:"M V30 END ATOM\n",V3K_BEGIN_BOND_BLOCK:"M V30 BEGIN BOND\n",V3K_END_BOND_BLOCK:"M V30 END BOND\n",V3K_BOND_CONFIG:" CFG=",V3K_BEGIN_DATA_LINE:"M V30 ",V3K_END:"M END",PRECISION_FACTOR:1e4,DEOXYRIBOSE:{polymerType:"RNA",symbol:"d"},RIBOSE:{polymerType:"RNA",symbol:"r"},PHOSPHATE:{polymerType:"RNA",symbol:"p"},OXYGEN:"O",HYDROGEN:"H"}},4356:(e,t,n)=>{"use strict";n.d(t,{Eu:()=>a,ub:()=>i});var r=n(4328);const o="Libraries";let s=Promise.resolve();async function i(){let e;return s=s.then((async()=>{const t=r.userSettings.getValue(o,"Settings",!0);e=t?JSON.parse(t):{exclude:[],explicit:[],duplicateMonomerPreferences:{}},e.exclude=e.exclude instanceof Array?e.exclude:[],e.explicit=e.explicit instanceof Array?e.explicit:[],e.duplicateMonomerPreferences=e.duplicateMonomerPreferences instanceof Object?e.duplicateMonomerPreferences:{},console.debug(`Bio: getUserLibSettings()\n${JSON.stringify(e,void 0,2)}`)})),await s,e}async function a(e){s=s.then((async()=>{console.debug(`Bio: setUserLibSettings()\n${JSON.stringify(e,void 0,2)}`),r.userSettings.add(o,"Settings",JSON.stringify(e),!0)})),await s}},5553:(e,t,n)=>{"use strict";n.d(t,{Qc:()=>E,WN:()=>C});var r=n(1991),o=n.n(r);const s="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,i=new Set,a="object"==typeof process&&process?process:{},c=(e,t,n,r)=>{"function"==typeof a.emitWarning?a.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)};let l=globalThis.AbortController,u=globalThis.AbortSignal;if(void 0===l){u=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},l=class{constructor(){t()}signal=new u;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==a.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,c("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}Symbol("type");const d=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),h=e=>d(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?p:null:null;class p extends Array{constructor(e){super(e),this.fill(0)}}class m{heap;length;static#e=!1;static create(e){const t=h(e);if(!t)return[];m.#e=!0;const n=new m(e,t);return m.#e=!1,n}constructor(e,t){if(!m.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class f{#t;#n;#r;#o;#s;#i;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#c;#l;#u;#d;#h;#p;#m;#f;#g;#y;#b;#w;#v;#A;#E;#C;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#v,sizes:e.#b,keyMap:e.#l,keyList:e.#u,valList:e.#d,next:e.#h,prev:e.#p,get head(){return e.#m},get tail(){return e.#f},free:e.#g,isBackgroundFetch:t=>e.#T(t),backgroundFetch:(t,n,r,o)=>e.#S(t,n,r,o),moveToTail:t=>e.#_(t),indexes:t=>e.#P(t),rindexes:t=>e.#M(t),isStale:t=>e.#x(t)}}get max(){return this.#t}get maxSize(){return this.#n}get calculatedSize(){return this.#c}get size(){return this.#a}get fetchMethod(){return this.#s}get memoMethod(){return this.#i}get dispose(){return this.#r}get disposeAfter(){return this.#o}constructor(e){const{max:t=0,ttl:n,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:a,allowStale:l,dispose:u,disposeAfter:p,noDisposeOnSet:g,noUpdateTTL:y,maxSize:b=0,maxEntrySize:w=0,sizeCalculation:v,fetchMethod:A,memoMethod:E,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:_,ignoreFetchAbort:P}=e;if(0!==t&&!d(t))throw new TypeError("max option must be a nonnegative integer");const M=t?h(t):Array;if(!M)throw new Error("invalid max value: "+t);if(this.#t=t,this.#n=b,this.maxEntrySize=w||this.#n,this.sizeCalculation=v,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==E&&"function"!=typeof E)throw new TypeError("memoMethod must be a function if defined");if(this.#i=E,void 0!==A&&"function"!=typeof A)throw new TypeError("fetchMethod must be a function if specified");if(this.#s=A,this.#E=!!A,this.#l=new Map,this.#u=new Array(t).fill(void 0),this.#d=new Array(t).fill(void 0),this.#h=new M(t),this.#p=new M(t),this.#m=0,this.#f=0,this.#g=m.create(t),this.#a=0,this.#c=0,"function"==typeof u&&(this.#r=u),"function"==typeof p?(this.#o=p,this.#y=[]):(this.#o=void 0,this.#y=void 0),this.#A=!!this.#r,this.#C=!!this.#o,this.noDisposeOnSet=!!g,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!P,0!==this.maxEntrySize){if(0!==this.#n&&!d(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!d(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#N()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!a,this.ttlResolution=d(r)||0===r?r:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!d(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#$()}if(0===this.#t&&0===this.ttl&&0===this.#n)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#n){const e="LRU_CACHE_UNBOUNDED";(e=>!i.has(e))(e)&&(i.add(e),c("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,f))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#$(){const e=new p(this.#t),t=new p(this.#t);this.#v=e,this.#w=t,this.#L=(n,r,o=s.now())=>{if(t[n]=0!==r?o:0,e[n]=r,0!==r&&this.ttlAutopurge){const e=setTimeout((()=>{this.#x(n)&&this.#I(this.#u[n],"expire")}),r+1);e.unref&&e.unref()}},this.#R=n=>{t[n]=0!==e[n]?s.now():0},this.#O=(o,s)=>{if(e[s]){const i=e[s],a=t[s];if(!i||!a)return;o.ttl=i,o.start=a,o.now=n||r();const c=o.now-a;o.remainingTTL=i-c}};let n=0;const r=()=>{const e=s.now();if(this.ttlResolution>0){n=e;const t=setTimeout((()=>n=0),this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=o=>{const s=this.#l.get(o);if(void 0===s)return 0;const i=e[s],a=t[s];return i&&a?i-((n||r())-a):1/0},this.#x=o=>{const s=t[o],i=e[o];return!!i&&!!s&&(n||r())-s>i}}#R=()=>{};#O=()=>{};#L=()=>{};#x=()=>!1;#N(){const e=new p(this.#t);this.#c=0,this.#b=e,this.#k=t=>{this.#c-=e[t],e[t]=0},this.#G=(e,t,n,r)=>{if(this.#T(t))return 0;if(!d(n)){if(!r)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof r)throw new TypeError("sizeCalculation must be a function");if(n=r(t,e),!d(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n},this.#D=(t,n,r)=>{if(e[t]=n,this.#n){const n=this.#n-e[t];for(;this.#c>n;)this.#H(!0)}this.#c+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#c)}}#k=e=>{};#D=(e,t,n)=>{};#G=(e,t,n,r)=>{if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#f;this.#F(t)&&(!e&&this.#x(t)||(yield t),t!==this.#m);)t=this.#p[t]}*#M({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#m;this.#F(t)&&(!e&&this.#x(t)||(yield t),t!==this.#f);)t=this.#h[t]}#F(e){return void 0!==e&&this.#l.get(this.#u[e])===e}*entries(){for(const e of this.#P())void 0===this.#d[e]||void 0===this.#u[e]||this.#T(this.#d[e])||(yield[this.#u[e],this.#d[e]])}*rentries(){for(const e of this.#M())void 0===this.#d[e]||void 0===this.#u[e]||this.#T(this.#d[e])||(yield[this.#u[e],this.#d[e]])}*keys(){for(const e of this.#P()){const t=this.#u[e];void 0===t||this.#T(this.#d[e])||(yield t)}}*rkeys(){for(const e of this.#M()){const t=this.#u[e];void 0===t||this.#T(this.#d[e])||(yield t)}}*values(){for(const e of this.#P())void 0===this.#d[e]||this.#T(this.#d[e])||(yield this.#d[e])}*rvalues(){for(const e of this.#M())void 0===this.#d[e]||this.#T(this.#d[e])||(yield this.#d[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const n of this.#P()){const r=this.#d[n],o=this.#T(r)?r.__staleWhileFetching:r;if(void 0!==o&&e(o,this.#u[n],this))return this.get(this.#u[n],t)}}forEach(e,t=this){for(const n of this.#P()){const r=this.#d[n],o=this.#T(r)?r.__staleWhileFetching:r;void 0!==o&&e.call(t,o,this.#u[n],this)}}rforEach(e,t=this){for(const n of this.#M()){const r=this.#d[n],o=this.#T(r)?r.__staleWhileFetching:r;void 0!==o&&e.call(t,o,this.#u[n],this)}}purgeStale(){let e=!1;for(const t of this.#M({allowStale:!0}))this.#x(t)&&(this.#I(this.#u[t],"expire"),e=!0);return e}info(e){const t=this.#l.get(e);if(void 0===t)return;const n=this.#d[t],r=this.#T(n)?n.__staleWhileFetching:n;if(void 0===r)return;const o={value:r};if(this.#v&&this.#w){const e=this.#v[t],n=this.#w[t];if(e&&n){const t=e-(s.now()-n);o.ttl=t,o.start=Date.now()}}return this.#b&&(o.size=this.#b[t]),o}dump(){const e=[];for(const t of this.#P({allowStale:!0})){const n=this.#u[t],r=this.#d[t],o=this.#T(r)?r.__staleWhileFetching:r;if(void 0===o||void 0===n)continue;const i={value:o};if(this.#v&&this.#w){i.ttl=this.#v[t];const e=s.now()-this.#w[t];i.start=Math.floor(Date.now()-e)}this.#b&&(i.size=this.#b[t]),e.unshift([n,i])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const e=Date.now()-n.start;n.start=s.now()-e}this.set(t,n.value,n)}}set(e,t,n={}){if(void 0===t)return this.delete(e),this;const{ttl:r=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:i=this.sizeCalculation,status:a}=n;let{noUpdateTTL:c=this.noUpdateTTL}=n;const l=this.#G(e,t,n.size||0,i);if(this.maxEntrySize&&l>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#I(e,"set"),this;let u=0===this.#a?void 0:this.#l.get(e);if(void 0===u)u=0===this.#a?this.#f:0!==this.#g.length?this.#g.pop():this.#a===this.#t?this.#H(!1):this.#a,this.#u[u]=e,this.#d[u]=t,this.#l.set(e,u),this.#h[this.#f]=u,this.#p[u]=this.#f,this.#f=u,this.#a++,this.#D(u,l,a),a&&(a.set="add"),c=!1;else{this.#_(u);const n=this.#d[u];if(t!==n){if(this.#E&&this.#T(n)){n.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=n;void 0===t||s||(this.#A&&this.#r?.(t,e,"set"),this.#C&&this.#y?.push([t,e,"set"]))}else s||(this.#A&&this.#r?.(n,e,"set"),this.#C&&this.#y?.push([n,e,"set"]));if(this.#k(u),this.#D(u,l,a),this.#d[u]=t,a){a.set="replace";const e=n&&this.#T(n)?n.__staleWhileFetching:n;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0===r||this.#v||this.#$(),this.#v&&(c||this.#L(u,r,o),a&&this.#O(a,u)),!s&&this.#C&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}return this}pop(){try{for(;this.#a;){const e=this.#d[this.#m];if(this.#H(!0),this.#T(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#C&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}}}#H(e){const t=this.#m,n=this.#u[t],r=this.#d[t];return this.#E&&this.#T(r)?r.__abortController.abort(new Error("evicted")):(this.#A||this.#C)&&(this.#A&&this.#r?.(r,n,"evict"),this.#C&&this.#y?.push([r,n,"evict"])),this.#k(t),e&&(this.#u[t]=void 0,this.#d[t]=void 0,this.#g.push(t)),1===this.#a?(this.#m=this.#f=0,this.#g.length=0):this.#m=this.#h[t],this.#l.delete(n),this.#a--,t}has(e,t={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,o=this.#l.get(e);if(void 0!==o){const e=this.#d[o];if(this.#T(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#x(o))return n&&this.#R(o),r&&(r.has="hit",this.#O(r,o)),!0;r&&(r.has="stale",this.#O(r,o))}else r&&(r.has="miss");return!1}peek(e,t={}){const{allowStale:n=this.allowStale}=t,r=this.#l.get(e);if(void 0===r||!n&&this.#x(r))return;const o=this.#d[r];return this.#T(o)?o.__staleWhileFetching:o}#S(e,t,n,r){const o=void 0===t?void 0:this.#d[t];if(this.#T(o))return o;const s=new l,{signal:i}=n;i?.addEventListener("abort",(()=>s.abort(i.reason)),{signal:s.signal});const a={signal:s.signal,options:n,context:r},c=(r,o=!1)=>{const{aborted:i}=s.signal,c=n.ignoreFetchAbort&&void 0!==r;if(n.status&&(i&&!o?(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),i&&!c&&!o)return u(s.signal.reason);const l=d;return this.#d[t]===d&&(void 0===r?l.__staleWhileFetching?this.#d[t]=l.__staleWhileFetching:this.#I(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,a.options))),r},u=r=>{const{aborted:o}=s.signal,i=o&&n.allowStaleOnFetchAbort,a=i||n.allowStaleOnFetchRejection,c=a||n.noDeleteOnFetchRejection,l=d;if(this.#d[t]===d&&(c&&void 0!==l.__staleWhileFetching?i||(this.#d[t]=l.__staleWhileFetching):this.#I(e,"fetch")),a)return n.status&&void 0!==l.__staleWhileFetching&&(n.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw r};n.status&&(n.status.fetchDispatched=!0);const d=new Promise(((t,r)=>{const i=this.#s?.(e,o,a);i&&i instanceof Promise&&i.then((e=>t(void 0===e?void 0:e)),r),s.signal.addEventListener("abort",(()=>{n.ignoreFetchAbort&&!n.allowStaleOnFetchAbort||(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))}))})).then(c,(e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e)))),h=Object.assign(d,{__abortController:s,__staleWhileFetching:o,__returned:void 0});return void 0===t?(this.set(e,h,{...a.options,status:void 0}),t=this.#l.get(e)):this.#d[t]=h,h}#T(e){if(!this.#E)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof l}async fetch(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:i=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:f=!1,status:g,signal:y}=t;if(!this.#E)return g&&(g.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:o,status:g});const b={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:i,size:a,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:h,status:g,signal:y};let w=this.#l.get(e);if(void 0===w){g&&(g.fetch="miss");const t=this.#S(e,w,b,m);return t.__returned=t}{const t=this.#d[w];if(this.#T(t)){const e=n&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const o=this.#x(w);if(!f&&!o)return g&&(g.fetch="hit"),this.#_(w),r&&this.#R(w),g&&this.#O(g,w),t;const s=this.#S(e,w,b,m),i=void 0!==s.__staleWhileFetching&&n;return g&&(g.fetch=o?"stale":"refresh",i&&o&&(g.returnedStale=!0)),i?s.__staleWhileFetching:s.__returned=s}}async forceFetch(e,t={}){const n=await this.fetch(e,t);if(void 0===n)throw new Error("fetch() returned undefined");return n}memo(e,t={}){const n=this.#i;if(!n)throw new Error("no memoMethod provided to constructor");const{context:r,forceRefresh:o,...s}=t,i=this.get(e,s);if(!o&&void 0!==i)return i;const a=n(e,i,{options:s,context:r});return this.set(e,a,s),a}get(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:s}=t,i=this.#l.get(e);if(void 0!==i){const t=this.#d[i],a=this.#T(t);return s&&this.#O(s,i),this.#x(i)?(s&&(s.get="stale"),a?(s&&n&&void 0!==t.__staleWhileFetching&&(s.returnedStale=!0),n?t.__staleWhileFetching:void 0):(o||this.#I(e,"expire"),s&&n&&(s.returnedStale=!0),n?t:void 0)):(s&&(s.get="hit"),a?t.__staleWhileFetching:(this.#_(i),r&&this.#R(i),t))}s&&(s.get="miss")}#V(e,t){this.#p[t]=e,this.#h[e]=t}#_(e){e!==this.#f&&(e===this.#m?this.#m=this.#h[e]:this.#V(this.#p[e],this.#h[e]),this.#V(this.#f,e),this.#f=e)}delete(e){return this.#I(e,"delete")}#I(e,t){let n=!1;if(0!==this.#a){const r=this.#l.get(e);if(void 0!==r)if(n=!0,1===this.#a)this.#U(t);else{this.#k(r);const n=this.#d[r];if(this.#T(n)?n.__abortController.abort(new Error("deleted")):(this.#A||this.#C)&&(this.#A&&this.#r?.(n,e,t),this.#C&&this.#y?.push([n,e,t])),this.#l.delete(e),this.#u[r]=void 0,this.#d[r]=void 0,r===this.#f)this.#f=this.#p[r];else if(r===this.#m)this.#m=this.#h[r];else{const e=this.#p[r];this.#h[e]=this.#h[r];const t=this.#h[r];this.#p[t]=this.#p[r]}this.#a--,this.#g.push(r)}}if(this.#C&&this.#y?.length){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}return n}clear(){return this.#U("delete")}#U(e){for(const t of this.#M({allowStale:!0})){const n=this.#d[t];if(this.#T(n))n.__abortController.abort(new Error("deleted"));else{const r=this.#u[t];this.#A&&this.#r?.(n,r,e),this.#C&&this.#y?.push([n,r,e])}}if(this.#l.clear(),this.#d.fill(void 0),this.#u.fill(void 0),this.#v&&this.#w&&(this.#v.fill(0),this.#w.fill(0)),this.#b&&this.#b.fill(0),this.#m=0,this.#f=0,this.#g.length=0,this.#c=0,this.#a=0,this.#C&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}}}function g(e){window.$monomerHover=e}var y=n(2003),b=n(6077),w=n(3561),v=n(9235);const A="MonomerHoverLinks";async function E(e,t,n,r,s,i=!1){const a=r.getSeqHandler(e),c=a.alphabet==y.YI.RNA||a.alphabet==y.YI.DNA,l=a.isHelm()&&c,u=!a.isHelm()&&c,d=e=>null==e?null:l?i?e:Math.floor(e/3):u&&i?3*e+1:e,h=i?await r.getHelmToMolfileConverter(n):null,p=new f({max:100});function m(e,t){const a=e.get(t);if(null==a)return null;let c=p.get(a);return c||p.set(a,c=function(e,t){const a=r.getSeqHandler(e);if(i){const e=a.getHelm(t);return r.helmToAtomicLevelSingle(e,h,!1,!1).monomers}{const e=a.getSplitted(t),r=a.defaultBiotype,i=o().count(0).take(e.length).map((t=>({position:t,symbol:e.getCanonical(t),biotype:r}))).toArray(),c=a.alphabet,l=c==y.YI.RNA||c==y.YI.DNA?"RNA":"PEPTIDE",u=(0,b.eM)([i],l,c,n,s);return(0,w.gU)(i,u,c,l).monomers}}(e,t)),c}const E={targetCol:t,handler:(t,r,o)=>{const s=o.grid,i=t.tableRowIndex,a=t.gridRow,c=s.cell(o.name,a),l=null!==(u=window.$monomerHover)&&void 0!==u?u:null;var u;if(!l||l&&(l.dataFrameId!=e.dataFrame.id||l.gridRowIdx!=a||l.seqColName!=e.name||l.seqPosition!=r?.position)){if(l&&(g(null),l.gridCell.render()),!r)return g(null),!0;g({gridCell:c,dataFrameId:e.dataFrame.id,gridRowIdx:a,seqColName:e.name,seqPosition:d(r?.position)??-1,getSubstruct:()=>{if(!r||"*"===r.symbol)return;const t=m(e,i);if(!t)return;const o=t.get(d(r?.position));return o?(0,v.H)([o],n):{atoms:[],bonds:[],highlightAtomColors:[],highlightBondColors:[]}}}),c.render()}return!0},getSubstruct:r=>{if("true"!=t.getTag(".sequence-src-highlight-monomers"))return;if(null==r)return;if(!e.get(r))return;const o=m(e,r);return o?(0,v.H)(o.values(),n):void 0}};return function(e,t){let n=e[A];n||(n=e[A]=[]),n.push(t),e[A]=n}(e.temp,E),function(e,t){let n=e["substruct-providers"];n||(n=e["substruct-providers"]=[]),n.push(t),e["substruct-providers"]=n}(t.temp,E),E}function C(e,t){try{const n=e.tableColumn;if(!n)return;const r=function(e){return e.temp[A]??[]}(n);for(let n=r.length-1;n>=0;--n){const o=r[n],s=e.grid.col(o.targetCol.name);if(s&&!o.handler(e,t,s))break}}catch(e){console.error(e)}}},6718:(e,t,n)=>{"use strict";n.d(t,{A7:()=>c,pj:()=>i});var r=n(6082),o=n(4328),s=n(6295);async function i(){const e=r.Func.find({package:"Bio",name:"getMonomerLibHelper"});if(0===e.length)throw new Error('Package "Bio" must be installed for MonomerLibHelper.');return(await e[0].prepare().call()).getOutputParamValue()}async function a(e){const t=(await i()).getMonomerLib(),n=[],s={},a=e.map((e=>t.getMonomer("PEPTIDE",e)?.smiles??"")),c=r.Column.fromStrings("smiles",a);for(let t=0;t<a.length;++t){s[e[t]]=t;const r=a[t],i=""===r?new Array(a.length).fill(0):(await o.chem.getSimilarities(c,r)).getRawData();i[t]=1,n[t]=Array.from(i)}return{scoringMatrix:n,alphabetIndexes:s}}async function c(e,t="Morgan"){const n=(await i()).getMonomerLib(),o=new Array(e.length).fill(0).map((()=>new Array(e.length).fill(0))),c={},l=e.map((e=>n.getMonomer("PEPTIDE",e)?.molfile||n.getMonomer("PEPTIDE",e)?.smiles||"")),u=r.Func.find({package:"Chem",name:"getFingerprints"})[0];if(!u)return console.warn('Function "Chem:getFingerprints" is not found in chem package. falling back to Morgan fingerprints'),await a(e);const d=r.Column.fromStrings("smiles",l),h=(r.DataFrame.fromColumns([d]),(await u.apply({col:d,fingerprintType:t}))?.entries);if(!h)return console.warn(`${t} Fingerprints could not be calculated for monomers from chem package.\n falling back to Morgan fingerprints`),await a(e);for(let t=0;t<h.length;++t)if(o[t][t]=1,c[e[t]]=t,h[t])for(let e=t+1;e<h.length;++e)h[e]&&(o[t][e]=o[e][t]=(0,s.$1)(h[t],h[e]));return{scoringMatrix:o,alphabetIndexes:c}}n(3151),n(3077),n(439)},6197:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var r=n(3599);function o(e){let t;switch(e){case r.o.BASE:case r.o.SUGAR:case r.o.LINKER:case r.o.NUCLEOTIDE:case"nucleotide":t="RNA";break;case r.o.AA:t="PEPTIDE";break;case r.o.CHEM:t="CHEM";break;case r.o.BLOB:t="BLOB";break;default:t="PEPTIDE",console.warn(`Unexpected HelmType '${e}'`)}return t}},9235:(e,t,n)=>{"use strict";n.d(t,{H:()=>l,R:()=>c});var r=n(6082),o=n(1991),s=n.n(o),i=n(330),a=n(3599);async function c(e,t,o,c,l,u,d){const h=e.length,p=e.dataFrame,m=Math.max(navigator.hardwareConcurrency-2,1),f=new Array(m).fill(null).map((()=>new Worker(new URL(n.p+n.u(455),n.b)))),g=h/m,y=new Array(m),b=u.getSeqHandler(e),w="RNA"==c?a.o.NUCLEOTIDE:a.o.AA,v=s().count(0).take(e.length).map((e=>{const t=b.getSplitted(e);return s().count(0).take(t.length).map((e=>({position:e,symbol:t.getCanonical(e),biotype:w}))).toArray()})).toArray();for(let e=0;e<m;e++){const n=f[e],r=Math.floor(e*g),s=e===m-1?h:Math.floor((e+1)*g);y[e]=new Promise((e=>{n.onmessage=t=>{e(t.data)}})),n.postMessage({seqList:v,monomersDict:t,alphabet:o,polymerType:c,start:r,end:s})}const A=[],E=[];await Promise.all(y).then((e=>{for(const t of e)A.push(...t.molfiles),E.push(...t.warnings)})),setTimeout((()=>{f.forEach((e=>{e.terminate()}))}),0);const C=(0,i.qj)(p,e.name),T=r.Column.fromType(r.COLUMN_TYPE.STRING,C,e.length).init((e=>A[e]?.molfile));return T.semType=r.SEMTYPE.MOLECULE,T.meta.units=r.UNITS.Molecule.MOLBLOCK,T.setTag(".sequence-src-col",e.name),{molCol:T,warnings:E}}function l(e,t){const n={},o={};for(const s of e){const e=t.getWebEditorMonomer(s.biotype,s.symbol).backgroundcolor,a=(0,i.vG)(e??r.Color.toRgb(r.Color.mouseOverRows))??[1,0,0,.7];for(const e of s.atoms)n[e]=a;for(const e of s.bonds)o[e]=a}return{atoms:Object.keys(n).map((e=>parseInt(e))),bonds:Object.keys(o).map((e=>parseInt(e))),highlightAtomColors:n,highlightBondColors:o}}},3561:(e,t,n)=>{"use strict";n.d(t,{Hb:()=>c,YN:()=>f,gU:()=>l});var r=n(8123),o=n(294),s=n(3151),i=n(439),a=n(6197);function c(e,t,n){const o=new Map;for(const a of e.getMonomerSymbolsByType(t)){const c=e.getMonomer(t,a);if("RNA"===t&&("Branch"===c.monomerType||n===i.YI.DNA&&c.symbol===r.u.DEOXYRIBOSE.symbol||n===i.YI.RNA&&c.symbol===r.u.RIBOSE.symbol||c.symbol===r.u.PHOSPHATE.symbol)||"PEPTIDE"===t&&"Branch"!==c.monomerType){const e={};s.f6.forEach((t=>{e[t]=c[t]})),o.set(c.symbol,e)}}return o}function l(e,t,n,s){if(0===e.length)return o.vF.createEmpty();const c=m,{atomCount:l,bondCount:d,needsCapping:p}=c(e,t,n,s),g=new Array(l),y=new Array(d);let b,w=null,v=null;"PEPTIDE"===s?b=u:(b=h,w=n===i.YI.DNA?(0,o.xb)(t,r.u.DEOXYRIBOSE):(0,o.xb)(t,r.u.RIBOSE),v=(0,o.xb)(t,r.u.PHOSPHATE));const A={i:0,nodeShift:0,bondShift:0,backbonePositionShift:new Array(2).fill(0),branchPositionShift:new Array(2).fill(0),backboneAttachNode:0,branchAttachNode:0,flipFactor:1},E={sugar:w,phosphate:v,seqLength:e.length,atomCount:l,bondCount:d},C=new o.Cg,T=[];let S=0;for(A.i=0;A.i<E.seqLength;++A.i){const n=e[A.i];if(n.symbol===i._S)continue;const r=(0,o.xb)(t,{symbol:n.symbol,polymerType:(0,a.Y)(n.biotype)}),s=A.nodeShift,c=A.bondShift;b(r,g,y,A,E),r.stereoAtoms?.forEach((e=>T.push(e+S))),S+=r.atoms.x.length;const l=A.nodeShift-s,u=new Array(l);for(let e=0;e<l;++e)u[e]=s+e;const d=A.bondShift-c,h=new Array(d);for(let e=0;e<d;++e)h[e]=c+e;C.set(A.i,{biotype:n.biotype,symbol:n.symbol,atoms:u,bonds:h})}p&&function(e,t,n,o){const s=n.nodeShift+1;e[o.atomCount]=r.u.V3K_BEGIN_DATA_LINE+s+" "+r.u.OXYGEN+" "+f(n.backbonePositionShift[0])+" "+n.flipFactor*f(n.backbonePositionShift[1])+" 0.000000 0\n";const i=n.backboneAttachNode,a=s;t[o.bondCount]=r.u.V3K_BEGIN_DATA_LINE+n.bondShift+" 1 "+i+" "+a+"\n"}(g,y,A,E);const _=r.u.V3K_BEGIN_COUNTS_LINE+l+" "+d+r.u.V3K_COUNTS_LINE_ENDING;let P="";return P+=r.u.V3K_HEADER_FIRST_LINE,P+=r.u.V3K_HEADER_SECOND_LINE,P+=r.u.V3K_BEGIN_CTAB_BLOCK,P+=_,P+=r.u.V3K_BEGIN_ATOM_BLOCK,P+=g.join(""),P+=r.u.V3K_END_ATOM_BLOCK,P+=r.u.V3K_BEGIN_BOND_BLOCK,P+=y.join(""),P+=r.u.V3K_END_BOND_BLOCK,T.length>0&&(P+=function(e){const t=[];let n=`M V30 MDLV30/STEABS ATOMS=(${e.length}`;for(let r=0;r<e.length;r++){const o=`${n} ${e[r]}`;o.length>76?(t.push(`${n} -\n`),n=`M V30 ${e[r]}`):n=o,r===e.length-1&&t.push(`${n})\n`)}return`M V30 BEGIN COLLECTION\n${t.join("")}M V30 END COLLECTION\n`}(T)),P+=r.u.V3K_END_CTAB_BLOCK,P+=r.u.V3K_END,{molfile:P,monomers:C}}function u(e,t,n,r){r.flipFactor=(-1)**(r.i%2),d(e,t,n,r)}function d(e,t,n,o){!function(e,t,n){for(let o=0;o<e.atoms.atomTypes.length;++o){const s=n.nodeShift+o+1;t[n.nodeShift+o]=r.u.V3K_BEGIN_DATA_LINE+s+" "+e.atoms.atomTypes[o]+" "+f(n.backbonePositionShift[0]+e.atoms.x[o])+" "+f(n.backbonePositionShift[1]+n.flipFactor*e.atoms.y[o])+" "+e.atoms.kwargs[o]}}(e,t,o),p(e,n,o),function(e,t,n){if(0!==n.backboneAttachNode){const o=n.bondShift,s=n.backboneAttachNode,i=e.meta.terminalNodes[0]+n.nodeShift;t[n.bondShift-1]=r.u.V3K_BEGIN_DATA_LINE+o+" 1 "+s+" "+i+"\n"}}(e,n,o),null!==e.meta.branchShift&&e.meta.terminalNodes.length>2&&function(e,t){t.branchAttachNode=t.nodeShift+e.meta.terminalNodes[2];for(let n=0;n<2;++n)t.branchPositionShift[n]=t.backbonePositionShift[n]+e.meta.branchShift[n]}(e,o),function(e,t){t.backboneAttachNode=t.nodeShift+e.meta.terminalNodes[1],t.bondShift+=e.bonds.atomPairs.length+1,t.nodeShift+=e.atoms.atomTypes.length,t.backbonePositionShift[0]+=e.meta.backboneShift?.[0]??0,t.backbonePositionShift[1]+=t.flipFactor*(e.meta.backboneShift?.[1]??0)}(e,o)}function h(e,t,n,o,s){if(0===o.i)d(s.sugar,t,n,o);else for(const e of[s.phosphate,s.sugar])d(e,t,n,o);!function(e,t,n,o){(function(e,t,n){for(let o=0;o<e.atoms.atomTypes.length;++o){const s=n.nodeShift+o+1;t[n.nodeShift+o]=r.u.V3K_BEGIN_DATA_LINE+s+" "+e.atoms.atomTypes[o]+" "+f(n.branchPositionShift[0]+e.atoms.x[o])+" "+f(n.branchPositionShift[1]+n.flipFactor*e.atoms.y[o])+" "+e.atoms.kwargs[o]}})(e,t,o),p(e,n,o),function(e,t,n){const o=n.bondShift,s=n.branchAttachNode,i=e.meta.terminalNodes[0]+n.nodeShift;t[o-1]=r.u.V3K_BEGIN_DATA_LINE+o+" 1 "+s+" "+i+"\n"}(e,n,o);const s=o.bondShift,i=o.branchAttachNode,a=e.meta.terminalNodes[0]+o.nodeShift;n[s-1]=r.u.V3K_BEGIN_DATA_LINE+s+" 1 "+i+" "+a+"\n",o.bondShift+=e.bonds.atomPairs.length+1,o.nodeShift+=e.atoms.atomTypes.length}(e,t,n,o)}function p(e,t,n){for(let o=0;o<e.bonds.atomPairs.length;++o){const s=n.bondShift+o+1,i=e.bonds.atomPairs[o][0]+n.nodeShift,a=e.bonds.atomPairs[o][1]+n.nodeShift;let c="";if(e.bonds.bondConfiguration.has(o)){let t=e.bonds.bondConfiguration.get(o);n.flipFactor<0&&(t=1===t?3:1),c=" CFG="+t}const l=e.bonds.kwargs.has(o)?" "+e.bonds.kwargs.get(o):"";t[n.bondShift+o]=r.u.V3K_BEGIN_DATA_LINE+s+" "+e.bonds.bondTypes[o]+" "+i+" "+a+c+l+"\n"}}function m(e,t,n,s){let c=0,l=0,u=0,d=!0,h=null;for(const n of e)if(n.symbol!==i._S){if("*"==n.symbol)throw new Error("Gap canonical symbol is '', not '*");h=(0,o.xb)(t,{symbol:n.symbol,polymerType:(0,a.Y)(n.biotype)}),c+=h.atoms.x.length,l+=h.bonds.bondTypes.length,u++}if("PEPTIDE"===s)c+=1,l+=u,u>0&&(h?.meta?.rNodes?.length??0)<2&&(d=!1,c-=1,l-=1);else{const s=n===i.YI.DNA?(0,o.xb)(t,r.u.DEOXYRIBOSE):(0,o.xb)(t,r.u.RIBOSE),a=(0,o.xb)(t,r.u.PHOSPHATE);c+=(e.length-1)*a.atoms.x.length,c+=e.length*s.atoms.x.length,c+=1,l+=(e.length-1)*a.bonds.bondTypes.length,l+=e.length*s.bonds.bondTypes.length,l-=1,l+=3*e.length}return{atomCount:c,bondCount:l,needsCapping:d}}function f(e){return Math.round(r.u.PRECISION_FACTOR*e)/r.u.PRECISION_FACTOR}},6077:(e,t,n)=>{"use strict";n.d(t,{C4:()=>m,eM:()=>f});var r=n(4328),o=n(6082),s=n(1991),i=n.n(s),a=n(439),c=n(3561),l=n(9235),u=n(294),d=n(9192),h=n(330),p=n(8123);async function m(e,t,n,s,c){if(t.semType!==o.SEMTYPE.MACROMOLECULE)return{molCol:null,warnings:[`Only the ${o.SEMTYPE.MACROMOLECULE} columns can be converted to atomic level, the chosen column has semType '${t.semType}'`]};let u=t;const p=s.getSeqHandler(t);let m,g;p.notation!==a.Hi.SEPARATOR&&(u=p.convert(a.Hi.SEPARATOR,"."),u.name=t.name);try{g=s.getSeqHandler(u).alphabet,m=(0,h.pz)(g)}catch(e){const[t,n]=(0,d.AP)(e);return{molCol:null,warnings:[t]}}const y=function(e,t){const n=e.length,o=new Array(n),s=t.getSeqHandler(e);let a=!1;const c=s.defaultBiotype;for(let e=0;e<n;++e){const t=s.getSplitted(e);a||(a=0===t.length),o[e]=i().count(0).take(t.length).filter((e=>!t.isGap(e))).map((e=>({position:e,biotype:c,symbol:t.getCanonical(e)}))).toArray()}return a&&r.shell.warning(`Some values in the "${e.name}" column are empty`),o}(u,s),b=f(y,m,g,n,c),w=u.length,v=await(0,l.R)(u,b,g,m,n,s,c);return v.warnings.length>.05*w&&r.shell.warning(`Molfile conversion resulted in ${v.warnings.length} errors`),v}function f(e,t,n,r,o){const s=(0,c.Hb)(r,t,n),i={},l={value:null};if("RNA"===t){const e=n===a.YI.RNA?[p.u.RIBOSE,p.u.PHOSPHATE]:[p.u.DEOXYRIBOSE,p.u.PHOSPHATE];for(const n of e)g(i,n.symbol,s,o,t,l)}for(let n=0;n<e.length;++n){const r=e[n];for(const e of r){const n=e.symbol;if(""!==n)try{if("RNA"===t&&3===n.split(/\(|\)/).filter((e=>!!e)).length){const e=n.split(/\(|\)/)[1];g(i,e,s,o,t,l),i[t]?.[e]&&(i[t][n]=i[t][e])}else g(i,n,s,o,t,l)}catch(e){const t=e instanceof Error?e.message:e.toString(),r=e instanceof Error?e.stack:void 0;throw console.error(`bio lib: getMonomersDictFromLib() sym='${n}', error:\n${t}\n${r}`),new Error(`Can't get monomer '${n}' from library: ${t}`)}}}return i}function g(e,t,n,r,o,s){const i={polymerType:o,symbol:t};if(!(0,u.bq)(e,i)){const a=function(e,t,n,r,o){if(t.has(e)){const i=t.get(e),a=function(e){const t=[];for(const n of e){let e=n.capGroupSmiles;e||(e=n.capGroupSMILES),e=e.replace(/(\[|\]|\*|:|\d)/g,"").replace("OH","O").replace("Oh","O"),t.push(e)}return t}(i.rgroups),l=(s=i.molfile).includes("V3000")?function(e){const t=new Map,n=/M V30 (\d+) R#.+RGROUPS=\((\d+) (\d+)\).*/gm;let r;for(;null!==(r=n.exec(e));)r.index===n.lastIndex&&n.lastIndex++,t.set(parseInt(r[1]),parseInt(r[3]));return t}(s):function(e){const t=new Map;let n=e.indexOf(p.u.V2K_A_LINE,0),r=n;for(;-1!==n;){r=e.indexOf("\n",n);const o=parseInt(e.substring(n,r).replace(/^A\s+/,""));n=e.indexOf("R",r),r=e.indexOf("\n",n);const s=parseInt(e.substring(n,r).replace(/^R/,""));t.set(o,s),n=e.indexOf(p.u.V2K_A_LINE,r)}for(n=e.indexOf(p.u.V2K_RGP_LINE,0),r=e.indexOf("\n",n);-1!==n;){n+=p.u.V2K_RGP_SHIFT,r=e.indexOf("\n",n);const o=e.substring(n,r).replaceAll(/\s+/g," ").split(" ").map((e=>parseInt(e))).slice(1);for(let e=0;e<o.length;e+=2){if(t.has(o[e])&&t.get(o[e])!==o[e+1])throw new Error(`r-group index ${o[e]} has already been added with a different value`);t.set(o[e],o[e+1])}n=e.indexOf(p.u.V2K_RGP_LINE,r)}return t}(s),u=i.molfile.includes("V3000")?i.molfile:function(e,t){const n=t.get_mol(function(e){return e.split("\n").map((e=>{const t=e.indexOf(" R# "),n=e.indexOf(" R ");if(-1===t&&-1===n)return e;const r=-1!==t?t:n,o=e.split("");for(let e=r+5;e<o.length;e++)" "!==o[e]&&(o[e]="0");return o.join("")})).join("\n")}(e)),r=n.get_v3Kmolblock();return n.delete(),r}(function(e){let t=e.indexOf(p.u.V2K_A_LINE,0);-1===t&&(t=e.indexOf(p.u.V2K_RGP_LINE));const n=e.indexOf(p.u.V3K_END,t);return e.substring(0,t)+e.substring(n)}(i.molfile),n),d=function(e){let t=(e=e.replaceAll("\r","")).indexOf(p.u.V3K_BEGIN_COUNTS_LINE)+p.u.V3K_COUNTS_SHIFT,n=e.indexOf(" ",t+1);const r=parseInt(e.substring(t,n));return t=n+1,n=e.indexOf(" ",t+1),{atomCount:r,bondCount:parseInt(e.substring(t,n))}}(u),h=function(e,t){const n=new Array(t),r=new Float32Array(t),o=new Float32Array(t),s=new Array(t);let i=e.indexOf(p.u.V3K_BEGIN_ATOM_BLOCK);i=e.indexOf("\n",i);let a=i;for(let c=0;c<t;c++){i=e.indexOf(p.u.V3K_BEGIN_DATA_LINE,i)+p.u.V3K_IDX_SHIFT,a=e.indexOf(" ",i),i=a+1,a=e.indexOf(" ",i),n[c]=e.substring(i,a);const t=new Array(2);for(let n=0;n<2;++n)i=a+1,a=e.indexOf(" ",i),t[n]=parseFloat(e.substring(i,a));r[c]=t[0],o[c]=t[1],i=a,a=e.indexOf("\n",i)+1,s[c]=e.slice(i,a),i=a}return{atomTypes:n,x:r,y:o,kwargs:s}}(u,d.atomCount),m=function(e,t){const n=new Uint32Array(t),r=new Array(t),o=new Map,s=new Map;let i=e.indexOf(p.u.V3K_BEGIN_BOND_BLOCK);i=e.indexOf("\n",i);let a=i;for(let c=0;c<t;++c){const t=new Array(3);i=e.indexOf(p.u.V3K_BEGIN_DATA_LINE,a)+p.u.V3K_IDX_SHIFT,a=e.indexOf(" ",i);for(let n=0;n<3;++n)i=a+1,a=Math.min(e.indexOf("\n",i),e.indexOf(" ",i)),t[n]=parseInt(e.slice(i,a));n[c]=t[0],r[c]=t.slice(1);const l=e.indexOf("\n",i);let u=e.slice(a,l),d=u.indexOf(p.u.V3K_BOND_CONFIG);if(-1!==d){d=u.indexOf("=",d)+1;let e=u.indexOf(" ",d);-1===e&&(e=u.length);const t=parseInt(u.slice(d,e));o.set(c,t);const n=p.u.V3K_BOND_CONFIG+t.toString();u=u.replace(n,"")}u||s.set(c,u)}return{bondTypes:n,atomPairs:r,bondConfiguration:o,kwargs:s}}(u,d.bondCount),f=function(e,t,n,r){const o={backboneShift:null,branchShift:null,terminalNodes:[],rNodes:[]};if(n&&r&&[1,2].some((e=>!Array.from(r.values()).find((t=>t==e))))){const t=[1,2].find((e=>!Array.from(r.values()).find((t=>t==e)))),o=[1,2].find((e=>Array.from(r.values()).find((t=>t==e)))),s=Array.from(r.keys()).find((e=>r.get(e)===o))-1,i=e.x[s],a=e.y[s],c=e.x.reduce(((t,n,r)=>{if(r===s)return t;const o=e.y[r];return Math.sqrt((n-i)**2+(o-a)**2)>Math.sqrt((e.x[t]-i)**2+(e.y[t]-a)**2)?r:t}),0);if(r.set(c+1,t),1===t)n.unshift(e.atomTypes[c]);else{if(2!==t)throw new Error(`Unexpected missing R-group: ${t}`);n.splice(1,0,e.atomTypes[c])}}return function(e,t,n){for(const[r,o]of n)e.atomTypes[r-1]=t[o-1]}(e,n,r),function(e,t){t.rNodes=Array.from(e.keys());for(let n=0;n<t.rNodes.length;n++)for(const r of[1,2])if(e.get(t.rNodes[n])===r){const e=t.rNodes[r-1];t.rNodes[r-1]=t.rNodes[n],t.rNodes[n]=e}}(r,o),y(t,o),o}(h,m,a,l),g=function(e){let t=[],n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(");for(;-1!==n;){n+=28;const r=e.indexOf(")",n);t=t.concat(e.substring(n,r).split(" ").slice(1).map((e=>parseInt(e)))),n=r,n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(",n)}return t}(u),w={atoms:h,bonds:m,meta:f,stereoAtoms:g};return"PEPTIDE"===r?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,r=e.atoms.x,o=e.atoms.y;_(e,-r[t],-o[t]);const s=E(r[n],o[n]);C(e.atoms,-s),r[e.meta.rNodes[1]-1]<0&&T(e);const i=function(e){const t=function(e){const t=new Map;for(const n of e.bonds.atomPairs)for(let e=0;e<2;e++){const r=n[e],o=n[(e+1)%2];t.has(r)?t.get(r)?.push(o):t.set(r,new Array(1).fill(o))}return t}(e);let n=0;const r=e.atoms.atomTypes.length;let o=0;if(e.meta.terminalNodes.length<2)return null;for(;0===n;){const s=t.get(e.meta.terminalNodes[1])[o];if(e.atoms.atomTypes[s-1]===p.u.OXYGEN&&s!==e.meta.rNodes[1]&&(n=s),o++,o>r)return null}return n}(e);null!=i&&(function(e,t){e.atoms.y[e.meta.rNodes[1]-1]<0&&e.atoms.y[t-1]<0&&(function(e){S(e,!0)}(e),C(e.atoms,-function(e,t){return E(e,t)+Math.PI/2}(e.atoms.x[e.meta.terminalNodes[1]-1],e.atoms.y[e.meta.terminalNodes[1]-1])))}(e,i),function(e,t){const n=e.atoms.x;n[e.meta.rNodes[1]-1]>n[t-1]&&function(e,t,n){const r=t-1,o=n-1,s=e.atoms.x,i=e.atoms.y,a=s[r],c=i[r];s[r]=s[o],i[r]=i[o],s[o]=a,i[o]=c}(e,t,e.meta.rNodes[1])}(e,i))}(w):e===p.u.RIBOSE.symbol||e===p.u.DEOXYRIBOSE.symbol?function(e,t){const n=e.atoms.x,r=e.atoms.y;let o=e.meta.terminalNodes[0]-1;const s=e.meta.rNodes[1]-1;_(e,-n[o],-r[o]);const i=E(n[e.meta.rNodes[2]-1],r[e.meta.rNodes[2]-1]);C(e.atoms,-i),n[e.meta.rNodes[0]-1]>n[e.meta.rNodes[1]-1]&&T(e);const a=E(n[s],r[s]);C(e.atoms,3*Math.PI/2-a),t.value=function(e){const t=e.atoms.x,n=e.atoms.y,r=e.meta.rNodes[2]-1,o=e.meta.terminalNodes[2]-1,s=t[r]-t[o],i=n[r]-n[o];return Math.atan2(s,i)}(e),o=e.meta.terminalNodes[0]-1,_(e,-n[o],-r[o])}(w,o):e===p.u.PHOSPHATE.symbol?function(e){const t=e.meta.rNodes[1]-1,n=e.meta.rNodes[0]-1,r=e.atoms.x,o=e.atoms.y;_(e,-r[t],-o[t]);const s=E(r[n],o[n]);C(e.atoms,Math.PI/2-s)}(w):function(e,t){const n=e.atoms.x,r=e.atoms.y,o=e.meta.terminalNodes[0]-1,s=e.meta.rNodes[0]-1;_(e,-n[o],-r[o]);const i=E(n[s],r[s]),a=t.value;if(!a)throw new Error("The value of sugarBranchToOYAngle is null");C(e.atoms,Math.PI-i+a);const l=function(e,t){return(0,c.YN)(Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2))}({x:n[e.meta.rNodes[0]-1],y:r[e.meta.rNodes[0]-1]},{x:n[e.meta.terminalNodes[0]-1],y:r[e.meta.terminalNodes[0]-1]});if(1!=l)for(let e=0;e<n.length;++e)n[e]=(0,c.YN)(n[e]/l),r[e]=(0,c.YN)(r[e]/l)}(w,o),function(e,t,n){"PEPTIDE"===e?(b(t,e),v(t,t.meta.rNodes[1])):n===p.u.RIBOSE.symbol||n===p.u.DEOXYRIBOSE.symbol?(v(t,t.meta.rNodes[1]),t.meta.rNodes[1]=t.meta.terminalNodes[1],y(t.bonds,t.meta),b(t,e),v(t,t.meta.rNodes[1]),v(t,t.meta.rNodes[0]),v(t,t.meta.rNodes[2])):n===p.u.PHOSPHATE.symbol&&(t.meta.terminalNodes[0]=t.meta.rNodes[0],_(t,-t.atoms.x[t.meta.terminalNodes[0]-1],-t.atoms.y[t.meta.terminalNodes[0]-1]),b(t,e),v(t,t.meta.rNodes[1]))}(r,w,e),function(e){let t=0;for(;t<e.atoms.atomTypes.length;)e.atoms.atomTypes[t]===p.u.HYDROGEN&&(v(e,t+1),--t),++t}(w),function(e){let t=0;for(;t<e.atoms.atomTypes.length;)"oh"===e.atoms.atomTypes[t]?.toLowerCase()&&(e.atoms.atomTypes[t]="O"),"?"===e.atoms.atomTypes[t]&&(e.atoms.atomTypes[t]="H"),++t}(w),function(e){const t=" RGROUPS=(1 1)";for(let n=0;n<(e.atoms.kwargs?.length??0);n++){const r=e.atoms.kwargs[n];r&&r.includes(t)&&(e.atoms.kwargs[n]=r.replace(t,""))}}(w),w}var s;return null}(t,n,r,o,s);if(!a)throw new Error(`Monomer with symbol '${t}' is absent the monomer library`);(0,u.LQ)(e,i,a)}}function y(e,t){const n=t.rNodes;t.terminalNodes=new Array(n.length).fill(0);const r=t.terminalNodes,o=e.atomPairs;let s=0,i=0;for(;s<o.length&&i<r.length;){for(let e=0;e<r.length;++e)for(let t=0;t<2;++t)o[s][t]===n[e]&&(r[e]=o[s][(t+1)%2],n.length,++i);++s}}function b(e,t){e.meta.rNodes.length>1&&(e.meta.backboneShift=w(e,e.meta.rNodes[1]-1,e.meta.terminalNodes[0]-1)),"RNA"===t&&e.meta.rNodes.length>2&&(e.meta.branchShift=w(e,e.meta.rNodes[2]-1,e.meta.terminalNodes[0]-1))}function w(e,t,n){return[(0,c.YN)(e.atoms.x[t]-e.atoms.x[n]),(0,c.YN)(e.atoms.y[t]-e.atoms.y[n])]}function v(e,t){if(void 0!==t){const n=t-1,r=e.atoms,o=e.bonds,s=e.meta;r.atomTypes.splice(n,1),r.x=A(Float32Array,r.x,n,1),r.y=A(Float32Array,r.y,n,1),r.kwargs.splice(n,1);for(let e=0;e<s.terminalNodes.length;++e)s.terminalNodes[e]>t?--s.terminalNodes[e]:s.terminalNodes[e]===t&&(s.terminalNodes[e]=-1);for(let e=0;e<s.rNodes.length;++e)s.rNodes[e]>t?--s.rNodes[e]:s.rNodes[e]===t&&(s.rNodes[e]=-1);let i=0;for(;i<o.atomPairs.length;){const e=o.atomPairs[i][0],n=o.atomPairs[i][1];e===t||n===t?(o.atomPairs.splice(i,1),o.bondTypes=A(Uint32Array,o.bondTypes,i,1),o.bondConfiguration.has(i)&&o.bondConfiguration.delete(i),o.kwargs.has(i)&&o.kwargs.delete(i),--i):(o.atomPairs[i][0]=e>t?e-1:e,o.atomPairs[i][1]=n>t?n-1:n),++i}let a=Array.from(o.bondConfiguration.keys());a.forEach((e=>{if(o.bondConfiguration.has(e)&&e>n){const t=o.bondConfiguration.get(e);o.bondConfiguration.delete(e),o.bondConfiguration.set(e-1,t)}})),a=Array.from(o.kwargs.keys()),a.forEach((e=>{if(o.kwargs.has(e)&&e>n){const t=o.kwargs.get(e);o.kwargs.delete(e),o.kwargs.set(e-1,t)}}))}}function A(e,t,n,r){const o=new e(t.length-r);let s=0,i=0;for(;s<t.length;)s===n&&(s+=r),o[i]=t[s],++i,++s;return o}function E(e,t){let n;if(0===e)n=t>0?0:Math.PI;else if(0===t)n=e>0?-Math.PI/2:Math.PI/2;else{const r=t/e,o=Math.atan(r);n=e<0?Math.PI/2+o:-Math.PI/2+o}return n}function C(e,t){if(0!==t){const n=e.x,r=e.y,o=Math.cos(t),s=Math.sin(t);for(let e=0;e<n.length;++e){const t=n[e];n[e]=(0,c.YN)(t*o-r[e]*s),r[e]=(0,c.YN)(t*s+r[e]*o)}}}function T(e){S(e,!1)}function S(e,t){if(t){const t=e.atoms.y;for(let e=0;e<t.length;e++)t[e]=-t[e]}else{const t=e.atoms.x;for(let e=0;e<t.length;e++)t[e]=-t[e]}const n=e.bonds.bondConfiguration;for(const[e,t]of n){const r=1===t?3:1;n.set(e,r)}}function _(e,t,n){const r=e.atoms.x,o=e.atoms.y;for(let e=0;e<r.length;++e)r[e]=(0,c.YN)(r[e]+t),void 0!==n&&(o[e]=(0,c.YN)(o[e]+n))}},294:(e,t,n)=>{"use strict";function r(e,t){return e[t.polymerType]?.[t.symbol]}function o(e,t){return!!e[t.polymerType]?.[t.symbol]}function s(e,t,n){let r=e[t.polymerType];r||(r=e[t.polymerType]={}),r[t.symbol]=n}n.d(t,{Cg:()=>i,LQ:()=>s,bq:()=>o,vF:()=>a,xb:()=>r});class i extends Map{constructor(e){super(e)}}class a{constructor(e,t){this.molfile=e,this.monomers=t}static createEmpty(){return new a("",new i(null))}}},330:(e,t,n)=>{"use strict";n.d(t,{pz:()=>s,qj:()=>o,vG:()=>i});var r=n(2003);function o(e,t){return function(e,t){return e?e.columns.getUnusedName(t):t}(e,`molfile(${t})`)}function s(e){let t;if(e===r.YI.PT||e===r.YI.UN)t="PEPTIDE";else{if(e!==r.YI.RNA&&e!==r.YI.DNA)throw new Error(`Unexpected alphabet '${e}'.`);t="RNA"}return t}function i(e){const t=7===e.length?/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e):/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16)/256,parseInt(t[2],16)/256,parseInt(t[3],16)/256,t.length>4?parseInt(t[4],16)/256:.3]:null}},1093:(e,t,n)=>{"use strict";n.d(t,{A:()=>o,Q:()=>s});var r=n(7362);class o extends r.e{static get Chromatogram(){return void 0===this.chromatogram&&(this.chromatogram=new o({A:"green",C:"blue",G:"black",T:"red",U:"red",others:"gray"})),this.chromatogram}}class s{}s.SemType="Nucleotides",s.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",s.Names={A:"Adenine",C:"Cytosine",G:"Guanine",T:"Thymine",U:"Uracil"}},7362:(e,t,n)=>{"use strict";n.d(t,{e:()=>r});class r{static makePalette(e,t=!1,n=r){const o={};return e.forEach((e=>{const n=e[0],r=e[1];n.forEach(((e,n)=>{o[e]=this.colourPalette[r][t?0:n]}))})),new n(o)}constructor(e){this._palette=e}get(e,t){return this._palette[e]}}r.undefinedColor="rgb(100,100,100)",r.colourPalette={orange:["rgb(255,187,120)","rgb(245,167,100)","rgb(235,137,70)","rgb(205, 111, 71)"],all_green:["rgb(44,160,44)","rgb(74,160,74)","rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)","rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],all_blue:["rgb(31,119,180)","rgb(23,190,207)","rgb(122, 102, 189)","rgb(158,218,229)","rgb(141, 124, 217)","rgb(31, 120, 150)"],magenta:["rgb(162,106,192)","rgb(197,165,224)","rgb(208,113,218)"],red:["rgb(214,39,40)","rgb(255,152,150)"],st_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(31,119,180)"],dark_blue:["rgb(31,119,180)","rgb(31, 120, 150)"],light_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(108, 218, 229)","rgb(23,190,227)"],lilac_blue:["rgb(124,102,211)","rgb(149,134,217)","rgb(97, 81, 150)"],dark_green:["rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)"],green:["rgb(44,160,44)","rgb(74,160,74)"],light_green:["rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],st_green:["rgb(44,160,44)","rgb(152,223,138)","rgb(39, 174, 96)","rgb(74,160,74)"],pink:["rgb(247,182,210)"],brown:["rgb(140,86,75)","rgb(102, 62, 54)"],gray:["rgb(127,127,127)","rgb(199,199,199)","rgb(196,156,148)","rgb(222, 222, 180)"],yellow:["rgb(188,189,34)"],white:["rgb(230,230,230)"]}},4574:(e,t,n)=>{"use strict";n.d(t,{O:()=>s,n:()=>o});var r=n(1858);class o{constructor(e,t=!0,n){return this.substructure=e,this.readOnly=t,this.logger=n,new Proxy(this,{set:(e,t,n)=>{if(this.logger?.debug(`BioFilterProps.set ${t.toString()}( '${n}' )`),this.readOnly)throw new Error("Properties are immutable.");return e[t]=n,!0}})}}class s{constructor(){this.onChanged=new r.Subject,this._props=null,this._propsChanging=!1}get props(){return this._props||(this._props=this.emptyProps),this._props}set props(e){this._propsChanging=!0;try{this._props=e,this.applyProps(),this.onChanged.next()}finally{this._propsChanging=!1}}saveProps(){const e={};for(const[t,n]of Object.entries(this.props))"_onChanged"!==t&&"logger"!==t&&(e[t]=this.props[t]);return e}async detach(){}get filterSummary(){return this.props.substructure}get isFiltering(){return""!==this.props.substructure}resetFilter(){this.props=this.emptyProps,this.onChanged.next()}}},4152:(e,t,n)=>{"use strict";n.d(t,{$u:()=>c,oT:()=>d});var r=n(6082),o=n(7362),s=n(6718);function i(e,t=!0){if(null==e)return"rgb(100,100,100)";const n=r.Color.fromHtml(e);if(t){const e=r.Color.g(n),t=r.Color.r(n),o=r.Color.b(n),s=Math.sqrt(Math.pow(0-t,2)+Math.pow(0-e,2)+Math.pow(0-o,2));if(s>210)return`rgb(${t/s*210},${e/s*210},${o/s*210})`}return r.Color.toRgb(n)}class a{static hashCode(e){let t=0;if(0===e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}}class c{}class l extends c{get(e,t){return"#666666"}}class u extends c{static get palette(){return u._pallete||(u._pallete=u.buildPalette()),u._pallete}static buildPalette(){return(0,s.pj)().then((e=>{e.awaitLoaded(1/0).then((()=>{const t=e.getMonomerLib();t.onChanged.subscribe((()=>{u.customMonomerColors={},u.polymerTypes=t.getPolymerTypes();for(const e of this.polymerTypes){const n=t.getMonomerSymbolsByType(e);for(const r of n){const n=t.getMonomer(e,r);n?.meta?.colors?.default?.background&&(this.customMonomerColors[r]||(this.customMonomerColors[r]={}),this.customMonomerColors[r][e]=i(n.meta.colors.default.background))}}}))}))})),[].concat(...Object.values(o.e.colourPalette))}get(e,t){const n=u.palette.length,r=u.customMonomerColors[e],o=t??"PEPTIDE";if(r&&r[o])return r[o];const s=a.hashCode(e)%n;return i(u.palette[s])}}u._pallete=null,u.customMonomerColors={},u.polymerTypes=[];class d extends o.e{static get Gray(){return void 0===this.gray&&(this.gray=new l),this.gray}static get Color(){return void 0===this.color&&(this.color=new u),this.color}}},6642:(e,t,n)=>{"use strict";n.d(t,{BG:()=>i,sD:()=>c});var r=n(4328),o=n(1858),s=n(8070);function i(e){let t=null,n=null;try{n=e.dart?e.gridColumn:null,t=n?n.temp:null}catch{[n,t]=[null,null]}const r=e.cell.column;if(t=t??(r?r.temp:null),!t)throw new Error("Grid cell renderer back store (GridColumn or Column) not found.");return[n,r,t]}class a{onKeyDown(e,t){}onKeyPress(e,t){}onMouseEnter(e,t){}onMouseLeave(e,t){}onMouseDown(e,t){}onMouseUp(e,t){}onMouseMove(e,t){}onClick(e,t){}onDoubleClick(e,t){}}class c extends a{constructor(e,t,n){super(),this.gridCol=e,this.tableCol=t,this.logger=n,this.subs=[],this.dirty=!0,this.destroyed=!1,this.viewerId=++c.viewerCounter,this.errors=[],this._onRendered=new o.Subject,this.tableCol&&this.tableCol.dataFrame&&(this.subs.push(this.tableCol.dataFrame.onDataChanged.subscribe((()=>{this.dirty=!0}))),this.subs.push(this.tableCol.dataFrame.onColumnsRemoved.subscribe((e=>{try{this.destroyed||!this.tableCol||this.tableCol.dataFrame||this.destroy()}catch(e){this.logger.error(e)}})))),this.tableCol&&this.subs.push(r.events.onTableRemoved.subscribe((e=>{try{const t=e.args.dataFrame;this.tableCol?.dataFrame.id!==t.id||this.destroyed||this.destroy()}catch(e){this.logger.error(e)}}))),this.gridCol&&this.subs.push(r.events.onViewRemoving.subscribe((e=>{try{const t=e.args.view;this.gridCol?.dart&&this.gridCol.grid&&this.gridCol?.grid?.dart&&this.gridCol?.grid?.view?.id===t.id&&!this.destroyed&&this.destroy()}catch(e){this.logger.error(e)}})))}toLog(){return`${this.constructor.name}<${this.viewerId}>`}destroy(){for(const e of this.subs)e.unsubscribe();this.destroyed=!0}invalidateGrid(){this.gridCol&&this.gridCol.dart&&this.gridCol.grid?.invalidate()}reset(){this.dirty=!1}get onRendered(){return this._onRendered}invalidate(e){this.invalidateGrid()}async awaitRendered(e=1e4,t=`${e} timeout`){const n=`${this.toLog()}.awaitRendered()`;if(this.logger.debug(`${n}, start, testEvent before`),await(0,s.PE)(this._onRendered,(()=>{}),(()=>{this.invalidate()}),e,`${n}, ${t}`),this.errors.length>0){const e=this.errors[0];throw this.errors=[],e}this.logger.debug(`${n}, end`)}}c.viewerCounter=-1},673:(e,t,n)=>{"use strict";n.d(t,{s:()=>r});const r={true:"1",false:"0"}},6882:(e,t,n)=>{"use strict";n.d(t,{Bb:()=>b,Jy:()=>w,S$:()=>y,U0:()=>v});var r=n(7389),o=n(6082),s=n(1991),i=n.n(s),a=n(8312),c=n(2003),l=n(6642),u=n(6718),d=n(9192),h=n(3856),p=n(673),m=n(3599),f=n(5553),g=n(9713);const y="rgb(100,100,100)";function b(e,t,n){if((n??0)>0&&t<(e[0]??0)+n)return-1;t-=n??0;let r,o=100,s=0,i=e.length-1;for(;s<=i;){if(r=Math.floor((i+s)/2),e[r]<=t&&t<e[r+1])return r;if(t<e[r]?i=r-1:s=r+1,--o<=0)throw new Error(`Get position for pointer x = ${t} searching has not converged on ${JSON.stringify(e)}. `)}return null}class w extends l.sD{get separatorWidth(){return this.props?.fontCharWidth?this.props?.fontCharWidth:5}constructor(e,t,n,r,s){if(super(e,t,n),this.monomerLengthLimit=r,this.propsProvider=s,this.colWidth=0,this._monomerLengthList=null,this._processedMaxVisibleSeqLength=0,this._monomerLengthMap={},this._monomerStructureMap={},this._ellipsisBounds=void 0,this._totalLinesNeeded=0,this._lineHeight=20,this._cellBounds=new Map,this.sysMonomerLib=null,this.padding=5,this._leftThreeDotsPadding=0,this.props=this.propsProvider(),this._processedRows=o.BitSet.create(this.tableCol.length),this.gridCol&&this.subs.push(this.gridCol.grid.onAfterDrawContent.subscribe((()=>{this._onRendered.next()}))),this.tableCol&&this.gridCol){this.subs.push(this.tableCol.dataFrame.onCurrentRowChanged.subscribe((()=>{-1===this.tableCol.dataFrame.currentRowIdx&&(this.tableCol.temp["reference-sequence"]=null,this.tableCol.temp["current-word"]=null,this.invalidateGrid())})));const e=[c.gp.positionShift,"renderMultiline"];this.subs.push(o.debounce(this.tableCol.dataFrame.onMetadataChanged.pipe(g.filter((t=>t.args.source===this.tableCol&&e.includes(t.args.key)))),200).subscribe((e=>{this.reset()}))),this.subs.push(o.debounce(this.tableCol.dataFrame.onMetadataChanged.pipe(g.filter((e=>e.args.source===this.tableCol&&e.args.key===c.gp.positionShift))),200).subscribe((e=>{this.reset()})))}}calculateFontBasedSpacing(e){const t=e.measureText("M");let n=12;if(this.tableCol?.temp[".mm.cellRenderer.fontSize"]){const e=this.tableCol.temp[".mm.cellRenderer.fontSize"];"number"!=typeof e||isNaN(e)||(n=Math.max(e,1))}return{lineHeight:Math.max(1.4*n,t.fontBoundingBoxAscent+t.fontBoundingBoxDescent+4),monomerSpacing:Math.max(2,.2*this.props.fontCharWidth)}}shouldUseMultilineRendering(e){return"true"===e.getTag("renderMultiline")}calculateMultiLineLayoutDynamic(e,t,n,r,o,s){if(this.dirty)try{this.reset()}catch(e){const[t,n]=(0,d.AP)(e);this.logger.error(t,void 0,n)}const{lineHeight:i,monomerSpacing:a}=this.calculateFontBasedSpacing(e),c=t-2*this.padding;let l=0;const u=[];if(r.length>0)for(let t=o;t<r.length;t++){const n=r.getOriginal(t),o=this.props.monomerToShort(n,s);u.push({text:o,posIdx:t}),l=Math.max(l,e.measureText(o).width)}if(0===u.length)return{lineLayouts:[],lineHeight:i};const h=l;let p=Math.floor((c+a)/(h+a));p=Math.max(1,p);const m=n-2*this.padding,f=Math.max(0,Math.floor(m/i)),g=[];let y=0;for(let e=0;e<f&&y<u.length;e++){const t=[];for(let e=0;e<p&&y<u.length;e++){const n=u[y],r=this.padding+e*(h+a);t.push({posIdx:n.posIdx,x:r,width:h,om:n.text,isSeparator:!1}),y++}g.push({lineIdx:e,elements:t})}return{lineLayouts:g,lineHeight:i}}async init(){await Promise.all([(async()=>{this.seqHelper=await(0,a.Q)(),this.invalidateGrid()})(),(async()=>{const e=await(0,u.pj)();this.sysMonomerLib=e.getMonomerLib()})()]),this.subs.push(this.sysMonomerLib.onChanged.subscribe((()=>{this.reset()}))),this.reset()}static getFontSettings(e){let t=12;return e&&e.temp[".mm.cellRenderer.fontSize"]&&"number"==typeof e.temp[".mm.cellRenderer.fontSize"]&&!isNaN(e.temp[".mm.cellRenderer.fontSize"])&&(t=Math.max(e.temp[".mm.cellRenderer.fontSize"],1)),{font:`${t}px monospace`,fontWidth:.6*t}}toLog(){return`MonomerPlacer<${this.viewerId}>`}getMonomerLib(){return this.tableCol.temp[".mm.cellRenderer.overriddenLibrary"]??this.sysMonomerLib}reset(){this.propsProvider&&(this.props=this.propsProvider()),this._processedRows=o.BitSet.create(this.tableCol.length),this._monomerLengthList=null,this._monomerLengthMap={},this._monomerStructureMap={},this._cellBounds.clear(),super.reset(),this.invalidateGrid()}invalidateGrid(){this.gridCol&&this.gridCol.dart&&this.gridCol.grid?.invalidate()}getCellMonomerLengths(e,t){const n=this.seqHelper.getSeqHandler(this.tableCol);if(this.colWidth<t&&(this.colWidth=t,this.dirty=!0),this.dirty)try{this.reset()}catch(e){const[t,n]=(0,d.AP)(e);this.logger.error(t,void 0,n)}const r=n.isMsa()?this.getCellMonomerLengthsForSeqMsa():this.getCellMonomerLengthsForSeq(e);return[r,this.getSummedMonomerLengths(r)]}getSummedMonomerLengths(e){const t=new Array(e.length+1);t[0]=this.padding;for(let n=1;n<t.length;n++)t[n]=t[n-1]+e[n-1];let n=t[0];for(let e=1;e<t.length;e++)t[e]?n=t[e]:t[e]=n;return t}getCellMonomerLengthsForSeqValue(e,t){const n=this.seqHelper.getSeqHandler(this.tableCol),r=this.props.separatorWidth+1*this.props.fontCharWidth,o=this.positionShift,s=Math.ceil(t/r)+o,i=n.splitter(e),a=Math.min(s,i.length),c=new Array(a-o);let l=0;for(let e=o;e<a;++e){const r=i.getOriginal(e),s=this.props.monomerToShort(r,this.monomerLengthLimit),a=(n.isSeparator()?this.separatorWidth:this.props.separatorWidth)+s.length*this.props.fontCharWidth;if(c[e-o]=a,l+=a,l>t)break}return c}getCellMonomerLengthsForSeq(e){this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(this.tableCol.length).fill(null));const t=this.positionShift,n=this.seqHelper.getSeqHandler(this.tableCol),r=this.props.separatorWidth+1*this.props.fontCharWidth,o=Math.ceil(this.colWidth/r)+t,s=n.getSplitted(e),i=Math.min(o,s.length);let a=this._monomerLengthList[e];if(null===a||a.length!=i-t){a=this._monomerLengthList[e]=new Array(s.length);let r=0;for(let e=t;e<i;++e){const o=s.getOriginal(e),i=this.props.monomerToShort(o,this.monomerLengthLimit),c=(n.isSeparator()?this.separatorWidth:this.props.separatorWidth)+i.length*this.props.fontCharWidth;if(a[e-t]=c,r+=c,r>this.colWidth)break}}return a}getCellMonomerLengthsForSeqMsa(){var e;this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(1).fill(null)),(e=this._monomerLengthList)[0]??(e[0]=new Array(0));const t=this._monomerLengthList[0],{startIdx:n,endIdx:r}=(()=>{try{const e=this.gridCol&&this.gridCol.dart?this.gridCol.grid:null;return e&&e.dart?{startIdx:Math.max(Math.floor((e?.vertScroll.min??0)-10),0),endIdx:Math.min(Math.ceil((e?.vertScroll.max??0)+10),this.tableCol.length)}:{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}catch(e){return{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}})(),o=this.props.separatorWidth+1*this.props.fontCharWidth,s=this.positionShift,i=Math.ceil(this.colWidth/o)+s;for(let e=n;e<r;e++){if(this._processedRows.get(e)&&i<=this._processedMaxVisibleSeqLength)continue;const n=this.seqHelper.getSeqHandler(this.tableCol).getSplitted(e,i),r=Math.min(i,n.length);r-s>t.length&&t.push(...new Array(r-s-t.length).fill(o));let a=0;for(let e=s;e<r;++e){const r=n.getOriginal(e),o=this.props.monomerToShort(r,this.monomerLengthLimit),i=this.props.separatorWidth+o.length*this.props.fontCharWidth;if(t[e-s]=Math.max(t[e-s]??0,i),a+=i,a>=this.colWidth)break}this._processedMaxVisibleSeqLength=Math.max(this._processedMaxVisibleSeqLength,i),this._processedRows.set(e,!0)}return t}getPosition(e,t,n,r){const[o,s]=this.getCellMonomerLengths(e,n);return 0===this.seqHelper.getSeqHandler(this.tableCol).getSplitted(e).length?null:b(s,t,r)}setMonomerLengthLimit(e){this.monomerLengthLimit!=e&&(this.monomerLengthLimit=e,this.dirty=!0)}setSeparatorWidth(e){this.separatorWidth!=e&&(this.props.separatorWidth=e,this.dirty=!0)}get positionShift(){const e=Number.parseInt(this.tableCol?.tags[c.gp.positionShift]??"0")??0;return isNaN(e)?0:Math.max(e,0)}render(e,t,n,r,s,a,l){const u=a.grid?.canvas===e.canvas;if(!this.seqHelper)return;const m=this.tableCol,f=this.positionShift;e.save();try{const l=this.seqHelper.getSeqHandler(m);let d=this.monomerLengthLimit;if(h.gp.maxMonomerLength in m.tags){const e=parseInt(m.getTag(h.gp.maxMonomerLength));d=!isNaN(e)&&e?e:50}if(m.temp[".mm.cellRenderer.settingsChanged"]===p.s.true||this.monomerLengthLimit!=d){let e=0;const t=8;e=m.temp[".mm.cellRenderer.gapLength"]??e,this.setMonomerLengthLimit(d),this.setSeparatorWidth(l.isMsa()?t:e),m.temp[".mm.cellRenderer.settingsChanged"]=p.s.false,this.dirty=!0}const g=a.cell.rowIndex,b=a.cell.value;u&&(r=v(a.grid,e,t,r,window.devicePixelRatio)),e.beginPath(),e.rect(t,n,r,s),e.clip(),e.font=this.props?.font??"12px monospace",e.textBaseline="top";const w=m.meta.units,A=m.getTag(c.gp.aligned),E=m.getTag(c.gp.separator)??"",C=u?l.getSplitted(g):l.splitter(b);let T=h.yg.classic;A?.includes("MSA")&&w===c.Hi.SEPARATOR&&(T=h.yg.MSA);const S=m.temp["reference-sequence"],_=this.tableCol.temp["current-word"],P=(()=>{const e=(0,l.splitter)(null!=S&&""!==S?S:_??"");return i().count(0).take(e.length).slice(f).map((t=>e.getCanonical(t))).toArray()})(),M=Number.parseInt(m.getTag(c.gp.selectedPosition)??"-200");if(this.shouldUseMultilineRendering(m)){const i=[],c=this.calculateMultiLineLayoutDynamic(e,r,s,C,f,d);let u=n+this.padding;1===c.lineLayouts.length&&(u=n+(s-c.lineHeight)/2);for(const r of c.lineLayouts){const s=u+r.lineIdx*c.lineHeight;for(const u of r.elements){const d=t+u.x,p=u,g=p.posIdx,b=C.getCanonical(g);let w=y;const v=this.getMonomerLib();v&&(w=v.getMonomerTextColor(l.defaultBiotype,b));let A=0;if(a.tableRowIndex!==m.dataFrame.currentRowIdx&&P.length>0){const e=g-f;e>=0&&e<P.length&&b===P[e]&&(A=.7)}i.push({lineIdx:r.lineIdx,monomerIdx:g-f,bounds:new o.Rect(u.x,s-n,u.width,c.lineHeight),sequencePosition:g}),(0,h.oZ)(e,p.om,d,s,u.width,c.lineHeight,{color:w,isMultiLineContext:!0,transparencyRate:A,selectedPosition:isNaN(M)||M<1?void 0:M,wordIdx:g})}}null!==a.tableRowIndex&&this._cellBounds.set(a.tableRowIndex,i)}else{this._leftThreeDotsPadding=this.shouldRenderShiftedThreeDots(f)?e.measureText("...").width:0;let[,o]=this.getCellMonomerLengths(a.tableRowIndex,r);u||(o=this.getSummedMonomerLengths(this.getCellMonomerLengthsForSeqValue(b,r)));const i=this.props.separatorWidth+1*this.props.fontCharWidth,c=Math.min(C.length,Math.ceil(r/i)+f);for(let i=f;i<c;++i){const c=i<C.length?C.getOriginal(i):l.defaultGapOriginal,u=i<C.length?C.getCanonical(i):l.defaultGapOriginal;let p=y;this.getMonomerLib()&&(p=this.getMonomerLib().getMonomerTextColor(l.defaultBiotype,u));const m={color:p,pivot:0,left:!0,transparencyRate:0,separator:E,last:i===C.length-1,drawStyle:T,maxWord:o,wordIdx:i-f,gridCell:a,referenceSequence:P,maxLengthOfMonomer:d,monomerTextSizeMap:this._monomerLengthMap,logger:this.logger,selectedPosition:isNaN(M)||M<1?void 0:M-f};(0,h.oZ)(e,c,t+this.padding+this._leftThreeDotsPadding,n,r,s,m)}if(this.shouldRenderShiftedThreeDots(f)){const i={color:y,pivot:0,left:!0,transparencyRate:0,separator:E,last:!1,drawStyle:T,maxWord:o,wordIdx:0,gridCell:a,maxLengthOfMonomer:d,monomerTextSizeMap:this._monomerLengthMap,logger:this.logger};(0,h.oZ)(e,"...",t+this.padding,n,r,s,i)}}}catch(e){const[t,n]=(0,d.AP)(e);this.logger.error(t,void 0,n),this.errors.push(e)}finally{e.restore()}}shouldRenderShiftedThreeDots(e){return e>0&&(!this.gridCol||!this.gridCol.dart||!this.gridCol.grid||!this.gridCol.grid.dart||(this.gridCol.grid.props.colHeaderHeight??0)<=50)}onMouseMove(e,t){const n=`${this.toLog()}.onMouseMove()`;if(!this.seqHelper||null==e.tableRowIndex)return;const o=this.positionShift,s=e.bounds,i=t.offsetX-e.gridColumn.left+(e.gridColumn.left-s.x),a=t.offsetY-s.y;this.gridCol?.grid?.canvas&&(this.gridCol.grid.canvas.style.cursor="default");let l=null;const u=this._cellBounds.get(e.tableRowIndex);if(u){for(const e of u)if(e.bounds.contains(i,a)){l=e.monomerIdx;break}}else{const t=this.shouldRenderShiftedThreeDots(o)&&(this._leftThreeDotsPadding??0)>0?this._leftThreeDotsPadding:0;l=this.getPosition(e.tableRowIndex,i,s.width,t)}this.logger.debug(`${n}, argsX: ${i}, argsY: ${a}, left: ${l}`);const d=this.seqHelper.getSeqHandler(this.tableCol),h=d.getSplitted(e.tableRowIndex);if(null!==l&&l>=0&&l+o<h.length){const n=d.alphabet??c.YI.UN,s={position:l,biotype:n===c.YI.RNA||n===c.YI.DNA?m.o.NUCLEOTIDE:m.o.AA,symbol:h.getCanonical(l+o)},i=[];let a=this._monomerStructureMap[s.symbol];if(!a){const e=this.getMonomerLib();a=this._monomerStructureMap[s.symbol]=e?e.getTooltip(s.biotype,s.symbol):r.divText("Monomer library is not available")}i.push(a),r.tooltip.show(r.divV(i),t.x+16,t.y+16),(0,f.WN)(e,s)}else-1===l?r.tooltip.show(r.divText(`${Math.min(o,h.length)} hidden monomers`),t.x+16,t.y+16):r.tooltip.hide(),(0,f.WN)(e,null)}}function v(e,t,n,r,o){return e?Math.max(Math.min(e.canvas.width/o-n,r)):Math.max(t.canvas.width/o-n,0)}},3856:(e,t,n)=>{"use strict";n.d(t,{Mn:()=>u,gp:()=>l,oZ:()=>p,yg:()=>d});var r=n(6082),o=n(7278);const s="rgb(100,100,100)",i="#808080",a="rgb(0,0,0)",c=o.zS;var l,u,d;!function(e){e.maxMonomerLength=".mm.cellRenderer.maxMonomerLength"}(l||(l={})),function(e){e.applyToBackground=".m.cellRenderer.applyToBackground"}(u||(u={})),function(e){e.MSA="MSA",e.classic="classic"}(d||(d={}));const h=new class{constructor(){this.color=s,this.pivot=0,this.left=!1,this.transparencyRate=0,this.separator="",this.last=!1,this.drawStyle=d.classic,this.maxWord=[],this.wordIdx=0,this.gridCell=null,this.referenceSequence=null,this.maxLengthOfMonomer=null,this.monomerTextSizeMap={},this.logger=void 0,this.selectedPosition=void 0,this.isMultiLineContext=!1,this.lineNumber=0}};function p(e,t,n,o,l,u,p){var m,f,g;const y={...h,...p};if(y.isMultiLineContext){e.textBaseline="middle",e.textAlign="center";let r=t;null!=y.maxLengthOfMonomer&&(r=c(r,y.maxLengthOfMonomer));const i=Math.max(.1,1-(y.transparencyRate??0));e.globalAlpha=i;const d=e.measureText(r),h=d.fontBoundingBoxAscent+d.fontBoundingBoxDescent,p=o+(u-h)/2+d.fontBoundingBoxAscent;let m=y.color??s;return m&&m!==s||(m=a),e.fillStyle=m,y.selectedPosition===y.wordIdx+1&&(e.save(),e.fillStyle="rgba(60, 177, 115, 0.2)",e.fillRect(n,o,l,u),e.restore(),e.fillStyle=m),e.fillText(r,n+l/2,p),e.globalAlpha=1,e.textBaseline="top",e.textAlign="start",n+l}p.logger?.debug("Bio: printLeftOrCentered(), start"),e.textAlign="start";let b=t.substring(0),w=y.last?"":y.separator;y.drawStyle===d.MSA&&(w="");let v=!0,A=!0,E="difference";if(null!=y.gridCell&&null!=y.gridCell.cell.column&&(v=y.gridCell.cell.column.temp["color-code"]??!0,A=y.gridCell.cell.column.temp["compare-with-current"]??!0,E=y.gridCell.cell.column.temp["highlight-difference"]??"difference"),y.referenceSequence){const e=y.referenceSequence[y.wordIdx];A&&y.referenceSequence.length>0&&"difference"===E&&(y.transparencyRate=b==e?.7:y.transparencyRate),A&&y.referenceSequence.length>0&&"equal"===E&&(y.transparencyRate=b!=e?.7:y.transparencyRate)}null!=y.maxLengthOfMonomer&&(b=c(b,y.maxLengthOfMonomer));const C=b+w;(m=y.monomerTextSizeMap)[C]??(m[C]=e.measureText(C));let T=y.monomerTextSizeMap[C];(f=y.monomerTextSizeMap)[b]??(f[b]=e.measureText(b));let S=y.monomerTextSizeMap[b].width;const _=u/2-(T.fontBoundingBoxAscent+T.fontBoundingBoxDescent)/2+1;(g=y.monomerTextSizeMap)[w]??(g[w]=e.measureText(w));const P=y.monomerTextSizeMap[w].width;function M(t,s){let c=v?y.color:a;y.selectedPosition===y.wordIdx+1&&(e.fillStyle="rgba(60, 177, 115, 0.2)",e.fillRect(n+t-4,o-5,y.monomerTextSizeMap[b].width+8,u+10),c=r.Color.toHtml(r.Color.setAlpha(r.Color.fromHtml(c),255))),e.fillStyle=c,e.globalAlpha=1-y.transparencyRate,y.drawStyle===d.classic&&(e.fillText(b,n+t,o+_),e.fillStyle=i,e.fillText(w,n+s,o+_)),y.drawStyle===d.MSA&&e.fillText(b,n+t,o+_),e.globalAlpha=1}T=T.width,y.drawStyle===d.MSA&&(S=y.maxWord[y.wordIdx],T=y.maxWord[y.wordIdx]);const x=(y.maxWord[y.wordIdx]??0)-(y.maxWord[0]??0);if(y.left||T>l)return M(x,x+S),n+x+S+P;{const e=(l-T)/2;return M(e,e+S),n+x+e+S}}},6307:(e,t,n)=>{"use strict";n.d(t,{F:()=>i});var r=n(7389),o=n(6082),s=n(439);function i(e,t,n){let i=0,a=null;for(const t of Object.values(e))i+=t,a=null===a?t:Math.max(a,t);const c=a/i,l=Object.assign({},...Array.from(Object.entries(e)).sort(((e,t)=>t[1]-e[1])).map((([e,a])=>{const l=a/i;let u;try{const r=n.getMonomerColors(t,e);u=r?.backgroundcolor||"#CCCCCC"}catch(t){console.warn(`Failed to get colors for monomer ${e}:`,t),u="#CCCCCC"}const d=r.div("",{classes:"macromolecule-cell-comp-analysis-bar"});d.style.width=50*l/c+"px",d.style.backgroundColor=u,s._S===e&&(d.style.borderWidth="1px",d.style.borderStyle="solid",d.style.borderColor=o.Color.toHtml(o.Color.lightGray));const h=s._S===e?"-":e,p=r.div(`${(100*l).toFixed(2)}%`),m=r.div([d,p],{classes:"macromolecule-cell-comp-analysis-value"});return{[h]:m}}))),u=r.tableFromMap(l);return Array.from(u.rows).forEach((e=>{const t=e.getElementsByClassName("macromolecule-cell-comp-analysis-bar")[0].style.backgroundColor;e.cells[0].style.color=t})),u}},3151:(e,t,n)=>{"use strict";n.d(t,{f6:()=>r});const r=["symbol","molfile","rgroups","name"];new RegExp("[rd]\\((\\w)\\)p?","g")},9192:(e,t,n)=>{"use strict";function r(e){return"string"==typeof e||e instanceof String?e:"StateError"===e.constructor.name?e.message:"StateError"===e.constructor.name&&"$thrownJsError"in e?r(e.$thrownJsError):e instanceof Error?e.message:e.toString()}function o(e){return e instanceof Error?e.stack:"StateError"===e.constructor.name&&"$thrownJsError"in e?o(e.$thrownJsError):void 0}function s(e){return[r(e),o(e)]}n.d(t,{AP:()=>s})},3516:(e,t,n)=>{"use strict";n.d(t,{m:()=>s});var r=n(6082),o=n(439);class s{get descriptionsArray(){return this._descriptionsArray}get sequencesArray(){return this._sequencesArray}parseMacromolecule(e,t){return this._fileContent.slice(e,t).split(/\s/).join("")}parseColumns(){const e=/^>(.*)$/gm;let t,n=0;for(;t=e.exec(this._fileContent);){const r=this._fileContent.substring(t.index+1,e.lastIndex);this._descriptionsArray.push(r),0!==n&&this._sequencesArray.push(this.parseMacromolecule(n,t.index)),n=e.lastIndex+1}this._sequencesArray.push(this.parseMacromolecule(n,-1))}importFasta(){const e=r.Column.fromStrings("description",this.descriptionsArray),t=r.Column.fromStrings("sequence",this.sequencesArray);return t.semType=r.SEMTYPE.MACROMOLECULE,t.meta.units=o.Hi.FASTA,[r.DataFrame.fromColumns([e,t])]}constructor(e){this._descriptionsArray=[],this._sequencesArray=[],this._fileContent=e,this.parseColumns()}}},6873:(e,t,n)=>{"use strict";n.d(t,{dW:()=>i,fD:()=>s});var r=n(6082),o=(n(1991),n(2003));function s(){const e=[];return e.push(r.Column.fromList("string","MSA",new Array(10**6).fill("meI/hHis/Aca/N/T/dE/Thr_PO3H2/Aca/D-Tyr_Et/Tyr_ab-dehydroMe/dV/E/N/D-Orn/D-aThr//Phe_4Me"))),e.push(r.Column.fromList(r.COLUMN_TYPE.FLOAT,"Activity",new Array(10**6).fill(5.30751))),e}function i(e=10**5){const t="meI/hHis/Aca/N//dE/Thr_PO3H2/Aca/D-Tyr_Et/Tyr_ab-dehydroMe".repeat(Math.ceil(e/10)).slice(0,-1),n=r.Column.fromList(r.COLUMN_TYPE.STRING,"MSA",new Array(100).fill(t));n.semType=r.SEMTYPE.MACROMOLECULE,n.meta.units=o.Hi.SEPARATOR,n.setTag(o.gp.separator,"/"),n.setTag(o.gp.alphabet,o.YI.UN),n.setTag(o.gp.alphabetIsMultichar,"true");const s=[];return s.push(n),s.push(r.Column.fromList(r.COLUMN_TYPE.FLOAT,"Activity",new Array(100).fill(7.30751))),s}n(7278),n(439)},439:(e,t,n)=>{"use strict";n.d(t,{B5:()=>c,Hi:()=>r,Vl:()=>l,YI:()=>o,_S:()=>d,b9:()=>h,gp:()=>s,q7:()=>u,z1:()=>a});var r,o,s,i=n(2738);!function(e){e.FASTA="fasta",e.SEPARATOR="separator",e.HELM="helm",e.CUSTOM="custom"}(r||(r={})),function(e){e.DNA="DNA",e.RNA="RNA",e.PT="PT",e.UN="UN"}(o||(o={})),function(e){e.aligned="aligned",e.alphabet="alphabet",e.alphabetSize=".alphabetSize",e.alphabetIsMultichar=".alphabetIsMultichar",e.separator="separator",e.isHelmCompatible=".isHelmCompatible",e.positionNames=".positionNames",e.positionLabels=".positionLabels",e.regions=".regions",e.positionShift=".positionShift",e.selectedPosition=".selectedPosition"}(s||(s={}));const a=", ",c=/(?:\[([A-Za-z0-9_\-,()]+)\])|([A-Za-z\-])/g,l=new class{constructor(){this.fasta={peptide:new Set(["G","L","Y","S","E","Q","D","N","F","A","K","R","H","C","V","P","W","I","M","T"]),dna:new Set(["A","C","G","T"]),rna:new Set(["A","C","G","U"])}}},u=[new i.a(o.PT,l.fasta.peptide,.5),new i.a(o.DNA,l.fasta.dna,.55),new i.a(o.RNA,l.fasta.rna,.55)],d="",h={[r.FASTA]:"-",[r.SEPARATOR]:"",[r.HELM]:"*"}},2003:(e,t,n)=>{"use strict";n.d(t,{Hi:()=>r.Hi,J9:()=>o.J9,Qf:()=>o.Qf,SM:()=>o.SM,YI:()=>r.YI,gp:()=>r.gp,mn:()=>o.mn,nq:()=>o.nq,qp:()=>o.qp,z1:()=>r.z1,zS:()=>o.zS});var r=n(439),o=n(7278)},2738:(e,t,n)=>{"use strict";n.d(t,{X:()=>o,a:()=>r});class r{constructor(e,t,n){this.name=e,this.alphabet=t,this.cutoff=n}}class o extends r{constructor(e,t,n){super(e.name,e.alphabet,e.cutoff),this.freq=t,this.similarity=n}}},7278:(e,t,n)=>{"use strict";n.d(t,{Iv:()=>b,J9:()=>g,Mu:()=>m,Qf:()=>A,SM:()=>C,mn:()=>T,nq:()=>E,qp:()=>y,vZ:()=>f,zS:()=>v});var r=n(6082),o=n(1991),s=n.n(o),i=n(3527),a=n(3629),c=n(2738),l=n(439),u=n(8924),d=n(1093),h=n(4152),p=n(8438);class m{get length(){return this.mList.length}isGap(e){return this.getOriginal(e)===this.gapOriginalMonomer}getCanonical(e){if(this.length<=e)throw new Error("Index out of bounds");const t=this.mList[e];return t!==this.gapOriginalMonomer?t:l._S}getOriginal(e){if(this.length<=e)throw new Error("Index out of bounds");return this.mList[e]}getCanonicalRegion(e,t){const n=Math.min(Math.max(0,e),this.length),r=Math.max(Math.min(this.length,t),0)-n,o=this.gapOriginalMonomer;return new Array(r).fill(null).map(((e,t)=>{const r=this.mList[t+n];return r===o?l._S:r}))}getOriginalRegion(e,t){const n=Math.min(Math.max(0,e),this.length),r=Math.max(Math.min(this.length,t),0);return new Array(r-n).fill(null).map(((e,t)=>this.mList[t+n]))}get gapOriginal(){return this.gapOriginalMonomer}constructor(e,t){this.mList=e,this.gapOriginalMonomer=t}}function f(e,t,n){const r=e.categories;return function(e,t){const n={};let r=!0,o=null;for(const s of e)if(null==o?o=s.length:s.length!==o&&(r=!1),s.length>=t)for(let e=0;e<s.length;++e){const t=s.getCanonical(e);t in n||(n[t]=0),n[t]+=1}return{freq:n,sameLength:r}}(s().enumerate(e.getRawData()).map((([e,t])=>n(r[e]))),t)}const g=e=>{const t=s()(e.toString().matchAll(l.B5)).map((e=>e[2]??e[1])).toArray();return new m(t,l.b9[l.Hi.FASTA])},y=e=>{const t=e.split("$")[0].split("|"),n=s()(t.map((e=>(e.match(/(?<=\{).+(?=})/)?.[0]?.split(".")??[]).map((e=>(0,p.D)(e)))))).flatten().toArray();return new m(n,l.b9[l.Hi.HELM])};function b(e,t,n=void 0){if(e.toLowerCase().startsWith(l.Hi.FASTA))return g;if(e.toLowerCase().startsWith(l.Hi.SEPARATOR))return function(e,t){return n=>{if(n){let r;const o=new RegExp(`(?<=^|\\${e})("-"|'-'|[^\\${e}]*)(?=\\${e}|$)`,"g");return void 0!==t?(o.lastIndex=0,r=s()(n.matchAll(o)).take(t).map((e=>e[0])).toArray()):r=n.replaceAll('"-"',"").replaceAll("'-'","").split(e,t),new m(r,l.b9[l.Hi.SEPARATOR])}return new m([],l.b9[l.Hi.SEPARATOR])}}(t,n);if(e.toLowerCase().startsWith(l.Hi.HELM))return y;throw new Error(`Unexpected units ${e} .`)}const w=/([^\W_]+)/g;function v(e,t){if(e.length<=t)return e;const n=e.match(w),r=e.length>t||(n?.length??0)>1,o=n?.[0]??" ";return r?o.substring(0,t-1)+"…":o}function A(e){switch(e){case l.YI.DNA:return l.Vl.fasta.dna;case l.YI.RNA:return l.Vl.fasta.rna;case l.YI.PT:return l.Vl.fasta.peptide;default:throw new Error(`Unsupported alphabet '${e}'.`)}}function E(e,t,n="-"){const r=new Set([...new Set(Object.keys(e)),...t]);r.delete(n);const o=[],s=[];for(const n of r)o.push(n in e?e[n]:0),s.push(t.has(n)?1:0);const c=new i.Mi(o),l=new i.Mi(s);return(0,a.KE)(c,l)/((0,a.wQ)(c)*(0,a.wQ)(l))}function C(e,t,n=5){let o;return o=e.semType==r.SEMTYPE.MACROMOLECULE?t.getSeqHandler(e).alphabet:function(e,t,n="-"){const r=t.map((t=>{const r=E(e,t.alphabet,n);return new c.X(t,e,r)}));let o;const s=Math.max(...r.map((e=>e.similarity>e.cutoff?e.similarity:-1)));return o=s>0?r.find((e=>e.similarity===s)).name:l.YI.UN,o}(f(e,n,g).freq,l.q7),function(e){switch(e){case l.YI.PT:return u.X.GrokGroups;case l.YI.DNA:case l.YI.RNA:return d.A.Chromatogram;default:return h.oT.Color}}(o)}function T(e){const t=e.columns.bySemTypeAll(r.SEMTYPE.MACROMOLECULE);let n=t.find((e=>{const t=e.meta.units;return!!t&&-1!==t.indexOf("MSA")}))??null;return!n&&t.length>0&&(n=t[0]),n}},8312:(e,t,n)=>{"use strict";n.d(t,{Q:()=>o});var r=n(6082);async function o(){const e=r.Func.find({package:"Bio",name:"getSeqHelper"});if(0===e.length)throw new Error("Package 'Bio' must be installed for SeqHelper.");return(await e[0].prepare().call()).getOutputParamValue()}},3077:(e,t,n)=>{"use strict";n(6082)},7602:(e,t,n)=>{"use strict";n.d(t,{g:()=>s});var r,o=n(9192);!function(e){e[e.error=0]="error",e[e.warning=1]="warning",e[e.info=2]="info",e[e.debug=3]="debug"}(r||(r={}));class s{constructor(e){this.logger=e,this.promise=Promise.resolve(),this.errors=[],this.syncCounter=0}sync(e,t){const n=++this.syncCounter;this.logger.debug(`${e}, SYNC syncId = ${n}, IN `),this.promise=this.promise.then((async()=>{this.logger.debug(`${e}, SYNC syncId = ${n}, START `),await t(),this.logger.debug(`${e}, SYNC syncId = ${n}, END `)})).catch((t=>{const[r,s]=(0,o.AP)(t);this.logger.error(`${e}, SYNC syncId = ${n}, ERROR:\n${r}`,void 0,s),this.errors.push(t)}))}resetErrors(){const e=this.errors;return this.errors=[],e}}},4326:(e,t,n)=>{"use strict";n.d(t,{Fo:()=>u,Lp:()=>s,P4:()=>i,fH:()=>o,gp:()=>r,lT:()=>c,mH:()=>a});var r,o,s,i,a,c,l=n(6082);!function(e){e.tooltipWebLogo=".tooltipWebLogo"}(r||(r={})),function(e){e.Entropy="Entropy",e.full="100%"}(o||(o={})),function(e){e.TOP="top",e.MIDDLE="middle",e.BOTTOM="bottom"}(s||(s={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(i||(i={})),function(e){e.AUTO="auto",e.ON="on",e.OFF="off"}(a||(a={})),function(e){e.Filtered="Filtered",e.Selected="Selected"}(c||(c={}));const u=new class{constructor(){this.sequenceColumnName=null,this.valueAggrType=l.AGG.TOTAL_COUNT,this.valueColumnName="Activity",this.startPositionName=null,this.endPositionName=null,this.skipEmptySequences=!0,this.skipEmptyPositions=!1,this.shrinkEmptyTail=!0,this.backgroundColor=4294967295,this.positionHeight=o.Entropy,this.positionWidth=20,this.verticalAlignment=s.MIDDLE,this.horizontalAlignment=i.CENTER,this.fixWidth=!1,this.fitArea=!0,this.minHeight=25,this.maxHeight=300,this.maxMonomerLetters=5,this.showPositionLabels=!0,this.positionMarginState=a.AUTO,this.positionMargin=0,this.filterSource=c.Filtered}}},6869:(e,t,n)=>{"use strict";var r;n.d(t,{o:()=>r}),function(e){e.BASE="HELM_BASE",e.SUGAR="HELM_SUGAR",e.LINKER="HELM_LINKER",e.AA="HELM_AA",e.CHEM="HELM_CHEM",e.BLOB="HELM_BLOB",e.NUCLEOTIDE="HELM_NUCLETIDE"}(r||(r={}))},5540:(e,t,n)=>{"use strict";e=n.hmd(e);var r,o=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){var t,n,o=void 0!==e?e:{};o.ready=new Promise((function(e,r){t=e,n=r}));var s,i=Object.assign({},o),a="object"==typeof window,c="function"==typeof importScripts,l=("object"==typeof process&&"object"==typeof process.versions&&process.versions.node,"");(a||c)&&(c?l=self.location.href:"undefined"!=typeof document&&document.currentScript&&(l=document.currentScript.src),r&&(l=r),l=0!==l.indexOf("blob:")?l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):"",c&&(s=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)})),o.print||console.log.bind(console);var u,d,h=o.printErr||console.warn.bind(console);Object.assign(o,i),i=null,o.arguments&&o.arguments,o.thisProgram&&o.thisProgram,o.quit&&o.quit,o.wasmBinary&&(u=o.wasmBinary),o.noExitRuntime,"object"!=typeof WebAssembly&&_("no native wasm support detected");var p,m,f,g=!1;function y(){var e=d.buffer;o.HEAP8=p=new Int8Array(e),o.HEAP16=new Int16Array(e),o.HEAP32=new Int32Array(e),o.HEAPU8=m=new Uint8Array(e),o.HEAPU16=new Uint16Array(e),o.HEAPU32=f=new Uint32Array(e),o.HEAPF32=new Float32Array(e),o.HEAPF64=new Float64Array(e)}var b,w,v=[],A=[],E=[],C=0,T=null,S=null;function _(e){o.onAbort&&o.onAbort(e),h(e="Aborted("+e+")"),g=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}function P(e){return e.startsWith("data:application/octet-stream;base64,")}function M(e){try{if(e==b&&u)return new Uint8Array(u);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){_(e)}}function x(e,t,n){return function(e){return u||!a&&!c||"function"!=typeof fetch?Promise.resolve().then((function(){return M(e)})):fetch(e,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((function(){return M(e)}))}(e).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(n,(function(e){h("failed to asynchronously prepare wasm: "+e),_(e)}))}function N(e){for(;e.length>0;)e.shift()(o)}function $(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){f[this.ptr+4>>2]=e},this.get_type=function(){return f[this.ptr+4>>2]},this.set_destructor=function(e){f[this.ptr+8>>2]=e},this.get_destructor=function(){return f[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,p[this.ptr+12|0]=e},this.get_caught=function(){return 0!=p[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,p[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=p[this.ptr+13|0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){f[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return f[this.ptr+16>>2]},this.get_exception_ptr=function(){if(V(this.get_type()))return f[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function L(e){var t=d.buffer;try{return d.grow(e-t.byteLength+65535>>>16),y(),1}catch(e){}}function I(e){return o["_"+e]}P(b="wasmDbscan.wasm")||(w=b,b=o.locateFile?o.locateFile(w,l):l+w);var R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(e,t,n,r,o){var s={string:e=>{var t=0;return null!=e&&0!==e&&(t=function(e){var t=function(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t}(e)+1,n=F(t);return function(e,t,n){!function(e,t,n,r){if(!(r>0))return 0;for(var o=n+r-1,s=0;s<e.length;++s){var i=e.charCodeAt(s);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++s)),i<=127){if(n>=o)break;t[n++]=i}else if(i<=2047){if(n+1>=o)break;t[n++]=192|i>>6,t[n++]=128|63&i}else if(i<=65535){if(n+2>=o)break;t[n++]=224|i>>12,t[n++]=128|i>>6&63,t[n++]=128|63&i}else{if(n+3>=o)break;t[n++]=240|i>>18,t[n++]=128|i>>12&63,t[n++]=128|i>>6&63,t[n++]=128|63&i}}t[n]=0}(e,m,t,n)}(e,n,t),n}(e)),t},array:e=>{var t,n,r=F(e.length);return t=e,n=r,p.set(t,n),r}},i=I(e),a=[],c=0;if(r)for(var l=0;l<r.length;l++){var u=s[n[l]];u?(0===c&&(c=D()),a[l]=u(r[l])):a[l]=r[l]}var d=i.apply(null,a);return function(e){return 0!==c&&H(c),function(e){return"string"===t?(n=e)?function(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.buffer&&R)return R.decode(e.subarray(t,o));for(var s="";t<o;){var i=e[t++];if(128&i){var a=63&e[t++];if(192!=(224&i)){var c=63&e[t++];if((i=224==(240&i)?(15&i)<<12|a<<6|c:(7&i)<<18|a<<12|c<<6|63&e[t++])<65536)s+=String.fromCharCode(i);else{var l=i-65536;s+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else s+=String.fromCharCode((31&i)<<6|a)}else s+=String.fromCharCode(i)}return s}(m,n,r):"":"boolean"===t?Boolean(e):e;var n,r}(e)}(d)}var k,G={__cxa_throw:function(e,t,n){throw new $(e).init(t,n),e},abort:function(){_("")},emscripten_memcpy_big:function(e,t,n){m.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=m.length,r=2147483648;if((e>>>=0)>r)return!1;for(var o=1;o<=4;o*=2){var s=n*(1+.2/o);if(s=Math.min(s,e+100663296),L(Math.min(r,(t=Math.max(e,s))+(65536-t%65536)%65536)))return!0}return!1}},D=(function(){var e,t,r,s,i={env:G,wasi_snapshot_preview1:G};function a(e,t){var n,r=e.exports;return o.asm=r,d=o.asm.memory,y(),o.asm.__indirect_function_table,n=o.asm.__wasm_call_ctors,A.unshift(n),function(){if(C--,o.monitorRunDependencies&&o.monitorRunDependencies(C),0==C&&(null!==T&&(clearInterval(T),T=null),S)){var e=S;S=null,e()}}(),r}if(C++,o.monitorRunDependencies&&o.monitorRunDependencies(C),o.instantiateWasm)try{return o.instantiateWasm(i,a)}catch(e){h("Module.instantiateWasm callback failed with error: "+e),n(e)}(e=u,t=b,r=i,s=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||P(t)||"function"!=typeof fetch?x(t,r,s):fetch(t,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(s,(function(e){return h("wasm streaming compile failed: "+e),h("falling back to ArrayBuffer instantiation"),x(t,r,s)}))}))).catch(n)}(),o._dbscan=function(){return(o._dbscan=o.asm.dbscan).apply(null,arguments)},o._malloc=function(){return(o._malloc=o.asm.malloc).apply(null,arguments)},o._free=function(){return(o._free=o.asm.free).apply(null,arguments)},function(){return(D=o.asm.stackSave).apply(null,arguments)}),H=function(){return(H=o.asm.stackRestore).apply(null,arguments)},F=function(){return(F=o.asm.stackAlloc).apply(null,arguments)},V=function(){return(V=o.asm.__cxa_is_pointer_type).apply(null,arguments)};function U(){function e(){k||(k=!0,o.calledRun=!0,g||(N(A),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),E.unshift(e);var e;N(E)}()))}C>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),v.unshift(e);var e;N(v)}(),C>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),e()}),1)):e()))}if(o.ccall=O,o.cwrap=function(e,t,n,r){var o=!n||n.every((e=>"number"===e||"boolean"===e));return"string"!==t&&o&&!r?I(e):function(){return O(e,t,n,arguments)}},S=function e(){k||U(),k||(S=e)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return U(),e.ready});"object"==typeof exports?e.exports=o:"function"==typeof define&&n.amdO?define([],(function(){return o})):"object"==typeof exports&&(exports.exportCppDbscanLib=o)},6295:(e,t,n)=>{"use strict";n.d(t,{$1:()=>i,Hf:()=>u,Hr:()=>S,Ii:()=>g,Qj:()=>m,T6:()=>T,TK:()=>E,be:()=>f,gt:()=>w,ij:()=>v,jL:()=>l,lO:()=>p,lP:()=>b,rR:()=>y,tO:()=>a,v_:()=>c,w_:()=>d,yK:()=>A,zn:()=>h});var r=n(8774),o=n(8498),s=n(6863);function i(e,t){const n=e.trueCount()+t.trueCount();if(0==n)return 1;const r=e.andWithCountBits(t,!0);return r/(n-r)}function a(e,t){return 1-i(e,t)}function c(e,t){return C(i(new r.A(e,32*e.length),new r.A(t,32*t.length)))}function l(e,t){let n=0;for(let r=0;r<e.length;r++)n+=Math.pow(e[r]-t[r],2);return Math.sqrt(n)}function u(e,t){let n=0;for(let r=0;r<e.length;r++)n+=Math.abs(e[r]-t[r]);return n}function d(e,t){let n=0,r=0,o=0;for(let s=0;s<e.length;s++)n+=e[s]*t[s],r+=e[s]*e[s],o+=t[s]*t[s];return(1-n/(Math.sqrt(r)*Math.sqrt(o)))/2}function h(e,t){return 1-function(e,t){const n=e.trueCount()+t.trueCount();return 0==n?0:2*e.andWithCountBits(t,!0)/n}(e,t)}function p(e,t){return 1-function(e,t){const n=e.trueCount()*t.trueCount();return 0==n?0:e.andWithCountBits(t,!0)/Math.sqrt(n)}(e,t)}function m(e,t){return Math.sqrt(e.trueCount()+t.trueCount()-2*e.andWithCountBits(t,!0))}function f(e,t){return e.trueCount()+t.trueCount()-2*e.andWithCountBits(t,!0)}function g(e,t){return 1-function(e,t){const n=e.trueCount()+t.trueCount(),r=e.andWithCountBits(t,!0);return r/(2*n-3*r)}(e,t)}function y(e,t){return C(function(e,t){const n=e.trueCount()+t.trueCount(),r=e.trueCount()*t.trueCount();return 0==r?0:e.andWithCountBits(t,!0)*n/(2*r)}(e,t))}function b(e,t){return C(function(e,t){const n=e.trueCount()+t.trueCount(),r=e.trueCount()*t.trueCount();return 0==r?0:(e.andWithCountBits(t,!0)*n-r)/r}(e,t))}function w(e,t){return 1-function(e,t){const n=Math.min(e.trueCount(),t.trueCount());return 0==n?0:e.andWithCountBits(t,!0)/n}(e,t)}function v(e,t){return C(function(e,t){const n=Math.max(e.trueCount(),t.trueCount());return 0==n?0:e.andWithCountBits(t,!0)/n}(e,t))}function A(e,t){return C(function(e,t){return 0==e.length?0:e.andWithCountBits(t,!0)/e.length}(e,t))}function E(e,t){return C(function(e,t){const n=e.andWithCountBits(t,!0),r=e.countBits(!0)+t.countBits(!0),o=e.length,s=o-r+n;return n==o||s==o?1:n/r+s/(2*o-r)}(e,t))}function C(e){return e<=0?3402823e32:1/e-1}function T(e){if(e&&null!=e.range&&e.range>0){const t=e.range;return(e,n)=>Math.abs(e-n)/t}return(e,t)=>Math.abs(e-t)}function S(e){const t=function(e){const t=e?.mostCommon??new Set;return(e,n)=>{const r=e.length,o=n.length;let s=0,i=0,a=0;for(;i<r&&a<o;)e[i]===n[a]?(t?.has(e[i])||++s,++i,++a):e[i]<n[a]?++i:++a;return s}}(e);return(e,n)=>0===n.length||0===e.length?1e4:Math.min(e.length,n.length)/(t(e,n)+1e-4)}o.aT.Tanimoto,o.aT.Dice,o.aT.Asymmetric,o.aT.BraunBlanquet,o.aT.Cosine,o.aT.Kulczynski,o.aT.McConnaughey,o.aT.RogotGoldberg,o.aT.Russel,o.aT.Sokal,o.aT.Hamming,o.aT.Euclidean,o.aT.Tanimoto,o.aT.Dice,o.aT.Asymmetric,o.aT.BraunBlanquet,o.aT.Cosine,o.aT.Kulczynski,o.aT.McConnaughey,o.aT.RogotGoldberg,o.aT.Russel,o.aT.Sokal,o.aT.Hamming,o.aT.Euclidean,o.aT.Tanimoto,o.aT.Dice,o.aT.Cosine,o.aT.Tanimoto,o.aT.Asymmetric,o.aT.Cosine,o.aT.Sokal,s.Z.HAMMING,s.Z.LEVENSHTEIN,s.Z.MONOMER_CHEMICAL_DISTANCE,s.Z.NEEDLEMANN_WUNSCH},684:(e,t,n)=>{"use strict";n.d(t,{C0:()=>s,GP:()=>r,Gi:()=>a,_X:()=>i,n3:()=>o,vb:()=>c});const r="dim-red-preprocessing-function",o="supportedSemTypes",s="supportedTypes",i="supportedUnits",a="supportedDistanceFunctions",c="bypassLargeDataWarning"},6863:(e,t,n)=>{"use strict";function r(e={}){const t=function(){if(!e||!e.scoringMatrix||!e.alphabetIndexes)return(e,t)=>e===t?0:1;if(e.scoringMatrix.length!==Object.keys(e.alphabetIndexes).length)throw new Error("Scoring matrix and alphabet indexes should have the same length");const t=e.alphabetIndexes,n=e.scoringMatrix,r=Math.min(...Object.keys(t).map((e=>e.charCodeAt(0))))+1,o=new Float32Array((n.length+r)*(n.length+r));return Object.entries(t).forEach((([e,r])=>{const s=n[r];Object.entries(t).forEach((([t,r])=>{o[e.charCodeAt(0)*n.length+t.charCodeAt(0)]=s[r]}))})),(e,t)=>1-o[e.charCodeAt(0)*n.length+t.charCodeAt(0)]}(),n=e?.threshold??0;return(e,r)=>{let o=0;const s=e.length,i=r.length,a=Math.ceil(Math.max(s,i)*(1-n));s!==i&&(o=Math.abs(s-i));let c=0;for(let n=0;n<Math.min(s,i);n++)if(e[n]!==r[n]&&(c+=t(e[n],r[n]),c>a))return 1;return c+=o,c/=Math.max(s,i),c}}n.d(t,{Z:()=>i,V:()=>a});var o=n(2787);const s={gapOpen:1,gapExtend:.6,scoringMatrix:[[4,-1,-2,-2,0,-1,-1,0,-2,-1,-1,-1,-1,-2,-1,1,0,-3,-2,0,-2,-1,0,-4],[-1,5,0,-2,-3,1,0,-2,0,-3,-2,2,-1,-3,-2,-1,-1,-3,-2,-3,-1,0,-1,-4],[-2,0,6,1,-3,0,0,0,1,-3,-3,0,-2,-3,-2,1,0,-4,-2,-3,3,0,-1,-4],[-2,-2,1,6,-3,0,2,-1,-1,-3,-4,-1,-3,-3,-1,0,-1,-4,-3,-3,4,1,-1,-4],[0,-3,-3,-3,9,-3,-4,-3,-3,-1,-1,-3,-1,-2,-3,-1,-1,-2,-2,-1,-3,-3,-2,-4],[-1,1,0,0,-3,5,2,-2,0,-3,-2,1,0,-3,-1,0,-1,-2,-1,-2,0,3,-1,-4],[-1,0,0,2,-4,2,5,-2,0,-3,-3,1,-2,-3,-1,0,-1,-3,-2,-2,1,4,-1,-4],[0,-2,0,-1,-3,-2,-2,6,-2,-4,-4,-2,-3,-3,-2,0,-2,-2,-3,-3,-1,-2,-1,-4],[-2,0,1,-1,-3,0,0,-2,8,-3,-3,-1,-2,-1,-2,-1,-2,-2,2,-3,0,0,-1,-4],[-1,-3,-3,-3,-1,-3,-3,-4,-3,4,2,-3,1,0,-3,-2,-1,-3,-1,3,-3,-3,-1,-4],[-1,-2,-3,-4,-1,-2,-3,-4,-3,2,4,-2,2,0,-3,-2,-1,-2,-1,1,-4,-3,-1,-4],[-1,2,0,-1,-3,1,1,-2,-1,-3,-2,5,-1,-3,-1,0,-1,-3,-2,-2,0,1,-1,-4],[-1,-1,-2,-3,-1,0,-2,-3,-2,1,2,-1,5,0,-2,-1,-1,-1,-1,1,-3,-1,-1,-4],[-2,-3,-3,-3,-2,-3,-3,-3,-1,0,0,-3,0,6,-4,-2,-2,1,3,-1,-3,-3,-1,-4],[-1,-2,-2,-1,-3,-1,-1,-2,-2,-3,-3,-1,-2,-4,7,-1,-1,-4,-3,-2,-2,-1,-2,-4],[1,-1,1,0,-1,0,0,0,-1,-2,-2,0,-1,-2,-1,4,1,-3,-2,-2,0,0,0,-4],[0,-1,0,-1,-1,-1,-1,-2,-2,-1,-1,-1,-1,-2,-1,1,5,-2,-2,0,-1,-1,0,-4],[-3,-3,-4,-4,-2,-2,-3,-2,-2,-3,-2,-3,-1,1,-4,-3,-2,11,2,-3,-4,-3,-2,-4],[-2,-2,-2,-3,-2,-1,-2,-3,2,-1,-1,-2,-1,3,-3,-2,-2,2,7,-1,-3,-2,-1,-4],[0,-3,-3,-3,-1,-2,-2,-3,-3,3,1,-2,1,-1,-2,-2,0,-3,-1,4,-3,-2,-1,-4],[-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,4,1,-1,-4],[-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,1,4,-1,-4],[0,-1,-1,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2,0,0,-2,-1,-1,-1,-1,-1,-4],[-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,1]],alphabetIndexes:{A:0,R:1,N:2,D:3,C:4,Q:5,E:6,G:7,H:8,I:9,L:10,K:11,M:12,F:13,P:14,S:15,T:16,W:17,Y:18,V:19,B:20,Z:21,X:22,"*":23}};var i;!function(e){e.HAMMING="Hamming",e.LEVENSHTEIN="Levenshtein",e.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",e.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(i||(i={}));const a={[i.HAMMING]:r,[i.LEVENSHTEIN]:function(){return(e,t)=>(0,o.I)(e,t)/Math.max(e.length,t.length)},[i.NEEDLEMANN_WUNSCH]:function(e){const t=new Uint16Array(65536),{gapOpen:n,gapExtend:r,scoringMatrix:o,alphabetIndexes:i}={...s,...e};Object.entries(i).forEach((([e,n])=>t[e.charCodeAt(0)]=n));const a=[new Float32Array(1e4),new Float32Array(1e4)];return(e,s)=>{const i=new Array(e.length+1).fill(!1),c=new Array(e.length+1).fill(!1);let l=0,u=1;for(let t=1;t<e.length+1;t++)a[0][t]=-r-(t-1)*r,a[1][t]=0;a[0][0]=0;for(let d=1;d<s.length+1;d++){a[u][0]=-r-(d-1)*r;for(let h=1;h<e.length+1;h++){const p=a[l][h-1]+o[t[e.charCodeAt(h-1)]][t[s.charCodeAt(d-1)]],m=a[l][h]-(i[h]||1===d||d===s.length?r:n),f=a[u][h-1]-(c[h-1]||1===h||h===e.length?r:n);a[u][h]=Math.max(p,f,m),a[u][h]===p?(i[h]=!1,c[h]=!1):a[u][h]===f?(i[h]=!1,c[h]=!0):(i[h]=!0,c[h]=!1)}l=u,u=(u+1)%2}const d=Math.min(e.length,s.length);return(d-a[l][e.length])/d}},[i.MONOMER_CHEMICAL_DISTANCE]:r}},9039:(e,t,n)=>{"use strict";var r;n.d(t,{c:()=>r}),function(e){e.UMAP="UMAP",e.T_SNE="t-SNE"}(r||(r={}))},8498:(e,t,n)=>{"use strict";var r,o,s,i,a,c,l;n.d(t,{EG:()=>a,Pn:()=>o,RR:()=>c,Wn:()=>l,aT:()=>s,m6:()=>i,xL:()=>r}),function(e){e.Levenshtein="Levenshtein",e.JaroWinkler="Jaro-Winkler",e.Manhattan="Manhattan String",e.Onehot="One-Hot"}(r||(r={})),function(e){e.Euclidean="Euclidean",e.Manhattan="Manhattan",e.Cosine="Vector Cosine"}(o||(o={})),function(e){e.Tanimoto="Tanimoto",e.Dice="Dice",e.Asymmetric="Asymmetric",e.BraunBlanquet="Braun-Blanquet",e.Cosine="Cosine",e.Kulczynski="Kulczynski",e.McConnaughey="Mc-Connaughey",e.RogotGoldberg="Rogot-Goldberg",e.Russel="Russel",e.Sokal="Sokal",e.Hamming="Hamming",e.Euclidean="Euclidean BitArray"}(s||(s={})),function(e){e.TanimotoIntArray="TanimotoIntArray"}(i||(i={})),function(e){e.Vector="Vector",e.String="String",e.BitArray="BitArray",e.MacroMolecule="MacroMolecule",e.Number="Number",e.IntArray="IntArray",e.NumberArray="NumberArray"}(a||(a={})),function(e){e.Difference="Difference"}(c||(c={})),function(e){e.CommonItems="Common Items"}(l||(l={}))},2780:(e,t,n)=>{"use strict";n.d(t,{aT:()=>r.aT});var r=n(8498);n(9336)},9336:(e,t,n)=>{"use strict";var r=n(2787),o=n(944),s=n(6295),i=n(6863),a=n(8498);const c={[a.Pn.Euclidean]:s.jL,[a.Pn.Manhattan]:s.Hf,[a.Pn.Cosine]:s.w_},l={[a.xL.Levenshtein]:r.I,[a.xL.JaroWinkler]:o.Vb,[a.xL.Manhattan]:function(e,t){if(e.length!==t.length)return 1;{let n=0;for(let r=1;r<e.length;r++)n+=e[r]==t[r]?0:1;return n/e.length}},[a.xL.Onehot]:function(e,t){return e===t?0:1}},u={[a.aT.Tanimoto]:s.tO,[a.aT.Dice]:s.zn,[a.aT.Asymmetric]:s.gt,[a.aT.BraunBlanquet]:s.ij,[a.aT.Cosine]:s.lO,[a.aT.Kulczynski]:s.rR,[a.aT.McConnaughey]:s.lP,[a.aT.RogotGoldberg]:s.TK,[a.aT.Russel]:s.yK,[a.aT.Sokal]:s.Ii,[a.aT.Hamming]:s.be,[a.aT.Euclidean]:s.Qj},d={[a.m6.TanimotoIntArray]:s.v_},h={[a.RR.Difference]:s.T6},p={[a.Wn.CommonItems]:s.Hr},m={[a.EG.Vector]:{[a.Pn.Euclidean]:c[a.Pn.Euclidean],[a.Pn.Manhattan]:c[a.Pn.Manhattan],[a.Pn.Cosine]:c[a.Pn.Cosine]},[a.EG.String]:{[a.xL.Levenshtein]:l[a.xL.Levenshtein],[a.xL.JaroWinkler]:l[a.xL.JaroWinkler],[a.xL.Manhattan]:l[a.xL.Manhattan],[a.xL.Onehot]:l[a.xL.Onehot]},[a.EG.BitArray]:{[a.aT.Tanimoto]:u[a.aT.Tanimoto],[a.aT.Dice]:u[a.aT.Dice],[a.aT.Asymmetric]:u[a.aT.Asymmetric],[a.aT.BraunBlanquet]:u[a.aT.BraunBlanquet],[a.aT.Cosine]:u[a.aT.Cosine],[a.aT.Kulczynski]:u[a.aT.Kulczynski],[a.aT.McConnaughey]:u[a.aT.McConnaughey],[a.aT.RogotGoldberg]:u[a.aT.RogotGoldberg],[a.aT.Russel]:u[a.aT.Russel],[a.aT.Sokal]:u[a.aT.Sokal]},[a.EG.MacroMolecule]:{[i.Z.HAMMING]:i.V[i.Z.HAMMING],[i.Z.LEVENSHTEIN]:i.V[i.Z.LEVENSHTEIN],[i.Z.NEEDLEMANN_WUNSCH]:i.V[i.Z.NEEDLEMANN_WUNSCH],[i.Z.MONOMER_CHEMICAL_DISTANCE]:i.V[i.Z.MONOMER_CHEMICAL_DISTANCE]},[a.EG.Number]:{[a.RR.Difference]:h[a.RR.Difference]},[a.EG.IntArray]:{[a.m6.TanimotoIntArray]:d[a.m6.TanimotoIntArray]},[a.EG.NumberArray]:{[a.Wn.CommonItems]:p[a.Wn.CommonItems]}};Object.keys(m).reduce(((e,t)=>{for(const n of Object.keys(m[t]))e[n]=t;return e}),{})},8774:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});class r{constructor(e,t=!1){if(this._length=0,this._version=0,this._updateLevel=0,this._selectedCount=0,this._selectedCountVersion=-1,this._selectedIndexesVersion=-1,this._versionedName="",this._versionedNameVersion=-1,this.SHRINK_THRESHOLD=256,"number"==typeof e){const n=e,o=r._createBuffer(n);if(t)for(let e=0;e<o.length;e++)o[e]=-1;this._data=o,this._length=n}else{if(!(e instanceof Uint32Array))throw new Error("Invalid constructor");this._data=e,this._length=t}}getRawData(){return this._data}assureGoez(e,t){if(e<0)throw new Error(`${t} should be greater than zero`)}assureInRange(e,t,n,r){if(e<t||e>n)throw new Error(`Argument ${r} (${e}) out of range (${t}, ${n})`)}copy(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}copyFrom(e){if(this._length!=e._length)throw new Error(`Lengths differ (${this._length} != ${e._length})`);this.copy(e._data,this._data,this.lengthInInts),this._version++}get length(){return this._length}get buffer(){return this._data}set buffer(e){this._data=e,this._version++}get version(){return this._version}set version(e){this._version=e}incrementVersion(e=!0){this._version++}get lengthInInts(){return Math.floor((this._length+31)/32)}get versionedName(){return this._version==this._versionedNameVersion?this._versionedName:""}set versionedName(e){this._versionedName=e,this._versionedNameVersion=this._version}get self(){return this}setLength(e){if(e<0)throw new Error("should be >= 0");if(e==this._length)return;const t=Math.floor((e+31)/32);if(t>this._data.length||t+this.SHRINK_THRESHOLD<this._data.length){const e=new Uint32Array(t);this.copy(this._data,e,t>this._data.length?this._data.length:t),this._data=e}e>this._length&&(this._length%32>0&&(this._data[this.lengthInInts-1]&=(1<<(this._length%32&31))-1),this._data.fill(0,this.lengthInInts,t)),this._length=e,this._version++}static fromAnd(e,t){if(e._length!=t._length)throw new Error(`Lengths differ (${e._length} != ${t._length})`);const n=new r(e._length);n._length=e._length,n._data=r._createBuffer(n._length),n._version=0;const o=e.lengthInInts;for(let r=0;r<o;r++)n._data[r]=e._data[r]&t._data[r];return n}static _createBuffer(e){return new Uint32Array(Math.floor((e+31)/32))}static fromValues(e){const t=new r(e.length);t._version=0;for(let n=0;n<t._length;n++)e[n]&&(t._data[Math.floor(n/32)]|=1<<(n%32&31));return t}static fromSeq(e,t){const n=new r(e);for(let r=0;r<e;++r)n.setBit(r,t(r));return n._version=0,n}static fromString(e){return r.fromSeq(e.length,(t=>"1"==e.charAt(t)))}static fromUint32Array(e,t){const n=new r(e);return n._data=t,n}static fromBytes(e){const t=e.length,n=new r(8*t);n._data=new Uint32Array(Math.floor((t+3)/4)),n._length=8*t;let o=0,s=0;for(;t-s>=4;)n._data[o++]=255&e[s]|(255&e[s+1])<<8|(255&e[s+2])<<16|(255&e[s+3])<<24,s+=4;return t-s==3&&(n._data[o]=(255&e[s+2])<<16),t-s==2&&(n._data[o]|=(255&e[s+1])<<8),t-s==1&&(n._data[o]|=255&e[s]),n._version=0,n}toString(){return`${this._length} bits, ${this.countBits(!0)} set`}equals(e){if(this==e)return!0;if(null==e)return!1;if(this._length!=e._length)return!1;if(0==this._length)return!0;for(let t=0;t<this._data.length-1;t++)if(this._data[t]!=e._data[t])return!1;for(let t=8*(this._data.length-1);t<this._length;t++)if(this.getBit(t)!=e.getBit(t))return!1;return!0}clone(){const e=new r(0,!1);return e._data=Uint32Array.from(this._data),e._length=this._length,e._version=this._version,e}init(e,t){this.setAll(!1,!1);for(let t=0;t<this._length;t++)e(t)&&(this._data[Math.floor(t/32)]|=1<<(t%32&31));return this.incrementVersion(t),this}invert(e=!0){for(let e=0;e<this._data.length;e++)this._data[e]^=-1;this.incrementVersion(e)}setAll(e,t=!1){const n=e?-1:0,r=this.lengthInInts;for(let e=0;e<r;e++)this._data[e]=n;this.incrementVersion(t)}setIndexes(e,t=!0,n=!0,r=!0){n&&this.setAll(!t,!1);for(const n of e)this.setFast(n,t);this.incrementVersion(r)}everyIndex(e,t=!0){for(const n of e)if(this.getBit(n)!=t)return!1;return!0}anyIndex(e,t=!0){for(const n of e)if(this.getBit(n)==t)return!0;return!1}setWhere(e,t=!0,n=!0,r=!0,o=!0){if(n&&o&&this.setAll(!t,!1),o)for(let n=0;n<this._length;n++)e(n)&&this.setFast(n,t);else for(let n=0;n<this._length;n++)this.setFast(n,e(n)?t:!t);this.incrementVersion(r)}getRange(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let r=e;r<t;++r)n.push(this.getBit(r));return r.fromValues(n)}getRangeAsList(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let r=e;r<t;++r)n.push(this.getBit(r));return n}setRange(e,t,n,r=!0){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length-1,"to");const o=Math.min(e,t),s=Math.max(e,t);if(n)for(let e=o;e<=s;e++)this.setTrue(e);else for(let e=o;e<=s;e++)this.setFalse(e);return this.incrementVersion(r),this}setRandom(e,t,n=!0){if(e<0||e>this._length)throw new Error("n must be >= 0 && <= Count");e>this._length/2&&this.setRandom(this._length-e,!t),this.setAll(!t);for(let n=0;n<e;){const e=Math.floor(Math.random()*this._length);this.getBit(e)!=t&&(this.setFast(e,t),n++)}this.incrementVersion(n)}and(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]&=e._data[t];return this.incrementVersion(t),this}andNot(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");const n=this.lengthInInts;for(let t=0;t<n;t++)this._data[t]&=~e._data[t];return this.incrementVersion(t),this}notAnd(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]=~this._data[t]&e._data[t];return this.incrementVersion(t),this}not(e=!0){for(let e=0,t=this.lengthInInts;e<t;e++)this._data[e]=~this._data[e];return this.incrementVersion(e),this}or(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]|=e._data[t];return this.incrementVersion(t),this}xor(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]^=e._data[t];return this.incrementVersion(t),this}insertAt(e,t,n=!1){if(this.assureInRange(e,0,this._length,"pos"),0==t)return;const r=this._length;this.setLength(this._length+t);for(let n=r-1;n>=e;n--)this.setBit(n+t,this.getBit(n));for(let r=e;r<e+t;r++)this.setBit(r,n)}removeAt(e,t=1){if(t<0)throw new Error("n cannot be negative");if(this.assureInRange(e,0,this._length-t,"pos"),this.contains(!0))for(let n=e;n<this._length-t;n++)this.setBit(n,this.getBit(n+t));this.setLength(this._length-t)}removeByMask(e,t=!0){if(this._length!=e.length)throw new Error("length != mask.length");if(e==this)this.setLength(e.countBits(!t)),this.setAll(!t);else{let n=0;for(let r=-1;-1!=(r=e.findNext(r,!t));)this.setFast(n++,this.getBit(r));this._length=n,this._version++}return this}getBit(e){return!!(this._data[Math.floor(e/32)]&1<<(31&e))}setBit(e,t,n=!0){this.setFast(e,t),this._version++}setFast(e,t){t?this._data[Math.floor(e/32)]|=1<<(31&e):this._data[Math.floor(e/32)]&=~(1<<(31&e))}setTrue(e){this._data[Math.floor(e/32)]|=1<<(31&e)}setFalse(e){this._data[Math.floor(e/32)]&=~(1<<(31&e))}trueCount(){return this.countBits(!0)}falseCount(){return this.countBits(!1)}countBits(e){if(0==this._length)return 0;if(this._selectedCountVersion!=this._version){this._selectedCount=0;const e=this.lengthInInts;let t=0;for(;t<e-1;t++)for(let e=this._data[t];0!=e;e>>>=8)this._selectedCount+=r._onBitCount[255&e];let n=this._data[t];const o=31&this._length;for(0!=o&&(n&=~(4294967295<<o));0!=n;n>>>=8)this._selectedCount+=r._onBitCount[255&n];this._selectedCountVersion=this._version}return e?this._selectedCount:this._length-this._selectedCount}countWhere(e){let t=0;if(this.trueCount()==this._length)for(let n=0;n<this._length;n++)t+=e(n)?1:0;else for(let n=-1;-1!=(n=this.findNext(n,!0));)t+=e(n)?1:0;return t}andWithCountBits(e,t){if(0==this._length)return 0;let n=0;const o=this.lengthInInts;let s=0;for(;s<o-1;s++)for(let t=this._data[s]&e._data[s];0!=t;t>>>=8)n+=r._onBitCount[255&t];let i=this._data[s]&e._data[s];const a=31&this._length;for(0!=a&&(i&=~(4294967295<<a));0!=i;i>>>=8)n+=r._onBitCount[255&i];return t?n:this._length-n}clear(){this.setLength(0)}contains(e){return this.findNext(-1,e)>=0}get allTrue(){return this.countBits(!0)==this._length}get allFalse(){return this.countBits(!1)==this._length}get anyTrue(){return this.countBits(!0)>0}get anyFalse(){return this.countBits(!1)>0}findNext(e,t=!0){if(this.assureInRange(e,-1,this._length,"index"),e>=this._length-1)return-1;let n=31&(e=e<0?0:e+1);const o=this.lengthInInts;for(let s=Math.floor(e/32);s<o;s++){let o=t?this._data[s]:~this._data[s];if(0!=n)o&=4294967295<<n&4294967295,n=0;else if(!t&&-4294967296==o)continue;for(let t=0;0!=o;t+=8,o>>>=8){const n=r._firstOnBit[255&o];if(n>=0)return(e=n+32*s+t)>=this._length?-1:e}}return-1}findPrev(e,t=!0){if(0==e)return-1;this.assureInRange(e,-1,this._length,"index");let n=1+(e=e<0?this._length-1:e-1)&31;for(let o=Math.floor(e/32);o>=0;o--){let e=t?this._data[o]:~this._data[o];0!=n&&(e&=~(4294967295<<n),n=0);for(let t=24;0!=e;t-=8,e<<=8){const n=r._lastOnBit[e>>>24];if(n>=0)return n+32*o+t}}return-1}}r._onBitCount=Int8Array.from([0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8]),r._firstOnBit=Int8Array.from([-1,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0]),r._lastOnBit=Int8Array.from([-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7])},8070:(e,t,n)=>{"use strict";n.d(t,{Pl:()=>D,bk:()=>K,gM:()=>G,L1:()=>k,cb:()=>j,E3:()=>L,J6:()=>O,Wj:()=>I,Xk:()=>R,Xb:()=>F,N$:()=>V,t6:()=>$,PE:()=>x,rd:()=>N,Bl:()=>Z,CN:()=>w});var r=n(4328),o=n(6082);n(9982);const s=o.DataFrame.fromCsv('countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,Questions,empty_number,empty_string\nBelgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,1,1,1QBS,1,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.497360340644872, 1.7058694986686864, 5.278052678195135, 0.16000320889028383],""points"":[{""x"":0.10000000149011612,""y"":2.374499797821045},{""x"":0.6000000238418579,""y"":2.6242473125457764},{""x"":1.100000023841858,""y"":2.367267608642578},{""x"":1.600000023841858,""y"":2.6723148822784424},{""x"":2.0999999046325684,""y"":2.6537344455718994},{""x"":2.5999999046325684,""y"":2.3651671409606934},{""x"":3.0999999046325684,""y"":2.5654284954071045},{""x"":3.5999999046325684,""y"":2.4160959720611572},{""x"":4.099999904632568,""y"":2.286726713180542},{""x"":4.599999904632568,""y"":2.5100042819976807},{""x"":5.099999904632568,""y"":1.6676985025405884},{""x"":5.599999904632568,""y"":0.680136501789093},{""x"":6.099999904632568,""y"":0.3391543924808502},{""x"":6.599999904632568,""y"":0.09038983285427094},{""x"":7.099999904632568,""y"":0.19802775979042053}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[7.525235855508179, 1.3186911876809984, 5.335672608564294, 0.7860743343958098],""points"":[{""x"":0.10000000149011612,""y"":7.988070487976074},{""x"":0.6000000238418579,""y"":7.018453121185303},{""x"":1.100000023841858,""y"":8.115279197692871},{""x"":1.600000023841858,""y"":7.486658096313477},{""x"":2.0999999046325684,""y"":7.396438121795654},{""x"":2.5999999046325684,""y"":7.477052211761475},{""x"":3.0999999046325684,""y"":6.913095474243164},{""x"":3.5999999046325684,""y"":8.01385498046875},{""x"":4.099999904632568,""y"":6.985900402069092},{""x"":4.599999904632568,""y"":6.970335960388184},{""x"":5.099999904632568,""y"":5.448817253112793},{""x"":5.599999904632568,""y"":2.5534818172454834},{""x"":6.099999904632568,""y"":1.893947958946228},{""x"":6.599999904632568,""y"":0.6340042352676392},{""x"":7.099999904632568,""y"":0.8403874039649963}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,100,abc\nBurundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,2,2,1ZP8,2,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.431460753103398, 2.1691498799246745, 5.266445597102774, 0.7825762827017926],""points"":[{""x"":0.10000000149011612,""y"":4.751083850860596},{""x"":0.6000000238418579,""y"":4.203000068664551},{""x"":1.100000023841858,""y"":4.415858745574951},{""x"":1.600000023841858,""y"":4.68414306640625},{""x"":2.0999999046325684,""y"":4.198400974273682},{""x"":2.5999999046325684,""y"":4.179222106933594},{""x"":3.0999999046325684,""y"":4.638473987579346},{""x"":3.5999999046325684,""y"":4.708553314208984},{""x"":4.099999904632568,""y"":4.291589260101318},{""x"":4.599999904632568,""y"":4.038082599639893},{""x"":5.099999904632568,""y"":3.4349939823150635},{""x"":5.599999904632568,""y"":1.2194708585739136},{""x"":6.099999904632568,""y"":1.1920831203460693},{""x"":6.599999904632568,""y"":0.5352635979652405},{""x"":7.099999904632568,""y"":0.3346920311450958}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.339458017970126, -1.0734184310171178, 4.746332950550934, 0.2482416857595658],""points"":[{""x"":0.10000000149011612,""y"":0.2139337658882141},{""x"":0.6000000238418579,""y"":0.4269562065601349},{""x"":1.100000023841858,""y"":0.2441573292016983},{""x"":1.600000023841858,""y"":0.146635964512825},{""x"":2.0999999046325684,""y"":0.08818462491035461},{""x"":2.5999999046325684,""y"":0.2560656666755676},{""x"":3.0999999046325684,""y"":0.42434045672416687},{""x"":3.5999999046325684,""y"":0.37111231684684753},{""x"":4.099999904632568,""y"":0.5581737160682678},{""x"":4.599999904632568,""y"":1.183590054512024},{""x"":5.099999904632568,""y"":1.5629843473434448},{""x"":5.599999904632568,""y"":2.3211288452148438},{""x"":6.099999904632568,""y"":2.229961633682251},{""x"":6.599999904632568,""y"":2.2560226917266846},{""x"":7.099999904632568,""y"":2.2142398357391357}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,3,3,2BDJ,3,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.6760652578642325, 0.9046956320756703, 5.651408971856738, 0.07738846012184185],""points"":[{""x"":0.10000000149011612,""y"":4.32425594329834},{""x"":0.6000000238418579,""y"":4.668442249298096},{""x"":1.100000023841858,""y"":4.379785060882568},{""x"":1.600000023841858,""y"":5.0345139503479},{""x"":2.0999999046325684,""y"":4.878653526306152},{""x"":2.5999999046325684,""y"":4.3451313972473145},{""x"":3.0999999046325684,""y"":4.336992263793945},{""x"":3.5999999046325684,""y"":5.037430286407471},{""x"":4.099999904632568,""y"":5.0092692375183105},{""x"":4.599999904632568,""y"":4.151902675628662},{""x"":5.099999904632568,""y"":3.4066951274871826},{""x"":5.599999904632568,""y"":2.3732759952545166},{""x"":6.099999904632568,""y"":1.673728108406067},{""x"":6.599999904632568,""y"":0.48574790358543396},{""x"":7.099999904632568,""y"":0.2783052325248718}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.938395863010111, -1.4658480661392117, 5.462702751996584, 0.3473139023615039],""points"":[{""x"":0.10000000149011612,""y"":0.4941710829734802},{""x"":0.6000000238418579,""y"":0.15323974192142487},{""x"":1.100000023841858,""y"":0.46373432874679565},{""x"":1.600000023841858,""y"":0.3370431363582611},{""x"":2.0999999046325684,""y"":0.5179030299186707},{""x"":2.5999999046325684,""y"":0.27899765968322754},{""x"":3.0999999046325684,""y"":0.22075064480304718},{""x"":3.5999999046325684,""y"":0.5789918899536133},{""x"":4.099999904632568,""y"":0.21169911324977875},{""x"":4.599999904632568,""y"":0.27857646346092224},{""x"":5.099999904632568,""y"":1.0906332731246948},{""x"":5.599999904632568,""y"":1.8520300388336182},{""x"":6.099999904632568,""y"":2.7177059650421143},{""x"":6.599999904632568,""y"":2.8680918216705322},{""x"":7.099999904632568,""y"":3.2413077354431152}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCanada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,4,4,1IAN,4,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[0.8597390975430008, 1.0957625732481946, 5.260537067987958, 0.07974187998177736],""points"":[{""x"":0.10000000149011612,""y"":0.8190152645111084},{""x"":0.6000000238418579,""y"":0.8421689867973328},{""x"":1.100000023841858,""y"":0.8740922212600708},{""x"":1.600000023841858,""y"":0.8924275040626526},{""x"":2.0999999046325684,""y"":0.8249067664146423},{""x"":2.5999999046325684,""y"":0.9327669143676758},{""x"":3.0999999046325684,""y"":0.8522974252700806},{""x"":3.5999999046325684,""y"":0.8174492716789246},{""x"":4.099999904632568,""y"":0.8394647240638733},{""x"":4.599999904632568,""y"":0.7139387726783752},{""x"":5.099999904632568,""y"":0.5561167597770691},{""x"":5.599999904632568,""y"":0.3276226818561554},{""x"":6.099999904632568,""y"":0.12479474395513535},{""x"":6.599999904632568,""y"":0.13006797432899475},{""x"":7.099999904632568,""y"":0.059702079743146896}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.760930219582546, 1.6591793293833013, 4.667155929720851, 0.7858109544121652],""points"":[{""x"":0.10000000149011612,""y"":6.156993389129639},{""x"":0.6000000238418579,""y"":5.236701965332031},{""x"":1.100000023841858,""y"":6.010560512542725},{""x"":1.600000023841858,""y"":5.495512962341309},{""x"":2.0999999046325684,""y"":6.087770462036133},{""x"":2.5999999046325684,""y"":5.79986572265625},{""x"":3.0999999046325684,""y"":5.597546577453613},{""x"":3.5999999046325684,""y"":5.520902156829834},{""x"":4.099999904632568,""y"":5.360654354095459},{""x"":4.599999904632568,""y"":3.5539746284484863},{""x"":5.099999904632568,""y"":1.577236294746399},{""x"":5.599999904632568,""y"":1.0001264810562134},{""x"":6.099999904632568,""y"":0.9305797815322876},{""x"":6.599999904632568,""y"":0.6033638715744019},{""x"":7.099999904632568,""y"":0.4203685522079468}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nColombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,5,5,4UJ1,5,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[6.4995088314153655, 2.4270351004539914, 5.178659535348579, 0.625653346241577],""points"":[{""x"":0.10000000149011612,""y"":6.496231555938721},{""x"":0.6000000238418579,""y"":6.42543363571167},{""x"":1.100000023841858,""y"":7.040063858032227},{""x"":1.600000023841858,""y"":6.1115403175354},{""x"":2.0999999046325684,""y"":6.680728435516357},{""x"":2.5999999046325684,""y"":6.406774520874023},{""x"":3.0999999046325684,""y"":6.611269474029541},{""x"":3.5999999046325684,""y"":5.889094352722168},{""x"":4.099999904632568,""y"":6.75344705581665},{""x"":4.599999904632568,""y"":6.361435890197754},{""x"":5.099999904632568,""y"":4.1666975021362305},{""x"":5.599999904632568,""y"":1.172118902206421},{""x"":6.099999904632568,""y"":0.801048994064331},{""x"":6.599999904632568,""y"":0.4640021026134491},{""x"":7.099999904632568,""y"":0.0010357667924836278}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[1.4734381347446401, 1.1649805188074196, 4.82958608866421, 0.09500545496710007],""points"":[{""x"":0.10000000149011612,""y"":1.5279096364974976},{""x"":0.6000000238418579,""y"":1.3559974431991577},{""x"":1.100000023841858,""y"":1.5246378183364868},{""x"":1.600000023841858,""y"":1.5567657947540283},{""x"":2.0999999046325684,""y"":1.4114240407943726},{""x"":2.5999999046325684,""y"":1.4045010805130005},{""x"":3.0999999046325684,""y"":1.4769829511642456},{""x"":3.5999999046325684,""y"":1.4875500202178955},{""x"":4.099999904632568,""y"":1.2991987466812134},{""x"":4.599999904632568,""y"":0.922961413860321},{""x"":5.099999904632568,""y"":0.6520044803619385},{""x"":5.599999904632568,""y"":0.15350978076457977},{""x"":6.099999904632568,""y"":0.1078903079032898},{""x"":6.599999904632568,""y"":0.17276449501514435},{""x"":7.099999904632568,""y"":0.14066608250141144}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCosta Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,6,6,2BPW,6,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.4833641843311227, -1.8945978742090062, 4.671127708092568, 0.24159861311815153],""points"":[{""x"":0.10000000149011612,""y"":0.0969524160027504},{""x"":0.6000000238418579,""y"":0.028483040630817413},{""x"":1.100000023841858,""y"":0.22087176144123077},{""x"":1.600000023841858,""y"":0.0068915546871721745},{""x"":2.0999999046325684,""y"":0.4305879771709442},{""x"":2.5999999046325684,""y"":0.44774115085601807},{""x"":3.0999999046325684,""y"":0.45346319675445557},{""x"":3.5999999046325684,""y"":0.2370593100786209},{""x"":4.099999904632568,""y"":0.4657953977584839},{""x"":4.599999904632568,""y"":1.155200719833374},{""x"":5.099999904632568,""y"":2.2294070720672607},{""x"":5.599999904632568,""y"":2.4311530590057373},{""x"":6.099999904632568,""y"":2.33846116065979},{""x"":6.599999904632568,""y"":2.608201026916504},{""x"":7.099999904632568,""y"":2.8136143684387207}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.224573521642033, 1.4454033924198528, 5.6014197746076535, 0.2823216054197577],""points"":[{""x"":0.10000000149011612,""y"":4.95027494430542},{""x"":0.6000000238418579,""y"":5.1754679679870605},{""x"":1.100000023841858,""y"":5.276752948760986},{""x"":1.600000023841858,""y"":5.589294910430908},{""x"":2.0999999046325684,""y"":5.616994857788086},{""x"":2.5999999046325684,""y"":5.120813846588135},{""x"":3.0999999046325684,""y"":5.340766906738281},{""x"":3.5999999046325684,""y"":4.876471042633057},{""x"":4.099999904632568,""y"":4.94999361038208},{""x"":4.599999904632568,""y"":5.162564754486084},{""x"":5.099999904632568,""y"":4.399557590484619},{""x"":5.599999904632568,""y"":2.7977969646453857},{""x"":6.099999904632568,""y"":1.0229872465133667},{""x"":6.599999904632568,""y"":0.48275601863861084},{""x"":7.099999904632568,""y"":0.10408931970596313}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,7,7,1QBS,7,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.320838679713925, -1.2421619987316728, 4.831325425225256, 0.3236011098403072],""points"":[{""x"":0.10000000149011612,""y"":0.3727470338344574},{""x"":0.6000000238418579,""y"":0.12365014106035233},{""x"":1.100000023841858,""y"":0.48422467708587646},{""x"":1.600000023841858,""y"":0.2264465093612671},{""x"":2.0999999046325684,""y"":0.16821794211864471},{""x"":2.5999999046325684,""y"":0.3879014551639557},{""x"":3.0999999046325684,""y"":0.5470244884490967},{""x"":3.5999999046325684,""y"":0.3419053554534912},{""x"":4.099999904632568,""y"":0.7655120491981506},{""x"":4.599999904632568,""y"":1.2346516847610474},{""x"":5.099999904632568,""y"":2.453336715698242},{""x"":5.599999904632568,""y"":2.9565491676330566},{""x"":6.099999904632568,""y"":3.335299491882324},{""x"":6.599999904632568,""y"":3.240290880203247},{""x"":7.099999904632568,""y"":3.1107218265533447}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.6401853521511094, 1.26211588875013, 5.399028074402744, 0.5089580830068091],""points"":[{""x"":0.10000000149011612,""y"":3.8585598468780518},{""x"":0.6000000238418579,""y"":3.6077206134796143},{""x"":1.100000023841858,""y"":3.855252265930176},{""x"":1.600000023841858,""y"":3.619039297103882},{""x"":2.0999999046325684,""y"":3.839388370513916},{""x"":2.5999999046325684,""y"":3.335283041000366},{""x"":3.0999999046325684,""y"":3.571141481399536},{""x"":3.5999999046325684,""y"":3.4155046939849854},{""x"":4.099999904632568,""y"":3.7316646575927734},{""x"":4.599999904632568,""y"":3.0680155754089355},{""x"":5.099999904632568,""y"":2.891066551208496},{""x"":5.599999904632568,""y"":1.6022753715515137},{""x"":6.099999904632568,""y"":0.7652576565742493},{""x"":6.599999904632568,""y"":0.6875326037406921},{""x"":7.099999904632568,""y"":0.5828871726989746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nItaly,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,8,8,1ZP8,8,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.293592105923809, 1.3781586549141835, 5.1025898038676605, 0.03493851245291291],""points"":[{""x"":0.10000000149011612,""y"":2.1287283897399902},{""x"":0.6000000238418579,""y"":2.267972230911255},{""x"":1.100000023841858,""y"":2.398442506790161},{""x"":1.600000023841858,""y"":2.5130622386932373},{""x"":2.0999999046325684,""y"":2.3255116939544678},{""x"":2.5999999046325684,""y"":2.127340793609619},{""x"":3.0999999046325684,""y"":2.47259783744812},{""x"":3.5999999046325684,""y"":2.131181478500366},{""x"":4.099999904632568,""y"":2.090421438217163},{""x"":4.599999904632568,""y"":2.02299165725708},{""x"":5.099999904632568,""y"":1.1105059385299683},{""x"":5.599999904632568,""y"":0.4494485855102539},{""x"":6.099999904632568,""y"":0.1375635862350464},{""x"":6.599999904632568,""y"":0.036351121962070465},{""x"":7.099999904632568,""y"":0.1619771122932434}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.953125499439879, 1.2528620255306528, 5.187637440149802, 0.3110348753260886],""points"":[{""x"":0.10000000149011612,""y"":5.6585283279418945},{""x"":0.6000000238418579,""y"":5.911152362823486},{""x"":1.100000023841858,""y"":5.924920082092285},{""x"":1.600000023841858,""y"":5.8469438552856445},{""x"":2.0999999046325684,""y"":5.929472923278809},{""x"":2.5999999046325684,""y"":6.190037727355957},{""x"":3.0999999046325684,""y"":6.236179828643799},{""x"":3.5999999046325684,""y"":6.141019344329834},{""x"":4.099999904632568,""y"":5.295210838317871},{""x"":4.599999904632568,""y"":5.265801906585693},{""x"":5.099999904632568,""y"":3.3722851276397705},{""x"":5.599999904632568,""y"":1.8299226760864258},{""x"":6.099999904632568,""y"":0.32690900564193726},{""x"":6.599999904632568,""y"":0.6274543404579163},{""x"":7.099999904632568,""y"":0.8441857099533081}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nRwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,9,2BDJ,9,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.8209972202654474, 1.3779216716448506, 5.299882228439686, 0.06040645519069608],""points"":[{""x"":0.10000000149011612,""y"":3.7821109294891357},{""x"":0.6000000238418579,""y"":3.542433023452759},{""x"":1.100000023841858,""y"":3.7008674144744873},{""x"":1.600000023841858,""y"":3.717301607131958},{""x"":2.0999999046325684,""y"":4.024452209472656},{""x"":2.5999999046325684,""y"":4.013899326324463},{""x"":3.0999999046325684,""y"":3.945094347000122},{""x"":3.5999999046325684,""y"":3.866621971130371},{""x"":4.099999904632568,""y"":3.7461626529693604},{""x"":4.599999904632568,""y"":3.3454740047454834},{""x"":5.099999904632568,""y"":2.61944317817688},{""x"":5.599999904632568,""y"":0.999405026435852},{""x"":6.099999904632568,""y"":0.46259793639183044},{""x"":6.599999904632568,""y"":0.054134611040353775},{""x"":7.099999904632568,""y"":0.05711187422275543}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.6318079657726035, 1.8495493770000595, 5.391793312471116, 0.17060707587348442],""points"":[{""x"":0.10000000149011612,""y"":5.458079814910889},{""x"":0.6000000238418579,""y"":5.554427146911621},{""x"":1.100000023841858,""y"":5.799983024597168},{""x"":1.600000023841858,""y"":5.364140033721924},{""x"":2.0999999046325684,""y"":5.864485740661621},{""x"":2.5999999046325684,""y"":5.4509806632995605},{""x"":3.0999999046325684,""y"":5.702574729919434},{""x"":3.5999999046325684,""y"":5.7314534187316895},{""x"":4.099999904632568,""y"":5.5123443603515625},{""x"":4.599999904632568,""y"":5.724395751953125},{""x"":5.099999904632568,""y"":4.354506969451904},{""x"":5.599999904632568,""y"":1.7307666540145874},{""x"":6.099999904632568,""y"":0.6305936574935913},{""x"":6.599999904632568,""y"":0.035183437168598175},{""x"":7.099999904632568,""y"":0.7575169205665588}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nSwitzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,10,1IAN,10,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[1.1190255865097471, 2.3163895161544437, 5.4968866182279195, 0.2035204047289052],""points"":[{""x"":0.10000000149011612,""y"":1.1057683229446411},{""x"":0.6000000238418579,""y"":1.1019697189331055},{""x"":1.100000023841858,""y"":1.0818607807159424},{""x"":1.600000023841858,""y"":1.062997817993164},{""x"":2.0999999046325684,""y"":1.046447515487671},{""x"":2.5999999046325684,""y"":1.1217249631881714},{""x"":3.0999999046325684,""y"":1.2166996002197266},{""x"":3.5999999046325684,""y"":1.215477705001831},{""x"":4.099999904632568,""y"":1.0581893920898438},{""x"":4.599999904632568,""y"":1.1747995615005493},{""x"":5.099999904632568,""y"":1.0181127786636353},{""x"":5.599999904632568,""y"":0.5344523191452026},{""x"":6.099999904632568,""y"":0.2569526433944702},{""x"":6.599999904632568,""y"":0.1912207305431366},{""x"":7.099999904632568,""y"":0.15060538053512573}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.1038581025805785, 2.0032224204185245, 5.087602825989163, 0.13277988512492753],""points"":[{""x"":0.10000000149011612,""y"":3.0498509407043457},{""x"":0.6000000238418579,""y"":2.805217742919922},{""x"":1.100000023841858,""y"":3.3415253162384033},{""x"":1.600000023841858,""y"":3.0549843311309814},{""x"":2.0999999046325684,""y"":3.250074863433838},{""x"":2.5999999046325684,""y"":3.0432586669921875},{""x"":3.0999999046325684,""y"":3.265852451324463},{""x"":3.5999999046325684,""y"":2.9475724697113037},{""x"":4.099999904632568,""y"":3.1929898262023926},{""x"":4.599999904632568,""y"":2.7460060119628906},{""x"":5.099999904632568,""y"":1.6175861358642578},{""x"":5.599999904632568,""y"":0.3006608486175537},{""x"":6.099999904632568,""y"":0.3444803059101105},{""x"":6.599999904632568,""y"":0.015537971630692482},{""x"":7.099999904632568,""y"":0.5527358055114746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\n,,,,,,,,,,,,,,,,,,,,,');s.columns.add(o.Column.fromList(o.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var i=function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};function a(e,t,n,o,s,a,c,l,u=!0){return i(this,void 0,void 0,(function*(){let d=null;if(yield N(o,(n=>i(this,void 0,void 0,(function*(){let n=null;for(const r of e.viewers)r.type===t&&(n=r);if(!n)throw Error("Viewer hasn't been added");if(yield Promise.resolve(),a&&(yield a(n)),s){const t=null!=l?l:{};t.tv=e,t.viewer=n,d=yield s(t,u)}yield x(r.events.onViewerClosed,(()=>{L(n.subs.some((e=>!e.closed)),!1)}),(()=>n.close()),3e3)}))),(()=>i(this,void 0,void 0,(function*(){c?e.loadLayout(c):yield function(e,t,n){return i(this,void 0,void 0,(function*(){let r;return n?(r=yield e.dataFrame.plot.fromType(t),e.dockManager.dock(r)):r=e.addViewer(t),r}))}(e,t,n)}))),6e4,"TEST_EVENT_ASYNC"),d)return d}))}function c(e,t=!0){return i(this,void 0,void 0,(function*(){const n=e.tv.dataFrame,r=n.clone();Array.from(n.row(0).cells).forEach((e=>e.value=null));const o=n.rowCount<20?Math.floor(n.rowCount/2):10;n.rows.select((e=>e.idx>=0&&e.idx<o)),t&&(yield j(50));for(let e=o;e<2*o;e++)n.filter.set(e,!1);t&&(yield j(50)),n.currentRowIdx=1,n.columns.names().slice(0,Math.ceil(n.columns.length/2)).forEach((e=>n.columns.remove(e))),t&&(yield j(100)),e.tv.dataFrame=r,yield j(50)}))}function l(e,t=!0){return i(this,void 0,void 0,(function*(){const t=e.tv.dataFrame;setTimeout((()=>t.filter.set(0,!t.filter.get(0))),0)}))}function u(e,t=!0){return i(this,void 0,void 0,(function*(){let t,n;try{t=e.viewer.getOptions(!0).look}catch(e){throw new Error("Viewer's .getOptions() error.",{cause:e})}try{n=e.viewer.getProperties()}catch(e){throw new Error("Viewer's .getProperties() error.",{cause:e})}const r={};return Object.keys(t).filter((e=>"boolean"==typeof t[e])).forEach((e=>r[e]=!t[e])),n.filter((e=>null!==e.choices)).forEach((e=>r[e.name]=e.choices.find((n=>n!==t[e.name])))),e.viewer.setOptions(r),yield j(300),{layout:e.tv.saveLayout(),savedProps:e.viewer.getOptions().look}}))}function d(e,t=!0){return i(this,void 0,void 0,(function*(){L(JSON.stringify(e.viewer.getOptions().look),JSON.stringify(e.savedProps))}))}var h=function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};const p=3e4,m=108e5,f=console.log.bind(console),g=console.info.bind(console),y=console.warn.bind(console),b=console.error.bind(console),w={},v="Auto Tests",A="Demo",E="Detectors",C="Core",T={};let S;var _;!function(e){e.notNull=function(e,t){if(null==e)throw new Error(`${null==t?"Value":t} not defined`)}}(_||(_={}));class P{constructor(e,t){this.catchUnhandled=!0,this.report=!1,void 0!==e&&(this.catchUnhandled=e),void 0!==t&&(this.report=t)}}class M{constructor(e,t,n,r){var s;this.category=e,this.name=t,null!=r||(r={}),null!==(s=r.timeout)&&void 0!==s||(r.timeout=p),this.options=r,this.test=()=>h(this,void 0,void 0,(function*(){return new Promise(((e,t)=>h(this,void 0,void 0,(function*(){var r;let s="";try{o.Test.isInDebug;let e=yield n();try{s=null!==(r=null==e?void 0:e.toString())&&void 0!==r?r:""}catch(e){s="Can't convert test's result to string",console.error(`Can't convert test's result to string in the ${this.category}:${this.name} test`)}}catch(e){t(e)}e(s)}))))}))}}function x(e,t,n,r=0,o="timeout"){return h(this,void 0,void 0,(function*(){return new Promise(((s,i)=>{const a=e.subscribe((e=>{try{t(e),s("OK")}catch(e){i(e)}finally{a.unsubscribe(),clearTimeout(c)}})),c=setTimeout((()=>{a.unsubscribe(),i(o)}),r);n()}))}))}function N(e,t,n,r=0,o="timeout"){return h(this,void 0,void 0,(function*(){return new Promise(((s,i)=>{const a=e.subscribe((e=>{t(e).then((()=>{s("OK")})).catch((e=>{i(e)})).finally((()=>{a.unsubscribe(),clearTimeout(c)}))})),c=setTimeout((()=>{a.unsubscribe(),i(o)}),r);n()}))}))}function $(e,t,n){null==w[S]&&(w[S]={}),null==w[S].tests&&(w[S].tests=[]),w[S].tests.push(new M(S,e,t,n))}function L(e,t=!0,n){if(n=n?`${n}, `:"",e!==t)throw new Error(`${n}Expected "${t}", got "${e}"`)}function I(e,t,n=.001,r){if(e===Number.POSITIVE_INFINITY&&t===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY&&t===Number.NEGATIVE_INFINITY||e===Number.NaN&&t===Number.NaN||isNaN(e)&&isNaN(t))return;const o=Math.abs(e-t)<n;if(L(o,!0,`${null!=r?r:""} (tolerance = ${n})`),!o)throw new Error(`Expected ${t}, got ${e} (tolerance = ${n})`)}function R(e,t){for(const[n,r]of Object.entries(t)){if(!e.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const t=e[n];if(t instanceof Array&&r instanceof Array)O(t,r);else if(t instanceof Object&&r instanceof Object)R(t,r);else if(Number.isFinite(t)&&Number.isFinite(r))I(t,r);else if(t!=r)throw new Error(`Expected (${r}) for key '${n}', got (${t})`)}}function O(e,t){const n=e.length,r=t.length;if(n!=r)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${r}`);for(let r=0;r<n;r++)if(e[r]instanceof Array&&t[r]instanceof Array)O(e[r],t[r]);else if(e[r]instanceof Object&&t[r]instanceof Object)R(e[r],t[r]);else if(e[r]!=t[r])throw new Error(`Expected ${t[r]} at position ${r}, got ${e[r]}`)}function k(e,t,n){var r;S=e,t(),w[S]&&(w[S].clear=null===(r=null==n?void 0:n.clear)||void 0===r||r,w[S].timeout=null==n?void 0:n.timeout,w[S].benchmarks=null==n?void 0:n.benchmarks,w[S].stressTests=null==n?void 0:n.stressTests,w[S].owner=null==n?void 0:n.owner)}function G(e){null==w[S]&&(w[S]={}),w[S].before=e}function D(e){null==w[S]&&(w[S]={}),w[S].after=e}function H(e,t){return e.replace(new RegExp(t.name,"gi"),t.nqName)}function F(e,t){var n,i,a,c,l,u,d,f,g,y;return h(this,void 0,void 0,(function*(){const b=e.id;if(T[b])return;const S=t?t.tests:w;if("DevTools"===e.name||t&&"DevTools"===t._package.name)for(const e of window.dartTests){const t=e.name.split(/\s*\|\s*!/g);let r=null!==(n=t.pop())&&void 0!==n?n:e.name,o=t.length?C+": "+t.join(": "):C,s=r.split(" | ");r=s[s.length-1],s.unshift(o),s.pop(),o=s.join(": "),void 0===S[o]&&(S[o]={tests:[],clear:!0}),S[o].tests.push(new M(o,r,e.test,{isAggregated:!1,timeout:null!==(a=null===(i=e.options)||void 0===i?void 0:i.timeout)&&void 0!==a?a:p,skipReason:null===(c=e.options)||void 0===c?void 0:c.skipReason,owner:null===(l=e.options)||void 0===l?void 0:l.owner,benchmark:null!==(d=null===(u=e.options)||void 0===u?void 0:u.benchmark)&&void 0!==d&&d}))}const _=[],P=[],x=[],N=yield r.dapi.functions.filter(`package.id = "${b}"`).list(),$=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const t of N){const n=t.options.test,i=t.options.demoPath;if(n&&Array.isArray(n)&&n.length)for(let e=0;e<n.length;e++){const s=n[e].matchAll($),i={};Array.from(s).forEach((e=>{e[0].startsWith("skip")?i.skip=e[1]:e[0].startsWith("wait")?i.wait=parseInt(e[2]):e[0].startsWith("cat")?i.cat=e[3]:e[0].startsWith("timeout")&&(i.timeout=parseInt(e[4]))}));const a=new M(null!==(f=i.cat)&&void 0!==f?f:v,1===n.length?t.name:`${t.name} ${e+1}`,(()=>h(this,void 0,void 0,(function*(){const o=yield r.functions.eval(H(n[e],t));if(i.wait&&(yield j(i.wait)),"boolean"==typeof o&&!o)throw`Failed: ${n[e]}, expected true, got ${o}`}))),{skipReason:i.skip,timeout:o.Test.isInBenchmark?null!==(g=i.benchmarkTimeout)&&void 0!==g?g:m:null!==(y=i.timeout)&&void 0!==y?y:p});if(i.cat){const e=i.cat;void 0===S[e]&&(S[e]={tests:[],clear:!0}),S[e].tests||(S[e].tests=[]),S[e].tests.push(a)}else _.push(a)}if(i){const e=t.options.demoWait?parseInt(t.options.demoWait):void 0,n=new M(A,t.friendlyName,(()=>h(this,void 0,void 0,(function*(){yield j(300),r.shell.clearLastError(),yield t.apply(),yield j(e||2e3);const n=yield r.shell.lastError;if(n)throw new Error(n)}))),{skipReason:t.options.demoSkip});P.push(n)}if(t.hasTag("semTypeDetector")){let n=s;t.options.testData&&(n=yield r.data.files.openTable(`System:AppData/${e.nqName}/${t.options.testData}`));const o=new M(E,t.friendlyName,(()=>h(this,void 0,void 0,(function*(){const r=[];console.log(`System:AppData/${e.nqName}/${t.options.testData}`);for(const e of n.clone().columns){const n=yield t.apply([e]);r.push(n||e.semType)}const o=r.filter((e=>e));L(o.length,1),t.options.testDataColumnName&&L(o[0],t.options.testDataColumnName)}))),{skipReason:t.options.skipTest});x.push(o)}}T[b]=!0,_.length>0&&(S[v]={tests:_,clear:!0}),P.length>0&&(S[A]={tests:P,clear:!0}),x.length>0&&(S[E]={tests:x,clear:!1})}))}function V(e){var t,n,s,i,a,c;return h(this,void 0,void 0,(function*(){console.log("--------------------");const l=null===(n=null===(t=r.functions.getCurrentCall())||void 0===t?void 0:t.func)||void 0===n?void 0:n.package,u=(null!==(i=(null!==(s=null==l?void 0:l.packageOwner)&&void 0!==s?s:"").match(new RegExp("[^<]*<([^>]*)>")))&&void 0!==i?i:["",""])[1];yield F(l);const d=[];console.log("Running tests"),console.log(e),null!=e||(e={}),null!==(a=(c=e).testContext)&&void 0!==a||(c.testContext=new P),r.shell.clearLastError();const v=function(){const e=[];return console.log=(...t)=>{e.push(...t),f(...t)},console.info=(...t)=>{e.push(...t),g(...t)},console.warn=(...t)=>{e.push(...t),y(...t)},console.error=(...t)=>{e.push(...t),b(...t)},e}();yield function(e,t){var n,s,i,a,c,p,m;return h(this,void 0,void 0,(function*(){try{for(const[r,u]of Object.entries(e)){if((null==t?void 0:t.category)&&!r.toLowerCase().startsWith(null==t?void 0:t.category.toLowerCase())||(null===(n=t.exclude)||void 0===n?void 0:n.some((e=>r.startsWith(e)))))continue;f(`Started ${r} category`);const e=null===(s=u.tests)||void 0===s?void 0:s.every((e=>{var t;return null===(t=e.options)||void 0===t?void 0:t.skipReason}));e||(u.beforeStatus=yield A(u.before,null!==(i=t.category)&&void 0!==i?i:""));let g,y=null!==(a=u.tests)&&void 0!==a?a:[];t.stressTest&&(y=y.filter((e=>{var t;return null===(t=e.options)||void 0===t?void 0:t.stressTest})),y=W(y)),(null!==(p=null===(c=t.tags)||void 0===c?void 0:c.length)&&void 0!==p?p:0)>0&&(y=y.filter((e=>{var n,r;return null===(r=null===(n=e.options)||void 0===n?void 0:n.tags)||void 0===r?void 0:r.some((e=>{var n;return(null!==(n=null==t?void 0:t.tags)&&void 0!==n?n:[]).includes(e)}))}))),u.beforeStatus?(g=Array.from(y.map((e=>({date:(new Date).toISOString(),category:r,name:e.name,success:!1,result:"before() failed",ms:0,skipped:!1,logs:"",owner:null==l?void 0:l.packageOwner,package:l.name,widgetsDifference:0,flaking:o.Test.isReproducing})))),g.forEach((e=>h(this,void 0,void 0,(function*(){return U("package",e)}))))):g=yield E(u,t);const b=g.filter((e=>"skipped"!=e.result));e||(u.afterStatus=yield A(u.after,null!==(m=t.category)&&void 0!==m?m:"")),u.afterStatus&&b.push({date:(new Date).toISOString(),category:r,name:"after",success:!1,result:u.afterStatus,ms:0,skipped:!1,logs:"",owner:null==l?void 0:l.packageOwner,package:l.name,widgetsDifference:0,flaking:o.Test.isReproducing}),u.beforeStatus&&b.push({date:(new Date).toISOString(),category:r,name:"before",success:!1,result:u.beforeStatus,ms:0,skipped:!1,logs:"",owner:null==l?void 0:l.packageOwner,package:l.name,widgetsDifference:0,flaking:o.Test.isReproducing}),d.push(...b)}}finally{console.log=f,console.info=g,console.warn=y,console.error=b}if(t.testContext.catchUnhandled&&!o.Test.isInBenchmark){yield j(1e3);const e=yield r.shell.lastError,t={logs:"",date:(new Date).toISOString(),category:"Unhandled exceptions",name:"Exception",result:null!=e?e:"",success:!e,ms:0,skipped:!1,owner:null!=u?u:"",package:l.name,widgetsDifference:0};d.push(Object.assign(Object.assign({},t),{flaking:o.Test.isReproducing&&!e})),t.package=l.name,yield U("package",t)}}))}(w,e);for(let e of d)e.result=e.result.toString().replace(/"/g,"'"),null!=e.logs&&(e.logs=e.logs.toString().replace(/"/g,"'"));return d;function A(e,t){return h(this,void 0,void 0,(function*(){let n;try{void 0!==e&&(yield q((()=>h(this,void 0,void 0,(function*(){yield e()}))),1e5,`before ${t}: timeout error`))}catch(e){n=yield B(e)}return n}))}function E(e,t){var n,s,i,a,c,d,f,g,y,b,w,A,E,T,S,_,P,M;return h(this,void 0,void 0,(function*(){let h=null!==(n=e.tests)&&void 0!==n?n:[];const x=[],N=C();if(e.clear)for(let n=0;n<h.length;n++){h[n].options&&void 0===(null===(s=h[n].options)||void 0===s?void 0:s.benchmark)&&(h[n].options||(h[n].options={}),h[n].options.benchmark=null!==(i=e.benchmarks)&&void 0!==i&&i);let A=h[n];if(t.test&&t.test.toLowerCase()!==A.name.toLowerCase())continue;(null==A?void 0:A.options)&&(A.options.owner=null!==(f=null!==(d=null!==(c=null===(a=h[n].options)||void 0===a?void 0:a.owner)&&void 0!==c?c:null==e?void 0:e.owner)&&void 0!==d?d:u)&&void 0!==f?f:"");let E=yield Y(A,null==t?void 0:t.test,v,o.Test.isInBenchmark?null!==(y=null===(g=h[n].options)||void 0===g?void 0:g.benchmarkTimeout)&&void 0!==y?y:m:null!==(w=null===(b=h[n].options)||void 0===b?void 0:b.timeout)&&void 0!==w?w:p,l.name,t.verbose);E&&x.push(Object.assign(Object.assign({},E),{widgetsDifference:C()-N})),r.shell.closeAll(),o.Balloon.closeAll()}else for(let n=0;n<h.length;n++){let r=h[n];if(t.test&&t.test.toLowerCase()!==r.name.toLowerCase())continue;(null==r?void 0:r.options)&&(r.options.owner=null!==(S=null!==(T=null!==(E=null===(A=h[n].options)||void 0===A?void 0:A.owner)&&void 0!==E?E:null==e?void 0:e.owner)&&void 0!==T?T:u)&&void 0!==S?S:"");let s=yield Y(r,null==t?void 0:t.test,v,o.Test.isInBenchmark?null!==(P=null===(_=h[n].options)||void 0===_?void 0:_.benchmarkTimeout)&&void 0!==P?P:m:null===(M=h[n].options)||void 0===M?void 0:M.timeout,l.name,t.verbose);s&&x.push(Object.assign(Object.assign({},s),{widgetsDifference:C()-N}))}return x}))}function C(){var e;let t=-1;try{t=o.Widget.getAll().length}catch(t){console.warn(null!==(e=t.message)&&void 0!==e?e:t)}return t}}))}function U(e,t){return h(this,void 0,void 0,(function*(){null!=r.shell.reportTest?yield r.shell.reportTest(e,t):yield fetch(`${r.dapi.root}/log/tests/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)})}))}function B(e){return h(this,void 0,void 0,(function*(){return`${e.toString()}\n${e.stack?yield o.Logger.translateStackTrace(e.stack):""}`}))}function Y(e,t,n,s,i,a){var c,l,u,d,m,g,y,w,v,A,E,C,T,S;return h(this,void 0,void 0,(function*(){let h;n.length=0;const _=null!=t&&e.name.toLowerCase()!==t.toLowerCase();let P=(null===(c=e.options)||void 0===c?void 0:c.skipReason)||_,M=_?"skipped":null===(l=e.options)||void 0===l?void 0:l.skipReason;if(console.log($.name,P),o.Test.isInBenchmark&&!(null===(u=e.options)||void 0===u?void 0:u.benchmark))return void f(`SKIPPED: ${e.category} ${e.name} doesnt available in benchmark mode`);P||f(`Started ${e.category} ${e.name}`);const x=Date.now(),N=new Date(x).toISOString();try{if(P)h={name:e.name,owner:null!==(m=null===(d=e.options)||void 0===d?void 0:d.owner)&&void 0!==m?m:"",category:e.category,logs:"",date:N,success:!0,result:M,ms:0,skipped:!0,package:null!=i?i:"",flaking:o.Test.isReproducing};else{let t=null!=s?s:p;o.Test.isProfiling&&console.profile(`${e.category}: ${e.name}`),h={name:e.name,owner:null!==(y=null===(g=e.options)||void 0===g?void 0:g.owner)&&void 0!==y?y:"",category:e.category,logs:"",date:N,success:!0,result:null!==(w=yield q(e.test,t))&&void 0!==w?w:"OK",ms:0,skipped:!1,package:null!=i?i:"",flaking:o.Test.isReproducing},o.Test.isProfiling&&(console.profileEnd(`${e.category}: ${e.name}`),r.shell.info(`Profiling of ${e.category}: ${e.name} finished \n Please ensure that you have opened DevTools (F12) / Performance panel before test starts.`))}}catch(t){b(t),h={name:e.name,owner:null!==(A=null===(v=e.options)||void 0===v?void 0:v.owner)&&void 0!==A?A:"",category:e.category,logs:"",date:N,success:!1,result:yield B(t),ms:0,skipped:!1,package:null!=i?i:"",flaking:!1}}if((null===(E=e.options)||void 0===E?void 0:E.isAggregated)&&h.result.constructor===o.DataFrame){const e=h.result.col("success");if(e&&(h.success=e.stats.sum===e.length),!a){const e=h.result;e.columns.remove("stack"),e.rows.removeWhere((e=>e.get("success"))),h.result=e}h.result=h.result.toCsv()}if(h.logs=n.join("\n"),h.ms=Date.now()-x,P||f(`Finished ${e.category} ${e.name} for ${h.ms} ms`),h.category=e.category,h.name=e.name,h.owner=null!==(T=null===(C=e.options)||void 0===C?void 0:C.owner)&&void 0!==T?T:"",!_){let t={success:h.success,result:h.result,ms:h.ms,date:h.date,skipped:h.skipped,category:e.category,name:e.name,logs:h.logs,owner:h.owner,flaking:o.Test.isReproducing&&h.success,package:h.package};if(h.result.constructor==Object){const e=Object.keys(h.result).reduce(((e,t)=>Object.assign(Object.assign({},e),{["result."+t]:h.result[t]})),{});t=Object.assign(Object.assign({},t),e)}t.result instanceof o.DataFrame&&(t.result=JSON.stringify(null===(S=t.result)||void 0===S?void 0:S.toJson())||""),yield U("package",t)}return h}))}function W(e){const t=e.slice();return t.sort((()=>Math.random()-.5)),t}function j(e){return h(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,e)))}))}function K(e,t="Timeout exceeded",n=500,r=50){return h(this,void 0,void 0,(function*(){return new Promise(((o,s)=>{setTimeout((()=>{clearInterval(i),s(new Error(t))}),n);const i=setInterval((()=>{e()&&(clearInterval(i),o(null))}),r)}))}))}function q(e,t,n="EXECUTION TIMEOUT"){return h(this,void 0,void 0,(function*(){let r=null;const o=new Promise(((e,o)=>{r=setTimeout((()=>{o(n)}),t)}));try{return yield Promise.race([e(),o])}finally{r&&clearTimeout(r)}}))}const z=o.DataFrame.fromColumns([o.Column.fromStrings("col",["val1","val2","val3"])]);function Z(e,t,n){var o;return h(this,void 0,void 0,(function*(){const s=null!==(o=null==n?void 0:n.packageName)&&void 0!==o?o:"";(null==n?void 0:n.detectSemanticTypes)&&(yield r.data.detectSemanticTypes(t));const i=r.shell.addTableView(t);try{yield a(i,e,s,r.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield a(i,e,s,r.events.onViewerAdded,void 0,n.awaitViewer)),(null==n?void 0:n.readOnly)||(yield a(i,e,s,r.events.onViewerAdded,c),(null==n?void 0:n.awaitViewer)&&(yield a(i,e,s,r.events.onViewerAdded,c,n.awaitViewer)));let t=null;t=yield a(i,e,s,r.events.onViewerAdded,u),(null==n?void 0:n.awaitViewer)&&(t=yield a(i,e,s,r.events.onViewerAdded,u,n.awaitViewer)),yield a(i,e,s,r.events.onViewLayoutApplied,d,void 0,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps}),(null==n?void 0:n.awaitViewer)&&(yield a(i,e,s,r.events.onViewLayoutApplied,d,n.awaitViewer,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps})),!1!==(null==n?void 0:n.arbitraryDfTest)&&(i.dataFrame=z,yield j(50),yield a(i,e,s,r.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield a(i,e,s,r.events.onViewerAdded,void 0,n.awaitViewer))),yield a(i,e,s,r.events.onViewerAdded,l),(null==n?void 0:n.awaitViewer)&&(yield a(i,e,s,r.events.onViewerAdded,l,n.awaitViewer))}finally{}}))}},3527:(e,t,n)=>{"use strict";n.d(t,{Mi:()=>r});class r extends Float32Array{}},3629:(e,t,n)=>{"use strict";n.d(t,{KE:()=>a,dC:()=>s,vA:()=>o,wQ:()=>i});var r=n(3527);function o(e=!1,t="Assertion error."){if(!e)throw new Error(t)}function s(e,t,n=1){const s=e.length;o(s==t.length,"Vector lengths do not match.");const i=new r.Mi(s);for(let r=0;r<e.length;++r)i[r]=e[r]+n*t[r];return i}function i(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*e[n];return Math.sqrt(t)}function a(e,t){if(e.length!=t.length)throw new Error("The dimensionality of the vectors must match");let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}},1913:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3282),o=n(9029),s=n(1520),i=n(2586),a=n(8708),c=n(2023),l="errorMessage",u=new r.Name("emUsed"),d={required:"missingProperty",dependencies:"property",dependentRequired:"property"},h=/\$\{[^}]+\}/,p=/\$\{([^}]+)\}/g,m=/^""\s*\+\s*|\s*\+\s*""$/g;const f=(e,t={})=>{if(!e.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(e.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return e.addKeyword(function(e){return{keyword:l,schemaType:["string","object"],post:!0,code(t){const{gen:n,data:f,schema:g,schemaValue:y,it:b}=t;if(!1===b.createErrors)return;const w=g,v=o.strConcat(c.default.instancePath,b.errorPath);function A(e,t){return o.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${u}`,r._`${e}.instancePath === ${v}`,r._`${e}.keyword in ${t}`,r._`${e}.schemaPath.indexOf(${b.errSchemaPath}) === 0`,r._`/^\\/[^\\/]*$/.test(${e}.schemaPath.slice(${b.errSchemaPath.length}))`)}function E(e,t){const r=[];for(const n in e){const e=t[n];h.test(e)&&r.push([n,T(e)])}return n.object(...r)}function C(e){return h.test(e)?new s._Code(s.safeStringify(e).replace(p,((e,t)=>`" + JSON.stringify(${i.getData(t,b)}) + "`)).replace(m,"")):r.stringify(e)}function T(e){return r._`function(){return ${C(e)}}`}n.if(r._`${c.default.errors} > 0`,(()=>{if("object"==typeof w){const[s,i]=function(e){let t,n;for(const r in e){if("properties"===r||"items"===r)continue;const o=e[r];if("object"==typeof o){t||(t={});const e=t[r]={};for(const t in o)e[t]=[]}else n||(n={}),n[r]=[]}return[t,n]}(w);i&&function(o){const s=n.const("emErrors",r.stringify(o)),i=n.const("templates",E(o,g));n.forOf("err",c.default.vErrors,(e=>n.if(A(e,s),(()=>n.code(r._`${s}[${e}.keyword].push(${e})`).assign(r._`${e}.${u}`,!0)))));const{singleError:l}=e;if(l){const e=n.let("message",r._`""`),o=n.let("paramsErrors",r._`[]`);d((t=>{n.if(e,(()=>n.code(r._`${e} += ${"string"==typeof l?l:";"}`))),n.code(r._`${e} += ${h(t)}`),n.assign(o,r._`${o}.concat(${s}[${t}])`)})),a.reportError(t,{message:e,params:r._`{errors: ${o}}`})}else d((e=>a.reportError(t,{message:h(e),params:r._`{errors: ${s}[${e}]}`})));function d(e){n.forIn("key",s,(t=>n.if(r._`${s}[${t}].length`,(()=>e(t)))))}function h(e){return r._`${e} in ${i} ? ${i}[${e}]() : ${y}[${e}]`}}(i),s&&function(e){const o=n.const("emErrors",r.stringify(e)),s=[];for(const t in e)s.push([t,E(e[t],g[t])]);const i=n.const("templates",n.object(...s)),l=n.scopeValue("obj",{ref:d,code:r.stringify(d)}),h=n.let("emPropParams"),p=n.let("emParamsErrors");n.forOf("err",c.default.vErrors,(e=>n.if(A(e,o),(()=>{n.assign(h,r._`${l}[${e}.keyword]`),n.assign(p,r._`${o}[${e}.keyword][${e}.params[${h}]]`),n.if(p,(()=>n.code(r._`${p}.push(${e})`).assign(r._`${e}.${u}`,!0)))})))),n.forIn("key",o,(e=>n.forIn("keyProp",r._`${o}[${e}]`,(s=>{n.assign(p,r._`${o}[${e}][${s}]`),n.if(r._`${p}.length`,(()=>{const o=n.const("tmpl",r._`${i}[${e}] && ${i}[${e}][${s}]`);a.reportError(t,{message:r._`${o} ? ${o}() : ${y}[${e}][${s}]`,params:r._`{errors: ${p}}`})}))}))))}(s),function(e){const{props:s,items:i}=e;if(!s&&!i)return;const d=r._`typeof ${f} == "object"`,h=r._`Array.isArray(${f})`,p=n.let("emErrors");let m,b;const w=n.let("templates");function A(e,t){n.assign(p,r.stringify(e)),n.assign(w,E(e,t))}s&&i?(m=n.let("emChildKwd"),n.if(d),n.if(h,(()=>{A(i,g.items),n.assign(m,r.str`items`)}),(()=>{A(s,g.properties),n.assign(m,r.str`properties`)})),b=r._`[${m}]`):i?(n.if(h),A(i,g.items),b=r._`.items`):s&&(n.if(o.and(d,o.not(h))),A(s,g.properties),b=r._`.properties`),n.forOf("err",c.default.vErrors,(e=>function(e,t,s){n.if(o.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${u}`,r._`${e}.instancePath.indexOf(${v}) === 0`),(()=>{const o=n.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:r._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),i=n.const("emMatches",r._`${o}.exec(${e}.instancePath.slice(${v}.length))`),a=n.const("emChild",r._`${i} && ${i}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);n.if(r._`${a} !== undefined && ${a} in ${t}`,(()=>s(a)))}))}(e,p,(t=>n.code(r._`${p}[${t}].push(${e})`).assign(r._`${e}.${u}`,!0))))),n.forIn("key",p,(e=>n.if(r._`${p}[${e}].length`,(()=>{a.reportError(t,{message:r._`${e} in ${w} ? ${w}[${e}]() : ${y}${b}[${e}]`,params:r._`{errors: ${p}[${e}]}`}),n.assign(r._`${c.default.vErrors}[${c.default.errors}-1].instancePath`,r._`${v} + "/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})))),n.endIf()}(function({properties:e,items:t}){const n={};if(e){n.props={};for(const t in e)n.props[t]=[]}if(t){n.items={};for(let e=0;e<t.length;e++)n.items[e]=[]}return n}(w))}const s="string"==typeof w?w:w._;s&&function(e){const s=n.const("emErrs",r._`[]`);n.forOf("err",c.default.vErrors,(e=>n.if(function(e){return o.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${u}`,o.or(r._`${e}.instancePath === ${v}`,o.and(r._`${e}.instancePath.indexOf(${v}) === 0`,r._`${e}.instancePath[${v}.length] === "/"`)),r._`${e}.schemaPath.indexOf(${b.errSchemaPath}) === 0`,r._`${e}.schemaPath[${b.errSchemaPath}.length] === "/"`)}(e),(()=>n.code(r._`${s}.push(${e})`).assign(r._`${e}.${u}`,!0))))),n.if(r._`${s}.length`,(()=>a.reportError(t,{message:C(e),params:r._`{errors: ${s}}`})))}(s),e.keepErrors||function(){const e=n.const("emErrs",r._`[]`);n.forOf("err",c.default.vErrors,(t=>n.if(r._`!${t}.${u}`,(()=>n.code(r._`${e}.push(${t})`))))),n.assign(c.default.vErrors,e).assign(c.default.errors,r._`${e}.length`)}()}))},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}(t))};t.default=f,e.exports=f,e.exports.default=f},7433:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const r=n(4042),o=n(6105),s=n(6653),i=n(9572),a="https://json-schema.org/draft/2020-12/schema";class c extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;t&&(i.default.call(this,e),this.refs["http://json-schema.org/schema"]=a)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv2020=c,e.exports=t=c,e.exports.Ajv2020=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var l=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var h=n(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})},3282:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=n(4042),o=n(6144),s=n(6653),i=n(2079),a=["/properties"],c="http://json-schema.org/draft-07/schema";class l extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(i,a):i;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var h=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var p=n(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})},1520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class o extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function s(e,...t){const n=[e[0]];let r=0;for(;r<t.length;)c(n,t[r]),n.push(e[++r]);return new o(n)}t._Code=o,t.nil=new o(""),t._=s;const i=new o("+");function a(e,...t){const n=[u(e[0])];let r=0;for(;r<t.length;)n.push(i),c(n,t[r]),n.push(i,u(e[++r]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===i){const n=l(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new o(n)}function c(e,t){var n;t instanceof o?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:u(Array.isArray(n)?n.join(","):n))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof r||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof r?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=a,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`},t.stringify=function(e){return new o(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new o(`.${e}`):s`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new o(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new o(e.toString())}},9029:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const r=n(1520),o=n(7845);var s=n(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return s.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return s.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return s.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return s.Name}});var i=n(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),t.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?o.varKinds.var:this.varKind,r=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=$(this.rhs,e,t)),this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}class l extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof r.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=$(this.rhs,e,t),this}get names(){return N(this.lhs instanceof r.Name?{}:{...this.lhs.names},this.rhs)}}class u extends l{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class p extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class m extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=$(this.code,e,t),this}get names(){return this.code instanceof r._CodeOrName?this.code.names:{}}}class f extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let r=n.length;for(;r--;){const o=n[r];o.optimizeNames(e,t)||(L(e,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>x(e,t.names)),{})}}class g extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends f{}class b extends g{}b.kind="else";class w extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new b(e):e}return t?!1===e?t instanceof w?t:t.nodes:this.nodes.length?this:new w(I(e),t instanceof w?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=$(this.condition,e,t),this}get names(){const e=super.names;return N(e,this.condition),this.else&&x(e,this.else.names),e}}w.kind="if";class v extends g{}v.kind="for";class A extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=$(this.iteration,e,t),this}get names(){return x(super.names,this.iteration.names)}}class E extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:n,from:r,to:s}=this;return`for(${t} ${n}=${r}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){const e=N(super.names,this.from);return N(e,this.to)}}class C extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=$(this.iterable,e,t),this}get names(){return x(super.names,this.iterable.names)}}class T extends g{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}T.kind="func";class S extends f{render(e){return"return "+super.render(e)}}S.kind="return";class _ extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(r=this.finally)||void 0===r||r.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&x(e,this.catch.names),this.finally&&x(e,this.finally.names),e}}class P extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}P.kind="catch";class M extends g{render(e){return"finally"+super.render(e)}}function x(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function N(e,t){return t instanceof r._CodeOrName?x(e,t.names):e}function $(e,t,n){return e instanceof r.Name?s(e):(o=e)instanceof r._Code&&o._items.some((e=>e instanceof r.Name&&1===t[e.str]&&void 0!==n[e.str]))?new r._Code(e._items.reduce(((e,t)=>(t instanceof r.Name&&(t=s(t)),t instanceof r._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function s(e){const r=n[e.str];return void 0===r||1!==t[e.str]?e:(delete t[e.str],r)}}function L(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function I(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:r._`!${G(e)}`}M.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new o.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){const o=this._scope.toName(t);return void 0!==n&&r&&(this._constants[o.str]=n),this._leafNode(new c(e,o,n)),o}const(e,t,n){return this._def(o.varKinds.const,e,t,n)}let(e,t,n){return this._def(o.varKinds.let,e,t,n)}var(e,t,n){return this._def(o.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new l(e,t,n))}add(e,n){return this._leafNode(new u(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==r.nil&&this._leafNode(new m(e)),this}object(...e){const t=["{"];for(const[n,o]of e)t.length>1&&t.push(","),t.push(n),(n!==o||this.opts.es5)&&(t.push(":"),(0,r.addCodeArg)(t,o));return t.push("}"),new r._Code(t)}if(e,t,n){if(this._blockNode(new w(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new w(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(w,b)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new A(e),t)}forRange(e,t,n,r,s=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const i=this._scope.toName(e);return this._for(new E(s,i,t,n),(()=>r(i)))}forOf(e,t,n,s=o.varKinds.const){const i=this._scope.toName(e);if(this.opts.es5){const e=t instanceof r.Name?t:this.var("_arr",t);return this.forRange("_i",0,r._`${e}.length`,(t=>{this.var(i,r._`${e}[${t}]`),n(i)}))}return this._for(new C("of",s,i,t),(()=>n(i)))}forIn(e,t,n,s=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,r._`Object.keys(${t})`,n);const i=this._scope.toName(e);return this._for(new C("in",s,i,t),(()=>n(i)))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new h(e))}return(e){const t=new S;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new _;if(this._blockNode(r),this.code(e),t){const e=this.name("e");this._currNode=r.catch=new P(e),t(e)}return n&&(this._currNode=r.finally=new M,this.code(n)),this._endBlockNode(P,M)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=r.nil,n,o){return this._blockNode(new T(e,t,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(T)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof w))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=I;const R=k(t.operators.AND);t.and=function(...e){return e.reduce(R)};const O=k(t.operators.OR);function k(e){return(t,n)=>t===r.nil?n:n===r.nil?t:r._`${G(t)} ${e} ${G(n)}`}function G(e){return e instanceof r.Name?e:r._`(${e})`}t.or=function(...e){return e.reduce(O)}},7845:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const r=n(1520);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var s;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(s||(t.UsedValueState=s={})),t.varKinds={const:new r.Name("const"),let:new r.Name("let"),var:new r.Name("var")};class i{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof r.Name?e:this.name(e)}name(e){return new r.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=i;class a extends r.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=r._`.${new r.Name(t)}[${n}]`}}t.ValueScopeName=a;const c=r._`\n`;t.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:r.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(e),{prefix:o}=r,s=null!==(n=t.key)&&void 0!==n?n:t.ref;let i=this._values[o];if(i){const e=i.get(s);if(e)return e}else i=this._values[o]=new Map;i.set(s,r);const a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,r.setValue(t,{property:o,itemIndex:c}),r}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return r._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n,i={},a){let c=r.nil;for(const l in e){const u=e[l];if(!u)continue;const d=i[l]=i[l]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,s.Started);let i=n(e);if(i){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;c=r._`${c}${n} ${e} = ${i};${this.opts._n}`}else{if(!(i=null==a?void 0:a(e)))throw new o(e);c=r._`${c}${i}${this.opts._n}`}d.set(e,s.Completed)}))}return c}}},8708:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const r=n(9029),o=n(4227),s=n(2023);function i(e,t){const n=e.const("err",t);e.if(r._`${s.default.vErrors} === null`,(()=>e.assign(s.default.vErrors,r._`[${n}]`)),r._`${s.default.vErrors}.push(${n})`),e.code(r._`${s.default.errors}++`)}function a(e,t){const{gen:n,validateName:o,schemaEnv:s}=e;s.$async?n.throw(r._`new ${e.ValidationError}(${t})`):(n.assign(r._`${o}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>r.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?r.str`"${e}" keyword must be ${t} ($data)`:r.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,o,s){const{it:c}=e,{gen:u,compositeRule:d,allErrors:h}=c,p=l(e,n,o);(null!=s?s:d||h)?i(u,p):a(c,r._`[${p}]`)},t.reportExtraError=function(e,n=t.keywordError,r){const{it:o}=e,{gen:c,compositeRule:u,allErrors:d}=o;i(c,l(e,n,r)),u||d||a(o,s.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(s.default.errors,t),e.if(r._`${s.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(r._`${s.default.vErrors}.length`,t)),(()=>e.assign(s.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:o,errsCount:i,it:a}){if(void 0===i)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",i,s.default.errors,(i=>{e.const(c,r._`${s.default.vErrors}[${i}]`),e.if(r._`${c}.instancePath === undefined`,(()=>e.assign(r._`${c}.instancePath`,(0,r.strConcat)(s.default.instancePath,a.errorPath)))),e.assign(r._`${c}.schemaPath`,r.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(r._`${c}.schema`,n),e.assign(r._`${c}.data`,o))}))};const c={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function l(e,t,n){const{createErrors:o}=e.it;return!1===o?r._`{}`:function(e,t,n={}){const{gen:o,it:i}=e,a=[u(i,n),d(e,n)];return function(e,{params:t,message:n},o){const{keyword:i,data:a,schemaValue:l,it:u}=e,{opts:d,propertyName:h,topSchemaRef:p,schemaPath:m}=u;o.push([c.keyword,i],[c.params,"function"==typeof t?t(e):t||r._`{}`]),d.messages&&o.push([c.message,"function"==typeof n?n(e):n]),d.verbose&&o.push([c.schema,l],[c.parentSchema,r._`${p}${m}`],[s.default.data,a]),h&&o.push([c.propertyName,h])}(e,t,a),o.object(...a)}(e,t,n)}function u({errorPath:e},{instancePath:t}){const n=t?r.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[s.default.instancePath,(0,r.strConcat)(s.default.instancePath,n)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:s}){let i=s?t:r.str`${t}/${e}`;return n&&(i=r.str`${i}${(0,o.getErrorPath)(n,o.Type.Str)}`),[c.schemaPath,i]}},3835:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const r=n(9029),o=n(3558),s=n(2023),i=n(6939),a=n(4227),c=n(2586);class l{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,i.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function u(e){const t=h.call(this,e);if(t)return t;const n=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:l}=this.opts.code,{ownProperties:u}=this.opts,d=new r.CodeGen(this.scope,{es5:a,lines:l,ownProperties:u});let p;e.$async&&(p=d.scopeValue("Error",{ref:o.default,code:r._`require("ajv/dist/runtime/validation_error").default`}));const m=d.scopeName("validate");e.validateName=m;const f={gen:d,allErrors:this.opts.allErrors,data:s.default.data,parentData:s.default.parentData,parentDataProperty:s.default.parentDataProperty,dataNames:[s.default.data],dataPathArr:[r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,r.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:r.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:r._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,c.validateFunctionCode)(f),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(s.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${s.default.self}`,`${s.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:m,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=f;n.evaluated={props:e instanceof r.Name?void 0:e,items:t instanceof r.Name?void 0:t,dynamicProps:e instanceof r.Name,dynamicItems:t instanceof r.Name},n.source&&(n.source.evaluated=(0,r.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function d(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function h(e){for(const r of this._compilations)if(n=e,(t=r).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return r;var t,n}function p(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){const n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n);let o=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===o)return g.call(this,n,e);const s=(0,i.normalizeId)(r),a=this.refs[s]||this.schemas[s];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||u.call(this,a),s===(0,i.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,r=t[n];return r&&(o=(0,i.resolveUrl)(this.opts.uriResolver,o,r)),new l({schema:t,schemaId:n,root:e,baseId:o})}return g.call(this,n,a)}}t.SchemaEnv=l,t.compileSchema=u,t.resolveRef=function(e,t,n){var r;n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);const o=e.refs[n];if(o)return o;let s=p.call(this,e,n);if(void 0===s){const o=null===(r=e.localRefs)||void 0===r?void 0:r[n],{schemaId:i}=this.opts;o&&(s=new l({schema:o,schemaId:i,root:e,baseId:t}))}return void 0!==s?e.refs[n]=d.call(this,s):void 0},t.getCompilingSchema=h,t.resolveSchema=m;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:n,root:r}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const r of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,a.unescapeFragment)(r)];if(void 0===e)return;const o="object"==typeof(n=e)&&n[this.opts.schemaId];!f.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let s;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);s=m.call(this,r,e)}const{schemaId:c}=this.opts;return s=s||new l({schema:n,schemaId:c,root:r,baseId:t}),s.schema!==s.root.schema?s:void 0}},2023:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o={data:new r.Name("data"),valCxt:new r.Name("valCxt"),instancePath:new r.Name("instancePath"),parentData:new r.Name("parentData"),parentDataProperty:new r.Name("parentDataProperty"),rootData:new r.Name("rootData"),dynamicAnchors:new r.Name("dynamicAnchors"),vErrors:new r.Name("vErrors"),errors:new r.Name("errors"),this:new r.Name("this"),self:new r.Name("self"),scope:new r.Name("scope"),json:new r.Name("json"),jsonPos:new r.Name("jsonPos"),jsonLen:new r.Name("jsonLen"),jsonPart:new r.Name("jsonPart")};t.default=o},4551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6939);class o extends Error{constructor(e,t,n,o){super(o||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,r.resolveUrl)(e,t,n),this.missingSchema=(0,r.normalizeId)((0,r.getFullPath)(e,this.missingRef))}}t.default=o},6939:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const r=n(4227),o=n(2017),s=n(7106),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&l(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(a.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(c))return!0;if("object"==typeof n&&c(n))return!0}return!1}function l(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!i.has(n)&&("object"==typeof e[n]&&(0,r.eachItem)(e[n],(e=>t+=l(e))),t===1/0))return 1/0}return t}function u(e,t="",n){!1!==n&&(t=p(t));const r=e.parse(t);return d(e,r)}function d(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=d;const h=/#\/?$/;function p(e){return e?e.replace(h,""):""}t.normalizeId=p,t.resolveUrl=function(e,t,n){return n=p(n),e.resolve(t,n)};const m=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:r}=this.opts,i=p(e[n]||t),a={"":i},c=u(r,i,!1),l={},d=new Set;return s(e,{allKeys:!0},((e,t,r,o)=>{if(void 0===o)return;const s=c+t;let i=a[o];function u(t){const n=this.opts.uriResolver.resolve;if(t=p(i?n(i,t):t),d.has(t))throw f(t);d.add(t);let r=this.refs[t];return"string"==typeof r&&(r=this.refs[r]),"object"==typeof r?h(e,r.schema,t):t!==p(s)&&("#"===t[0]?(h(e,l[t],t),l[t]=e):this.refs[t]=s),t}function g(e){if("string"==typeof e){if(!m.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[n]&&(i=u.call(this,e[n])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),a[t]=i})),l;function h(e,t,n){if(void 0!==t&&!o(e,t))throw f(n)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},396:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},4227:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const r=n(9029),o=n(1520);function s(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const o=r.RULES.keywords;for(const n in t)o[n]||m(e,`unknown keyword: "${n}"`)}function i(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function l({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:o}){return(s,i,a,c)=>{const l=void 0===a?i:a instanceof r.Name?(i instanceof r.Name?e(s,i,a):t(s,i,a),a):i instanceof r.Name?(t(s,a,i),i):n(i,a);return c!==r.Name||l instanceof r.Name?l:o(s,l)}}function u(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",r._`{}`);return void 0!==t&&d(e,n,t),n}function d(e,t,n){Object.keys(n).forEach((n=>e.assign(r._`${t}${(0,r.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(s(e,t),!i(t,e.self.RULES.all))},t.checkUnknownRules=s,t.schemaHasRules=i,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},n,o,s){if(!s){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return r._`${n}`}return r._`${e}${t}${(0,r.getProperty)(o)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>{e.if(r._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,r._`${n} || {}`).code(r._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,r._`${n} || {}`),d(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,r._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>e.assign(n,!0===t||r._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=d;const h={};var p;function m(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:h[t.code]||(h[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(p||(t.Type=p={})),t.getErrorPath=function(e,t,n){if(e instanceof r.Name){const o=t===p.Num;return n?o?r._`"[" + ${e} + "]"`:r._`"['" + ${e} + "']"`:o?r._`"/" + ${e}`:r._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,r.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=m},7887:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>r(e,t)))}function r(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},r){const o=t.RULES.types[r];return o&&!0!==o&&n(e,o)},t.shouldUseGroup=n,t.shouldUseRule=r},8727:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const r=n(8708),o=n(9029),s=n(2023),i={message:"boolean schema is false"};function a(e,t){const{gen:n,data:o}=e,s={gen:n,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,r.reportError)(s,i,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:r}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(s.default.data):(t.assign(o._`${r}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:r}=e;!1===r?(n.var(t,!1),a(e)):n.var(t,!0)}},208:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const r=n(396),o=n(7887),s=n(8708),i=n(9029),a=n(4227);var c;function l(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(r.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c||(t.DataType=c={})),t.getSchemaTypes=function(e){const t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=l,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:r,opts:s}=e,a=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,s.coerceTypes),l=t.length>0&&!(0===a.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(l){const o=h(t,r,s.strictNumbers,c.Wrong);n.if(o,(()=>{a.length?function(e,t,n){const{gen:r,data:o,opts:s}=e,a=r.let("dataType",i._`typeof ${o}`),c=r.let("coerced",i._`undefined`);"array"===s.coerceTypes&&r.if(i._`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>r.assign(o,i._`${o}[0]`).assign(a,i._`typeof ${o}`).if(h(t,o,s.strictNumbers),(()=>r.assign(c,o))))),r.if(i._`${c} !== undefined`);for(const e of n)(u.has(e)||"array"===e&&"array"===s.coerceTypes)&&l(e);function l(e){switch(e){case"string":return void r.elseIf(i._`${a} == "number" || ${a} == "boolean"`).assign(c,i._`"" + ${o}`).elseIf(i._`${o} === null`).assign(c,i._`""`);case"number":return void r.elseIf(i._`${a} == "boolean" || ${o} === null
1
+ var bio_test;(()=>{var e={8924:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var r=n(7362);class o extends r.e{static get Lesk(){return void 0===this.lesk&&(this.lesk=this.makePalette([[["G","A","S","T"],"orange"],[["C","V","I","L","P","F","Y","M","W"],"all_green"],[["N","Q","H"],"magenta"],[["D","E"],"red"],[["K","R"],"all_blue"]],!1,o)),this.lesk}static get GrokGroups(){return void 0===this.grokGroups&&(this.grokGroups=this.makePalette([[["C","U"],"yellow"],[["G","P"],"red"],[["A","V","I","L","M","F","Y","W"],"all_green"],[["R","H","K"],"light_blue"],[["D","E"],"dark_blue"],[["S","T","N","Q"],"orange"]],!1,o)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new o({D:"#E60A0A",E:"#E60A0A",C:"#E6E600",M:"#E6E600",K:"#145AFF",R:"#145AFF",S:"#FA9600",T:"#FA9600",F:"#3232AA",Y:"#3232AA",N:"#00DCDC",Q:"#00DCDC",G:"#EBEBEB",L:"#0F820F",V:"#0F820F",I:"#0F820F",A:"#C8C8C8",W:"#B45AB4",H:"#8282D2",P:"#DC9682",others:"#BEA06E"})),this.rasMol}get(e){const t=e in o.aaSynonyms?o.aaSynonyms[e]:e;return super.get(t)}}o.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class s{static getPalette(e="grok"){switch(e){case"grok":return o.GrokGroups;case"lesk":return o.Lesk;default:throw new Error(`ChemPalette: scheme \`${e}\` does not exist`)}}static getInnerOuter(e){let t=0,n="",r="";for(const o of e)"("==o?t++:")"==o?t--:t?n+=o:r+=o;return isNaN(parseInt(n))?[r,n]:[r,""]}static getColorAAPivot(e="",t="grok"){const n=this.getPalette(t);let[r,o]=this.getInnerOuter(e);if(r=r.length>6?`${r.slice(0,3)}...`:r,o=o.length>6?`${o.slice(0,3)}...`:o,1==e.length||"("==e[1]){const t=e[0]?.toUpperCase();return t in n?[n.get(t),t,o,1]:[this.undefinedColor,r,o,1]}if("d"==e[0]&&e[1]in n&&(2==e.length||"("==e[2])){const t=e[1]?.toUpperCase();return t in n?[n.get(t),t,o,2]:[this.undefinedColor,r,o,2]}if(e.substring(0,3)in this.AAFullNames&&(3==e.length||"("==e[3])){const t=this.AAFullNames[e.substring(0,3)];return t in n?[n.get(t),t,o,3]:[this.undefinedColor,r,o,3]}if(e[0]?.toLowerCase()==e[0]&&e.substring(1,3)in this.AAFullNames&&(4==e.length||"("==e[4])){const t=this.AAFullNames[e.substring(1,3)];return t in n?[n.get(t),t,o,4]:[this.undefinedColor,r,o,4]}return[this.undefinedColor,r,o,0]}}s.SemType="Aminoacids",s.SemTypeMultipleAlignment="AminoacidsMultipleAlignment",s.undefinedColor="rgb(100,100,100)",s.Names={G:"Glycine",L:"Leucine",Y:"Tyrosine",S:"Serine",E:"Glutamic acid",Q:"Glutamine",D:"Aspartic acid",N:"Asparagine",F:"Phenylalanine",A:"Alanine",K:"Lysine",R:"Arginine",H:"Histidine",C:"Cysteine",V:"Valine",P:"Proline",W:"Tryptophan",I:"Isoleucine",M:"Methionine",T:"Threonine"},s.AASmiles={G:"NCC(=O)O",L:"N[C@H](CC(C)C)C(=O)O",Y:"NC(CC1=CC=C(O)C=C1)C(=O)O",S:"NC(CO)C(=O)O",E:"N[C@@H](CCC(O)=O)C(=O)O",Q:"N[C@@H](CCC(N)=O)C(=O)O",D:"N[C@@H](CC(O)=O)C(=O)O",N:"N[C@@H](CC(N)=O)C(=O)O",F:"NC(CC1=CC=CC=C1)C(=O)O",A:"N[C@H](C)C(=O)O",K:"NC(CCCCN)C(=O)O",R:"N[C@H](CCCNC(=N)C)C(=O)O",H:"NC(CC1=CN=C[N]1)C(=O)O",C:"N[C@@H](CS)C(=O)O",V:"NC(C(C)C)C(=O)O",P:"N(CCC1)C1C(=O)O",W:"N[C@@H](Cc1c2ccccc2n([H])c1)C(=O)O",I:"N[C@H]([C@H](C)CC)C(=O)O",M:"NC(CCSC)C(=O)O",T:"NC(C(O)C)C(=O)O"},s.AASmilesTruncated={G:"*C*",L:"CC(C)C[C@H](*)*",Y:"C1=CC(=CC=C1CC(*)*)O",S:"OCC(*)C*",E:"*[C@@H](CCC(O)=O)*",Q:"*N[C@@H](CCC(N)=O)*",D:"*[C@@H](CC(O)=O)*",N:"*[C@@H](CC(N)=O)*",F:"C1=CC=C(C=C1)CC(*)*",A:"C[C@H](*)*",K:"C(CCN)CC(*)*",R:"*[C@H](CCCNC(=N)C)*",H:"C1=C(NC=N1)CC(*)*",C:"C([C@@H](*)*)S",V:"CC(C)C(*)*",P:"C1CCN(*)C1*",W:"*[C@@H](Cc1c2ccccc2n([H])c1)*",I:"CC[C@H](C)[C@H](*)*",M:"CSCCC(*)*",T:"CC(O)C(*)*"},s.AAFullNames={Ala:"A",Arg:"R",Asn:"N",Asp:"D",Cys:"C",Gln:"Q",Glu:"E",Gly:"G",His:"H",Ile:"I",Leu:"L",Lys:"K",Met:"M",Phe:"F",Pro:"P",Ser:"S",Thr:"T",Trp:"W",Tyr:"Y",Val:"V"}},6717:(e,t,n)=>{"use strict";n.d(t,{j:()=>o});var r=n(6082);async function o(){const e=r.Func.find({package:"Chem",name:"getRdKitModule"});if(0===e.length)throw new Error('Package "Chem" must be installed for getRdKitModule.');return(await e[0].prepare().call()).getOutputParamValue()}},3599:(e,t,n)=>{"use strict";n.d(t,{o:()=>r.o});var r=n(6869)},9124:(e,t,n)=>{"use strict";n.d(t,{b2:()=>s,fA:()=>i});var r=n(7389),o=n(6082);async function s(){const e="Helm",t=o.Func.find({package:e,name:"getHelmHelper"});if(0===t.length)throw new Error(`Package '${e}' must be installed for HelmHelper.`);return(await t[0].prepare().call()).getOutputParamValue()}function i(e,t){if(!e)throw new Error("Argument 'a' of type Atom or HelmType is mandatory.");let n,r;const o=e;return"ATOM"===o.T?(n=o.biotype(),r=o.elem):(n=e,r=t),[n,r]}o.JsInputBase,Error,r.input.helmAsync=async function(e,t){return(await s()).createHelmInput(e,t)}},8438:(e,t,n)=>{"use strict";function r(e){return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e}n.d(t,{D:()=>r})},8123:(e,t,n)=>{"use strict";n.d(t,{u:()=>r});const r={V2K_RGP_SHIFT:8,V2K_RGP_LINE:"M RGP",V2K_A_LINE:"A ",V3K_COUNTS_SHIFT:14,V3K_IDX_SHIFT:7,V3K_HEADER_FIRST_LINE:"\nDatagrok macromolecule handler\n\n",V3K_HEADER_SECOND_LINE:" 0 0 0 0 0 0 999 V3000\n",V3K_BEGIN_CTAB_BLOCK:"M V30 BEGIN CTAB\n",V3K_END_CTAB_BLOCK:"M V30 END CTAB\n",V3K_BEGIN_COUNTS_LINE:"M V30 COUNTS ",V3K_COUNTS_LINE_ENDING:" 0 0 0\n",V3K_BEGIN_ATOM_BLOCK:"M V30 BEGIN ATOM\n",V3K_END_ATOM_BLOCK:"M V30 END ATOM\n",V3K_BEGIN_BOND_BLOCK:"M V30 BEGIN BOND\n",V3K_END_BOND_BLOCK:"M V30 END BOND\n",V3K_BOND_CONFIG:" CFG=",V3K_BEGIN_DATA_LINE:"M V30 ",V3K_END:"M END",PRECISION_FACTOR:1e4,DEOXYRIBOSE:{polymerType:"RNA",symbol:"d"},RIBOSE:{polymerType:"RNA",symbol:"r"},PHOSPHATE:{polymerType:"RNA",symbol:"p"},OXYGEN:"O",HYDROGEN:"H"}},4356:(e,t,n)=>{"use strict";n.d(t,{Eu:()=>a,ub:()=>i});var r=n(4328);const o="Libraries";let s=Promise.resolve();async function i(){let e;return s=s.then((async()=>{const t=r.userSettings.getValue(o,"Settings",!0);e=t?JSON.parse(t):{exclude:[],explicit:[],duplicateMonomerPreferences:{}},e.exclude=e.exclude instanceof Array?e.exclude:[],e.explicit=e.explicit instanceof Array?e.explicit:[],e.duplicateMonomerPreferences=e.duplicateMonomerPreferences instanceof Object?e.duplicateMonomerPreferences:{},console.debug(`Bio: getUserLibSettings()\n${JSON.stringify(e,void 0,2)}`)})),await s,e}async function a(e){s=s.then((async()=>{console.debug(`Bio: setUserLibSettings()\n${JSON.stringify(e,void 0,2)}`),r.userSettings.add(o,"Settings",JSON.stringify(e),!0)})),await s}},5553:(e,t,n)=>{"use strict";n.d(t,{Qc:()=>E,WN:()=>C});var r=n(1991),o=n.n(r);const s="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,i=new Set,a="object"==typeof process&&process?process:{},c=(e,t,n,r)=>{"function"==typeof a.emitWarning?a.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)};let l=globalThis.AbortController,u=globalThis.AbortSignal;if(void 0===l){u=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},l=class{constructor(){t()}signal=new u;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==a.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,c("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}Symbol("type");const d=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),h=e=>d(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?p:null:null;class p extends Array{constructor(e){super(e),this.fill(0)}}class m{heap;length;static#e=!1;static create(e){const t=h(e);if(!t)return[];m.#e=!0;const n=new m(e,t);return m.#e=!1,n}constructor(e,t){if(!m.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class f{#t;#n;#r;#o;#s;#i;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#c;#l;#u;#d;#h;#p;#m;#f;#g;#y;#b;#w;#v;#A;#E;#C;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#v,sizes:e.#b,keyMap:e.#l,keyList:e.#u,valList:e.#d,next:e.#h,prev:e.#p,get head(){return e.#m},get tail(){return e.#f},free:e.#g,isBackgroundFetch:t=>e.#T(t),backgroundFetch:(t,n,r,o)=>e.#S(t,n,r,o),moveToTail:t=>e.#_(t),indexes:t=>e.#P(t),rindexes:t=>e.#M(t),isStale:t=>e.#x(t)}}get max(){return this.#t}get maxSize(){return this.#n}get calculatedSize(){return this.#c}get size(){return this.#a}get fetchMethod(){return this.#s}get memoMethod(){return this.#i}get dispose(){return this.#r}get disposeAfter(){return this.#o}constructor(e){const{max:t=0,ttl:n,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:a,allowStale:l,dispose:u,disposeAfter:p,noDisposeOnSet:g,noUpdateTTL:y,maxSize:b=0,maxEntrySize:w=0,sizeCalculation:v,fetchMethod:A,memoMethod:E,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:_,ignoreFetchAbort:P}=e;if(0!==t&&!d(t))throw new TypeError("max option must be a nonnegative integer");const M=t?h(t):Array;if(!M)throw new Error("invalid max value: "+t);if(this.#t=t,this.#n=b,this.maxEntrySize=w||this.#n,this.sizeCalculation=v,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==E&&"function"!=typeof E)throw new TypeError("memoMethod must be a function if defined");if(this.#i=E,void 0!==A&&"function"!=typeof A)throw new TypeError("fetchMethod must be a function if specified");if(this.#s=A,this.#E=!!A,this.#l=new Map,this.#u=new Array(t).fill(void 0),this.#d=new Array(t).fill(void 0),this.#h=new M(t),this.#p=new M(t),this.#m=0,this.#f=0,this.#g=m.create(t),this.#a=0,this.#c=0,"function"==typeof u&&(this.#r=u),"function"==typeof p?(this.#o=p,this.#y=[]):(this.#o=void 0,this.#y=void 0),this.#A=!!this.#r,this.#C=!!this.#o,this.noDisposeOnSet=!!g,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!P,0!==this.maxEntrySize){if(0!==this.#n&&!d(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!d(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#N()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!a,this.ttlResolution=d(r)||0===r?r:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!d(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#$()}if(0===this.#t&&0===this.ttl&&0===this.#n)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#n){const e="LRU_CACHE_UNBOUNDED";(e=>!i.has(e))(e)&&(i.add(e),c("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,f))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#$(){const e=new p(this.#t),t=new p(this.#t);this.#v=e,this.#w=t,this.#L=(n,r,o=s.now())=>{if(t[n]=0!==r?o:0,e[n]=r,0!==r&&this.ttlAutopurge){const e=setTimeout((()=>{this.#x(n)&&this.#I(this.#u[n],"expire")}),r+1);e.unref&&e.unref()}},this.#R=n=>{t[n]=0!==e[n]?s.now():0},this.#O=(o,s)=>{if(e[s]){const i=e[s],a=t[s];if(!i||!a)return;o.ttl=i,o.start=a,o.now=n||r();const c=o.now-a;o.remainingTTL=i-c}};let n=0;const r=()=>{const e=s.now();if(this.ttlResolution>0){n=e;const t=setTimeout((()=>n=0),this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=o=>{const s=this.#l.get(o);if(void 0===s)return 0;const i=e[s],a=t[s];return i&&a?i-((n||r())-a):1/0},this.#x=o=>{const s=t[o],i=e[o];return!!i&&!!s&&(n||r())-s>i}}#R=()=>{};#O=()=>{};#L=()=>{};#x=()=>!1;#N(){const e=new p(this.#t);this.#c=0,this.#b=e,this.#k=t=>{this.#c-=e[t],e[t]=0},this.#G=(e,t,n,r)=>{if(this.#T(t))return 0;if(!d(n)){if(!r)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof r)throw new TypeError("sizeCalculation must be a function");if(n=r(t,e),!d(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n},this.#D=(t,n,r)=>{if(e[t]=n,this.#n){const n=this.#n-e[t];for(;this.#c>n;)this.#H(!0)}this.#c+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#c)}}#k=e=>{};#D=(e,t,n)=>{};#G=(e,t,n,r)=>{if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#f;this.#F(t)&&(!e&&this.#x(t)||(yield t),t!==this.#m);)t=this.#p[t]}*#M({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#m;this.#F(t)&&(!e&&this.#x(t)||(yield t),t!==this.#f);)t=this.#h[t]}#F(e){return void 0!==e&&this.#l.get(this.#u[e])===e}*entries(){for(const e of this.#P())void 0===this.#d[e]||void 0===this.#u[e]||this.#T(this.#d[e])||(yield[this.#u[e],this.#d[e]])}*rentries(){for(const e of this.#M())void 0===this.#d[e]||void 0===this.#u[e]||this.#T(this.#d[e])||(yield[this.#u[e],this.#d[e]])}*keys(){for(const e of this.#P()){const t=this.#u[e];void 0===t||this.#T(this.#d[e])||(yield t)}}*rkeys(){for(const e of this.#M()){const t=this.#u[e];void 0===t||this.#T(this.#d[e])||(yield t)}}*values(){for(const e of this.#P())void 0===this.#d[e]||this.#T(this.#d[e])||(yield this.#d[e])}*rvalues(){for(const e of this.#M())void 0===this.#d[e]||this.#T(this.#d[e])||(yield this.#d[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const n of this.#P()){const r=this.#d[n],o=this.#T(r)?r.__staleWhileFetching:r;if(void 0!==o&&e(o,this.#u[n],this))return this.get(this.#u[n],t)}}forEach(e,t=this){for(const n of this.#P()){const r=this.#d[n],o=this.#T(r)?r.__staleWhileFetching:r;void 0!==o&&e.call(t,o,this.#u[n],this)}}rforEach(e,t=this){for(const n of this.#M()){const r=this.#d[n],o=this.#T(r)?r.__staleWhileFetching:r;void 0!==o&&e.call(t,o,this.#u[n],this)}}purgeStale(){let e=!1;for(const t of this.#M({allowStale:!0}))this.#x(t)&&(this.#I(this.#u[t],"expire"),e=!0);return e}info(e){const t=this.#l.get(e);if(void 0===t)return;const n=this.#d[t],r=this.#T(n)?n.__staleWhileFetching:n;if(void 0===r)return;const o={value:r};if(this.#v&&this.#w){const e=this.#v[t],n=this.#w[t];if(e&&n){const t=e-(s.now()-n);o.ttl=t,o.start=Date.now()}}return this.#b&&(o.size=this.#b[t]),o}dump(){const e=[];for(const t of this.#P({allowStale:!0})){const n=this.#u[t],r=this.#d[t],o=this.#T(r)?r.__staleWhileFetching:r;if(void 0===o||void 0===n)continue;const i={value:o};if(this.#v&&this.#w){i.ttl=this.#v[t];const e=s.now()-this.#w[t];i.start=Math.floor(Date.now()-e)}this.#b&&(i.size=this.#b[t]),e.unshift([n,i])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const e=Date.now()-n.start;n.start=s.now()-e}this.set(t,n.value,n)}}set(e,t,n={}){if(void 0===t)return this.delete(e),this;const{ttl:r=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:i=this.sizeCalculation,status:a}=n;let{noUpdateTTL:c=this.noUpdateTTL}=n;const l=this.#G(e,t,n.size||0,i);if(this.maxEntrySize&&l>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#I(e,"set"),this;let u=0===this.#a?void 0:this.#l.get(e);if(void 0===u)u=0===this.#a?this.#f:0!==this.#g.length?this.#g.pop():this.#a===this.#t?this.#H(!1):this.#a,this.#u[u]=e,this.#d[u]=t,this.#l.set(e,u),this.#h[this.#f]=u,this.#p[u]=this.#f,this.#f=u,this.#a++,this.#D(u,l,a),a&&(a.set="add"),c=!1;else{this.#_(u);const n=this.#d[u];if(t!==n){if(this.#E&&this.#T(n)){n.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=n;void 0===t||s||(this.#A&&this.#r?.(t,e,"set"),this.#C&&this.#y?.push([t,e,"set"]))}else s||(this.#A&&this.#r?.(n,e,"set"),this.#C&&this.#y?.push([n,e,"set"]));if(this.#k(u),this.#D(u,l,a),this.#d[u]=t,a){a.set="replace";const e=n&&this.#T(n)?n.__staleWhileFetching:n;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0===r||this.#v||this.#$(),this.#v&&(c||this.#L(u,r,o),a&&this.#O(a,u)),!s&&this.#C&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}return this}pop(){try{for(;this.#a;){const e=this.#d[this.#m];if(this.#H(!0),this.#T(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#C&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}}}#H(e){const t=this.#m,n=this.#u[t],r=this.#d[t];return this.#E&&this.#T(r)?r.__abortController.abort(new Error("evicted")):(this.#A||this.#C)&&(this.#A&&this.#r?.(r,n,"evict"),this.#C&&this.#y?.push([r,n,"evict"])),this.#k(t),e&&(this.#u[t]=void 0,this.#d[t]=void 0,this.#g.push(t)),1===this.#a?(this.#m=this.#f=0,this.#g.length=0):this.#m=this.#h[t],this.#l.delete(n),this.#a--,t}has(e,t={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,o=this.#l.get(e);if(void 0!==o){const e=this.#d[o];if(this.#T(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#x(o))return n&&this.#R(o),r&&(r.has="hit",this.#O(r,o)),!0;r&&(r.has="stale",this.#O(r,o))}else r&&(r.has="miss");return!1}peek(e,t={}){const{allowStale:n=this.allowStale}=t,r=this.#l.get(e);if(void 0===r||!n&&this.#x(r))return;const o=this.#d[r];return this.#T(o)?o.__staleWhileFetching:o}#S(e,t,n,r){const o=void 0===t?void 0:this.#d[t];if(this.#T(o))return o;const s=new l,{signal:i}=n;i?.addEventListener("abort",(()=>s.abort(i.reason)),{signal:s.signal});const a={signal:s.signal,options:n,context:r},c=(r,o=!1)=>{const{aborted:i}=s.signal,c=n.ignoreFetchAbort&&void 0!==r;if(n.status&&(i&&!o?(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),i&&!c&&!o)return u(s.signal.reason);const l=d;return this.#d[t]===d&&(void 0===r?l.__staleWhileFetching?this.#d[t]=l.__staleWhileFetching:this.#I(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,a.options))),r},u=r=>{const{aborted:o}=s.signal,i=o&&n.allowStaleOnFetchAbort,a=i||n.allowStaleOnFetchRejection,c=a||n.noDeleteOnFetchRejection,l=d;if(this.#d[t]===d&&(c&&void 0!==l.__staleWhileFetching?i||(this.#d[t]=l.__staleWhileFetching):this.#I(e,"fetch")),a)return n.status&&void 0!==l.__staleWhileFetching&&(n.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw r};n.status&&(n.status.fetchDispatched=!0);const d=new Promise(((t,r)=>{const i=this.#s?.(e,o,a);i&&i instanceof Promise&&i.then((e=>t(void 0===e?void 0:e)),r),s.signal.addEventListener("abort",(()=>{n.ignoreFetchAbort&&!n.allowStaleOnFetchAbort||(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))}))})).then(c,(e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e)))),h=Object.assign(d,{__abortController:s,__staleWhileFetching:o,__returned:void 0});return void 0===t?(this.set(e,h,{...a.options,status:void 0}),t=this.#l.get(e)):this.#d[t]=h,h}#T(e){if(!this.#E)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof l}async fetch(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:i=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:f=!1,status:g,signal:y}=t;if(!this.#E)return g&&(g.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:o,status:g});const b={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:i,size:a,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:h,status:g,signal:y};let w=this.#l.get(e);if(void 0===w){g&&(g.fetch="miss");const t=this.#S(e,w,b,m);return t.__returned=t}{const t=this.#d[w];if(this.#T(t)){const e=n&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const o=this.#x(w);if(!f&&!o)return g&&(g.fetch="hit"),this.#_(w),r&&this.#R(w),g&&this.#O(g,w),t;const s=this.#S(e,w,b,m),i=void 0!==s.__staleWhileFetching&&n;return g&&(g.fetch=o?"stale":"refresh",i&&o&&(g.returnedStale=!0)),i?s.__staleWhileFetching:s.__returned=s}}async forceFetch(e,t={}){const n=await this.fetch(e,t);if(void 0===n)throw new Error("fetch() returned undefined");return n}memo(e,t={}){const n=this.#i;if(!n)throw new Error("no memoMethod provided to constructor");const{context:r,forceRefresh:o,...s}=t,i=this.get(e,s);if(!o&&void 0!==i)return i;const a=n(e,i,{options:s,context:r});return this.set(e,a,s),a}get(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:s}=t,i=this.#l.get(e);if(void 0!==i){const t=this.#d[i],a=this.#T(t);return s&&this.#O(s,i),this.#x(i)?(s&&(s.get="stale"),a?(s&&n&&void 0!==t.__staleWhileFetching&&(s.returnedStale=!0),n?t.__staleWhileFetching:void 0):(o||this.#I(e,"expire"),s&&n&&(s.returnedStale=!0),n?t:void 0)):(s&&(s.get="hit"),a?t.__staleWhileFetching:(this.#_(i),r&&this.#R(i),t))}s&&(s.get="miss")}#V(e,t){this.#p[t]=e,this.#h[e]=t}#_(e){e!==this.#f&&(e===this.#m?this.#m=this.#h[e]:this.#V(this.#p[e],this.#h[e]),this.#V(this.#f,e),this.#f=e)}delete(e){return this.#I(e,"delete")}#I(e,t){let n=!1;if(0!==this.#a){const r=this.#l.get(e);if(void 0!==r)if(n=!0,1===this.#a)this.#U(t);else{this.#k(r);const n=this.#d[r];if(this.#T(n)?n.__abortController.abort(new Error("deleted")):(this.#A||this.#C)&&(this.#A&&this.#r?.(n,e,t),this.#C&&this.#y?.push([n,e,t])),this.#l.delete(e),this.#u[r]=void 0,this.#d[r]=void 0,r===this.#f)this.#f=this.#p[r];else if(r===this.#m)this.#m=this.#h[r];else{const e=this.#p[r];this.#h[e]=this.#h[r];const t=this.#h[r];this.#p[t]=this.#p[r]}this.#a--,this.#g.push(r)}}if(this.#C&&this.#y?.length){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}return n}clear(){return this.#U("delete")}#U(e){for(const t of this.#M({allowStale:!0})){const n=this.#d[t];if(this.#T(n))n.__abortController.abort(new Error("deleted"));else{const r=this.#u[t];this.#A&&this.#r?.(n,r,e),this.#C&&this.#y?.push([n,r,e])}}if(this.#l.clear(),this.#d.fill(void 0),this.#u.fill(void 0),this.#v&&this.#w&&(this.#v.fill(0),this.#w.fill(0)),this.#b&&this.#b.fill(0),this.#m=0,this.#f=0,this.#g.length=0,this.#c=0,this.#a=0,this.#C&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}}}function g(e){window.$monomerHover=e}var y=n(2003),b=n(6077),w=n(3561),v=n(9235);const A="MonomerHoverLinks";async function E(e,t,n,r,s,i=!1){const a=r.getSeqHandler(e),c=a.alphabet==y.YI.RNA||a.alphabet==y.YI.DNA,l=a.isHelm()&&c,u=!a.isHelm()&&c,d=e=>null==e?null:l?i?e:Math.floor(e/3):u&&i?3*e+1:e,h=i?await r.getHelmToMolfileConverter(n):null,p=new f({max:100});function m(e,t){const a=e.get(t);if(null==a)return null;let c=p.get(a);return c||p.set(a,c=function(e,t){const a=r.getSeqHandler(e);if(i){const e=a.getHelm(t);return r.helmToAtomicLevelSingle(e,h,!1,!1).monomers}{const e=a.getSplitted(t),r=a.defaultBiotype,i=o().count(0).take(e.length).map((t=>({position:t,symbol:e.getCanonical(t),biotype:r}))).toArray(),c=a.alphabet,l=c==y.YI.RNA||c==y.YI.DNA?"RNA":"PEPTIDE",u=(0,b.eM)([i],l,c,n,s);return(0,w.gU)(i,u,c,l).monomers}}(e,t)),c}const E={targetCol:t,handler:(t,r,o)=>{const s=o.grid,i=t.tableRowIndex,a=t.gridRow,c=s.cell(o.name,a),l=null!==(u=window.$monomerHover)&&void 0!==u?u:null;var u;if(!l||l&&(l.dataFrameId!=e.dataFrame.id||l.gridRowIdx!=a||l.seqColName!=e.name||l.seqPosition!=r?.position)){if(l&&(g(null),l.gridCell.render()),!r)return g(null),!0;g({gridCell:c,dataFrameId:e.dataFrame.id,gridRowIdx:a,seqColName:e.name,seqPosition:d(r?.position)??-1,getSubstruct:()=>{if(!r||"*"===r.symbol)return;const t=m(e,i);if(!t)return;const o=t.get(d(r?.position));return o?(0,v.H)([o],n):{atoms:[],bonds:[],highlightAtomColors:[],highlightBondColors:[]}}}),c.render()}return!0},getSubstruct:r=>{if("true"!=t.getTag(".sequence-src-highlight-monomers"))return;if(null==r)return;if(!e.get(r))return;const o=m(e,r);return o?(0,v.H)(o.values(),n):void 0}};return function(e,t){let n=e[A];n||(n=e[A]=[]),n.push(t),e[A]=n}(e.temp,E),function(e,t){let n=e["substruct-providers"];n||(n=e["substruct-providers"]=[]),n.push(t),e["substruct-providers"]=n}(t.temp,E),E}function C(e,t){try{const n=e.tableColumn;if(!n)return;const r=function(e){return e.temp[A]??[]}(n);for(let n=r.length-1;n>=0;--n){const o=r[n],s=e.grid.col(o.targetCol.name);if(s&&!o.handler(e,t,s))break}}catch(e){console.error(e)}}},6718:(e,t,n)=>{"use strict";n.d(t,{A7:()=>c,pj:()=>i});var r=n(6082),o=n(4328),s=n(6295);async function i(){const e=r.Func.find({package:"Bio",name:"getMonomerLibHelper"});if(0===e.length)throw new Error('Package "Bio" must be installed for MonomerLibHelper.');return(await e[0].prepare().call()).getOutputParamValue()}async function a(e){const t=(await i()).getMonomerLib(),n=[],s={},a=e.map((e=>t.getMonomer("PEPTIDE",e)?.smiles??"")),c=r.Column.fromStrings("smiles",a);for(let t=0;t<a.length;++t){s[e[t]]=t;const r=a[t],i=""===r?new Array(a.length).fill(0):(await o.chem.getSimilarities(c,r)).getRawData();i[t]=1,n[t]=Array.from(i)}return{scoringMatrix:n,alphabetIndexes:s}}async function c(e,t="Morgan"){const n=(await i()).getMonomerLib(),o=new Array(e.length).fill(0).map((()=>new Array(e.length).fill(0))),c={},l=e.map((e=>n.getMonomer("PEPTIDE",e)?.molfile||n.getMonomer("PEPTIDE",e)?.smiles||"")),u=r.Func.find({package:"Chem",name:"getFingerprints"})[0];if(!u)return console.warn('Function "Chem:getFingerprints" is not found in chem package. falling back to Morgan fingerprints'),await a(e);const d=r.Column.fromStrings("smiles",l),h=(r.DataFrame.fromColumns([d]),(await u.apply({col:d,fingerprintType:t}))?.entries);if(!h)return console.warn(`${t} Fingerprints could not be calculated for monomers from chem package.\n falling back to Morgan fingerprints`),await a(e);for(let t=0;t<h.length;++t)if(o[t][t]=1,c[e[t]]=t,h[t])for(let e=t+1;e<h.length;++e)h[e]&&(o[t][e]=o[e][t]=(0,s.$1)(h[t],h[e]));return{scoringMatrix:o,alphabetIndexes:c}}n(3151),n(3077),n(439)},6197:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var r=n(3599);function o(e){let t;switch(e){case r.o.BASE:case r.o.SUGAR:case r.o.LINKER:case r.o.NUCLEOTIDE:case"nucleotide":t="RNA";break;case r.o.AA:t="PEPTIDE";break;case r.o.CHEM:t="CHEM";break;case r.o.BLOB:t="BLOB";break;default:t="PEPTIDE",console.warn(`Unexpected HelmType '${e}'`)}return t}},9235:(e,t,n)=>{"use strict";n.d(t,{H:()=>l,R:()=>c});var r=n(6082),o=n(1991),s=n.n(o),i=n(330),a=n(3599);async function c(e,t,o,c,l,u,d){const h=e.length,p=e.dataFrame,m=Math.max(navigator.hardwareConcurrency-2,1),f=new Array(m).fill(null).map((()=>new Worker(new URL(n.p+n.u(455),n.b)))),g=h/m,y=new Array(m),b=u.getSeqHandler(e),w="RNA"==c?a.o.NUCLEOTIDE:a.o.AA,v=s().count(0).take(e.length).map((e=>{const t=b.getSplitted(e);return s().count(0).take(t.length).map((e=>({position:e,symbol:t.getCanonical(e),biotype:w}))).toArray()})).toArray();for(let e=0;e<m;e++){const n=f[e],r=Math.floor(e*g),s=e===m-1?h:Math.floor((e+1)*g);y[e]=new Promise((e=>{n.onmessage=t=>{e(t.data)}})),n.postMessage({seqList:v,monomersDict:t,alphabet:o,polymerType:c,start:r,end:s})}const A=[],E=[];await Promise.all(y).then((e=>{for(const t of e)A.push(...t.molfiles),E.push(...t.warnings)})),setTimeout((()=>{f.forEach((e=>{e.terminate()}))}),0);const C=(0,i.qj)(p,e.name),T=r.Column.fromType(r.COLUMN_TYPE.STRING,C,e.length).init((e=>A[e]?.molfile));return T.semType=r.SEMTYPE.MOLECULE,T.meta.units=r.UNITS.Molecule.MOLBLOCK,T.setTag(".sequence-src-col",e.name),{molCol:T,warnings:E}}function l(e,t){const n={},o={};for(const s of e){const e=t.getWebEditorMonomer(s.biotype,s.symbol).backgroundcolor,a=(0,i.vG)(e??r.Color.toRgb(r.Color.mouseOverRows))??[1,0,0,.7];for(const e of s.atoms)n[e]=a;for(const e of s.bonds)o[e]=a}return{atoms:Object.keys(n).map((e=>parseInt(e))),bonds:Object.keys(o).map((e=>parseInt(e))),highlightAtomColors:n,highlightBondColors:o}}},3561:(e,t,n)=>{"use strict";n.d(t,{Hb:()=>c,YN:()=>f,gU:()=>l});var r=n(8123),o=n(294),s=n(3151),i=n(439),a=n(6197);function c(e,t,n){const o=new Map;for(const a of e.getMonomerSymbolsByType(t)){const c=e.getMonomer(t,a);if("RNA"===t&&("Branch"===c.monomerType||n===i.YI.DNA&&c.symbol===r.u.DEOXYRIBOSE.symbol||n===i.YI.RNA&&c.symbol===r.u.RIBOSE.symbol||c.symbol===r.u.PHOSPHATE.symbol)||"PEPTIDE"===t&&"Branch"!==c.monomerType){const e={};s.f6.forEach((t=>{e[t]=c[t]})),o.set(c.symbol,e)}}return o}function l(e,t,n,s){if(0===e.length)return o.vF.createEmpty();const c=m,{atomCount:l,bondCount:d,needsCapping:p}=c(e,t,n,s),g=new Array(l),y=new Array(d);let b,w=null,v=null;"PEPTIDE"===s?b=u:(b=h,w=n===i.YI.DNA?(0,o.xb)(t,r.u.DEOXYRIBOSE):(0,o.xb)(t,r.u.RIBOSE),v=(0,o.xb)(t,r.u.PHOSPHATE));const A={i:0,nodeShift:0,bondShift:0,backbonePositionShift:new Array(2).fill(0),branchPositionShift:new Array(2).fill(0),backboneAttachNode:0,branchAttachNode:0,flipFactor:1},E={sugar:w,phosphate:v,seqLength:e.length,atomCount:l,bondCount:d},C=new o.Cg,T=[];let S,_=0;for(A.i=0;A.i<E.seqLength;++A.i){const n=e[A.i];if(n.symbol===i._S)continue;const r=(0,o.xb)(t,{symbol:n.symbol,polymerType:(0,a.Y)(n.biotype)});S=r.terminalR2Atom;const s=A.nodeShift,c=A.bondShift;b(r,g,y,A,E),r.stereoAtoms?.forEach((e=>T.push(e+_))),_+=r.atoms.x.length;const l=A.nodeShift-s,u=new Array(l);for(let e=0;e<l;++e)u[e]=s+e;const d=A.bondShift-c,h=new Array(d);for(let e=0;e<d;++e)h[e]=c+e;C.set(A.i,{biotype:n.biotype,symbol:n.symbol,atoms:u,bonds:h})}p&&function(e,t,n,o,s=r.u.OXYGEN){const i=n.nodeShift+1;e[o.atomCount]=r.u.V3K_BEGIN_DATA_LINE+i+" "+(s??r.u.OXYGEN)+" "+f(n.backbonePositionShift[0])+" "+n.flipFactor*f(n.backbonePositionShift[1])+" 0.000000 0\n";const a=n.backboneAttachNode,c=i;t[o.bondCount]=r.u.V3K_BEGIN_DATA_LINE+n.bondShift+" 1 "+a+" "+c+"\n"}(g,y,A,E,S??r.u.OXYGEN);const P=r.u.V3K_BEGIN_COUNTS_LINE+l+" "+d+r.u.V3K_COUNTS_LINE_ENDING;let M="";return M+=r.u.V3K_HEADER_FIRST_LINE,M+=r.u.V3K_HEADER_SECOND_LINE,M+=r.u.V3K_BEGIN_CTAB_BLOCK,M+=P,M+=r.u.V3K_BEGIN_ATOM_BLOCK,M+=g.join(""),M+=r.u.V3K_END_ATOM_BLOCK,M+=r.u.V3K_BEGIN_BOND_BLOCK,M+=y.join(""),M+=r.u.V3K_END_BOND_BLOCK,T.length>0&&(M+=function(e){const t=[];let n=`M V30 MDLV30/STEABS ATOMS=(${e.length}`;for(let r=0;r<e.length;r++){const o=`${n} ${e[r]}`;o.length>76?(t.push(`${n} -\n`),n=`M V30 ${e[r]}`):n=o,r===e.length-1&&t.push(`${n})\n`)}return`M V30 BEGIN COLLECTION\n${t.join("")}M V30 END COLLECTION\n`}(T)),M+=r.u.V3K_END_CTAB_BLOCK,M+=r.u.V3K_END,{molfile:M,monomers:C}}function u(e,t,n,r){r.flipFactor=(-1)**(r.i%2),d(e,t,n,r)}function d(e,t,n,o){!function(e,t,n){for(let o=0;o<e.atoms.atomTypes.length;++o){const s=n.nodeShift+o+1;t[n.nodeShift+o]=r.u.V3K_BEGIN_DATA_LINE+s+" "+e.atoms.atomTypes[o]+" "+f(n.backbonePositionShift[0]+e.atoms.x[o])+" "+f(n.backbonePositionShift[1]+n.flipFactor*e.atoms.y[o])+" "+e.atoms.kwargs[o]}}(e,t,o),p(e,n,o),function(e,t,n){if(0!==n.backboneAttachNode){const o=n.bondShift,s=n.backboneAttachNode,i=e.meta.terminalNodes[0]+n.nodeShift;t[n.bondShift-1]=r.u.V3K_BEGIN_DATA_LINE+o+" 1 "+s+" "+i+"\n"}}(e,n,o),null!==e.meta.branchShift&&e.meta.terminalNodes.length>2&&function(e,t){t.branchAttachNode=t.nodeShift+e.meta.terminalNodes[2];for(let n=0;n<2;++n)t.branchPositionShift[n]=t.backbonePositionShift[n]+e.meta.branchShift[n]}(e,o),function(e,t){t.backboneAttachNode=t.nodeShift+e.meta.terminalNodes[1],t.bondShift+=e.bonds.atomPairs.length+1,t.nodeShift+=e.atoms.atomTypes.length,t.backbonePositionShift[0]+=e.meta.backboneShift?.[0]??0,t.backbonePositionShift[1]+=t.flipFactor*(e.meta.backboneShift?.[1]??0)}(e,o)}function h(e,t,n,o,s){if(0===o.i)d(s.sugar,t,n,o);else for(const e of[s.phosphate,s.sugar])d(e,t,n,o);!function(e,t,n,o){(function(e,t,n){for(let o=0;o<e.atoms.atomTypes.length;++o){const s=n.nodeShift+o+1;t[n.nodeShift+o]=r.u.V3K_BEGIN_DATA_LINE+s+" "+e.atoms.atomTypes[o]+" "+f(n.branchPositionShift[0]+e.atoms.x[o])+" "+f(n.branchPositionShift[1]+n.flipFactor*e.atoms.y[o])+" "+e.atoms.kwargs[o]}})(e,t,o),p(e,n,o),function(e,t,n){const o=n.bondShift,s=n.branchAttachNode,i=e.meta.terminalNodes[0]+n.nodeShift;t[o-1]=r.u.V3K_BEGIN_DATA_LINE+o+" 1 "+s+" "+i+"\n"}(e,n,o);const s=o.bondShift,i=o.branchAttachNode,a=e.meta.terminalNodes[0]+o.nodeShift;n[s-1]=r.u.V3K_BEGIN_DATA_LINE+s+" 1 "+i+" "+a+"\n",o.bondShift+=e.bonds.atomPairs.length+1,o.nodeShift+=e.atoms.atomTypes.length}(e,t,n,o)}function p(e,t,n){for(let o=0;o<e.bonds.atomPairs.length;++o){const s=n.bondShift+o+1,i=e.bonds.atomPairs[o][0]+n.nodeShift,a=e.bonds.atomPairs[o][1]+n.nodeShift;let c="";if(e.bonds.bondConfiguration.has(o)){let t=e.bonds.bondConfiguration.get(o);n.flipFactor<0&&(t=1===t?3:1),c=" CFG="+t}const l=e.bonds.kwargs.has(o)?" "+e.bonds.kwargs.get(o):"";t[n.bondShift+o]=r.u.V3K_BEGIN_DATA_LINE+s+" "+e.bonds.bondTypes[o]+" "+i+" "+a+c+l+"\n"}}function m(e,t,n,s){let c=0,l=0,u=0,d=!0,h=null;for(const n of e)if(n.symbol!==i._S){if("*"==n.symbol)throw new Error("Gap canonical symbol is '', not '*");h=(0,o.xb)(t,{symbol:n.symbol,polymerType:(0,a.Y)(n.biotype)}),c+=h.atoms.x.length,l+=h.bonds.bondTypes.length,u++}if("PEPTIDE"===s)c+=1,l+=u,u>0&&((h?.meta?.rNodes?.length??0)<2||h?.terminalR2Atom?.toLowerCase()===r.u.HYDROGEN.toLowerCase())&&(d=!1,c-=1,l-=1);else{const s=n===i.YI.DNA?(0,o.xb)(t,r.u.DEOXYRIBOSE):(0,o.xb)(t,r.u.RIBOSE),a=(0,o.xb)(t,r.u.PHOSPHATE);c+=(e.length-1)*a.atoms.x.length,c+=e.length*s.atoms.x.length,c+=1,l+=(e.length-1)*a.bonds.bondTypes.length,l+=e.length*s.bonds.bondTypes.length,l-=1,l+=3*e.length}return{atomCount:c,bondCount:l,needsCapping:d}}function f(e){return Math.round(r.u.PRECISION_FACTOR*e)/r.u.PRECISION_FACTOR}},6077:(e,t,n)=>{"use strict";n.d(t,{C4:()=>m,eM:()=>f});var r=n(4328),o=n(6082),s=n(1991),i=n.n(s),a=n(439),c=n(3561),l=n(9235),u=n(294),d=n(9192),h=n(330),p=n(8123);async function m(e,t,n,s,c){if(t.semType!==o.SEMTYPE.MACROMOLECULE)return{molCol:null,warnings:[`Only the ${o.SEMTYPE.MACROMOLECULE} columns can be converted to atomic level, the chosen column has semType '${t.semType}'`]};let u=t;const p=s.getSeqHandler(t);let m,g;p.notation!==a.Hi.SEPARATOR&&(u=p.convert(a.Hi.SEPARATOR,"."),u.name=t.name);try{g=s.getSeqHandler(u).alphabet,m=(0,h.pz)(g)}catch(e){const[t,n]=(0,d.AP)(e);return{molCol:null,warnings:[t]}}const y=function(e,t){const n=e.length,o=new Array(n),s=t.getSeqHandler(e);let a=!1;const c=s.defaultBiotype;for(let e=0;e<n;++e){const t=s.getSplitted(e);a||(a=0===t.length),o[e]=i().count(0).take(t.length).filter((e=>!t.isGap(e))).map((e=>({position:e,biotype:c,symbol:t.getCanonical(e)}))).toArray()}return a&&r.shell.warning(`Some values in the "${e.name}" column are empty`),o}(u,s),b=f(y,m,g,n,c),w=u.length,v=await(0,l.R)(u,b,g,m,n,s,c);return v.warnings.length>.05*w&&r.shell.warning(`Molfile conversion resulted in ${v.warnings.length} errors`),v}function f(e,t,n,r,o){const s=(0,c.Hb)(r,t,n),i={},l={value:null};if("RNA"===t){const e=n===a.YI.RNA?[p.u.RIBOSE,p.u.PHOSPHATE]:[p.u.DEOXYRIBOSE,p.u.PHOSPHATE];for(const n of e)g(i,n.symbol,s,o,t,l)}for(let n=0;n<e.length;++n){const r=e[n];for(const e of r){const n=e.symbol;if(""!==n)try{if("RNA"===t&&3===n.split(/\(|\)/).filter((e=>!!e)).length){const e=n.split(/\(|\)/)[1];g(i,e,s,o,t,l),i[t]?.[e]&&(i[t][n]=i[t][e])}else g(i,n,s,o,t,l)}catch(e){const t=e instanceof Error?e.message:e.toString(),r=e instanceof Error?e.stack:void 0;throw console.error(`bio lib: getMonomersDictFromLib() sym='${n}', error:\n${t}\n${r}`),new Error(`Can't get monomer '${n}' from library: ${t}`)}}}return i}function g(e,t,n,r,o,s){const i={polymerType:o,symbol:t};if(!(0,u.bq)(e,i)){const a=function(e,t,n,r,o){if(t.has(e)){const i=t.get(e),a=function(e){const t=[];for(const n of e){let e=n.capGroupSmiles;e||(e=n.capGroupSMILES),e=e.replace(/(\[|\]|\*|:|\d)/g,"").replace("OH","O").replace("Oh","O"),t.push(e)}return t}(i.rgroups),l=(s=i.molfile).includes("V3000")?function(e){const t=new Map,n=/M V30 (\d+) R#.+RGROUPS=\((\d+) (\d+)\).*/gm;let r;for(;null!==(r=n.exec(e));)r.index===n.lastIndex&&n.lastIndex++,t.set(parseInt(r[1]),parseInt(r[3]));return t}(s):function(e){const t=new Map;let n=e.indexOf(p.u.V2K_A_LINE,0),r=n;for(;-1!==n;){r=e.indexOf("\n",n);const o=parseInt(e.substring(n,r).replace(/^A\s+/,""));n=e.indexOf("R",r),r=e.indexOf("\n",n);const s=parseInt(e.substring(n,r).replace(/^R/,""));t.set(o,s),n=e.indexOf(p.u.V2K_A_LINE,r)}for(n=e.indexOf(p.u.V2K_RGP_LINE,0),r=e.indexOf("\n",n);-1!==n;){n+=p.u.V2K_RGP_SHIFT,r=e.indexOf("\n",n);const o=e.substring(n,r).replaceAll(/\s+/g," ").split(" ").map((e=>parseInt(e))).slice(1);for(let e=0;e<o.length;e+=2){if(t.has(o[e])&&t.get(o[e])!==o[e+1])throw new Error(`r-group index ${o[e]} has already been added with a different value`);t.set(o[e],o[e+1])}n=e.indexOf(p.u.V2K_RGP_LINE,r)}return t}(s),u=i.molfile.includes("V3000")?i.molfile:function(e,t){const n=t.get_mol(function(e){return e.split("\n").map((e=>{const t=e.indexOf(" R# "),n=e.indexOf(" R ");if(-1===t&&-1===n)return e;const r=-1!==t?t:n,o=e.split("");for(let e=r+5;e<o.length;e++)" "!==o[e]&&(o[e]="0");return o.join("")})).join("\n")}(e)),r=n.get_v3Kmolblock();return n.delete(),r}(function(e){let t=e.indexOf(p.u.V2K_A_LINE,0);-1===t&&(t=e.indexOf(p.u.V2K_RGP_LINE));const n=e.indexOf(p.u.V3K_END,t);return e.substring(0,t)+e.substring(n)}(i.molfile),n),d=function(e){let t=(e=e.replaceAll("\r","")).indexOf(p.u.V3K_BEGIN_COUNTS_LINE)+p.u.V3K_COUNTS_SHIFT,n=e.indexOf(" ",t+1);const r=parseInt(e.substring(t,n));return t=n+1,n=e.indexOf(" ",t+1),{atomCount:r,bondCount:parseInt(e.substring(t,n))}}(u),h=function(e,t){const n=new Array(t),r=new Float32Array(t),o=new Float32Array(t),s=new Array(t);let i=e.indexOf(p.u.V3K_BEGIN_ATOM_BLOCK);i=e.indexOf("\n",i);let a=i;for(let c=0;c<t;c++){i=e.indexOf(p.u.V3K_BEGIN_DATA_LINE,i)+p.u.V3K_IDX_SHIFT,a=e.indexOf(" ",i),i=a+1,a=e.indexOf(" ",i),n[c]=e.substring(i,a);const t=new Array(2);for(let n=0;n<2;++n)i=a+1,a=e.indexOf(" ",i),t[n]=parseFloat(e.substring(i,a));r[c]=t[0],o[c]=t[1],i=a,a=e.indexOf("\n",i)+1,s[c]=e.slice(i,a),i=a}return{atomTypes:n,x:r,y:o,kwargs:s}}(u,d.atomCount),m=function(e,t){const n=new Uint32Array(t),r=new Array(t),o=new Map,s=new Map;let i=e.indexOf(p.u.V3K_BEGIN_BOND_BLOCK);i=e.indexOf("\n",i);let a=i;for(let c=0;c<t;++c){const t=new Array(3);i=e.indexOf(p.u.V3K_BEGIN_DATA_LINE,a)+p.u.V3K_IDX_SHIFT,a=e.indexOf(" ",i);for(let n=0;n<3;++n)i=a+1,a=Math.min(e.indexOf("\n",i),e.indexOf(" ",i)),t[n]=parseInt(e.slice(i,a));n[c]=t[0],r[c]=t.slice(1);const l=e.indexOf("\n",i);let u=e.slice(a,l),d=u.indexOf(p.u.V3K_BOND_CONFIG);if(-1!==d){d=u.indexOf("=",d)+1;let e=u.indexOf(" ",d);-1===e&&(e=u.length);const t=parseInt(u.slice(d,e));o.set(c,t);const n=p.u.V3K_BOND_CONFIG+t.toString();u=u.replace(n,"")}u||s.set(c,u)}return{bondTypes:n,atomPairs:r,bondConfiguration:o,kwargs:s}}(u,d.bondCount),f=function(e,t,n,r){const o={backboneShift:null,branchShift:null,terminalNodes:[],rNodes:[]};if(n&&r&&[1,2].some((e=>!Array.from(r.values()).find((t=>t==e))))){const o=[1,2].find((e=>!Array.from(r.values()).find((t=>t==e)))),s=[1,2].find((e=>Array.from(r.values()).find((t=>t==e)))),i=Array.from(r.keys()).find((e=>r.get(e)===s))-1,a=e.x[i],c=e.y[i],l=t.atomPairs.find((e=>e.includes(i+1))).find((e=>e!==i+1))-1;let u=e.x.reduce(((t,n,r)=>{if(r===i)return t;if(r===l)return t;const o=e.y[r];return Math.sqrt((n-a)**2+(o-c)**2)>Math.sqrt((e.x[t]-a)**2+(e.y[t]-c)**2)?r:t}),-1);if(-1===u&&(u=e.x.length,e.x=new Float32Array([...e.x,-a]),e.y=new Float32Array([...e.y,-c]),e.atomTypes=[...e.atomTypes,"H"],e.kwargs=[...e.kwargs,""],t.atomPairs.push([l+1,u+1]),t.bondTypes=new Uint32Array([...t.bondTypes,1]),t.kwargs.set(t.atomPairs.length-1,"")),r.set(u+1,o),1===o)n.unshift(e.atomTypes[u]);else{if(2!==o)throw new Error(`Unexpected missing R-group: ${o}`);n.splice(1,0,e.atomTypes[u])}}return function(e,t,n){for(const[r,o]of n)e.atomTypes[r-1]=t[o-1]}(e,n,r),function(e,t){t.rNodes=Array.from(e.keys());for(let n=0;n<t.rNodes.length;n++)for(const r of[1,2])if(e.get(t.rNodes[n])===r){const e=t.rNodes[r-1];t.rNodes[r-1]=t.rNodes[n],t.rNodes[n]=e}}(r,o),y(t,o),o}(h,m,a,l),g=function(e){let t=[],n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(");for(;-1!==n;){n+=28;const r=e.indexOf(")",n);t=t.concat(e.substring(n,r).split(" ").slice(1).map((e=>parseInt(e)))),n=r,n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(",n)}return t}(u),w={atoms:h,bonds:m,meta:f,stereoAtoms:g};return"PEPTIDE"===r?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,r=e.atoms.x,o=e.atoms.y;_(e,-r[t],-o[t]);const s=E(r[n],o[n]);C(e.atoms,-s),r[e.meta.rNodes[1]-1]<0&&T(e);const i=function(e){const t=function(e){const t=new Map;for(const n of e.bonds.atomPairs)for(let e=0;e<2;e++){const r=n[e],o=n[(e+1)%2];t.has(r)?t.get(r)?.push(o):t.set(r,new Array(1).fill(o))}return t}(e);let n=0;const r=e.atoms.atomTypes.length;let o=0;if(e.meta.terminalNodes.length<2)return null;for(;0===n;){const s=t.get(e.meta.terminalNodes[1])[o];if(e.atoms.atomTypes[s-1]===p.u.OXYGEN&&s!==e.meta.rNodes[1]&&(n=s),o++,o>r)return null}return n}(e);null!=i&&(function(e,t){e.atoms.y[e.meta.rNodes[1]-1]<0&&e.atoms.y[t-1]<0&&(function(e){S(e,!0)}(e),C(e.atoms,-function(e,t){return E(e,t)+Math.PI/2}(e.atoms.x[e.meta.terminalNodes[1]-1],e.atoms.y[e.meta.terminalNodes[1]-1])))}(e,i),function(e,t){const n=e.atoms.x;n[e.meta.rNodes[1]-1]>n[t-1]&&function(e,t,n){const r=t-1,o=n-1,s=e.atoms.x,i=e.atoms.y,a=s[r],c=i[r];s[r]=s[o],i[r]=i[o],s[o]=a,i[o]=c}(e,t,e.meta.rNodes[1])}(e,i))}(w):e===p.u.RIBOSE.symbol||e===p.u.DEOXYRIBOSE.symbol?function(e,t){const n=e.atoms.x,r=e.atoms.y;let o=e.meta.terminalNodes[0]-1;const s=e.meta.rNodes[1]-1;_(e,-n[o],-r[o]);const i=E(n[e.meta.rNodes[2]-1],r[e.meta.rNodes[2]-1]);C(e.atoms,-i),n[e.meta.rNodes[0]-1]>n[e.meta.rNodes[1]-1]&&T(e);const a=E(n[s],r[s]);C(e.atoms,3*Math.PI/2-a),t.value=function(e){const t=e.atoms.x,n=e.atoms.y,r=e.meta.rNodes[2]-1,o=e.meta.terminalNodes[2]-1,s=t[r]-t[o],i=n[r]-n[o];return Math.atan2(s,i)}(e),o=e.meta.terminalNodes[0]-1,_(e,-n[o],-r[o])}(w,o):e===p.u.PHOSPHATE.symbol?function(e){const t=e.meta.rNodes[1]-1,n=e.meta.rNodes[0]-1,r=e.atoms.x,o=e.atoms.y;_(e,-r[t],-o[t]);const s=E(r[n],o[n]);C(e.atoms,Math.PI/2-s)}(w):function(e,t){const n=e.atoms.x,r=e.atoms.y,o=e.meta.terminalNodes[0]-1,s=e.meta.rNodes[0]-1;_(e,-n[o],-r[o]);const i=E(n[s],r[s]),a=t.value;if(!a)throw new Error("The value of sugarBranchToOYAngle is null");C(e.atoms,Math.PI-i+a);const l=function(e,t){return(0,c.YN)(Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2))}({x:n[e.meta.rNodes[0]-1],y:r[e.meta.rNodes[0]-1]},{x:n[e.meta.terminalNodes[0]-1],y:r[e.meta.terminalNodes[0]-1]});if(1!=l)for(let e=0;e<n.length;++e)n[e]=(0,c.YN)(n[e]/l),r[e]=(0,c.YN)(r[e]/l)}(w,o),function(e,t,n){if("PEPTIDE"===e){b(t,e);const n=v(t,t.meta.rNodes[1]);n?.removedAtom&&(t.terminalR2Atom=n.removedAtom)}else n===p.u.RIBOSE.symbol||n===p.u.DEOXYRIBOSE.symbol?(v(t,t.meta.rNodes[1]),t.meta.rNodes[1]=t.meta.terminalNodes[1],y(t.bonds,t.meta),b(t,e),v(t,t.meta.rNodes[1]),v(t,t.meta.rNodes[0]),v(t,t.meta.rNodes[2])):n===p.u.PHOSPHATE.symbol&&(t.meta.terminalNodes[0]=t.meta.rNodes[0],_(t,-t.atoms.x[t.meta.terminalNodes[0]-1],-t.atoms.y[t.meta.terminalNodes[0]-1]),b(t,e),v(t,t.meta.rNodes[1]))}(r,w,e),function(e){let t=0;for(;t<e.atoms.atomTypes.length;)e.atoms.atomTypes[t]===p.u.HYDROGEN&&(v(e,t+1),--t),++t}(w),function(e){let t=0;for(;t<e.atoms.atomTypes.length;)"oh"===e.atoms.atomTypes[t]?.toLowerCase()&&(e.atoms.atomTypes[t]="O"),"?"===e.atoms.atomTypes[t]&&(e.atoms.atomTypes[t]="H"),++t}(w),function(e){const t=" RGROUPS=(1 1)";for(let n=0;n<(e.atoms.kwargs?.length??0);n++){const r=e.atoms.kwargs[n];r&&r.includes(t)&&(e.atoms.kwargs[n]=r.replace(t,""))}}(w),w}var s;return null}(t,n,r,o,s);if(!a)throw new Error(`Monomer with symbol '${t}' is absent the monomer library`);(0,u.LQ)(e,i,a)}}function y(e,t){const n=t.rNodes;t.terminalNodes=new Array(n.length).fill(0);const r=t.terminalNodes,o=e.atomPairs;let s=0,i=0;for(;s<o.length&&i<r.length;){for(let e=0;e<r.length;++e)for(let t=0;t<2;++t)o[s][t]===n[e]&&(r[e]=o[s][(t+1)%2],n.length,++i);++s}}function b(e,t){e.meta.rNodes.length>1&&(e.meta.backboneShift=w(e,e.meta.rNodes[1]-1,e.meta.terminalNodes[0]-1)),"RNA"===t&&e.meta.rNodes.length>2&&(e.meta.branchShift=w(e,e.meta.rNodes[2]-1,e.meta.terminalNodes[0]-1))}function w(e,t,n){return[(0,c.YN)(e.atoms.x[t]-e.atoms.x[n]),(0,c.YN)(e.atoms.y[t]-e.atoms.y[n])]}function v(e,t){if(void 0!==t){const n=t-1,r=e.atoms,o=e.bonds,s=e.meta,i=r.atomTypes.splice(n,1)[0];r.x=A(Float32Array,r.x,n,1),r.y=A(Float32Array,r.y,n,1),r.kwargs.splice(n,1);for(let e=0;e<s.terminalNodes.length;++e)s.terminalNodes[e]>t?--s.terminalNodes[e]:s.terminalNodes[e]===t&&(s.terminalNodes[e]=-1);for(let e=0;e<s.rNodes.length;++e)s.rNodes[e]>t?--s.rNodes[e]:s.rNodes[e]===t&&(s.rNodes[e]=-1);let a=0;for(;a<o.atomPairs.length;){const e=o.atomPairs[a][0],n=o.atomPairs[a][1];e===t||n===t?(o.atomPairs.splice(a,1),o.bondTypes=A(Uint32Array,o.bondTypes,a,1),o.bondConfiguration.has(a)&&o.bondConfiguration.delete(a),o.kwargs.has(a)&&o.kwargs.delete(a),--a):(o.atomPairs[a][0]=e>t?e-1:e,o.atomPairs[a][1]=n>t?n-1:n),++a}let c=Array.from(o.bondConfiguration.keys());return c.forEach((e=>{if(o.bondConfiguration.has(e)&&e>n){const t=o.bondConfiguration.get(e);o.bondConfiguration.delete(e),o.bondConfiguration.set(e-1,t)}})),c=Array.from(o.kwargs.keys()),c.forEach((e=>{if(o.kwargs.has(e)&&e>n){const t=o.kwargs.get(e);o.kwargs.delete(e),o.kwargs.set(e-1,t)}})),i?{removedAtom:i}:void 0}}function A(e,t,n,r){const o=new e(t.length-r);let s=0,i=0;for(;s<t.length;)s===n&&(s+=r),o[i]=t[s],++i,++s;return o}function E(e,t){let n;if(0===e)n=t>0?0:Math.PI;else if(0===t)n=e>0?-Math.PI/2:Math.PI/2;else{const r=t/e,o=Math.atan(r);n=e<0?Math.PI/2+o:-Math.PI/2+o}return n}function C(e,t){if(0!==t){const n=e.x,r=e.y,o=Math.cos(t),s=Math.sin(t);for(let e=0;e<n.length;++e){const t=n[e];n[e]=(0,c.YN)(t*o-r[e]*s),r[e]=(0,c.YN)(t*s+r[e]*o)}}}function T(e){S(e,!1)}function S(e,t){if(t){const t=e.atoms.y;for(let e=0;e<t.length;e++)t[e]=-t[e]}else{const t=e.atoms.x;for(let e=0;e<t.length;e++)t[e]=-t[e]}const n=e.bonds.bondConfiguration;for(const[e,t]of n){const r=1===t?3:1;n.set(e,r)}}function _(e,t,n){const r=e.atoms.x,o=e.atoms.y;for(let e=0;e<r.length;++e)r[e]=(0,c.YN)(r[e]+t),void 0!==n&&(o[e]=(0,c.YN)(o[e]+n))}},294:(e,t,n)=>{"use strict";function r(e,t){return e[t.polymerType]?.[t.symbol]}function o(e,t){return!!e[t.polymerType]?.[t.symbol]}function s(e,t,n){let r=e[t.polymerType];r||(r=e[t.polymerType]={}),r[t.symbol]=n}n.d(t,{Cg:()=>i,LQ:()=>s,bq:()=>o,vF:()=>a,xb:()=>r});class i extends Map{constructor(e){super(e)}}class a{constructor(e,t){this.molfile=e,this.monomers=t}static createEmpty(){return new a("",new i(null))}}},330:(e,t,n)=>{"use strict";n.d(t,{pz:()=>s,qj:()=>o,vG:()=>i});var r=n(2003);function o(e,t){return function(e,t){return e?e.columns.getUnusedName(t):t}(e,`molfile(${t})`)}function s(e){let t;if(e===r.YI.PT||e===r.YI.UN)t="PEPTIDE";else{if(e!==r.YI.RNA&&e!==r.YI.DNA)throw new Error(`Unexpected alphabet '${e}'.`);t="RNA"}return t}function i(e){const t=7===e.length?/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e):/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16)/256,parseInt(t[2],16)/256,parseInt(t[3],16)/256,t.length>4?parseInt(t[4],16)/256:.3]:null}},1093:(e,t,n)=>{"use strict";n.d(t,{A:()=>o,Q:()=>s});var r=n(7362);class o extends r.e{static get Chromatogram(){return void 0===this.chromatogram&&(this.chromatogram=new o({A:"green",C:"blue",G:"black",T:"red",U:"red",others:"gray"})),this.chromatogram}}class s{}s.SemType="Nucleotides",s.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",s.Names={A:"Adenine",C:"Cytosine",G:"Guanine",T:"Thymine",U:"Uracil"}},7362:(e,t,n)=>{"use strict";n.d(t,{e:()=>r});class r{static makePalette(e,t=!1,n=r){const o={};return e.forEach((e=>{const n=e[0],r=e[1];n.forEach(((e,n)=>{o[e]=this.colourPalette[r][t?0:n]}))})),new n(o)}constructor(e){this._palette=e}get(e,t){return this._palette[e]}}r.undefinedColor="rgb(100,100,100)",r.colourPalette={orange:["rgb(255,187,120)","rgb(245,167,100)","rgb(235,137,70)","rgb(205, 111, 71)"],all_green:["rgb(44,160,44)","rgb(74,160,74)","rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)","rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],all_blue:["rgb(31,119,180)","rgb(23,190,207)","rgb(122, 102, 189)","rgb(158,218,229)","rgb(141, 124, 217)","rgb(31, 120, 150)"],magenta:["rgb(162,106,192)","rgb(197,165,224)","rgb(208,113,218)"],red:["rgb(214,39,40)","rgb(255,152,150)"],st_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(31,119,180)"],dark_blue:["rgb(31,119,180)","rgb(31, 120, 150)"],light_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(108, 218, 229)","rgb(23,190,227)"],lilac_blue:["rgb(124,102,211)","rgb(149,134,217)","rgb(97, 81, 150)"],dark_green:["rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)"],green:["rgb(44,160,44)","rgb(74,160,74)"],light_green:["rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],st_green:["rgb(44,160,44)","rgb(152,223,138)","rgb(39, 174, 96)","rgb(74,160,74)"],pink:["rgb(247,182,210)"],brown:["rgb(140,86,75)","rgb(102, 62, 54)"],gray:["rgb(127,127,127)","rgb(199,199,199)","rgb(196,156,148)","rgb(222, 222, 180)"],yellow:["rgb(188,189,34)"],white:["rgb(230,230,230)"]}},4574:(e,t,n)=>{"use strict";n.d(t,{O:()=>s,n:()=>o});var r=n(1858);class o{constructor(e,t=!0,n){return this.substructure=e,this.readOnly=t,this.logger=n,new Proxy(this,{set:(e,t,n)=>{if(this.logger?.debug(`BioFilterProps.set ${t.toString()}( '${n}' )`),this.readOnly)throw new Error("Properties are immutable.");return e[t]=n,!0}})}}class s{constructor(){this.onChanged=new r.Subject,this._props=null,this._propsChanging=!1}get props(){return this._props||(this._props=this.emptyProps),this._props}set props(e){this._propsChanging=!0;try{this._props=e,this.applyProps(),this.onChanged.next()}finally{this._propsChanging=!1}}saveProps(){const e={};for(const[t,n]of Object.entries(this.props))"_onChanged"!==t&&"logger"!==t&&(e[t]=this.props[t]);return e}async detach(){}get filterSummary(){return this.props.substructure}get isFiltering(){return""!==this.props.substructure}resetFilter(){this.props=this.emptyProps,this.onChanged.next()}}},4152:(e,t,n)=>{"use strict";n.d(t,{$u:()=>c,oT:()=>d});var r=n(6082),o=n(7362),s=n(6718);function i(e,t=!0){if(null==e)return"rgb(100,100,100)";const n=r.Color.fromHtml(e);if(t){const e=r.Color.g(n),t=r.Color.r(n),o=r.Color.b(n),s=Math.sqrt(Math.pow(0-t,2)+Math.pow(0-e,2)+Math.pow(0-o,2));if(s>210)return`rgb(${t/s*210},${e/s*210},${o/s*210})`}return r.Color.toRgb(n)}class a{static hashCode(e){let t=0;if(0===e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}}class c{}class l extends c{get(e,t){return"#666666"}}class u extends c{static get palette(){return u._pallete||(u._pallete=u.buildPalette()),u._pallete}static buildPalette(){return(0,s.pj)().then((e=>{e.awaitLoaded(1/0).then((()=>{const t=e.getMonomerLib();t.onChanged.subscribe((()=>{u.customMonomerColors={},u.polymerTypes=t.getPolymerTypes();for(const e of this.polymerTypes){const n=t.getMonomerSymbolsByType(e);for(const r of n){const n=t.getMonomer(e,r);n?.meta?.colors?.default?.background&&(this.customMonomerColors[r]||(this.customMonomerColors[r]={}),this.customMonomerColors[r][e]=i(n.meta.colors.default.background))}}}))}))})),[].concat(...Object.values(o.e.colourPalette))}get(e,t){const n=u.palette.length,r=u.customMonomerColors[e],o=t??"PEPTIDE";if(r&&r[o])return r[o];const s=a.hashCode(e)%n;return i(u.palette[s])}}u._pallete=null,u.customMonomerColors={},u.polymerTypes=[];class d extends o.e{static get Gray(){return void 0===this.gray&&(this.gray=new l),this.gray}static get Color(){return void 0===this.color&&(this.color=new u),this.color}}},6642:(e,t,n)=>{"use strict";n.d(t,{BG:()=>i,sD:()=>c});var r=n(4328),o=n(1858),s=n(8070);function i(e){let t=null,n=null;try{n=e.dart?e.gridColumn:null,t=n?n.temp:null}catch{[n,t]=[null,null]}const r=e.cell.column;if(t=t??(r?r.temp:null),!t)throw new Error("Grid cell renderer back store (GridColumn or Column) not found.");return[n,r,t]}class a{onKeyDown(e,t){}onKeyPress(e,t){}onMouseEnter(e,t){}onMouseLeave(e,t){}onMouseDown(e,t){}onMouseUp(e,t){}onMouseMove(e,t){}onClick(e,t){}onDoubleClick(e,t){}}class c extends a{constructor(e,t,n){super(),this.gridCol=e,this.tableCol=t,this.logger=n,this.subs=[],this.dirty=!0,this.destroyed=!1,this.viewerId=++c.viewerCounter,this.errors=[],this._onRendered=new o.Subject,this.tableCol&&this.tableCol.dataFrame&&(this.subs.push(this.tableCol.dataFrame.onDataChanged.subscribe((()=>{this.dirty=!0}))),this.subs.push(this.tableCol.dataFrame.onColumnsRemoved.subscribe((e=>{try{this.destroyed||!this.tableCol||this.tableCol.dataFrame||this.destroy()}catch(e){this.logger.error(e)}})))),this.tableCol&&this.subs.push(r.events.onTableRemoved.subscribe((e=>{try{const t=e.args.dataFrame;this.tableCol?.dataFrame.id!==t.id||this.destroyed||this.destroy()}catch(e){this.logger.error(e)}}))),this.gridCol&&this.subs.push(r.events.onViewRemoving.subscribe((e=>{try{const t=e.args.view;this.gridCol?.dart&&this.gridCol.grid&&this.gridCol?.grid?.dart&&this.gridCol?.grid?.view?.id===t.id&&!this.destroyed&&this.destroy()}catch(e){this.logger.error(e)}})))}toLog(){return`${this.constructor.name}<${this.viewerId}>`}destroy(){for(const e of this.subs)e.unsubscribe();this.destroyed=!0}invalidateGrid(){this.gridCol&&this.gridCol.dart&&this.gridCol.grid?.invalidate()}reset(){this.dirty=!1}get onRendered(){return this._onRendered}invalidate(e){this.invalidateGrid()}async awaitRendered(e=1e4,t=`${e} timeout`){const n=`${this.toLog()}.awaitRendered()`;if(this.logger.debug(`${n}, start, testEvent before`),await(0,s.PE)(this._onRendered,(()=>{}),(()=>{this.invalidate()}),e,`${n}, ${t}`),this.errors.length>0){const e=this.errors[0];throw this.errors=[],e}this.logger.debug(`${n}, end`)}}c.viewerCounter=-1},673:(e,t,n)=>{"use strict";n.d(t,{s:()=>r});const r={true:"1",false:"0"}},6882:(e,t,n)=>{"use strict";n.d(t,{Bb:()=>b,Jy:()=>w,S$:()=>y,U0:()=>v});var r=n(7389),o=n(6082),s=n(1991),i=n.n(s),a=n(8312),c=n(2003),l=n(6642),u=n(6718),d=n(9192),h=n(3856),p=n(673),m=n(3599),f=n(5553),g=n(9713);const y="rgb(100,100,100)";function b(e,t,n){if((n??0)>0&&t<(e[0]??0)+n)return-1;t-=n??0;let r,o=100,s=0,i=e.length-1;for(;s<=i;){if(r=Math.floor((i+s)/2),e[r]<=t&&t<e[r+1])return r;if(t<e[r]?i=r-1:s=r+1,--o<=0)throw new Error(`Get position for pointer x = ${t} searching has not converged on ${JSON.stringify(e)}. `)}return null}class w extends l.sD{get separatorWidth(){return this.props?.fontCharWidth?this.props?.fontCharWidth:5}constructor(e,t,n,r,s){if(super(e,t,n),this.monomerLengthLimit=r,this.propsProvider=s,this.colWidth=0,this._monomerLengthList=null,this._processedMaxVisibleSeqLength=0,this._monomerLengthMap={},this._monomerStructureMap={},this._ellipsisBounds=void 0,this._totalLinesNeeded=0,this._lineHeight=20,this._cellBounds=new Map,this.sysMonomerLib=null,this.padding=5,this._leftThreeDotsPadding=0,this.props=this.propsProvider(),this._processedRows=o.BitSet.create(this.tableCol.length),this.gridCol&&this.subs.push(this.gridCol.grid.onAfterDrawContent.subscribe((()=>{this._onRendered.next()}))),this.tableCol&&this.gridCol){this.subs.push(this.tableCol.dataFrame.onCurrentRowChanged.subscribe((()=>{-1===this.tableCol.dataFrame.currentRowIdx&&(this.tableCol.temp["reference-sequence"]=null,this.tableCol.temp["current-word"]=null,this.invalidateGrid())})));const e=[c.gp.positionShift,"renderMultiline"];this.subs.push(o.debounce(this.tableCol.dataFrame.onMetadataChanged.pipe(g.filter((t=>t.args.source===this.tableCol&&e.includes(t.args.key)))),200).subscribe((e=>{this.reset()}))),this.subs.push(o.debounce(this.tableCol.dataFrame.onMetadataChanged.pipe(g.filter((e=>e.args.source===this.tableCol&&e.args.key===c.gp.positionShift))),200).subscribe((e=>{this.reset()})))}}calculateFontBasedSpacing(e){const t=e.measureText("M");let n=12;if(this.tableCol?.temp[".mm.cellRenderer.fontSize"]){const e=this.tableCol.temp[".mm.cellRenderer.fontSize"];"number"!=typeof e||isNaN(e)||(n=Math.max(e,1))}return{lineHeight:Math.max(1.4*n,t.fontBoundingBoxAscent+t.fontBoundingBoxDescent+4),monomerSpacing:Math.max(2,.2*this.props.fontCharWidth)}}shouldUseMultilineRendering(e){return"true"===e.getTag("renderMultiline")}calculateMultiLineLayoutDynamic(e,t,n,r,o,s){if(this.dirty)try{this.reset()}catch(e){const[t,n]=(0,d.AP)(e);this.logger.error(t,void 0,n)}const{lineHeight:i,monomerSpacing:a}=this.calculateFontBasedSpacing(e),c=t-2*this.padding;let l=0;const u=[];if(r.length>0)for(let t=o;t<r.length;t++){const n=r.getOriginal(t),o=this.props.monomerToShort(n,s);u.push({text:o,posIdx:t}),l=Math.max(l,e.measureText(o).width)}if(0===u.length)return{lineLayouts:[],lineHeight:i};const h=l;let p=Math.floor((c+a)/(h+a));p=Math.max(1,p);const m=n-2*this.padding,f=Math.max(0,Math.floor(m/i)),g=[];let y=0;for(let e=0;e<f&&y<u.length;e++){const t=[];for(let e=0;e<p&&y<u.length;e++){const n=u[y],r=this.padding+e*(h+a);t.push({posIdx:n.posIdx,x:r,width:h,om:n.text,isSeparator:!1}),y++}g.push({lineIdx:e,elements:t})}return{lineLayouts:g,lineHeight:i}}async init(){await Promise.all([(async()=>{this.seqHelper=await(0,a.Q)(),this.invalidateGrid()})(),(async()=>{const e=await(0,u.pj)();this.sysMonomerLib=e.getMonomerLib()})()]),this.subs.push(this.sysMonomerLib.onChanged.subscribe((()=>{this.reset()}))),this.reset()}static getFontSettings(e){let t=12;return e&&e.temp[".mm.cellRenderer.fontSize"]&&"number"==typeof e.temp[".mm.cellRenderer.fontSize"]&&!isNaN(e.temp[".mm.cellRenderer.fontSize"])&&(t=Math.max(e.temp[".mm.cellRenderer.fontSize"],1)),{font:`${t}px monospace`,fontWidth:.6*t}}toLog(){return`MonomerPlacer<${this.viewerId}>`}getMonomerLib(){return this.tableCol.temp[".mm.cellRenderer.overriddenLibrary"]??this.sysMonomerLib}reset(){this.propsProvider&&(this.props=this.propsProvider()),this._processedRows=o.BitSet.create(this.tableCol.length),this._monomerLengthList=null,this._monomerLengthMap={},this._monomerStructureMap={},this._cellBounds.clear(),super.reset(),this.invalidateGrid()}invalidateGrid(){this.gridCol&&this.gridCol.dart&&this.gridCol.grid?.invalidate()}getCellMonomerLengths(e,t){const n=this.seqHelper.getSeqHandler(this.tableCol);if(this.colWidth<t&&(this.colWidth=t,this.dirty=!0),this.dirty)try{this.reset()}catch(e){const[t,n]=(0,d.AP)(e);this.logger.error(t,void 0,n)}const r=n.isMsa()?this.getCellMonomerLengthsForSeqMsa():this.getCellMonomerLengthsForSeq(e);return[r,this.getSummedMonomerLengths(r)]}getSummedMonomerLengths(e){const t=new Array(e.length+1);t[0]=this.padding;for(let n=1;n<t.length;n++)t[n]=t[n-1]+e[n-1];let n=t[0];for(let e=1;e<t.length;e++)t[e]?n=t[e]:t[e]=n;return t}getCellMonomerLengthsForSeqValue(e,t){const n=this.seqHelper.getSeqHandler(this.tableCol),r=this.props.separatorWidth+1*this.props.fontCharWidth,o=this.positionShift,s=Math.ceil(t/r)+o,i=n.splitter(e),a=Math.min(s,i.length),c=new Array(a-o);let l=0;for(let e=o;e<a;++e){const r=i.getOriginal(e),s=this.props.monomerToShort(r,this.monomerLengthLimit),a=(n.isSeparator()?this.separatorWidth:this.props.separatorWidth)+s.length*this.props.fontCharWidth;if(c[e-o]=a,l+=a,l>t)break}return c}getCellMonomerLengthsForSeq(e){this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(this.tableCol.length).fill(null));const t=this.positionShift,n=this.seqHelper.getSeqHandler(this.tableCol),r=this.props.separatorWidth+1*this.props.fontCharWidth,o=Math.ceil(this.colWidth/r)+t,s=n.getSplitted(e),i=Math.min(o,s.length);let a=this._monomerLengthList[e];if(null===a||a.length!=i-t){a=this._monomerLengthList[e]=new Array(s.length);let r=0;for(let e=t;e<i;++e){const o=s.getOriginal(e),i=this.props.monomerToShort(o,this.monomerLengthLimit),c=(n.isSeparator()?this.separatorWidth:this.props.separatorWidth)+i.length*this.props.fontCharWidth;if(a[e-t]=c,r+=c,r>this.colWidth)break}}return a}getCellMonomerLengthsForSeqMsa(){var e;this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(1).fill(null)),(e=this._monomerLengthList)[0]??(e[0]=new Array(0));const t=this._monomerLengthList[0],{startIdx:n,endIdx:r}=(()=>{try{const e=this.gridCol&&this.gridCol.dart?this.gridCol.grid:null;return e&&e.dart?{startIdx:Math.max(Math.floor((e?.vertScroll.min??0)-10),0),endIdx:Math.min(Math.ceil((e?.vertScroll.max??0)+10),this.tableCol.length)}:{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}catch(e){return{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}})(),o=this.props.separatorWidth+1*this.props.fontCharWidth,s=this.positionShift,i=Math.ceil(this.colWidth/o)+s;for(let e=n;e<r;e++){if(this._processedRows.get(e)&&i<=this._processedMaxVisibleSeqLength)continue;const n=this.seqHelper.getSeqHandler(this.tableCol).getSplitted(e,i),r=Math.min(i,n.length);r-s>t.length&&t.push(...new Array(r-s-t.length).fill(o));let a=0;for(let e=s;e<r;++e){const r=n.getOriginal(e),o=this.props.monomerToShort(r,this.monomerLengthLimit),i=this.props.separatorWidth+o.length*this.props.fontCharWidth;if(t[e-s]=Math.max(t[e-s]??0,i),a+=i,a>=this.colWidth)break}this._processedMaxVisibleSeqLength=Math.max(this._processedMaxVisibleSeqLength,i),this._processedRows.set(e,!0)}return t}getPosition(e,t,n,r){const[o,s]=this.getCellMonomerLengths(e,n);return 0===this.seqHelper.getSeqHandler(this.tableCol).getSplitted(e).length?null:b(s,t,r)}setMonomerLengthLimit(e){this.monomerLengthLimit!=e&&(this.monomerLengthLimit=e,this.dirty=!0)}setSeparatorWidth(e){this.separatorWidth!=e&&(this.props.separatorWidth=e,this.dirty=!0)}get positionShift(){const e=Number.parseInt(this.tableCol?.tags[c.gp.positionShift]??"0")??0;return isNaN(e)?0:Math.max(e,0)}render(e,t,n,r,s,a,l){const u=a.grid?.canvas===e.canvas;if(!this.seqHelper)return;const m=this.tableCol,f=this.positionShift;e.save();try{const l=this.seqHelper.getSeqHandler(m);let d=this.monomerLengthLimit;if(h.gp.maxMonomerLength in m.tags){const e=parseInt(m.getTag(h.gp.maxMonomerLength));d=!isNaN(e)&&e?e:50}if(m.temp[".mm.cellRenderer.settingsChanged"]===p.s.true||this.monomerLengthLimit!=d){let e=0;const t=8;e=m.temp[".mm.cellRenderer.gapLength"]??e,this.setMonomerLengthLimit(d),this.setSeparatorWidth(l.isMsa()?t:e),m.temp[".mm.cellRenderer.settingsChanged"]=p.s.false,this.dirty=!0}const g=a.cell.rowIndex,b=a.cell.value;u&&(r=v(a.grid,e,t,r,window.devicePixelRatio)),e.beginPath(),e.rect(t,n,r,s),e.clip(),e.font=this.props?.font??"12px monospace",e.textBaseline="top";const w=m.meta.units,A=m.getTag(c.gp.aligned),E=m.getTag(c.gp.separator)??"",C=u?l.getSplitted(g):l.splitter(b);let T=h.yg.classic;A?.includes("MSA")&&w===c.Hi.SEPARATOR&&(T=h.yg.MSA);const S=m.temp["reference-sequence"],_=this.tableCol.temp["current-word"],P=(()=>{const e=(0,l.splitter)(null!=S&&""!==S?S:_??"");return i().count(0).take(e.length).slice(f).map((t=>e.getCanonical(t))).toArray()})(),M=Number.parseInt(m.getTag(c.gp.selectedPosition)??"-200");if(this.shouldUseMultilineRendering(m)){const i=[],c=this.calculateMultiLineLayoutDynamic(e,r,s,C,f,d);let u=n+this.padding;1===c.lineLayouts.length&&(u=n+(s-c.lineHeight)/2);for(const r of c.lineLayouts){const s=u+r.lineIdx*c.lineHeight;for(const u of r.elements){const d=t+u.x,p=u,g=p.posIdx,b=C.getCanonical(g);let w=y;const v=this.getMonomerLib();v&&(w=v.getMonomerTextColor(l.defaultBiotype,b));let A=0;if(a.tableRowIndex!==m.dataFrame.currentRowIdx&&P.length>0){const e=g-f;e>=0&&e<P.length&&b===P[e]&&(A=.7)}i.push({lineIdx:r.lineIdx,monomerIdx:g-f,bounds:new o.Rect(u.x,s-n,u.width,c.lineHeight),sequencePosition:g}),(0,h.oZ)(e,p.om,d,s,u.width,c.lineHeight,{color:w,isMultiLineContext:!0,transparencyRate:A,selectedPosition:isNaN(M)||M<1?void 0:M,wordIdx:g})}}null!==a.tableRowIndex&&this._cellBounds.set(a.tableRowIndex,i)}else{this._leftThreeDotsPadding=this.shouldRenderShiftedThreeDots(f)?e.measureText("...").width:0;let[,o]=this.getCellMonomerLengths(a.tableRowIndex,r);u||(o=this.getSummedMonomerLengths(this.getCellMonomerLengthsForSeqValue(b,r)));const i=this.props.separatorWidth+1*this.props.fontCharWidth,c=Math.min(C.length,Math.ceil(r/i)+f);for(let i=f;i<c;++i){const c=i<C.length?C.getOriginal(i):l.defaultGapOriginal,u=i<C.length?C.getCanonical(i):l.defaultGapOriginal;let p=y;this.getMonomerLib()&&(p=this.getMonomerLib().getMonomerTextColor(l.defaultBiotype,u));const m={color:p,pivot:0,left:!0,transparencyRate:0,separator:E,last:i===C.length-1,drawStyle:T,maxWord:o,wordIdx:i-f,gridCell:a,referenceSequence:P,maxLengthOfMonomer:d,monomerTextSizeMap:this._monomerLengthMap,logger:this.logger,selectedPosition:isNaN(M)||M<1?void 0:M-f};(0,h.oZ)(e,c,t+this.padding+this._leftThreeDotsPadding,n,r,s,m)}if(this.shouldRenderShiftedThreeDots(f)){const i={color:y,pivot:0,left:!0,transparencyRate:0,separator:E,last:!1,drawStyle:T,maxWord:o,wordIdx:0,gridCell:a,maxLengthOfMonomer:d,monomerTextSizeMap:this._monomerLengthMap,logger:this.logger};(0,h.oZ)(e,"...",t+this.padding,n,r,s,i)}}}catch(e){const[t,n]=(0,d.AP)(e);this.logger.error(t,void 0,n),this.errors.push(e)}finally{e.restore()}}shouldRenderShiftedThreeDots(e){return e>0&&(!this.gridCol||!this.gridCol.dart||!this.gridCol.grid||!this.gridCol.grid.dart||(this.gridCol.grid.props.colHeaderHeight??0)<=50)}onMouseMove(e,t){const n=`${this.toLog()}.onMouseMove()`;if(!this.seqHelper||null==e.tableRowIndex)return;const o=this.positionShift,s=e.bounds,i=t.offsetX-e.gridColumn.left+(e.gridColumn.left-s.x),a=t.offsetY-s.y;this.gridCol?.grid?.canvas&&(this.gridCol.grid.canvas.style.cursor="default");let l=null;const u=this._cellBounds.get(e.tableRowIndex);if(u){for(const e of u)if(e.bounds.contains(i,a)){l=e.monomerIdx;break}}else{const t=this.shouldRenderShiftedThreeDots(o)&&(this._leftThreeDotsPadding??0)>0?this._leftThreeDotsPadding:0;l=this.getPosition(e.tableRowIndex,i,s.width,t)}this.logger.debug(`${n}, argsX: ${i}, argsY: ${a}, left: ${l}`);const d=this.seqHelper.getSeqHandler(this.tableCol),h=d.getSplitted(e.tableRowIndex);if(null!==l&&l>=0&&l+o<h.length){const n=d.alphabet??c.YI.UN,s={position:l,biotype:n===c.YI.RNA||n===c.YI.DNA?m.o.NUCLEOTIDE:m.o.AA,symbol:h.getCanonical(l+o)},i=[];let a=this._monomerStructureMap[s.symbol];if(!a){const e=this.getMonomerLib();a=this._monomerStructureMap[s.symbol]=e?e.getTooltip(s.biotype,s.symbol):r.divText("Monomer library is not available")}i.push(a),r.tooltip.show(r.divV(i),t.x+16,t.y+16),(0,f.WN)(e,s)}else-1===l?r.tooltip.show(r.divText(`${Math.min(o,h.length)} hidden monomers`),t.x+16,t.y+16):r.tooltip.hide(),(0,f.WN)(e,null)}}function v(e,t,n,r,o){return e?Math.max(Math.min(e.canvas.width/o-n,r)):Math.max(t.canvas.width/o-n,0)}},3856:(e,t,n)=>{"use strict";n.d(t,{Mn:()=>u,gp:()=>l,oZ:()=>p,yg:()=>d});var r=n(6082),o=n(7278);const s="rgb(100,100,100)",i="#808080",a="rgb(0,0,0)",c=o.zS;var l,u,d;!function(e){e.maxMonomerLength=".mm.cellRenderer.maxMonomerLength"}(l||(l={})),function(e){e.applyToBackground=".m.cellRenderer.applyToBackground"}(u||(u={})),function(e){e.MSA="MSA",e.classic="classic"}(d||(d={}));const h=new class{constructor(){this.color=s,this.pivot=0,this.left=!1,this.transparencyRate=0,this.separator="",this.last=!1,this.drawStyle=d.classic,this.maxWord=[],this.wordIdx=0,this.gridCell=null,this.referenceSequence=null,this.maxLengthOfMonomer=null,this.monomerTextSizeMap={},this.logger=void 0,this.selectedPosition=void 0,this.isMultiLineContext=!1,this.lineNumber=0}};function p(e,t,n,o,l,u,p){var m,f,g;const y={...h,...p};if(y.isMultiLineContext){e.textBaseline="middle",e.textAlign="center";let r=t;null!=y.maxLengthOfMonomer&&(r=c(r,y.maxLengthOfMonomer));const i=Math.max(.1,1-(y.transparencyRate??0));e.globalAlpha=i;const d=e.measureText(r),h=d.fontBoundingBoxAscent+d.fontBoundingBoxDescent,p=o+(u-h)/2+d.fontBoundingBoxAscent;let m=y.color??s;return m&&m!==s||(m=a),e.fillStyle=m,y.selectedPosition===y.wordIdx+1&&(e.save(),e.fillStyle="rgba(60, 177, 115, 0.2)",e.fillRect(n,o,l,u),e.restore(),e.fillStyle=m),e.fillText(r,n+l/2,p),e.globalAlpha=1,e.textBaseline="top",e.textAlign="start",n+l}p.logger?.debug("Bio: printLeftOrCentered(), start"),e.textAlign="start";let b=t.substring(0),w=y.last?"":y.separator;y.drawStyle===d.MSA&&(w="");let v=!0,A=!0,E="difference";if(null!=y.gridCell&&null!=y.gridCell.cell.column&&(v=y.gridCell.cell.column.temp["color-code"]??!0,A=y.gridCell.cell.column.temp["compare-with-current"]??!0,E=y.gridCell.cell.column.temp["highlight-difference"]??"difference"),y.referenceSequence){const e=y.referenceSequence[y.wordIdx];A&&y.referenceSequence.length>0&&"difference"===E&&(y.transparencyRate=b==e?.7:y.transparencyRate),A&&y.referenceSequence.length>0&&"equal"===E&&(y.transparencyRate=b!=e?.7:y.transparencyRate)}null!=y.maxLengthOfMonomer&&(b=c(b,y.maxLengthOfMonomer));const C=b+w;(m=y.monomerTextSizeMap)[C]??(m[C]=e.measureText(C));let T=y.monomerTextSizeMap[C];(f=y.monomerTextSizeMap)[b]??(f[b]=e.measureText(b));let S=y.monomerTextSizeMap[b].width;const _=u/2-(T.fontBoundingBoxAscent+T.fontBoundingBoxDescent)/2+1;(g=y.monomerTextSizeMap)[w]??(g[w]=e.measureText(w));const P=y.monomerTextSizeMap[w].width;function M(t,s){let c=v?y.color:a;y.selectedPosition===y.wordIdx+1&&(e.fillStyle="rgba(60, 177, 115, 0.2)",e.fillRect(n+t-4,o-5,y.monomerTextSizeMap[b].width+8,u+10),c=r.Color.toHtml(r.Color.setAlpha(r.Color.fromHtml(c),255))),e.fillStyle=c,e.globalAlpha=1-y.transparencyRate,y.drawStyle===d.classic&&(e.fillText(b,n+t,o+_),e.fillStyle=i,e.fillText(w,n+s,o+_)),y.drawStyle===d.MSA&&e.fillText(b,n+t,o+_),e.globalAlpha=1}T=T.width,y.drawStyle===d.MSA&&(S=y.maxWord[y.wordIdx],T=y.maxWord[y.wordIdx]);const x=(y.maxWord[y.wordIdx]??0)-(y.maxWord[0]??0);if(y.left||T>l)return M(x,x+S),n+x+S+P;{const e=(l-T)/2;return M(e,e+S),n+x+e+S}}},6307:(e,t,n)=>{"use strict";n.d(t,{F:()=>i});var r=n(7389),o=n(6082),s=n(439);function i(e,t,n){let i=0,a=null;for(const t of Object.values(e))i+=t,a=null===a?t:Math.max(a,t);const c=a/i,l=Object.assign({},...Array.from(Object.entries(e)).sort(((e,t)=>t[1]-e[1])).map((([e,a])=>{const l=a/i;let u;try{const r=n.getMonomerColors(t,e);u=r?.backgroundcolor||"#CCCCCC"}catch(t){console.warn(`Failed to get colors for monomer ${e}:`,t),u="#CCCCCC"}const d=r.div("",{classes:"macromolecule-cell-comp-analysis-bar"});d.style.width=50*l/c+"px",d.style.backgroundColor=u,s._S===e&&(d.style.borderWidth="1px",d.style.borderStyle="solid",d.style.borderColor=o.Color.toHtml(o.Color.lightGray));const h=s._S===e?"-":e,p=r.div(`${(100*l).toFixed(2)}%`),m=r.div([d,p],{classes:"macromolecule-cell-comp-analysis-value"});return{[h]:m}}))),u=r.tableFromMap(l);return Array.from(u.rows).forEach((e=>{const t=e.getElementsByClassName("macromolecule-cell-comp-analysis-bar")[0].style.backgroundColor;e.cells[0].style.color=t})),u}},3151:(e,t,n)=>{"use strict";n.d(t,{f6:()=>r});const r=["symbol","molfile","rgroups","name"];new RegExp("[rd]\\((\\w)\\)p?","g")},9192:(e,t,n)=>{"use strict";function r(e){return"string"==typeof e||e instanceof String?e:"StateError"===e.constructor.name?e.message:"StateError"===e.constructor.name&&"$thrownJsError"in e?r(e.$thrownJsError):e instanceof Error?e.message:e.toString()}function o(e){return e instanceof Error?e.stack:"StateError"===e.constructor.name&&"$thrownJsError"in e?o(e.$thrownJsError):void 0}function s(e){return[r(e),o(e)]}n.d(t,{AP:()=>s})},3516:(e,t,n)=>{"use strict";n.d(t,{m:()=>s});var r=n(6082),o=n(439);class s{get descriptionsArray(){return this._descriptionsArray}get sequencesArray(){return this._sequencesArray}parseMacromolecule(e,t){return this._fileContent.slice(e,t).split(/\s/).join("")}parseColumns(){const e=/^>(.*)$/gm;let t,n=0;for(;t=e.exec(this._fileContent);){const r=this._fileContent.substring(t.index+1,e.lastIndex);this._descriptionsArray.push(r),0!==n&&this._sequencesArray.push(this.parseMacromolecule(n,t.index)),n=e.lastIndex+1}this._sequencesArray.push(this.parseMacromolecule(n,-1))}importFasta(){const e=r.Column.fromStrings("description",this.descriptionsArray),t=r.Column.fromStrings("sequence",this.sequencesArray);return t.semType=r.SEMTYPE.MACROMOLECULE,t.meta.units=o.Hi.FASTA,[r.DataFrame.fromColumns([e,t])]}constructor(e){this._descriptionsArray=[],this._sequencesArray=[],this._fileContent=e,this.parseColumns()}}},6873:(e,t,n)=>{"use strict";n.d(t,{dW:()=>i,fD:()=>s});var r=n(6082),o=(n(1991),n(2003));function s(){const e=[];return e.push(r.Column.fromList("string","MSA",new Array(10**6).fill("meI/hHis/Aca/N/T/dE/Thr_PO3H2/Aca/D-Tyr_Et/Tyr_ab-dehydroMe/dV/E/N/D-Orn/D-aThr//Phe_4Me"))),e.push(r.Column.fromList(r.COLUMN_TYPE.FLOAT,"Activity",new Array(10**6).fill(5.30751))),e}function i(e=10**5){const t="meI/hHis/Aca/N//dE/Thr_PO3H2/Aca/D-Tyr_Et/Tyr_ab-dehydroMe".repeat(Math.ceil(e/10)).slice(0,-1),n=r.Column.fromList(r.COLUMN_TYPE.STRING,"MSA",new Array(100).fill(t));n.semType=r.SEMTYPE.MACROMOLECULE,n.meta.units=o.Hi.SEPARATOR,n.setTag(o.gp.separator,"/"),n.setTag(o.gp.alphabet,o.YI.UN),n.setTag(o.gp.alphabetIsMultichar,"true");const s=[];return s.push(n),s.push(r.Column.fromList(r.COLUMN_TYPE.FLOAT,"Activity",new Array(100).fill(7.30751))),s}n(7278),n(439)},439:(e,t,n)=>{"use strict";n.d(t,{B5:()=>c,Hi:()=>r,Vl:()=>l,YI:()=>o,_S:()=>d,b9:()=>h,gp:()=>s,ot:()=>p,q7:()=>u,z1:()=>a});var r,o,s,i=n(2738);!function(e){e.FASTA="fasta",e.SEPARATOR="separator",e.HELM="helm",e.CUSTOM="custom"}(r||(r={})),function(e){e.DNA="DNA",e.RNA="RNA",e.PT="PT",e.UN="UN"}(o||(o={})),function(e){e.aligned="aligned",e.alphabet="alphabet",e.alphabetSize=".alphabetSize",e.alphabetIsMultichar=".alphabetIsMultichar",e.separator="separator",e.isHelmCompatible=".isHelmCompatible",e.positionNames=".positionNames",e.positionLabels=".positionLabels",e.regions=".regions",e.positionShift=".positionShift",e.selectedPosition=".selectedPosition"}(s||(s={}));const a=", ",c=/(?:\[([A-Za-z0-9_\-,()]+)\])|([A-Za-z\-])/g,l=new class{constructor(){this.fasta={peptide:new Set(["G","L","Y","S","E","Q","D","N","F","A","K","R","H","C","V","P","W","I","M","T"]),dna:new Set(["A","C","G","T"]),rna:new Set(["A","C","G","U"])}}},u=[new i.a(o.PT,l.fasta.peptide,.5),new i.a(o.DNA,l.fasta.dna,.55),new i.a(o.RNA,l.fasta.rna,.55)],d="",h={[r.FASTA]:"-",[r.SEPARATOR]:"",[r.HELM]:"*"},p=" , "},2003:(e,t,n)=>{"use strict";n.d(t,{Hi:()=>r.Hi,J9:()=>o.J9,Qf:()=>o.Qf,SM:()=>o.SM,YI:()=>r.YI,gp:()=>r.gp,mn:()=>o.mn,nq:()=>o.nq,qp:()=>o.qp,z1:()=>r.z1,zS:()=>o.zS});var r=n(439),o=n(7278)},2738:(e,t,n)=>{"use strict";n.d(t,{X:()=>o,a:()=>r});class r{constructor(e,t,n){this.name=e,this.alphabet=t,this.cutoff=n}}class o extends r{constructor(e,t,n){super(e.name,e.alphabet,e.cutoff),this.freq=t,this.similarity=n}}},7278:(e,t,n)=>{"use strict";n.d(t,{Iv:()=>b,J9:()=>g,Mu:()=>m,Qf:()=>A,SM:()=>C,mn:()=>T,nq:()=>E,qp:()=>y,vZ:()=>f,zS:()=>v});var r=n(6082),o=n(1991),s=n.n(o),i=n(3527),a=n(3629),c=n(2738),l=n(439),u=n(8924),d=n(1093),h=n(4152),p=n(8438);class m{get length(){return this.mList.length}isGap(e){return this.getOriginal(e)===this.gapOriginalMonomer}getCanonical(e){if(this.length<=e)throw new Error("Index out of bounds");const t=this.mList[e];return t!==this.gapOriginalMonomer?t:l._S}getOriginal(e){if(this.length<=e)throw new Error("Index out of bounds");return this.mList[e]}getCanonicalRegion(e,t){const n=Math.min(Math.max(0,e),this.length),r=Math.max(Math.min(this.length,t),0)-n,o=this.gapOriginalMonomer;return new Array(r).fill(null).map(((e,t)=>{const r=this.mList[t+n];return r===o?l._S:r}))}getOriginalRegion(e,t){const n=Math.min(Math.max(0,e),this.length),r=Math.max(Math.min(this.length,t),0);return new Array(r-n).fill(null).map(((e,t)=>this.mList[t+n]))}get gapOriginal(){return this.gapOriginalMonomer}constructor(e,t){this.mList=e,this.gapOriginalMonomer=t}}function f(e,t,n){const r=e.categories;return function(e,t){const n={};let r=!0,o=null;for(const s of e)if(null==o?o=s.length:s.length!==o&&(r=!1),s.length>=t)for(let e=0;e<s.length;++e){const t=s.getCanonical(e);t in n||(n[t]=0),n[t]+=1}return{freq:n,sameLength:r}}(s().enumerate(e.getRawData()).map((([e,t])=>n(r[e]))),t)}const g=e=>{const t=s()(e.toString().matchAll(l.B5)).map((e=>e[2]??e[1])).toArray();return new m(t,l.b9[l.Hi.FASTA])},y=e=>{const t=e.split("$")[0].split("|"),n=s()(t.map((e=>(e.match(/(?<=\{).+(?=})/)?.[0]?.split(".")??[]).map((e=>(0,p.D)(e)))))).flatten().toArray();return new m(n,l.b9[l.Hi.HELM])};function b(e,t,n=void 0){if(e.toLowerCase().startsWith(l.Hi.FASTA))return g;if(e.toLowerCase().startsWith(l.Hi.SEPARATOR))return function(e,t){return n=>{if(n){let r;const o=new RegExp(`(?<=^|\\${e})("-"|'-'|[^\\${e}]*)(?=\\${e}|$)`,"g");return void 0!==t?(o.lastIndex=0,r=s()(n.matchAll(o)).take(t).map((e=>e[0])).toArray()):r=n.replaceAll('"-"',"").replaceAll("'-'","").split(e,t),new m(r,l.b9[l.Hi.SEPARATOR])}return new m([],l.b9[l.Hi.SEPARATOR])}}(t,n);if(e.toLowerCase().startsWith(l.Hi.HELM))return y;throw new Error(`Unexpected units ${e} .`)}const w=/([^\W_]+)/g;function v(e,t){if(e.length<=t)return e;const n=e.match(w),r=e.length>t||(n?.length??0)>1,o=n?.[0]??" ";return r?o.substring(0,t-1)+"…":o}function A(e){switch(e){case l.YI.DNA:return l.Vl.fasta.dna;case l.YI.RNA:return l.Vl.fasta.rna;case l.YI.PT:return l.Vl.fasta.peptide;default:throw new Error(`Unsupported alphabet '${e}'.`)}}function E(e,t,n="-"){const r=new Set([...new Set(Object.keys(e)),...t]);r.delete(n);const o=[],s=[];for(const n of r)o.push(n in e?e[n]:0),s.push(t.has(n)?1:0);const c=new i.Mi(o),l=new i.Mi(s);return(0,a.KE)(c,l)/((0,a.wQ)(c)*(0,a.wQ)(l))}function C(e,t,n=5){let o;return o=e.semType==r.SEMTYPE.MACROMOLECULE?t.getSeqHandler(e).alphabet:function(e,t,n="-"){const r=t.map((t=>{const r=E(e,t.alphabet,n);return new c.X(t,e,r)}));let o;const s=Math.max(...r.map((e=>e.similarity>e.cutoff?e.similarity:-1)));return o=s>0?r.find((e=>e.similarity===s)).name:l.YI.UN,o}(f(e,n,g).freq,l.q7),function(e){switch(e){case l.YI.PT:return u.X.GrokGroups;case l.YI.DNA:case l.YI.RNA:return d.A.Chromatogram;default:return h.oT.Color}}(o)}function T(e){const t=e.columns.bySemTypeAll(r.SEMTYPE.MACROMOLECULE);let n=t.find((e=>{const t=e.meta.units;return!!t&&-1!==t.indexOf("MSA")}))??null;return!n&&t.length>0&&(n=t[0]),n}},8312:(e,t,n)=>{"use strict";n.d(t,{Q:()=>o});var r=n(6082);async function o(){const e=r.Func.find({package:"Bio",name:"getSeqHelper"});if(0===e.length)throw new Error("Package 'Bio' must be installed for SeqHelper.");return(await e[0].prepare().call()).getOutputParamValue()}},3077:(e,t,n)=>{"use strict";n(6082)},7602:(e,t,n)=>{"use strict";n.d(t,{g:()=>s});var r,o=n(9192);!function(e){e[e.error=0]="error",e[e.warning=1]="warning",e[e.info=2]="info",e[e.debug=3]="debug"}(r||(r={}));class s{constructor(e){this.logger=e,this.promise=Promise.resolve(),this.errors=[],this.syncCounter=0}sync(e,t){const n=++this.syncCounter;this.logger.debug(`${e}, SYNC syncId = ${n}, IN `),this.promise=this.promise.then((async()=>{this.logger.debug(`${e}, SYNC syncId = ${n}, START `),await t(),this.logger.debug(`${e}, SYNC syncId = ${n}, END `)})).catch((t=>{const[r,s]=(0,o.AP)(t);this.logger.error(`${e}, SYNC syncId = ${n}, ERROR:\n${r}`,void 0,s),this.errors.push(t)}))}resetErrors(){const e=this.errors;return this.errors=[],e}}},4326:(e,t,n)=>{"use strict";n.d(t,{Fo:()=>u,Lp:()=>s,P4:()=>i,fH:()=>o,gp:()=>r,lT:()=>c,mH:()=>a});var r,o,s,i,a,c,l=n(6082);!function(e){e.tooltipWebLogo=".tooltipWebLogo"}(r||(r={})),function(e){e.Entropy="Entropy",e.full="100%"}(o||(o={})),function(e){e.TOP="top",e.MIDDLE="middle",e.BOTTOM="bottom"}(s||(s={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(i||(i={})),function(e){e.AUTO="auto",e.ON="on",e.OFF="off"}(a||(a={})),function(e){e.Filtered="Filtered",e.Selected="Selected"}(c||(c={}));const u=new class{constructor(){this.sequenceColumnName=null,this.valueAggrType=l.AGG.TOTAL_COUNT,this.valueColumnName="Activity",this.startPositionName=null,this.endPositionName=null,this.skipEmptySequences=!0,this.skipEmptyPositions=!1,this.shrinkEmptyTail=!0,this.backgroundColor=4294967295,this.positionHeight=o.Entropy,this.positionWidth=20,this.verticalAlignment=s.MIDDLE,this.horizontalAlignment=i.CENTER,this.fixWidth=!1,this.fitArea=!0,this.minHeight=25,this.maxHeight=300,this.maxMonomerLetters=5,this.showPositionLabels=!0,this.positionMarginState=a.AUTO,this.positionMargin=0,this.filterSource=c.Filtered}}},6869:(e,t,n)=>{"use strict";var r;n.d(t,{o:()=>r}),function(e){e.BASE="HELM_BASE",e.SUGAR="HELM_SUGAR",e.LINKER="HELM_LINKER",e.AA="HELM_AA",e.CHEM="HELM_CHEM",e.BLOB="HELM_BLOB",e.NUCLEOTIDE="HELM_NUCLETIDE"}(r||(r={}))},5540:(e,t,n)=>{"use strict";e=n.hmd(e);var r,o=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){var t,n,o=void 0!==e?e:{};o.ready=new Promise((function(e,r){t=e,n=r}));var s,i=Object.assign({},o),a="object"==typeof window,c="function"==typeof importScripts,l=("object"==typeof process&&"object"==typeof process.versions&&process.versions.node,"");(a||c)&&(c?l=self.location.href:"undefined"!=typeof document&&document.currentScript&&(l=document.currentScript.src),r&&(l=r),l=0!==l.indexOf("blob:")?l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):"",c&&(s=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)})),o.print||console.log.bind(console);var u,d,h=o.printErr||console.warn.bind(console);Object.assign(o,i),i=null,o.arguments&&o.arguments,o.thisProgram&&o.thisProgram,o.quit&&o.quit,o.wasmBinary&&(u=o.wasmBinary),o.noExitRuntime,"object"!=typeof WebAssembly&&_("no native wasm support detected");var p,m,f,g=!1;function y(){var e=d.buffer;o.HEAP8=p=new Int8Array(e),o.HEAP16=new Int16Array(e),o.HEAP32=new Int32Array(e),o.HEAPU8=m=new Uint8Array(e),o.HEAPU16=new Uint16Array(e),o.HEAPU32=f=new Uint32Array(e),o.HEAPF32=new Float32Array(e),o.HEAPF64=new Float64Array(e)}var b,w,v=[],A=[],E=[],C=0,T=null,S=null;function _(e){o.onAbort&&o.onAbort(e),h(e="Aborted("+e+")"),g=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}function P(e){return e.startsWith("data:application/octet-stream;base64,")}function M(e){try{if(e==b&&u)return new Uint8Array(u);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}catch(e){_(e)}}function x(e,t,n){return function(e){return u||!a&&!c||"function"!=typeof fetch?Promise.resolve().then((function(){return M(e)})):fetch(e,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((function(){return M(e)}))}(e).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(n,(function(e){h("failed to asynchronously prepare wasm: "+e),_(e)}))}function N(e){for(;e.length>0;)e.shift()(o)}function $(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){f[this.ptr+4>>2]=e},this.get_type=function(){return f[this.ptr+4>>2]},this.set_destructor=function(e){f[this.ptr+8>>2]=e},this.get_destructor=function(){return f[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,p[this.ptr+12|0]=e},this.get_caught=function(){return 0!=p[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,p[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=p[this.ptr+13|0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){f[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return f[this.ptr+16>>2]},this.get_exception_ptr=function(){if(V(this.get_type()))return f[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function L(e){var t=d.buffer;try{return d.grow(e-t.byteLength+65535>>>16),y(),1}catch(e){}}function I(e){return o["_"+e]}P(b="wasmDbscan.wasm")||(w=b,b=o.locateFile?o.locateFile(w,l):l+w);var R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(e,t,n,r,o){var s={string:e=>{var t=0;return null!=e&&0!==e&&(t=function(e){var t=function(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t}(e)+1,n=F(t);return function(e,t,n){!function(e,t,n,r){if(!(r>0))return 0;for(var o=n+r-1,s=0;s<e.length;++s){var i=e.charCodeAt(s);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++s)),i<=127){if(n>=o)break;t[n++]=i}else if(i<=2047){if(n+1>=o)break;t[n++]=192|i>>6,t[n++]=128|63&i}else if(i<=65535){if(n+2>=o)break;t[n++]=224|i>>12,t[n++]=128|i>>6&63,t[n++]=128|63&i}else{if(n+3>=o)break;t[n++]=240|i>>18,t[n++]=128|i>>12&63,t[n++]=128|i>>6&63,t[n++]=128|63&i}}t[n]=0}(e,m,t,n)}(e,n,t),n}(e)),t},array:e=>{var t,n,r=F(e.length);return t=e,n=r,p.set(t,n),r}},i=I(e),a=[],c=0;if(r)for(var l=0;l<r.length;l++){var u=s[n[l]];u?(0===c&&(c=D()),a[l]=u(r[l])):a[l]=r[l]}var d=i.apply(null,a);return function(e){return 0!==c&&H(c),function(e){return"string"===t?(n=e)?function(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.buffer&&R)return R.decode(e.subarray(t,o));for(var s="";t<o;){var i=e[t++];if(128&i){var a=63&e[t++];if(192!=(224&i)){var c=63&e[t++];if((i=224==(240&i)?(15&i)<<12|a<<6|c:(7&i)<<18|a<<12|c<<6|63&e[t++])<65536)s+=String.fromCharCode(i);else{var l=i-65536;s+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else s+=String.fromCharCode((31&i)<<6|a)}else s+=String.fromCharCode(i)}return s}(m,n,r):"":"boolean"===t?Boolean(e):e;var n,r}(e)}(d)}var k,G={__cxa_throw:function(e,t,n){throw new $(e).init(t,n),e},abort:function(){_("")},emscripten_memcpy_big:function(e,t,n){m.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=m.length,r=2147483648;if((e>>>=0)>r)return!1;for(var o=1;o<=4;o*=2){var s=n*(1+.2/o);if(s=Math.min(s,e+100663296),L(Math.min(r,(t=Math.max(e,s))+(65536-t%65536)%65536)))return!0}return!1}},D=(function(){var e,t,r,s,i={env:G,wasi_snapshot_preview1:G};function a(e,t){var n,r=e.exports;return o.asm=r,d=o.asm.memory,y(),o.asm.__indirect_function_table,n=o.asm.__wasm_call_ctors,A.unshift(n),function(){if(C--,o.monitorRunDependencies&&o.monitorRunDependencies(C),0==C&&(null!==T&&(clearInterval(T),T=null),S)){var e=S;S=null,e()}}(),r}if(C++,o.monitorRunDependencies&&o.monitorRunDependencies(C),o.instantiateWasm)try{return o.instantiateWasm(i,a)}catch(e){h("Module.instantiateWasm callback failed with error: "+e),n(e)}(e=u,t=b,r=i,s=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||P(t)||"function"!=typeof fetch?x(t,r,s):fetch(t,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(s,(function(e){return h("wasm streaming compile failed: "+e),h("falling back to ArrayBuffer instantiation"),x(t,r,s)}))}))).catch(n)}(),o._dbscan=function(){return(o._dbscan=o.asm.dbscan).apply(null,arguments)},o._malloc=function(){return(o._malloc=o.asm.malloc).apply(null,arguments)},o._free=function(){return(o._free=o.asm.free).apply(null,arguments)},function(){return(D=o.asm.stackSave).apply(null,arguments)}),H=function(){return(H=o.asm.stackRestore).apply(null,arguments)},F=function(){return(F=o.asm.stackAlloc).apply(null,arguments)},V=function(){return(V=o.asm.__cxa_is_pointer_type).apply(null,arguments)};function U(){function e(){k||(k=!0,o.calledRun=!0,g||(N(A),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),E.unshift(e);var e;N(E)}()))}C>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),v.unshift(e);var e;N(v)}(),C>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),e()}),1)):e()))}if(o.ccall=O,o.cwrap=function(e,t,n,r){var o=!n||n.every((e=>"number"===e||"boolean"===e));return"string"!==t&&o&&!r?I(e):function(){return O(e,t,n,arguments)}},S=function e(){k||U(),k||(S=e)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return U(),e.ready});"object"==typeof exports?e.exports=o:"function"==typeof define&&n.amdO?define([],(function(){return o})):"object"==typeof exports&&(exports.exportCppDbscanLib=o)},6295:(e,t,n)=>{"use strict";n.d(t,{$1:()=>i,Hf:()=>u,Hr:()=>S,Ii:()=>g,Qj:()=>m,T6:()=>T,TK:()=>E,be:()=>f,gt:()=>w,ij:()=>v,jL:()=>l,lO:()=>p,lP:()=>b,rR:()=>y,tO:()=>a,v_:()=>c,w_:()=>d,yK:()=>A,zn:()=>h});var r=n(8774),o=n(8498),s=n(6863);function i(e,t){const n=e.trueCount()+t.trueCount();if(0==n)return 1;const r=e.andWithCountBits(t,!0);return r/(n-r)}function a(e,t){return 1-i(e,t)}function c(e,t){return C(i(new r.A(e,32*e.length),new r.A(t,32*t.length)))}function l(e,t){let n=0;for(let r=0;r<e.length;r++)n+=Math.pow(e[r]-t[r],2);return Math.sqrt(n)}function u(e,t){let n=0;for(let r=0;r<e.length;r++)n+=Math.abs(e[r]-t[r]);return n}function d(e,t){let n=0,r=0,o=0;for(let s=0;s<e.length;s++)n+=e[s]*t[s],r+=e[s]*e[s],o+=t[s]*t[s];return(1-n/(Math.sqrt(r)*Math.sqrt(o)))/2}function h(e,t){return 1-function(e,t){const n=e.trueCount()+t.trueCount();return 0==n?0:2*e.andWithCountBits(t,!0)/n}(e,t)}function p(e,t){return 1-function(e,t){const n=e.trueCount()*t.trueCount();return 0==n?0:e.andWithCountBits(t,!0)/Math.sqrt(n)}(e,t)}function m(e,t){return Math.sqrt(e.trueCount()+t.trueCount()-2*e.andWithCountBits(t,!0))}function f(e,t){return e.trueCount()+t.trueCount()-2*e.andWithCountBits(t,!0)}function g(e,t){return 1-function(e,t){const n=e.trueCount()+t.trueCount(),r=e.andWithCountBits(t,!0);return r/(2*n-3*r)}(e,t)}function y(e,t){return C(function(e,t){const n=e.trueCount()+t.trueCount(),r=e.trueCount()*t.trueCount();return 0==r?0:e.andWithCountBits(t,!0)*n/(2*r)}(e,t))}function b(e,t){return C(function(e,t){const n=e.trueCount()+t.trueCount(),r=e.trueCount()*t.trueCount();return 0==r?0:(e.andWithCountBits(t,!0)*n-r)/r}(e,t))}function w(e,t){return 1-function(e,t){const n=Math.min(e.trueCount(),t.trueCount());return 0==n?0:e.andWithCountBits(t,!0)/n}(e,t)}function v(e,t){return C(function(e,t){const n=Math.max(e.trueCount(),t.trueCount());return 0==n?0:e.andWithCountBits(t,!0)/n}(e,t))}function A(e,t){return C(function(e,t){return 0==e.length?0:e.andWithCountBits(t,!0)/e.length}(e,t))}function E(e,t){return C(function(e,t){const n=e.andWithCountBits(t,!0),r=e.countBits(!0)+t.countBits(!0),o=e.length,s=o-r+n;return n==o||s==o?1:n/r+s/(2*o-r)}(e,t))}function C(e){return e<=0?3402823e32:1/e-1}function T(e){if(e&&null!=e.range&&e.range>0){const t=e.range;return(e,n)=>Math.abs(e-n)/t}return(e,t)=>Math.abs(e-t)}function S(e){const t=function(e){const t=e?.mostCommon??new Set;return(e,n)=>{const r=e.length,o=n.length;let s=0,i=0,a=0;for(;i<r&&a<o;)e[i]===n[a]?(t?.has(e[i])||++s,++i,++a):e[i]<n[a]?++i:++a;return s}}(e);return(e,n)=>0===n.length||0===e.length?1e4:Math.min(e.length,n.length)/(t(e,n)+1e-4)}o.aT.Tanimoto,o.aT.Dice,o.aT.Asymmetric,o.aT.BraunBlanquet,o.aT.Cosine,o.aT.Kulczynski,o.aT.McConnaughey,o.aT.RogotGoldberg,o.aT.Russel,o.aT.Sokal,o.aT.Hamming,o.aT.Euclidean,o.aT.Tanimoto,o.aT.Dice,o.aT.Asymmetric,o.aT.BraunBlanquet,o.aT.Cosine,o.aT.Kulczynski,o.aT.McConnaughey,o.aT.RogotGoldberg,o.aT.Russel,o.aT.Sokal,o.aT.Hamming,o.aT.Euclidean,o.aT.Tanimoto,o.aT.Dice,o.aT.Cosine,o.aT.Tanimoto,o.aT.Asymmetric,o.aT.Cosine,o.aT.Sokal,s.Z.HAMMING,s.Z.LEVENSHTEIN,s.Z.MONOMER_CHEMICAL_DISTANCE,s.Z.NEEDLEMANN_WUNSCH},684:(e,t,n)=>{"use strict";n.d(t,{C0:()=>s,GP:()=>r,Gi:()=>a,_X:()=>i,n3:()=>o,vb:()=>c});const r="dim-red-preprocessing-function",o="supportedSemTypes",s="supportedTypes",i="supportedUnits",a="supportedDistanceFunctions",c="bypassLargeDataWarning"},6863:(e,t,n)=>{"use strict";function r(e={}){const t=function(){if(!e||!e.scoringMatrix||!e.alphabetIndexes)return(e,t)=>e===t?0:1;if(e.scoringMatrix.length!==Object.keys(e.alphabetIndexes).length)throw new Error("Scoring matrix and alphabet indexes should have the same length");const t=e.alphabetIndexes,n=e.scoringMatrix,r=Math.min(...Object.keys(t).map((e=>e.charCodeAt(0))))+1,o=new Float32Array((n.length+r)*(n.length+r));return Object.entries(t).forEach((([e,r])=>{const s=n[r];Object.entries(t).forEach((([t,r])=>{o[e.charCodeAt(0)*n.length+t.charCodeAt(0)]=s[r]}))})),(e,t)=>1-o[e.charCodeAt(0)*n.length+t.charCodeAt(0)]}(),n=e?.threshold??0;return(e,r)=>{let o=0;const s=e.length,i=r.length,a=Math.ceil(Math.max(s,i)*(1-n));s!==i&&(o=Math.abs(s-i));let c=0;for(let n=0;n<Math.min(s,i);n++)if(e[n]!==r[n]&&(c+=t(e[n],r[n]),c>a))return 1;return c+=o,c/=Math.max(s,i),c}}n.d(t,{Z:()=>i,V:()=>a});var o=n(2787);const s={gapOpen:1,gapExtend:.6,scoringMatrix:[[4,-1,-2,-2,0,-1,-1,0,-2,-1,-1,-1,-1,-2,-1,1,0,-3,-2,0,-2,-1,0,-4],[-1,5,0,-2,-3,1,0,-2,0,-3,-2,2,-1,-3,-2,-1,-1,-3,-2,-3,-1,0,-1,-4],[-2,0,6,1,-3,0,0,0,1,-3,-3,0,-2,-3,-2,1,0,-4,-2,-3,3,0,-1,-4],[-2,-2,1,6,-3,0,2,-1,-1,-3,-4,-1,-3,-3,-1,0,-1,-4,-3,-3,4,1,-1,-4],[0,-3,-3,-3,9,-3,-4,-3,-3,-1,-1,-3,-1,-2,-3,-1,-1,-2,-2,-1,-3,-3,-2,-4],[-1,1,0,0,-3,5,2,-2,0,-3,-2,1,0,-3,-1,0,-1,-2,-1,-2,0,3,-1,-4],[-1,0,0,2,-4,2,5,-2,0,-3,-3,1,-2,-3,-1,0,-1,-3,-2,-2,1,4,-1,-4],[0,-2,0,-1,-3,-2,-2,6,-2,-4,-4,-2,-3,-3,-2,0,-2,-2,-3,-3,-1,-2,-1,-4],[-2,0,1,-1,-3,0,0,-2,8,-3,-3,-1,-2,-1,-2,-1,-2,-2,2,-3,0,0,-1,-4],[-1,-3,-3,-3,-1,-3,-3,-4,-3,4,2,-3,1,0,-3,-2,-1,-3,-1,3,-3,-3,-1,-4],[-1,-2,-3,-4,-1,-2,-3,-4,-3,2,4,-2,2,0,-3,-2,-1,-2,-1,1,-4,-3,-1,-4],[-1,2,0,-1,-3,1,1,-2,-1,-3,-2,5,-1,-3,-1,0,-1,-3,-2,-2,0,1,-1,-4],[-1,-1,-2,-3,-1,0,-2,-3,-2,1,2,-1,5,0,-2,-1,-1,-1,-1,1,-3,-1,-1,-4],[-2,-3,-3,-3,-2,-3,-3,-3,-1,0,0,-3,0,6,-4,-2,-2,1,3,-1,-3,-3,-1,-4],[-1,-2,-2,-1,-3,-1,-1,-2,-2,-3,-3,-1,-2,-4,7,-1,-1,-4,-3,-2,-2,-1,-2,-4],[1,-1,1,0,-1,0,0,0,-1,-2,-2,0,-1,-2,-1,4,1,-3,-2,-2,0,0,0,-4],[0,-1,0,-1,-1,-1,-1,-2,-2,-1,-1,-1,-1,-2,-1,1,5,-2,-2,0,-1,-1,0,-4],[-3,-3,-4,-4,-2,-2,-3,-2,-2,-3,-2,-3,-1,1,-4,-3,-2,11,2,-3,-4,-3,-2,-4],[-2,-2,-2,-3,-2,-1,-2,-3,2,-1,-1,-2,-1,3,-3,-2,-2,2,7,-1,-3,-2,-1,-4],[0,-3,-3,-3,-1,-2,-2,-3,-3,3,1,-2,1,-1,-2,-2,0,-3,-1,4,-3,-2,-1,-4],[-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,4,1,-1,-4],[-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,1,4,-1,-4],[0,-1,-1,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2,0,0,-2,-1,-1,-1,-1,-1,-4],[-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,1]],alphabetIndexes:{A:0,R:1,N:2,D:3,C:4,Q:5,E:6,G:7,H:8,I:9,L:10,K:11,M:12,F:13,P:14,S:15,T:16,W:17,Y:18,V:19,B:20,Z:21,X:22,"*":23}};var i;!function(e){e.HAMMING="Hamming",e.LEVENSHTEIN="Levenshtein",e.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",e.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(i||(i={}));const a={[i.HAMMING]:r,[i.LEVENSHTEIN]:function(){return(e,t)=>(0,o.I)(e,t)/Math.max(e.length,t.length)},[i.NEEDLEMANN_WUNSCH]:function(e){const t=new Uint16Array(65536),{gapOpen:n,gapExtend:r,scoringMatrix:o,alphabetIndexes:i}={...s,...e};Object.entries(i).forEach((([e,n])=>t[e.charCodeAt(0)]=n));const a=[new Float32Array(1e4),new Float32Array(1e4)];return(e,s)=>{const i=new Array(e.length+1).fill(!1),c=new Array(e.length+1).fill(!1);let l=0,u=1;for(let t=1;t<e.length+1;t++)a[0][t]=-r-(t-1)*r,a[1][t]=0;a[0][0]=0;for(let d=1;d<s.length+1;d++){a[u][0]=-r-(d-1)*r;for(let h=1;h<e.length+1;h++){const p=a[l][h-1]+o[t[e.charCodeAt(h-1)]][t[s.charCodeAt(d-1)]],m=a[l][h]-(i[h]||1===d||d===s.length?r:n),f=a[u][h-1]-(c[h-1]||1===h||h===e.length?r:n);a[u][h]=Math.max(p,f,m),a[u][h]===p?(i[h]=!1,c[h]=!1):a[u][h]===f?(i[h]=!1,c[h]=!0):(i[h]=!0,c[h]=!1)}l=u,u=(u+1)%2}const d=Math.min(e.length,s.length);return(d-a[l][e.length])/d}},[i.MONOMER_CHEMICAL_DISTANCE]:r}},9039:(e,t,n)=>{"use strict";var r;n.d(t,{c:()=>r}),function(e){e.UMAP="UMAP",e.T_SNE="t-SNE"}(r||(r={}))},8498:(e,t,n)=>{"use strict";var r,o,s,i,a,c,l;n.d(t,{EG:()=>a,Pn:()=>o,RR:()=>c,Wn:()=>l,aT:()=>s,m6:()=>i,xL:()=>r}),function(e){e.Levenshtein="Levenshtein",e.JaroWinkler="Jaro-Winkler",e.Manhattan="Manhattan String",e.Onehot="One-Hot"}(r||(r={})),function(e){e.Euclidean="Euclidean",e.Manhattan="Manhattan",e.Cosine="Vector Cosine"}(o||(o={})),function(e){e.Tanimoto="Tanimoto",e.Dice="Dice",e.Asymmetric="Asymmetric",e.BraunBlanquet="Braun-Blanquet",e.Cosine="Cosine",e.Kulczynski="Kulczynski",e.McConnaughey="Mc-Connaughey",e.RogotGoldberg="Rogot-Goldberg",e.Russel="Russel",e.Sokal="Sokal",e.Hamming="Hamming",e.Euclidean="Euclidean BitArray"}(s||(s={})),function(e){e.TanimotoIntArray="TanimotoIntArray"}(i||(i={})),function(e){e.Vector="Vector",e.String="String",e.BitArray="BitArray",e.MacroMolecule="MacroMolecule",e.Number="Number",e.IntArray="IntArray",e.NumberArray="NumberArray"}(a||(a={})),function(e){e.Difference="Difference"}(c||(c={})),function(e){e.CommonItems="Common Items"}(l||(l={}))},2780:(e,t,n)=>{"use strict";n.d(t,{aT:()=>r.aT});var r=n(8498);n(9336)},9336:(e,t,n)=>{"use strict";var r=n(2787),o=n(944),s=n(6295),i=n(6863),a=n(8498);const c={[a.Pn.Euclidean]:s.jL,[a.Pn.Manhattan]:s.Hf,[a.Pn.Cosine]:s.w_},l={[a.xL.Levenshtein]:r.I,[a.xL.JaroWinkler]:o.Vb,[a.xL.Manhattan]:function(e,t){if(e.length!==t.length)return 1;{let n=0;for(let r=1;r<e.length;r++)n+=e[r]==t[r]?0:1;return n/e.length}},[a.xL.Onehot]:function(e,t){return e===t?0:1}},u={[a.aT.Tanimoto]:s.tO,[a.aT.Dice]:s.zn,[a.aT.Asymmetric]:s.gt,[a.aT.BraunBlanquet]:s.ij,[a.aT.Cosine]:s.lO,[a.aT.Kulczynski]:s.rR,[a.aT.McConnaughey]:s.lP,[a.aT.RogotGoldberg]:s.TK,[a.aT.Russel]:s.yK,[a.aT.Sokal]:s.Ii,[a.aT.Hamming]:s.be,[a.aT.Euclidean]:s.Qj},d={[a.m6.TanimotoIntArray]:s.v_},h={[a.RR.Difference]:s.T6},p={[a.Wn.CommonItems]:s.Hr},m={[a.EG.Vector]:{[a.Pn.Euclidean]:c[a.Pn.Euclidean],[a.Pn.Manhattan]:c[a.Pn.Manhattan],[a.Pn.Cosine]:c[a.Pn.Cosine]},[a.EG.String]:{[a.xL.Levenshtein]:l[a.xL.Levenshtein],[a.xL.JaroWinkler]:l[a.xL.JaroWinkler],[a.xL.Manhattan]:l[a.xL.Manhattan],[a.xL.Onehot]:l[a.xL.Onehot]},[a.EG.BitArray]:{[a.aT.Tanimoto]:u[a.aT.Tanimoto],[a.aT.Dice]:u[a.aT.Dice],[a.aT.Asymmetric]:u[a.aT.Asymmetric],[a.aT.BraunBlanquet]:u[a.aT.BraunBlanquet],[a.aT.Cosine]:u[a.aT.Cosine],[a.aT.Kulczynski]:u[a.aT.Kulczynski],[a.aT.McConnaughey]:u[a.aT.McConnaughey],[a.aT.RogotGoldberg]:u[a.aT.RogotGoldberg],[a.aT.Russel]:u[a.aT.Russel],[a.aT.Sokal]:u[a.aT.Sokal]},[a.EG.MacroMolecule]:{[i.Z.HAMMING]:i.V[i.Z.HAMMING],[i.Z.LEVENSHTEIN]:i.V[i.Z.LEVENSHTEIN],[i.Z.NEEDLEMANN_WUNSCH]:i.V[i.Z.NEEDLEMANN_WUNSCH],[i.Z.MONOMER_CHEMICAL_DISTANCE]:i.V[i.Z.MONOMER_CHEMICAL_DISTANCE]},[a.EG.Number]:{[a.RR.Difference]:h[a.RR.Difference]},[a.EG.IntArray]:{[a.m6.TanimotoIntArray]:d[a.m6.TanimotoIntArray]},[a.EG.NumberArray]:{[a.Wn.CommonItems]:p[a.Wn.CommonItems]}};Object.keys(m).reduce(((e,t)=>{for(const n of Object.keys(m[t]))e[n]=t;return e}),{})},8774:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});class r{constructor(e,t=!1){if(this._length=0,this._version=0,this._updateLevel=0,this._selectedCount=0,this._selectedCountVersion=-1,this._selectedIndexesVersion=-1,this._versionedName="",this._versionedNameVersion=-1,this.SHRINK_THRESHOLD=256,"number"==typeof e){const n=e,o=r._createBuffer(n);if(t)for(let e=0;e<o.length;e++)o[e]=-1;this._data=o,this._length=n}else{if(!(e instanceof Uint32Array))throw new Error("Invalid constructor");this._data=e,this._length=t}}getRawData(){return this._data}assureGoez(e,t){if(e<0)throw new Error(`${t} should be greater than zero`)}assureInRange(e,t,n,r){if(e<t||e>n)throw new Error(`Argument ${r} (${e}) out of range (${t}, ${n})`)}copy(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}copyFrom(e){if(this._length!=e._length)throw new Error(`Lengths differ (${this._length} != ${e._length})`);this.copy(e._data,this._data,this.lengthInInts),this._version++}get length(){return this._length}get buffer(){return this._data}set buffer(e){this._data=e,this._version++}get version(){return this._version}set version(e){this._version=e}incrementVersion(e=!0){this._version++}get lengthInInts(){return Math.floor((this._length+31)/32)}get versionedName(){return this._version==this._versionedNameVersion?this._versionedName:""}set versionedName(e){this._versionedName=e,this._versionedNameVersion=this._version}get self(){return this}setLength(e){if(e<0)throw new Error("should be >= 0");if(e==this._length)return;const t=Math.floor((e+31)/32);if(t>this._data.length||t+this.SHRINK_THRESHOLD<this._data.length){const e=new Uint32Array(t);this.copy(this._data,e,t>this._data.length?this._data.length:t),this._data=e}e>this._length&&(this._length%32>0&&(this._data[this.lengthInInts-1]&=(1<<(this._length%32&31))-1),this._data.fill(0,this.lengthInInts,t)),this._length=e,this._version++}static fromAnd(e,t){if(e._length!=t._length)throw new Error(`Lengths differ (${e._length} != ${t._length})`);const n=new r(e._length);n._length=e._length,n._data=r._createBuffer(n._length),n._version=0;const o=e.lengthInInts;for(let r=0;r<o;r++)n._data[r]=e._data[r]&t._data[r];return n}static _createBuffer(e){return new Uint32Array(Math.floor((e+31)/32))}static fromValues(e){const t=new r(e.length);t._version=0;for(let n=0;n<t._length;n++)e[n]&&(t._data[Math.floor(n/32)]|=1<<(n%32&31));return t}static fromSeq(e,t){const n=new r(e);for(let r=0;r<e;++r)n.setBit(r,t(r));return n._version=0,n}static fromString(e){return r.fromSeq(e.length,(t=>"1"==e.charAt(t)))}static fromUint32Array(e,t){const n=new r(e);return n._data=t,n}static fromBytes(e){const t=e.length,n=new r(8*t);n._data=new Uint32Array(Math.floor((t+3)/4)),n._length=8*t;let o=0,s=0;for(;t-s>=4;)n._data[o++]=255&e[s]|(255&e[s+1])<<8|(255&e[s+2])<<16|(255&e[s+3])<<24,s+=4;return t-s==3&&(n._data[o]=(255&e[s+2])<<16),t-s==2&&(n._data[o]|=(255&e[s+1])<<8),t-s==1&&(n._data[o]|=255&e[s]),n._version=0,n}toString(){return`${this._length} bits, ${this.countBits(!0)} set`}equals(e){if(this==e)return!0;if(null==e)return!1;if(this._length!=e._length)return!1;if(0==this._length)return!0;for(let t=0;t<this._data.length-1;t++)if(this._data[t]!=e._data[t])return!1;for(let t=8*(this._data.length-1);t<this._length;t++)if(this.getBit(t)!=e.getBit(t))return!1;return!0}clone(){const e=new r(0,!1);return e._data=Uint32Array.from(this._data),e._length=this._length,e._version=this._version,e}init(e,t){this.setAll(!1,!1);for(let t=0;t<this._length;t++)e(t)&&(this._data[Math.floor(t/32)]|=1<<(t%32&31));return this.incrementVersion(t),this}invert(e=!0){for(let e=0;e<this._data.length;e++)this._data[e]^=-1;this.incrementVersion(e)}setAll(e,t=!1){const n=e?-1:0,r=this.lengthInInts;for(let e=0;e<r;e++)this._data[e]=n;this.incrementVersion(t)}setIndexes(e,t=!0,n=!0,r=!0){n&&this.setAll(!t,!1);for(const n of e)this.setFast(n,t);this.incrementVersion(r)}everyIndex(e,t=!0){for(const n of e)if(this.getBit(n)!=t)return!1;return!0}anyIndex(e,t=!0){for(const n of e)if(this.getBit(n)==t)return!0;return!1}setWhere(e,t=!0,n=!0,r=!0,o=!0){if(n&&o&&this.setAll(!t,!1),o)for(let n=0;n<this._length;n++)e(n)&&this.setFast(n,t);else for(let n=0;n<this._length;n++)this.setFast(n,e(n)?t:!t);this.incrementVersion(r)}getRange(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let r=e;r<t;++r)n.push(this.getBit(r));return r.fromValues(n)}getRangeAsList(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let r=e;r<t;++r)n.push(this.getBit(r));return n}setRange(e,t,n,r=!0){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length-1,"to");const o=Math.min(e,t),s=Math.max(e,t);if(n)for(let e=o;e<=s;e++)this.setTrue(e);else for(let e=o;e<=s;e++)this.setFalse(e);return this.incrementVersion(r),this}setRandom(e,t,n=!0){if(e<0||e>this._length)throw new Error("n must be >= 0 && <= Count");e>this._length/2&&this.setRandom(this._length-e,!t),this.setAll(!t);for(let n=0;n<e;){const e=Math.floor(Math.random()*this._length);this.getBit(e)!=t&&(this.setFast(e,t),n++)}this.incrementVersion(n)}and(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]&=e._data[t];return this.incrementVersion(t),this}andNot(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");const n=this.lengthInInts;for(let t=0;t<n;t++)this._data[t]&=~e._data[t];return this.incrementVersion(t),this}notAnd(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]=~this._data[t]&e._data[t];return this.incrementVersion(t),this}not(e=!0){for(let e=0,t=this.lengthInInts;e<t;e++)this._data[e]=~this._data[e];return this.incrementVersion(e),this}or(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]|=e._data[t];return this.incrementVersion(t),this}xor(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]^=e._data[t];return this.incrementVersion(t),this}insertAt(e,t,n=!1){if(this.assureInRange(e,0,this._length,"pos"),0==t)return;const r=this._length;this.setLength(this._length+t);for(let n=r-1;n>=e;n--)this.setBit(n+t,this.getBit(n));for(let r=e;r<e+t;r++)this.setBit(r,n)}removeAt(e,t=1){if(t<0)throw new Error("n cannot be negative");if(this.assureInRange(e,0,this._length-t,"pos"),this.contains(!0))for(let n=e;n<this._length-t;n++)this.setBit(n,this.getBit(n+t));this.setLength(this._length-t)}removeByMask(e,t=!0){if(this._length!=e.length)throw new Error("length != mask.length");if(e==this)this.setLength(e.countBits(!t)),this.setAll(!t);else{let n=0;for(let r=-1;-1!=(r=e.findNext(r,!t));)this.setFast(n++,this.getBit(r));this._length=n,this._version++}return this}getBit(e){return!!(this._data[Math.floor(e/32)]&1<<(31&e))}setBit(e,t,n=!0){this.setFast(e,t),this._version++}setFast(e,t){t?this._data[Math.floor(e/32)]|=1<<(31&e):this._data[Math.floor(e/32)]&=~(1<<(31&e))}setTrue(e){this._data[Math.floor(e/32)]|=1<<(31&e)}setFalse(e){this._data[Math.floor(e/32)]&=~(1<<(31&e))}trueCount(){return this.countBits(!0)}falseCount(){return this.countBits(!1)}countBits(e){if(0==this._length)return 0;if(this._selectedCountVersion!=this._version){this._selectedCount=0;const e=this.lengthInInts;let t=0;for(;t<e-1;t++)for(let e=this._data[t];0!=e;e>>>=8)this._selectedCount+=r._onBitCount[255&e];let n=this._data[t];const o=31&this._length;for(0!=o&&(n&=~(4294967295<<o));0!=n;n>>>=8)this._selectedCount+=r._onBitCount[255&n];this._selectedCountVersion=this._version}return e?this._selectedCount:this._length-this._selectedCount}countWhere(e){let t=0;if(this.trueCount()==this._length)for(let n=0;n<this._length;n++)t+=e(n)?1:0;else for(let n=-1;-1!=(n=this.findNext(n,!0));)t+=e(n)?1:0;return t}andWithCountBits(e,t){if(0==this._length)return 0;let n=0;const o=this.lengthInInts;let s=0;for(;s<o-1;s++)for(let t=this._data[s]&e._data[s];0!=t;t>>>=8)n+=r._onBitCount[255&t];let i=this._data[s]&e._data[s];const a=31&this._length;for(0!=a&&(i&=~(4294967295<<a));0!=i;i>>>=8)n+=r._onBitCount[255&i];return t?n:this._length-n}clear(){this.setLength(0)}contains(e){return this.findNext(-1,e)>=0}get allTrue(){return this.countBits(!0)==this._length}get allFalse(){return this.countBits(!1)==this._length}get anyTrue(){return this.countBits(!0)>0}get anyFalse(){return this.countBits(!1)>0}findNext(e,t=!0){if(this.assureInRange(e,-1,this._length,"index"),e>=this._length-1)return-1;let n=31&(e=e<0?0:e+1);const o=this.lengthInInts;for(let s=Math.floor(e/32);s<o;s++){let o=t?this._data[s]:~this._data[s];if(0!=n)o&=4294967295<<n&4294967295,n=0;else if(!t&&-4294967296==o)continue;for(let t=0;0!=o;t+=8,o>>>=8){const n=r._firstOnBit[255&o];if(n>=0)return(e=n+32*s+t)>=this._length?-1:e}}return-1}findPrev(e,t=!0){if(0==e)return-1;this.assureInRange(e,-1,this._length,"index");let n=1+(e=e<0?this._length-1:e-1)&31;for(let o=Math.floor(e/32);o>=0;o--){let e=t?this._data[o]:~this._data[o];0!=n&&(e&=~(4294967295<<n),n=0);for(let t=24;0!=e;t-=8,e<<=8){const n=r._lastOnBit[e>>>24];if(n>=0)return n+32*o+t}}return-1}}r._onBitCount=Int8Array.from([0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8]),r._firstOnBit=Int8Array.from([-1,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0]),r._lastOnBit=Int8Array.from([-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7])},8070:(e,t,n)=>{"use strict";n.d(t,{Pl:()=>D,bk:()=>K,gM:()=>G,L1:()=>k,cb:()=>j,E3:()=>L,J6:()=>O,Wj:()=>I,Xk:()=>R,Xb:()=>F,N$:()=>V,t6:()=>$,PE:()=>x,rd:()=>N,Bl:()=>Z,CN:()=>w});var r=n(4328),o=n(6082);n(9982);const s=o.DataFrame.fromCsv('countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,Questions,empty_number,empty_string\nBelgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,1,1,1QBS,1,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.497360340644872, 1.7058694986686864, 5.278052678195135, 0.16000320889028383],""points"":[{""x"":0.10000000149011612,""y"":2.374499797821045},{""x"":0.6000000238418579,""y"":2.6242473125457764},{""x"":1.100000023841858,""y"":2.367267608642578},{""x"":1.600000023841858,""y"":2.6723148822784424},{""x"":2.0999999046325684,""y"":2.6537344455718994},{""x"":2.5999999046325684,""y"":2.3651671409606934},{""x"":3.0999999046325684,""y"":2.5654284954071045},{""x"":3.5999999046325684,""y"":2.4160959720611572},{""x"":4.099999904632568,""y"":2.286726713180542},{""x"":4.599999904632568,""y"":2.5100042819976807},{""x"":5.099999904632568,""y"":1.6676985025405884},{""x"":5.599999904632568,""y"":0.680136501789093},{""x"":6.099999904632568,""y"":0.3391543924808502},{""x"":6.599999904632568,""y"":0.09038983285427094},{""x"":7.099999904632568,""y"":0.19802775979042053}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[7.525235855508179, 1.3186911876809984, 5.335672608564294, 0.7860743343958098],""points"":[{""x"":0.10000000149011612,""y"":7.988070487976074},{""x"":0.6000000238418579,""y"":7.018453121185303},{""x"":1.100000023841858,""y"":8.115279197692871},{""x"":1.600000023841858,""y"":7.486658096313477},{""x"":2.0999999046325684,""y"":7.396438121795654},{""x"":2.5999999046325684,""y"":7.477052211761475},{""x"":3.0999999046325684,""y"":6.913095474243164},{""x"":3.5999999046325684,""y"":8.01385498046875},{""x"":4.099999904632568,""y"":6.985900402069092},{""x"":4.599999904632568,""y"":6.970335960388184},{""x"":5.099999904632568,""y"":5.448817253112793},{""x"":5.599999904632568,""y"":2.5534818172454834},{""x"":6.099999904632568,""y"":1.893947958946228},{""x"":6.599999904632568,""y"":0.6340042352676392},{""x"":7.099999904632568,""y"":0.8403874039649963}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,100,abc\nBurundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,2,2,1ZP8,2,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.431460753103398, 2.1691498799246745, 5.266445597102774, 0.7825762827017926],""points"":[{""x"":0.10000000149011612,""y"":4.751083850860596},{""x"":0.6000000238418579,""y"":4.203000068664551},{""x"":1.100000023841858,""y"":4.415858745574951},{""x"":1.600000023841858,""y"":4.68414306640625},{""x"":2.0999999046325684,""y"":4.198400974273682},{""x"":2.5999999046325684,""y"":4.179222106933594},{""x"":3.0999999046325684,""y"":4.638473987579346},{""x"":3.5999999046325684,""y"":4.708553314208984},{""x"":4.099999904632568,""y"":4.291589260101318},{""x"":4.599999904632568,""y"":4.038082599639893},{""x"":5.099999904632568,""y"":3.4349939823150635},{""x"":5.599999904632568,""y"":1.2194708585739136},{""x"":6.099999904632568,""y"":1.1920831203460693},{""x"":6.599999904632568,""y"":0.5352635979652405},{""x"":7.099999904632568,""y"":0.3346920311450958}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.339458017970126, -1.0734184310171178, 4.746332950550934, 0.2482416857595658],""points"":[{""x"":0.10000000149011612,""y"":0.2139337658882141},{""x"":0.6000000238418579,""y"":0.4269562065601349},{""x"":1.100000023841858,""y"":0.2441573292016983},{""x"":1.600000023841858,""y"":0.146635964512825},{""x"":2.0999999046325684,""y"":0.08818462491035461},{""x"":2.5999999046325684,""y"":0.2560656666755676},{""x"":3.0999999046325684,""y"":0.42434045672416687},{""x"":3.5999999046325684,""y"":0.37111231684684753},{""x"":4.099999904632568,""y"":0.5581737160682678},{""x"":4.599999904632568,""y"":1.183590054512024},{""x"":5.099999904632568,""y"":1.5629843473434448},{""x"":5.599999904632568,""y"":2.3211288452148438},{""x"":6.099999904632568,""y"":2.229961633682251},{""x"":6.599999904632568,""y"":2.2560226917266846},{""x"":7.099999904632568,""y"":2.2142398357391357}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,3,3,2BDJ,3,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.6760652578642325, 0.9046956320756703, 5.651408971856738, 0.07738846012184185],""points"":[{""x"":0.10000000149011612,""y"":4.32425594329834},{""x"":0.6000000238418579,""y"":4.668442249298096},{""x"":1.100000023841858,""y"":4.379785060882568},{""x"":1.600000023841858,""y"":5.0345139503479},{""x"":2.0999999046325684,""y"":4.878653526306152},{""x"":2.5999999046325684,""y"":4.3451313972473145},{""x"":3.0999999046325684,""y"":4.336992263793945},{""x"":3.5999999046325684,""y"":5.037430286407471},{""x"":4.099999904632568,""y"":5.0092692375183105},{""x"":4.599999904632568,""y"":4.151902675628662},{""x"":5.099999904632568,""y"":3.4066951274871826},{""x"":5.599999904632568,""y"":2.3732759952545166},{""x"":6.099999904632568,""y"":1.673728108406067},{""x"":6.599999904632568,""y"":0.48574790358543396},{""x"":7.099999904632568,""y"":0.2783052325248718}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.938395863010111, -1.4658480661392117, 5.462702751996584, 0.3473139023615039],""points"":[{""x"":0.10000000149011612,""y"":0.4941710829734802},{""x"":0.6000000238418579,""y"":0.15323974192142487},{""x"":1.100000023841858,""y"":0.46373432874679565},{""x"":1.600000023841858,""y"":0.3370431363582611},{""x"":2.0999999046325684,""y"":0.5179030299186707},{""x"":2.5999999046325684,""y"":0.27899765968322754},{""x"":3.0999999046325684,""y"":0.22075064480304718},{""x"":3.5999999046325684,""y"":0.5789918899536133},{""x"":4.099999904632568,""y"":0.21169911324977875},{""x"":4.599999904632568,""y"":0.27857646346092224},{""x"":5.099999904632568,""y"":1.0906332731246948},{""x"":5.599999904632568,""y"":1.8520300388336182},{""x"":6.099999904632568,""y"":2.7177059650421143},{""x"":6.599999904632568,""y"":2.8680918216705322},{""x"":7.099999904632568,""y"":3.2413077354431152}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCanada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,4,4,1IAN,4,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[0.8597390975430008, 1.0957625732481946, 5.260537067987958, 0.07974187998177736],""points"":[{""x"":0.10000000149011612,""y"":0.8190152645111084},{""x"":0.6000000238418579,""y"":0.8421689867973328},{""x"":1.100000023841858,""y"":0.8740922212600708},{""x"":1.600000023841858,""y"":0.8924275040626526},{""x"":2.0999999046325684,""y"":0.8249067664146423},{""x"":2.5999999046325684,""y"":0.9327669143676758},{""x"":3.0999999046325684,""y"":0.8522974252700806},{""x"":3.5999999046325684,""y"":0.8174492716789246},{""x"":4.099999904632568,""y"":0.8394647240638733},{""x"":4.599999904632568,""y"":0.7139387726783752},{""x"":5.099999904632568,""y"":0.5561167597770691},{""x"":5.599999904632568,""y"":0.3276226818561554},{""x"":6.099999904632568,""y"":0.12479474395513535},{""x"":6.599999904632568,""y"":0.13006797432899475},{""x"":7.099999904632568,""y"":0.059702079743146896}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.760930219582546, 1.6591793293833013, 4.667155929720851, 0.7858109544121652],""points"":[{""x"":0.10000000149011612,""y"":6.156993389129639},{""x"":0.6000000238418579,""y"":5.236701965332031},{""x"":1.100000023841858,""y"":6.010560512542725},{""x"":1.600000023841858,""y"":5.495512962341309},{""x"":2.0999999046325684,""y"":6.087770462036133},{""x"":2.5999999046325684,""y"":5.79986572265625},{""x"":3.0999999046325684,""y"":5.597546577453613},{""x"":3.5999999046325684,""y"":5.520902156829834},{""x"":4.099999904632568,""y"":5.360654354095459},{""x"":4.599999904632568,""y"":3.5539746284484863},{""x"":5.099999904632568,""y"":1.577236294746399},{""x"":5.599999904632568,""y"":1.0001264810562134},{""x"":6.099999904632568,""y"":0.9305797815322876},{""x"":6.599999904632568,""y"":0.6033638715744019},{""x"":7.099999904632568,""y"":0.4203685522079468}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nColombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,5,5,4UJ1,5,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[6.4995088314153655, 2.4270351004539914, 5.178659535348579, 0.625653346241577],""points"":[{""x"":0.10000000149011612,""y"":6.496231555938721},{""x"":0.6000000238418579,""y"":6.42543363571167},{""x"":1.100000023841858,""y"":7.040063858032227},{""x"":1.600000023841858,""y"":6.1115403175354},{""x"":2.0999999046325684,""y"":6.680728435516357},{""x"":2.5999999046325684,""y"":6.406774520874023},{""x"":3.0999999046325684,""y"":6.611269474029541},{""x"":3.5999999046325684,""y"":5.889094352722168},{""x"":4.099999904632568,""y"":6.75344705581665},{""x"":4.599999904632568,""y"":6.361435890197754},{""x"":5.099999904632568,""y"":4.1666975021362305},{""x"":5.599999904632568,""y"":1.172118902206421},{""x"":6.099999904632568,""y"":0.801048994064331},{""x"":6.599999904632568,""y"":0.4640021026134491},{""x"":7.099999904632568,""y"":0.0010357667924836278}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[1.4734381347446401, 1.1649805188074196, 4.82958608866421, 0.09500545496710007],""points"":[{""x"":0.10000000149011612,""y"":1.5279096364974976},{""x"":0.6000000238418579,""y"":1.3559974431991577},{""x"":1.100000023841858,""y"":1.5246378183364868},{""x"":1.600000023841858,""y"":1.5567657947540283},{""x"":2.0999999046325684,""y"":1.4114240407943726},{""x"":2.5999999046325684,""y"":1.4045010805130005},{""x"":3.0999999046325684,""y"":1.4769829511642456},{""x"":3.5999999046325684,""y"":1.4875500202178955},{""x"":4.099999904632568,""y"":1.2991987466812134},{""x"":4.599999904632568,""y"":0.922961413860321},{""x"":5.099999904632568,""y"":0.6520044803619385},{""x"":5.599999904632568,""y"":0.15350978076457977},{""x"":6.099999904632568,""y"":0.1078903079032898},{""x"":6.599999904632568,""y"":0.17276449501514435},{""x"":7.099999904632568,""y"":0.14066608250141144}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCosta Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,6,6,2BPW,6,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.4833641843311227, -1.8945978742090062, 4.671127708092568, 0.24159861311815153],""points"":[{""x"":0.10000000149011612,""y"":0.0969524160027504},{""x"":0.6000000238418579,""y"":0.028483040630817413},{""x"":1.100000023841858,""y"":0.22087176144123077},{""x"":1.600000023841858,""y"":0.0068915546871721745},{""x"":2.0999999046325684,""y"":0.4305879771709442},{""x"":2.5999999046325684,""y"":0.44774115085601807},{""x"":3.0999999046325684,""y"":0.45346319675445557},{""x"":3.5999999046325684,""y"":0.2370593100786209},{""x"":4.099999904632568,""y"":0.4657953977584839},{""x"":4.599999904632568,""y"":1.155200719833374},{""x"":5.099999904632568,""y"":2.2294070720672607},{""x"":5.599999904632568,""y"":2.4311530590057373},{""x"":6.099999904632568,""y"":2.33846116065979},{""x"":6.599999904632568,""y"":2.608201026916504},{""x"":7.099999904632568,""y"":2.8136143684387207}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.224573521642033, 1.4454033924198528, 5.6014197746076535, 0.2823216054197577],""points"":[{""x"":0.10000000149011612,""y"":4.95027494430542},{""x"":0.6000000238418579,""y"":5.1754679679870605},{""x"":1.100000023841858,""y"":5.276752948760986},{""x"":1.600000023841858,""y"":5.589294910430908},{""x"":2.0999999046325684,""y"":5.616994857788086},{""x"":2.5999999046325684,""y"":5.120813846588135},{""x"":3.0999999046325684,""y"":5.340766906738281},{""x"":3.5999999046325684,""y"":4.876471042633057},{""x"":4.099999904632568,""y"":4.94999361038208},{""x"":4.599999904632568,""y"":5.162564754486084},{""x"":5.099999904632568,""y"":4.399557590484619},{""x"":5.599999904632568,""y"":2.7977969646453857},{""x"":6.099999904632568,""y"":1.0229872465133667},{""x"":6.599999904632568,""y"":0.48275601863861084},{""x"":7.099999904632568,""y"":0.10408931970596313}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,7,7,1QBS,7,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.320838679713925, -1.2421619987316728, 4.831325425225256, 0.3236011098403072],""points"":[{""x"":0.10000000149011612,""y"":0.3727470338344574},{""x"":0.6000000238418579,""y"":0.12365014106035233},{""x"":1.100000023841858,""y"":0.48422467708587646},{""x"":1.600000023841858,""y"":0.2264465093612671},{""x"":2.0999999046325684,""y"":0.16821794211864471},{""x"":2.5999999046325684,""y"":0.3879014551639557},{""x"":3.0999999046325684,""y"":0.5470244884490967},{""x"":3.5999999046325684,""y"":0.3419053554534912},{""x"":4.099999904632568,""y"":0.7655120491981506},{""x"":4.599999904632568,""y"":1.2346516847610474},{""x"":5.099999904632568,""y"":2.453336715698242},{""x"":5.599999904632568,""y"":2.9565491676330566},{""x"":6.099999904632568,""y"":3.335299491882324},{""x"":6.599999904632568,""y"":3.240290880203247},{""x"":7.099999904632568,""y"":3.1107218265533447}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.6401853521511094, 1.26211588875013, 5.399028074402744, 0.5089580830068091],""points"":[{""x"":0.10000000149011612,""y"":3.8585598468780518},{""x"":0.6000000238418579,""y"":3.6077206134796143},{""x"":1.100000023841858,""y"":3.855252265930176},{""x"":1.600000023841858,""y"":3.619039297103882},{""x"":2.0999999046325684,""y"":3.839388370513916},{""x"":2.5999999046325684,""y"":3.335283041000366},{""x"":3.0999999046325684,""y"":3.571141481399536},{""x"":3.5999999046325684,""y"":3.4155046939849854},{""x"":4.099999904632568,""y"":3.7316646575927734},{""x"":4.599999904632568,""y"":3.0680155754089355},{""x"":5.099999904632568,""y"":2.891066551208496},{""x"":5.599999904632568,""y"":1.6022753715515137},{""x"":6.099999904632568,""y"":0.7652576565742493},{""x"":6.599999904632568,""y"":0.6875326037406921},{""x"":7.099999904632568,""y"":0.5828871726989746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nItaly,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,8,8,1ZP8,8,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.293592105923809, 1.3781586549141835, 5.1025898038676605, 0.03493851245291291],""points"":[{""x"":0.10000000149011612,""y"":2.1287283897399902},{""x"":0.6000000238418579,""y"":2.267972230911255},{""x"":1.100000023841858,""y"":2.398442506790161},{""x"":1.600000023841858,""y"":2.5130622386932373},{""x"":2.0999999046325684,""y"":2.3255116939544678},{""x"":2.5999999046325684,""y"":2.127340793609619},{""x"":3.0999999046325684,""y"":2.47259783744812},{""x"":3.5999999046325684,""y"":2.131181478500366},{""x"":4.099999904632568,""y"":2.090421438217163},{""x"":4.599999904632568,""y"":2.02299165725708},{""x"":5.099999904632568,""y"":1.1105059385299683},{""x"":5.599999904632568,""y"":0.4494485855102539},{""x"":6.099999904632568,""y"":0.1375635862350464},{""x"":6.599999904632568,""y"":0.036351121962070465},{""x"":7.099999904632568,""y"":0.1619771122932434}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.953125499439879, 1.2528620255306528, 5.187637440149802, 0.3110348753260886],""points"":[{""x"":0.10000000149011612,""y"":5.6585283279418945},{""x"":0.6000000238418579,""y"":5.911152362823486},{""x"":1.100000023841858,""y"":5.924920082092285},{""x"":1.600000023841858,""y"":5.8469438552856445},{""x"":2.0999999046325684,""y"":5.929472923278809},{""x"":2.5999999046325684,""y"":6.190037727355957},{""x"":3.0999999046325684,""y"":6.236179828643799},{""x"":3.5999999046325684,""y"":6.141019344329834},{""x"":4.099999904632568,""y"":5.295210838317871},{""x"":4.599999904632568,""y"":5.265801906585693},{""x"":5.099999904632568,""y"":3.3722851276397705},{""x"":5.599999904632568,""y"":1.8299226760864258},{""x"":6.099999904632568,""y"":0.32690900564193726},{""x"":6.599999904632568,""y"":0.6274543404579163},{""x"":7.099999904632568,""y"":0.8441857099533081}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nRwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,9,2BDJ,9,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.8209972202654474, 1.3779216716448506, 5.299882228439686, 0.06040645519069608],""points"":[{""x"":0.10000000149011612,""y"":3.7821109294891357},{""x"":0.6000000238418579,""y"":3.542433023452759},{""x"":1.100000023841858,""y"":3.7008674144744873},{""x"":1.600000023841858,""y"":3.717301607131958},{""x"":2.0999999046325684,""y"":4.024452209472656},{""x"":2.5999999046325684,""y"":4.013899326324463},{""x"":3.0999999046325684,""y"":3.945094347000122},{""x"":3.5999999046325684,""y"":3.866621971130371},{""x"":4.099999904632568,""y"":3.7461626529693604},{""x"":4.599999904632568,""y"":3.3454740047454834},{""x"":5.099999904632568,""y"":2.61944317817688},{""x"":5.599999904632568,""y"":0.999405026435852},{""x"":6.099999904632568,""y"":0.46259793639183044},{""x"":6.599999904632568,""y"":0.054134611040353775},{""x"":7.099999904632568,""y"":0.05711187422275543}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.6318079657726035, 1.8495493770000595, 5.391793312471116, 0.17060707587348442],""points"":[{""x"":0.10000000149011612,""y"":5.458079814910889},{""x"":0.6000000238418579,""y"":5.554427146911621},{""x"":1.100000023841858,""y"":5.799983024597168},{""x"":1.600000023841858,""y"":5.364140033721924},{""x"":2.0999999046325684,""y"":5.864485740661621},{""x"":2.5999999046325684,""y"":5.4509806632995605},{""x"":3.0999999046325684,""y"":5.702574729919434},{""x"":3.5999999046325684,""y"":5.7314534187316895},{""x"":4.099999904632568,""y"":5.5123443603515625},{""x"":4.599999904632568,""y"":5.724395751953125},{""x"":5.099999904632568,""y"":4.354506969451904},{""x"":5.599999904632568,""y"":1.7307666540145874},{""x"":6.099999904632568,""y"":0.6305936574935913},{""x"":6.599999904632568,""y"":0.035183437168598175},{""x"":7.099999904632568,""y"":0.7575169205665588}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nSwitzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,10,1IAN,10,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[1.1190255865097471, 2.3163895161544437, 5.4968866182279195, 0.2035204047289052],""points"":[{""x"":0.10000000149011612,""y"":1.1057683229446411},{""x"":0.6000000238418579,""y"":1.1019697189331055},{""x"":1.100000023841858,""y"":1.0818607807159424},{""x"":1.600000023841858,""y"":1.062997817993164},{""x"":2.0999999046325684,""y"":1.046447515487671},{""x"":2.5999999046325684,""y"":1.1217249631881714},{""x"":3.0999999046325684,""y"":1.2166996002197266},{""x"":3.5999999046325684,""y"":1.215477705001831},{""x"":4.099999904632568,""y"":1.0581893920898438},{""x"":4.599999904632568,""y"":1.1747995615005493},{""x"":5.099999904632568,""y"":1.0181127786636353},{""x"":5.599999904632568,""y"":0.5344523191452026},{""x"":6.099999904632568,""y"":0.2569526433944702},{""x"":6.599999904632568,""y"":0.1912207305431366},{""x"":7.099999904632568,""y"":0.15060538053512573}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.1038581025805785, 2.0032224204185245, 5.087602825989163, 0.13277988512492753],""points"":[{""x"":0.10000000149011612,""y"":3.0498509407043457},{""x"":0.6000000238418579,""y"":2.805217742919922},{""x"":1.100000023841858,""y"":3.3415253162384033},{""x"":1.600000023841858,""y"":3.0549843311309814},{""x"":2.0999999046325684,""y"":3.250074863433838},{""x"":2.5999999046325684,""y"":3.0432586669921875},{""x"":3.0999999046325684,""y"":3.265852451324463},{""x"":3.5999999046325684,""y"":2.9475724697113037},{""x"":4.099999904632568,""y"":3.1929898262023926},{""x"":4.599999904632568,""y"":2.7460060119628906},{""x"":5.099999904632568,""y"":1.6175861358642578},{""x"":5.599999904632568,""y"":0.3006608486175537},{""x"":6.099999904632568,""y"":0.3444803059101105},{""x"":6.599999904632568,""y"":0.015537971630692482},{""x"":7.099999904632568,""y"":0.5527358055114746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\n,,,,,,,,,,,,,,,,,,,,,');s.columns.add(o.Column.fromList(o.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var i=function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};function a(e,t,n,o,s,a,c,l,u=!0){return i(this,void 0,void 0,(function*(){let d=null;if(yield N(o,(n=>i(this,void 0,void 0,(function*(){let n=null;for(const r of e.viewers)r.type===t&&(n=r);if(!n)throw Error("Viewer hasn't been added");if(yield Promise.resolve(),a&&(yield a(n)),s){const t=null!=l?l:{};t.tv=e,t.viewer=n,d=yield s(t,u)}yield x(r.events.onViewerClosed,(()=>{L(n.subs.some((e=>!e.closed)),!1)}),(()=>n.close()),3e3)}))),(()=>i(this,void 0,void 0,(function*(){c?e.loadLayout(c):yield function(e,t,n){return i(this,void 0,void 0,(function*(){let r;return n?(r=yield e.dataFrame.plot.fromType(t),e.dockManager.dock(r)):r=e.addViewer(t),r}))}(e,t,n)}))),6e4,"TEST_EVENT_ASYNC"),d)return d}))}function c(e,t=!0){return i(this,void 0,void 0,(function*(){const n=e.tv.dataFrame,r=n.clone();Array.from(n.row(0).cells).forEach((e=>e.value=null));const o=n.rowCount<20?Math.floor(n.rowCount/2):10;n.rows.select((e=>e.idx>=0&&e.idx<o)),t&&(yield j(50));for(let e=o;e<2*o;e++)n.filter.set(e,!1);t&&(yield j(50)),n.currentRowIdx=1,n.columns.names().slice(0,Math.ceil(n.columns.length/2)).forEach((e=>n.columns.remove(e))),t&&(yield j(100)),e.tv.dataFrame=r,yield j(50)}))}function l(e,t=!0){return i(this,void 0,void 0,(function*(){const t=e.tv.dataFrame;setTimeout((()=>t.filter.set(0,!t.filter.get(0))),0)}))}function u(e,t=!0){return i(this,void 0,void 0,(function*(){let t,n;try{t=e.viewer.getOptions(!0).look}catch(e){throw new Error("Viewer's .getOptions() error.",{cause:e})}try{n=e.viewer.getProperties()}catch(e){throw new Error("Viewer's .getProperties() error.",{cause:e})}const r={};return Object.keys(t).filter((e=>"boolean"==typeof t[e])).forEach((e=>r[e]=!t[e])),n.filter((e=>null!==e.choices)).forEach((e=>r[e.name]=e.choices.find((n=>n!==t[e.name])))),e.viewer.setOptions(r),yield j(300),{layout:e.tv.saveLayout(),savedProps:e.viewer.getOptions().look}}))}function d(e,t=!0){return i(this,void 0,void 0,(function*(){L(JSON.stringify(e.viewer.getOptions().look),JSON.stringify(e.savedProps))}))}var h=function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};const p=3e4,m=108e5,f=console.log.bind(console),g=console.info.bind(console),y=console.warn.bind(console),b=console.error.bind(console),w={},v="Auto Tests",A="Demo",E="Detectors",C="Core",T={};let S;var _;!function(e){e.notNull=function(e,t){if(null==e)throw new Error(`${null==t?"Value":t} not defined`)}}(_||(_={}));class P{constructor(e,t){this.catchUnhandled=!0,this.report=!1,void 0!==e&&(this.catchUnhandled=e),void 0!==t&&(this.report=t)}}class M{constructor(e,t,n,r){var s;this.category=e,this.name=t,null!=r||(r={}),null!==(s=r.timeout)&&void 0!==s||(r.timeout=p),this.options=r,this.test=()=>h(this,void 0,void 0,(function*(){return new Promise(((e,t)=>h(this,void 0,void 0,(function*(){var r;let s="";try{o.Test.isInDebug;let e=yield n();try{s=null!==(r=null==e?void 0:e.toString())&&void 0!==r?r:""}catch(e){s="Can't convert test's result to string",console.error(`Can't convert test's result to string in the ${this.category}:${this.name} test`)}}catch(e){t(e)}e(s)}))))}))}}function x(e,t,n,r=0,o="timeout"){return h(this,void 0,void 0,(function*(){return new Promise(((s,i)=>{const a=e.subscribe((e=>{try{t(e),s("OK")}catch(e){i(e)}finally{a.unsubscribe(),clearTimeout(c)}})),c=setTimeout((()=>{a.unsubscribe(),i(o)}),r);n()}))}))}function N(e,t,n,r=0,o="timeout"){return h(this,void 0,void 0,(function*(){return new Promise(((s,i)=>{const a=e.subscribe((e=>{t(e).then((()=>{s("OK")})).catch((e=>{i(e)})).finally((()=>{a.unsubscribe(),clearTimeout(c)}))})),c=setTimeout((()=>{a.unsubscribe(),i(o)}),r);n()}))}))}function $(e,t,n){null==w[S]&&(w[S]={}),null==w[S].tests&&(w[S].tests=[]),w[S].tests.push(new M(S,e,t,n))}function L(e,t=!0,n){if(n=n?`${n}, `:"",e!==t)throw new Error(`${n}Expected "${t}", got "${e}"`)}function I(e,t,n=.001,r){if(e===Number.POSITIVE_INFINITY&&t===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY&&t===Number.NEGATIVE_INFINITY||e===Number.NaN&&t===Number.NaN||isNaN(e)&&isNaN(t))return;const o=Math.abs(e-t)<n;if(L(o,!0,`${null!=r?r:""} (tolerance = ${n})`),!o)throw new Error(`Expected ${t}, got ${e} (tolerance = ${n})`)}function R(e,t){for(const[n,r]of Object.entries(t)){if(!e.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const t=e[n];if(t instanceof Array&&r instanceof Array)O(t,r);else if(t instanceof Object&&r instanceof Object)R(t,r);else if(Number.isFinite(t)&&Number.isFinite(r))I(t,r);else if(t!=r)throw new Error(`Expected (${r}) for key '${n}', got (${t})`)}}function O(e,t){const n=e.length,r=t.length;if(n!=r)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${r}`);for(let r=0;r<n;r++)if(e[r]instanceof Array&&t[r]instanceof Array)O(e[r],t[r]);else if(e[r]instanceof Object&&t[r]instanceof Object)R(e[r],t[r]);else if(e[r]!=t[r])throw new Error(`Expected ${t[r]} at position ${r}, got ${e[r]}`)}function k(e,t,n){var r;S=e,t(),w[S]&&(w[S].clear=null===(r=null==n?void 0:n.clear)||void 0===r||r,w[S].timeout=null==n?void 0:n.timeout,w[S].benchmarks=null==n?void 0:n.benchmarks,w[S].stressTests=null==n?void 0:n.stressTests,w[S].owner=null==n?void 0:n.owner)}function G(e){null==w[S]&&(w[S]={}),w[S].before=e}function D(e){null==w[S]&&(w[S]={}),w[S].after=e}function H(e,t){return e.replace(new RegExp(t.name,"gi"),t.nqName)}function F(e,t){var n,i,a,c,l,u,d,f,g,y;return h(this,void 0,void 0,(function*(){const b=e.id;if(T[b])return;const S=t?t.tests:w;if("DevTools"===e.name||t&&"DevTools"===t._package.name)for(const e of window.dartTests){const t=e.name.split(/\s*\|\s*!/g);let r=null!==(n=t.pop())&&void 0!==n?n:e.name,o=t.length?C+": "+t.join(": "):C,s=r.split(" | ");r=s[s.length-1],s.unshift(o),s.pop(),o=s.join(": "),void 0===S[o]&&(S[o]={tests:[],clear:!0}),S[o].tests.push(new M(o,r,e.test,{isAggregated:!1,timeout:null!==(a=null===(i=e.options)||void 0===i?void 0:i.timeout)&&void 0!==a?a:p,skipReason:null===(c=e.options)||void 0===c?void 0:c.skipReason,owner:null===(l=e.options)||void 0===l?void 0:l.owner,benchmark:null!==(d=null===(u=e.options)||void 0===u?void 0:u.benchmark)&&void 0!==d&&d}))}const _=[],P=[],x=[],N=yield r.dapi.functions.filter(`package.id = "${b}"`).list(),$=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const t of N){const n=t.options.test,i=t.options.demoPath;if(n&&Array.isArray(n)&&n.length)for(let e=0;e<n.length;e++){const s=n[e].matchAll($),i={};Array.from(s).forEach((e=>{e[0].startsWith("skip")?i.skip=e[1]:e[0].startsWith("wait")?i.wait=parseInt(e[2]):e[0].startsWith("cat")?i.cat=e[3]:e[0].startsWith("timeout")&&(i.timeout=parseInt(e[4]))}));const a=new M(null!==(f=i.cat)&&void 0!==f?f:v,1===n.length?t.name:`${t.name} ${e+1}`,(()=>h(this,void 0,void 0,(function*(){const o=yield r.functions.eval(H(n[e],t));if(i.wait&&(yield j(i.wait)),"boolean"==typeof o&&!o)throw`Failed: ${n[e]}, expected true, got ${o}`}))),{skipReason:i.skip,timeout:o.Test.isInBenchmark?null!==(g=i.benchmarkTimeout)&&void 0!==g?g:m:null!==(y=i.timeout)&&void 0!==y?y:p});if(i.cat){const e=i.cat;void 0===S[e]&&(S[e]={tests:[],clear:!0}),S[e].tests||(S[e].tests=[]),S[e].tests.push(a)}else _.push(a)}if(i){const e=t.options.demoWait?parseInt(t.options.demoWait):void 0,n=new M(A,t.friendlyName,(()=>h(this,void 0,void 0,(function*(){yield j(300),r.shell.clearLastError(),yield t.apply(),yield j(e||2e3);const n=yield r.shell.lastError;if(n)throw new Error(n)}))),{skipReason:t.options.demoSkip});P.push(n)}if(t.hasTag("semTypeDetector")){let n=s;t.options.testData&&(n=yield r.data.files.openTable(`System:AppData/${e.nqName}/${t.options.testData}`));const o=new M(E,t.friendlyName,(()=>h(this,void 0,void 0,(function*(){const r=[];console.log(`System:AppData/${e.nqName}/${t.options.testData}`);for(const e of n.clone().columns){const n=yield t.apply([e]);r.push(n||e.semType)}const o=r.filter((e=>e));L(o.length,1),t.options.testDataColumnName&&L(o[0],t.options.testDataColumnName)}))),{skipReason:t.options.skipTest});x.push(o)}}T[b]=!0,_.length>0&&(S[v]={tests:_,clear:!0}),P.length>0&&(S[A]={tests:P,clear:!0}),x.length>0&&(S[E]={tests:x,clear:!1})}))}function V(e){var t,n,s,i,a,c;return h(this,void 0,void 0,(function*(){console.log("--------------------");const l=null===(n=null===(t=r.functions.getCurrentCall())||void 0===t?void 0:t.func)||void 0===n?void 0:n.package,u=(null!==(i=(null!==(s=null==l?void 0:l.packageOwner)&&void 0!==s?s:"").match(new RegExp("[^<]*<([^>]*)>")))&&void 0!==i?i:["",""])[1];yield F(l);const d=[];console.log("Running tests"),console.log(e),null!=e||(e={}),null!==(a=(c=e).testContext)&&void 0!==a||(c.testContext=new P),r.shell.clearLastError();const v=function(){const e=[];return console.log=(...t)=>{e.push(...t),f(...t)},console.info=(...t)=>{e.push(...t),g(...t)},console.warn=(...t)=>{e.push(...t),y(...t)},console.error=(...t)=>{e.push(...t),b(...t)},e}();yield function(e,t){var n,s,i,a,c,p,m;return h(this,void 0,void 0,(function*(){try{for(const[r,u]of Object.entries(e)){if((null==t?void 0:t.category)&&!r.toLowerCase().startsWith(null==t?void 0:t.category.toLowerCase())||(null===(n=t.exclude)||void 0===n?void 0:n.some((e=>r.startsWith(e)))))continue;f(`Started ${r} category`);const e=null===(s=u.tests)||void 0===s?void 0:s.every((e=>{var t;return null===(t=e.options)||void 0===t?void 0:t.skipReason}));e||(u.beforeStatus=yield A(u.before,null!==(i=t.category)&&void 0!==i?i:""));let g,y=null!==(a=u.tests)&&void 0!==a?a:[];t.stressTest&&(y=y.filter((e=>{var t;return null===(t=e.options)||void 0===t?void 0:t.stressTest})),y=W(y)),(null!==(p=null===(c=t.tags)||void 0===c?void 0:c.length)&&void 0!==p?p:0)>0&&(y=y.filter((e=>{var n,r;return null===(r=null===(n=e.options)||void 0===n?void 0:n.tags)||void 0===r?void 0:r.some((e=>{var n;return(null!==(n=null==t?void 0:t.tags)&&void 0!==n?n:[]).includes(e)}))}))),u.beforeStatus?(g=Array.from(y.map((e=>({date:(new Date).toISOString(),category:r,name:e.name,success:!1,result:"before() failed",ms:0,skipped:!1,logs:"",owner:null==l?void 0:l.packageOwner,package:l.name,widgetsDifference:0,flaking:o.Test.isReproducing})))),g.forEach((e=>h(this,void 0,void 0,(function*(){return U("package",e)}))))):g=yield E(u,t);const b=g.filter((e=>"skipped"!=e.result));e||(u.afterStatus=yield A(u.after,null!==(m=t.category)&&void 0!==m?m:"")),u.afterStatus&&b.push({date:(new Date).toISOString(),category:r,name:"after",success:!1,result:u.afterStatus,ms:0,skipped:!1,logs:"",owner:null==l?void 0:l.packageOwner,package:l.name,widgetsDifference:0,flaking:o.Test.isReproducing}),u.beforeStatus&&b.push({date:(new Date).toISOString(),category:r,name:"before",success:!1,result:u.beforeStatus,ms:0,skipped:!1,logs:"",owner:null==l?void 0:l.packageOwner,package:l.name,widgetsDifference:0,flaking:o.Test.isReproducing}),d.push(...b)}}finally{console.log=f,console.info=g,console.warn=y,console.error=b}if(t.testContext.catchUnhandled&&!o.Test.isInBenchmark){yield j(1e3);const e=yield r.shell.lastError,t={logs:"",date:(new Date).toISOString(),category:"Unhandled exceptions",name:"Exception",result:null!=e?e:"",success:!e,ms:0,skipped:!1,owner:null!=u?u:"",package:l.name,widgetsDifference:0};d.push(Object.assign(Object.assign({},t),{flaking:o.Test.isReproducing&&!e})),t.package=l.name,yield U("package",t)}}))}(w,e);for(let e of d)e.result=e.result.toString().replace(/"/g,"'"),null!=e.logs&&(e.logs=e.logs.toString().replace(/"/g,"'"));return d;function A(e,t){return h(this,void 0,void 0,(function*(){let n;try{void 0!==e&&(yield q((()=>h(this,void 0,void 0,(function*(){yield e()}))),1e5,`before ${t}: timeout error`))}catch(e){n=yield B(e)}return n}))}function E(e,t){var n,s,i,a,c,d,f,g,y,b,w,A,E,T,S,_,P,M;return h(this,void 0,void 0,(function*(){let h=null!==(n=e.tests)&&void 0!==n?n:[];const x=[],N=C();if(e.clear)for(let n=0;n<h.length;n++){h[n].options&&void 0===(null===(s=h[n].options)||void 0===s?void 0:s.benchmark)&&(h[n].options||(h[n].options={}),h[n].options.benchmark=null!==(i=e.benchmarks)&&void 0!==i&&i);let A=h[n];if(t.test&&t.test.toLowerCase()!==A.name.toLowerCase())continue;(null==A?void 0:A.options)&&(A.options.owner=null!==(f=null!==(d=null!==(c=null===(a=h[n].options)||void 0===a?void 0:a.owner)&&void 0!==c?c:null==e?void 0:e.owner)&&void 0!==d?d:u)&&void 0!==f?f:"");let E=yield Y(A,null==t?void 0:t.test,v,o.Test.isInBenchmark?null!==(y=null===(g=h[n].options)||void 0===g?void 0:g.benchmarkTimeout)&&void 0!==y?y:m:null!==(w=null===(b=h[n].options)||void 0===b?void 0:b.timeout)&&void 0!==w?w:p,l.name,t.verbose);E&&x.push(Object.assign(Object.assign({},E),{widgetsDifference:C()-N})),r.shell.closeAll(),o.Balloon.closeAll()}else for(let n=0;n<h.length;n++){let r=h[n];if(t.test&&t.test.toLowerCase()!==r.name.toLowerCase())continue;(null==r?void 0:r.options)&&(r.options.owner=null!==(S=null!==(T=null!==(E=null===(A=h[n].options)||void 0===A?void 0:A.owner)&&void 0!==E?E:null==e?void 0:e.owner)&&void 0!==T?T:u)&&void 0!==S?S:"");let s=yield Y(r,null==t?void 0:t.test,v,o.Test.isInBenchmark?null!==(P=null===(_=h[n].options)||void 0===_?void 0:_.benchmarkTimeout)&&void 0!==P?P:m:null===(M=h[n].options)||void 0===M?void 0:M.timeout,l.name,t.verbose);s&&x.push(Object.assign(Object.assign({},s),{widgetsDifference:C()-N}))}return x}))}function C(){var e;let t=-1;try{t=o.Widget.getAll().length}catch(t){console.warn(null!==(e=t.message)&&void 0!==e?e:t)}return t}}))}function U(e,t){return h(this,void 0,void 0,(function*(){null!=r.shell.reportTest?yield r.shell.reportTest(e,t):yield fetch(`${r.dapi.root}/log/tests/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)})}))}function B(e){return h(this,void 0,void 0,(function*(){return`${e.toString()}\n${e.stack?yield o.Logger.translateStackTrace(e.stack):""}`}))}function Y(e,t,n,s,i,a){var c,l,u,d,m,g,y,w,v,A,E,C,T,S;return h(this,void 0,void 0,(function*(){let h;n.length=0;const _=null!=t&&e.name.toLowerCase()!==t.toLowerCase();let P=(null===(c=e.options)||void 0===c?void 0:c.skipReason)||_,M=_?"skipped":null===(l=e.options)||void 0===l?void 0:l.skipReason;if(console.log($.name,P),o.Test.isInBenchmark&&!(null===(u=e.options)||void 0===u?void 0:u.benchmark))return void f(`SKIPPED: ${e.category} ${e.name} doesnt available in benchmark mode`);P||f(`Started ${e.category} ${e.name}`);const x=Date.now(),N=new Date(x).toISOString();try{if(P)h={name:e.name,owner:null!==(m=null===(d=e.options)||void 0===d?void 0:d.owner)&&void 0!==m?m:"",category:e.category,logs:"",date:N,success:!0,result:M,ms:0,skipped:!0,package:null!=i?i:"",flaking:o.Test.isReproducing};else{let t=null!=s?s:p;o.Test.isProfiling&&console.profile(`${e.category}: ${e.name}`),h={name:e.name,owner:null!==(y=null===(g=e.options)||void 0===g?void 0:g.owner)&&void 0!==y?y:"",category:e.category,logs:"",date:N,success:!0,result:null!==(w=yield q(e.test,t))&&void 0!==w?w:"OK",ms:0,skipped:!1,package:null!=i?i:"",flaking:o.Test.isReproducing},o.Test.isProfiling&&(console.profileEnd(`${e.category}: ${e.name}`),r.shell.info(`Profiling of ${e.category}: ${e.name} finished \n Please ensure that you have opened DevTools (F12) / Performance panel before test starts.`))}}catch(t){b(t),h={name:e.name,owner:null!==(A=null===(v=e.options)||void 0===v?void 0:v.owner)&&void 0!==A?A:"",category:e.category,logs:"",date:N,success:!1,result:yield B(t),ms:0,skipped:!1,package:null!=i?i:"",flaking:!1}}if((null===(E=e.options)||void 0===E?void 0:E.isAggregated)&&h.result.constructor===o.DataFrame){const e=h.result.col("success");if(e&&(h.success=e.stats.sum===e.length),!a){const e=h.result;e.columns.remove("stack"),e.rows.removeWhere((e=>e.get("success"))),h.result=e}h.result=h.result.toCsv()}if(h.logs=n.join("\n"),h.ms=Date.now()-x,P||f(`Finished ${e.category} ${e.name} for ${h.ms} ms`),h.category=e.category,h.name=e.name,h.owner=null!==(T=null===(C=e.options)||void 0===C?void 0:C.owner)&&void 0!==T?T:"",!_){let t={success:h.success,result:h.result,ms:h.ms,date:h.date,skipped:h.skipped,category:e.category,name:e.name,logs:h.logs,owner:h.owner,flaking:o.Test.isReproducing&&h.success,package:h.package};if(h.result.constructor==Object){const e=Object.keys(h.result).reduce(((e,t)=>Object.assign(Object.assign({},e),{["result."+t]:h.result[t]})),{});t=Object.assign(Object.assign({},t),e)}t.result instanceof o.DataFrame&&(t.result=JSON.stringify(null===(S=t.result)||void 0===S?void 0:S.toJson())||""),yield U("package",t)}return h}))}function W(e){const t=e.slice();return t.sort((()=>Math.random()-.5)),t}function j(e){return h(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,e)))}))}function K(e,t="Timeout exceeded",n=500,r=50){return h(this,void 0,void 0,(function*(){return new Promise(((o,s)=>{setTimeout((()=>{clearInterval(i),s(new Error(t))}),n);const i=setInterval((()=>{e()&&(clearInterval(i),o(null))}),r)}))}))}function q(e,t,n="EXECUTION TIMEOUT"){return h(this,void 0,void 0,(function*(){let r=null;const o=new Promise(((e,o)=>{r=setTimeout((()=>{o(n)}),t)}));try{return yield Promise.race([e(),o])}finally{r&&clearTimeout(r)}}))}const z=o.DataFrame.fromColumns([o.Column.fromStrings("col",["val1","val2","val3"])]);function Z(e,t,n){var o;return h(this,void 0,void 0,(function*(){const s=null!==(o=null==n?void 0:n.packageName)&&void 0!==o?o:"";(null==n?void 0:n.detectSemanticTypes)&&(yield r.data.detectSemanticTypes(t));const i=r.shell.addTableView(t);try{yield a(i,e,s,r.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield a(i,e,s,r.events.onViewerAdded,void 0,n.awaitViewer)),(null==n?void 0:n.readOnly)||(yield a(i,e,s,r.events.onViewerAdded,c),(null==n?void 0:n.awaitViewer)&&(yield a(i,e,s,r.events.onViewerAdded,c,n.awaitViewer)));let t=null;t=yield a(i,e,s,r.events.onViewerAdded,u),(null==n?void 0:n.awaitViewer)&&(t=yield a(i,e,s,r.events.onViewerAdded,u,n.awaitViewer)),yield a(i,e,s,r.events.onViewLayoutApplied,d,void 0,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps}),(null==n?void 0:n.awaitViewer)&&(yield a(i,e,s,r.events.onViewLayoutApplied,d,n.awaitViewer,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps})),!1!==(null==n?void 0:n.arbitraryDfTest)&&(i.dataFrame=z,yield j(50),yield a(i,e,s,r.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield a(i,e,s,r.events.onViewerAdded,void 0,n.awaitViewer))),yield a(i,e,s,r.events.onViewerAdded,l),(null==n?void 0:n.awaitViewer)&&(yield a(i,e,s,r.events.onViewerAdded,l,n.awaitViewer))}finally{}}))}},3527:(e,t,n)=>{"use strict";n.d(t,{Mi:()=>r});class r extends Float32Array{}},3629:(e,t,n)=>{"use strict";n.d(t,{KE:()=>a,dC:()=>s,vA:()=>o,wQ:()=>i});var r=n(3527);function o(e=!1,t="Assertion error."){if(!e)throw new Error(t)}function s(e,t,n=1){const s=e.length;o(s==t.length,"Vector lengths do not match.");const i=new r.Mi(s);for(let r=0;r<e.length;++r)i[r]=e[r]+n*t[r];return i}function i(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*e[n];return Math.sqrt(t)}function a(e,t){if(e.length!=t.length)throw new Error("The dimensionality of the vectors must match");let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}},1913:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3282),o=n(9029),s=n(1520),i=n(2586),a=n(8708),c=n(2023),l="errorMessage",u=new r.Name("emUsed"),d={required:"missingProperty",dependencies:"property",dependentRequired:"property"},h=/\$\{[^}]+\}/,p=/\$\{([^}]+)\}/g,m=/^""\s*\+\s*|\s*\+\s*""$/g;const f=(e,t={})=>{if(!e.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(e.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return e.addKeyword(function(e){return{keyword:l,schemaType:["string","object"],post:!0,code(t){const{gen:n,data:f,schema:g,schemaValue:y,it:b}=t;if(!1===b.createErrors)return;const w=g,v=o.strConcat(c.default.instancePath,b.errorPath);function A(e,t){return o.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${u}`,r._`${e}.instancePath === ${v}`,r._`${e}.keyword in ${t}`,r._`${e}.schemaPath.indexOf(${b.errSchemaPath}) === 0`,r._`/^\\/[^\\/]*$/.test(${e}.schemaPath.slice(${b.errSchemaPath.length}))`)}function E(e,t){const r=[];for(const n in e){const e=t[n];h.test(e)&&r.push([n,T(e)])}return n.object(...r)}function C(e){return h.test(e)?new s._Code(s.safeStringify(e).replace(p,((e,t)=>`" + JSON.stringify(${i.getData(t,b)}) + "`)).replace(m,"")):r.stringify(e)}function T(e){return r._`function(){return ${C(e)}}`}n.if(r._`${c.default.errors} > 0`,(()=>{if("object"==typeof w){const[s,i]=function(e){let t,n;for(const r in e){if("properties"===r||"items"===r)continue;const o=e[r];if("object"==typeof o){t||(t={});const e=t[r]={};for(const t in o)e[t]=[]}else n||(n={}),n[r]=[]}return[t,n]}(w);i&&function(o){const s=n.const("emErrors",r.stringify(o)),i=n.const("templates",E(o,g));n.forOf("err",c.default.vErrors,(e=>n.if(A(e,s),(()=>n.code(r._`${s}[${e}.keyword].push(${e})`).assign(r._`${e}.${u}`,!0)))));const{singleError:l}=e;if(l){const e=n.let("message",r._`""`),o=n.let("paramsErrors",r._`[]`);d((t=>{n.if(e,(()=>n.code(r._`${e} += ${"string"==typeof l?l:";"}`))),n.code(r._`${e} += ${h(t)}`),n.assign(o,r._`${o}.concat(${s}[${t}])`)})),a.reportError(t,{message:e,params:r._`{errors: ${o}}`})}else d((e=>a.reportError(t,{message:h(e),params:r._`{errors: ${s}[${e}]}`})));function d(e){n.forIn("key",s,(t=>n.if(r._`${s}[${t}].length`,(()=>e(t)))))}function h(e){return r._`${e} in ${i} ? ${i}[${e}]() : ${y}[${e}]`}}(i),s&&function(e){const o=n.const("emErrors",r.stringify(e)),s=[];for(const t in e)s.push([t,E(e[t],g[t])]);const i=n.const("templates",n.object(...s)),l=n.scopeValue("obj",{ref:d,code:r.stringify(d)}),h=n.let("emPropParams"),p=n.let("emParamsErrors");n.forOf("err",c.default.vErrors,(e=>n.if(A(e,o),(()=>{n.assign(h,r._`${l}[${e}.keyword]`),n.assign(p,r._`${o}[${e}.keyword][${e}.params[${h}]]`),n.if(p,(()=>n.code(r._`${p}.push(${e})`).assign(r._`${e}.${u}`,!0)))})))),n.forIn("key",o,(e=>n.forIn("keyProp",r._`${o}[${e}]`,(s=>{n.assign(p,r._`${o}[${e}][${s}]`),n.if(r._`${p}.length`,(()=>{const o=n.const("tmpl",r._`${i}[${e}] && ${i}[${e}][${s}]`);a.reportError(t,{message:r._`${o} ? ${o}() : ${y}[${e}][${s}]`,params:r._`{errors: ${p}}`})}))}))))}(s),function(e){const{props:s,items:i}=e;if(!s&&!i)return;const d=r._`typeof ${f} == "object"`,h=r._`Array.isArray(${f})`,p=n.let("emErrors");let m,b;const w=n.let("templates");function A(e,t){n.assign(p,r.stringify(e)),n.assign(w,E(e,t))}s&&i?(m=n.let("emChildKwd"),n.if(d),n.if(h,(()=>{A(i,g.items),n.assign(m,r.str`items`)}),(()=>{A(s,g.properties),n.assign(m,r.str`properties`)})),b=r._`[${m}]`):i?(n.if(h),A(i,g.items),b=r._`.items`):s&&(n.if(o.and(d,o.not(h))),A(s,g.properties),b=r._`.properties`),n.forOf("err",c.default.vErrors,(e=>function(e,t,s){n.if(o.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${u}`,r._`${e}.instancePath.indexOf(${v}) === 0`),(()=>{const o=n.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:r._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),i=n.const("emMatches",r._`${o}.exec(${e}.instancePath.slice(${v}.length))`),a=n.const("emChild",r._`${i} && ${i}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);n.if(r._`${a} !== undefined && ${a} in ${t}`,(()=>s(a)))}))}(e,p,(t=>n.code(r._`${p}[${t}].push(${e})`).assign(r._`${e}.${u}`,!0))))),n.forIn("key",p,(e=>n.if(r._`${p}[${e}].length`,(()=>{a.reportError(t,{message:r._`${e} in ${w} ? ${w}[${e}]() : ${y}${b}[${e}]`,params:r._`{errors: ${p}[${e}]}`}),n.assign(r._`${c.default.vErrors}[${c.default.errors}-1].instancePath`,r._`${v} + "/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})))),n.endIf()}(function({properties:e,items:t}){const n={};if(e){n.props={};for(const t in e)n.props[t]=[]}if(t){n.items={};for(let e=0;e<t.length;e++)n.items[e]=[]}return n}(w))}const s="string"==typeof w?w:w._;s&&function(e){const s=n.const("emErrs",r._`[]`);n.forOf("err",c.default.vErrors,(e=>n.if(function(e){return o.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${u}`,o.or(r._`${e}.instancePath === ${v}`,o.and(r._`${e}.instancePath.indexOf(${v}) === 0`,r._`${e}.instancePath[${v}.length] === "/"`)),r._`${e}.schemaPath.indexOf(${b.errSchemaPath}) === 0`,r._`${e}.schemaPath[${b.errSchemaPath}.length] === "/"`)}(e),(()=>n.code(r._`${s}.push(${e})`).assign(r._`${e}.${u}`,!0))))),n.if(r._`${s}.length`,(()=>a.reportError(t,{message:C(e),params:r._`{errors: ${s}}`})))}(s),e.keepErrors||function(){const e=n.const("emErrs",r._`[]`);n.forOf("err",c.default.vErrors,(t=>n.if(r._`!${t}.${u}`,(()=>n.code(r._`${e}.push(${t})`))))),n.assign(c.default.vErrors,e).assign(c.default.errors,r._`${e}.length`)}()}))},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}(t))};t.default=f,e.exports=f,e.exports.default=f},7433:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const r=n(4042),o=n(6105),s=n(6653),i=n(9572),a="https://json-schema.org/draft/2020-12/schema";class c extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;t&&(i.default.call(this,e),this.refs["http://json-schema.org/schema"]=a)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv2020=c,e.exports=t=c,e.exports.Ajv2020=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var l=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var h=n(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})},3282:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=n(4042),o=n(6144),s=n(6653),i=n(2079),a=["/properties"],c="http://json-schema.org/draft-07/schema";class l extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(i,a):i;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var h=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var p=n(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})},1520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class o extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function s(e,...t){const n=[e[0]];let r=0;for(;r<t.length;)c(n,t[r]),n.push(e[++r]);return new o(n)}t._Code=o,t.nil=new o(""),t._=s;const i=new o("+");function a(e,...t){const n=[u(e[0])];let r=0;for(;r<t.length;)n.push(i),c(n,t[r]),n.push(i,u(e[++r]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===i){const n=l(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new o(n)}function c(e,t){var n;t instanceof o?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:u(Array.isArray(n)?n.join(","):n))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof r||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof r?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=a,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`},t.stringify=function(e){return new o(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new o(`.${e}`):s`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new o(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new o(e.toString())}},9029:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const r=n(1520),o=n(7845);var s=n(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return s.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return s.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return s.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return s.Name}});var i=n(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),t.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?o.varKinds.var:this.varKind,r=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=$(this.rhs,e,t)),this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}class l extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof r.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=$(this.rhs,e,t),this}get names(){return N(this.lhs instanceof r.Name?{}:{...this.lhs.names},this.rhs)}}class u extends l{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class p extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class m extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=$(this.code,e,t),this}get names(){return this.code instanceof r._CodeOrName?this.code.names:{}}}class f extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let r=n.length;for(;r--;){const o=n[r];o.optimizeNames(e,t)||(L(e,o.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>x(e,t.names)),{})}}class g extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends f{}class b extends g{}b.kind="else";class w extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new b(e):e}return t?!1===e?t instanceof w?t:t.nodes:this.nodes.length?this:new w(I(e),t instanceof w?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=$(this.condition,e,t),this}get names(){const e=super.names;return N(e,this.condition),this.else&&x(e,this.else.names),e}}w.kind="if";class v extends g{}v.kind="for";class A extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=$(this.iteration,e,t),this}get names(){return x(super.names,this.iteration.names)}}class E extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:n,from:r,to:s}=this;return`for(${t} ${n}=${r}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){const e=N(super.names,this.from);return N(e,this.to)}}class C extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=$(this.iterable,e,t),this}get names(){return x(super.names,this.iterable.names)}}class T extends g{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}T.kind="func";class S extends f{render(e){return"return "+super.render(e)}}S.kind="return";class _ extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(r=this.finally)||void 0===r||r.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&x(e,this.catch.names),this.finally&&x(e,this.finally.names),e}}class P extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}P.kind="catch";class M extends g{render(e){return"finally"+super.render(e)}}function x(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function N(e,t){return t instanceof r._CodeOrName?x(e,t.names):e}function $(e,t,n){return e instanceof r.Name?s(e):(o=e)instanceof r._Code&&o._items.some((e=>e instanceof r.Name&&1===t[e.str]&&void 0!==n[e.str]))?new r._Code(e._items.reduce(((e,t)=>(t instanceof r.Name&&(t=s(t)),t instanceof r._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function s(e){const r=n[e.str];return void 0===r||1!==t[e.str]?e:(delete t[e.str],r)}}function L(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function I(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:r._`!${G(e)}`}M.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new o.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){const o=this._scope.toName(t);return void 0!==n&&r&&(this._constants[o.str]=n),this._leafNode(new c(e,o,n)),o}const(e,t,n){return this._def(o.varKinds.const,e,t,n)}let(e,t,n){return this._def(o.varKinds.let,e,t,n)}var(e,t,n){return this._def(o.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new l(e,t,n))}add(e,n){return this._leafNode(new u(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==r.nil&&this._leafNode(new m(e)),this}object(...e){const t=["{"];for(const[n,o]of e)t.length>1&&t.push(","),t.push(n),(n!==o||this.opts.es5)&&(t.push(":"),(0,r.addCodeArg)(t,o));return t.push("}"),new r._Code(t)}if(e,t,n){if(this._blockNode(new w(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new w(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(w,b)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new A(e),t)}forRange(e,t,n,r,s=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const i=this._scope.toName(e);return this._for(new E(s,i,t,n),(()=>r(i)))}forOf(e,t,n,s=o.varKinds.const){const i=this._scope.toName(e);if(this.opts.es5){const e=t instanceof r.Name?t:this.var("_arr",t);return this.forRange("_i",0,r._`${e}.length`,(t=>{this.var(i,r._`${e}[${t}]`),n(i)}))}return this._for(new C("of",s,i,t),(()=>n(i)))}forIn(e,t,n,s=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,r._`Object.keys(${t})`,n);const i=this._scope.toName(e);return this._for(new C("in",s,i,t),(()=>n(i)))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new h(e))}return(e){const t=new S;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new _;if(this._blockNode(r),this.code(e),t){const e=this.name("e");this._currNode=r.catch=new P(e),t(e)}return n&&(this._currNode=r.finally=new M,this.code(n)),this._endBlockNode(P,M)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=r.nil,n,o){return this._blockNode(new T(e,t,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(T)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof w))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=I;const R=k(t.operators.AND);t.and=function(...e){return e.reduce(R)};const O=k(t.operators.OR);function k(e){return(t,n)=>t===r.nil?n:n===r.nil?t:r._`${G(t)} ${e} ${G(n)}`}function G(e){return e instanceof r.Name?e:r._`(${e})`}t.or=function(...e){return e.reduce(O)}},7845:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const r=n(1520);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var s;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(s||(t.UsedValueState=s={})),t.varKinds={const:new r.Name("const"),let:new r.Name("let"),var:new r.Name("var")};class i{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof r.Name?e:this.name(e)}name(e){return new r.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=i;class a extends r.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=r._`.${new r.Name(t)}[${n}]`}}t.ValueScopeName=a;const c=r._`\n`;t.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:r.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(e),{prefix:o}=r,s=null!==(n=t.key)&&void 0!==n?n:t.ref;let i=this._values[o];if(i){const e=i.get(s);if(e)return e}else i=this._values[o]=new Map;i.set(s,r);const a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,r.setValue(t,{property:o,itemIndex:c}),r}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return r._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n,i={},a){let c=r.nil;for(const l in e){const u=e[l];if(!u)continue;const d=i[l]=i[l]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,s.Started);let i=n(e);if(i){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;c=r._`${c}${n} ${e} = ${i};${this.opts._n}`}else{if(!(i=null==a?void 0:a(e)))throw new o(e);c=r._`${c}${i}${this.opts._n}`}d.set(e,s.Completed)}))}return c}}},8708:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const r=n(9029),o=n(4227),s=n(2023);function i(e,t){const n=e.const("err",t);e.if(r._`${s.default.vErrors} === null`,(()=>e.assign(s.default.vErrors,r._`[${n}]`)),r._`${s.default.vErrors}.push(${n})`),e.code(r._`${s.default.errors}++`)}function a(e,t){const{gen:n,validateName:o,schemaEnv:s}=e;s.$async?n.throw(r._`new ${e.ValidationError}(${t})`):(n.assign(r._`${o}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>r.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?r.str`"${e}" keyword must be ${t} ($data)`:r.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,o,s){const{it:c}=e,{gen:u,compositeRule:d,allErrors:h}=c,p=l(e,n,o);(null!=s?s:d||h)?i(u,p):a(c,r._`[${p}]`)},t.reportExtraError=function(e,n=t.keywordError,r){const{it:o}=e,{gen:c,compositeRule:u,allErrors:d}=o;i(c,l(e,n,r)),u||d||a(o,s.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(s.default.errors,t),e.if(r._`${s.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(r._`${s.default.vErrors}.length`,t)),(()=>e.assign(s.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:o,errsCount:i,it:a}){if(void 0===i)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",i,s.default.errors,(i=>{e.const(c,r._`${s.default.vErrors}[${i}]`),e.if(r._`${c}.instancePath === undefined`,(()=>e.assign(r._`${c}.instancePath`,(0,r.strConcat)(s.default.instancePath,a.errorPath)))),e.assign(r._`${c}.schemaPath`,r.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(r._`${c}.schema`,n),e.assign(r._`${c}.data`,o))}))};const c={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function l(e,t,n){const{createErrors:o}=e.it;return!1===o?r._`{}`:function(e,t,n={}){const{gen:o,it:i}=e,a=[u(i,n),d(e,n)];return function(e,{params:t,message:n},o){const{keyword:i,data:a,schemaValue:l,it:u}=e,{opts:d,propertyName:h,topSchemaRef:p,schemaPath:m}=u;o.push([c.keyword,i],[c.params,"function"==typeof t?t(e):t||r._`{}`]),d.messages&&o.push([c.message,"function"==typeof n?n(e):n]),d.verbose&&o.push([c.schema,l],[c.parentSchema,r._`${p}${m}`],[s.default.data,a]),h&&o.push([c.propertyName,h])}(e,t,a),o.object(...a)}(e,t,n)}function u({errorPath:e},{instancePath:t}){const n=t?r.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[s.default.instancePath,(0,r.strConcat)(s.default.instancePath,n)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:s}){let i=s?t:r.str`${t}/${e}`;return n&&(i=r.str`${i}${(0,o.getErrorPath)(n,o.Type.Str)}`),[c.schemaPath,i]}},3835:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const r=n(9029),o=n(3558),s=n(2023),i=n(6939),a=n(4227),c=n(2586);class l{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,i.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function u(e){const t=h.call(this,e);if(t)return t;const n=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:l}=this.opts.code,{ownProperties:u}=this.opts,d=new r.CodeGen(this.scope,{es5:a,lines:l,ownProperties:u});let p;e.$async&&(p=d.scopeValue("Error",{ref:o.default,code:r._`require("ajv/dist/runtime/validation_error").default`}));const m=d.scopeName("validate");e.validateName=m;const f={gen:d,allErrors:this.opts.allErrors,data:s.default.data,parentData:s.default.parentData,parentDataProperty:s.default.parentDataProperty,dataNames:[s.default.data],dataPathArr:[r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,r.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:r.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:r._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,c.validateFunctionCode)(f),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(s.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${s.default.self}`,`${s.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:m,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=f;n.evaluated={props:e instanceof r.Name?void 0:e,items:t instanceof r.Name?void 0:t,dynamicProps:e instanceof r.Name,dynamicItems:t instanceof r.Name},n.source&&(n.source.evaluated=(0,r.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function d(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function h(e){for(const r of this._compilations)if(n=e,(t=r).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return r;var t,n}function p(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){const n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n);let o=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===o)return g.call(this,n,e);const s=(0,i.normalizeId)(r),a=this.refs[s]||this.schemas[s];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||u.call(this,a),s===(0,i.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,r=t[n];return r&&(o=(0,i.resolveUrl)(this.opts.uriResolver,o,r)),new l({schema:t,schemaId:n,root:e,baseId:o})}return g.call(this,n,a)}}t.SchemaEnv=l,t.compileSchema=u,t.resolveRef=function(e,t,n){var r;n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);const o=e.refs[n];if(o)return o;let s=p.call(this,e,n);if(void 0===s){const o=null===(r=e.localRefs)||void 0===r?void 0:r[n],{schemaId:i}=this.opts;o&&(s=new l({schema:o,schemaId:i,root:e,baseId:t}))}return void 0!==s?e.refs[n]=d.call(this,s):void 0},t.getCompilingSchema=h,t.resolveSchema=m;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:n,root:r}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const r of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,a.unescapeFragment)(r)];if(void 0===e)return;const o="object"==typeof(n=e)&&n[this.opts.schemaId];!f.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let s;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);s=m.call(this,r,e)}const{schemaId:c}=this.opts;return s=s||new l({schema:n,schemaId:c,root:r,baseId:t}),s.schema!==s.root.schema?s:void 0}},2023:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o={data:new r.Name("data"),valCxt:new r.Name("valCxt"),instancePath:new r.Name("instancePath"),parentData:new r.Name("parentData"),parentDataProperty:new r.Name("parentDataProperty"),rootData:new r.Name("rootData"),dynamicAnchors:new r.Name("dynamicAnchors"),vErrors:new r.Name("vErrors"),errors:new r.Name("errors"),this:new r.Name("this"),self:new r.Name("self"),scope:new r.Name("scope"),json:new r.Name("json"),jsonPos:new r.Name("jsonPos"),jsonLen:new r.Name("jsonLen"),jsonPart:new r.Name("jsonPart")};t.default=o},4551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6939);class o extends Error{constructor(e,t,n,o){super(o||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,r.resolveUrl)(e,t,n),this.missingSchema=(0,r.normalizeId)((0,r.getFullPath)(e,this.missingRef))}}t.default=o},6939:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const r=n(4227),o=n(2017),s=n(7106),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&l(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(a.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(c))return!0;if("object"==typeof n&&c(n))return!0}return!1}function l(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!i.has(n)&&("object"==typeof e[n]&&(0,r.eachItem)(e[n],(e=>t+=l(e))),t===1/0))return 1/0}return t}function u(e,t="",n){!1!==n&&(t=p(t));const r=e.parse(t);return d(e,r)}function d(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=d;const h=/#\/?$/;function p(e){return e?e.replace(h,""):""}t.normalizeId=p,t.resolveUrl=function(e,t,n){return n=p(n),e.resolve(t,n)};const m=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:r}=this.opts,i=p(e[n]||t),a={"":i},c=u(r,i,!1),l={},d=new Set;return s(e,{allKeys:!0},((e,t,r,o)=>{if(void 0===o)return;const s=c+t;let i=a[o];function u(t){const n=this.opts.uriResolver.resolve;if(t=p(i?n(i,t):t),d.has(t))throw f(t);d.add(t);let r=this.refs[t];return"string"==typeof r&&(r=this.refs[r]),"object"==typeof r?h(e,r.schema,t):t!==p(s)&&("#"===t[0]?(h(e,l[t],t),l[t]=e):this.refs[t]=s),t}function g(e){if("string"==typeof e){if(!m.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[n]&&(i=u.call(this,e[n])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),a[t]=i})),l;function h(e,t,n){if(void 0!==t&&!o(e,t))throw f(n)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},396:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},4227:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const r=n(9029),o=n(1520);function s(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const o=r.RULES.keywords;for(const n in t)o[n]||m(e,`unknown keyword: "${n}"`)}function i(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function l({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:o}){return(s,i,a,c)=>{const l=void 0===a?i:a instanceof r.Name?(i instanceof r.Name?e(s,i,a):t(s,i,a),a):i instanceof r.Name?(t(s,a,i),i):n(i,a);return c!==r.Name||l instanceof r.Name?l:o(s,l)}}function u(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",r._`{}`);return void 0!==t&&d(e,n,t),n}function d(e,t,n){Object.keys(n).forEach((n=>e.assign(r._`${t}${(0,r.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(s(e,t),!i(t,e.self.RULES.all))},t.checkUnknownRules=s,t.schemaHasRules=i,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},n,o,s){if(!s){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return r._`${n}`}return r._`${e}${t}${(0,r.getProperty)(o)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>{e.if(r._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,r._`${n} || {}`).code(r._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,r._`${n} || {}`),d(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,r._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>e.assign(n,!0===t||r._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=d;const h={};var p;function m(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:h[t.code]||(h[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(p||(t.Type=p={})),t.getErrorPath=function(e,t,n){if(e instanceof r.Name){const o=t===p.Num;return n?o?r._`"[" + ${e} + "]"`:r._`"['" + ${e} + "']"`:o?r._`"/" + ${e}`:r._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,r.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=m},7887:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>r(e,t)))}function r(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},r){const o=t.RULES.types[r];return o&&!0!==o&&n(e,o)},t.shouldUseGroup=n,t.shouldUseRule=r},8727:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const r=n(8708),o=n(9029),s=n(2023),i={message:"boolean schema is false"};function a(e,t){const{gen:n,data:o}=e,s={gen:n,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,r.reportError)(s,i,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:r}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(s.default.data):(t.assign(o._`${r}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:r}=e;!1===r?(n.var(t,!1),a(e)):n.var(t,!0)}},208:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const r=n(396),o=n(7887),s=n(8708),i=n(9029),a=n(4227);var c;function l(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(r.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c||(t.DataType=c={})),t.getSchemaTypes=function(e){const t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=l,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:r,opts:s}=e,a=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,s.coerceTypes),l=t.length>0&&!(0===a.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(l){const o=h(t,r,s.strictNumbers,c.Wrong);n.if(o,(()=>{a.length?function(e,t,n){const{gen:r,data:o,opts:s}=e,a=r.let("dataType",i._`typeof ${o}`),c=r.let("coerced",i._`undefined`);"array"===s.coerceTypes&&r.if(i._`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>r.assign(o,i._`${o}[0]`).assign(a,i._`typeof ${o}`).if(h(t,o,s.strictNumbers),(()=>r.assign(c,o))))),r.if(i._`${c} !== undefined`);for(const e of n)(u.has(e)||"array"===e&&"array"===s.coerceTypes)&&l(e);function l(e){switch(e){case"string":return void r.elseIf(i._`${a} == "number" || ${a} == "boolean"`).assign(c,i._`"" + ${o}`).elseIf(i._`${o} === null`).assign(c,i._`""`);case"number":return void r.elseIf(i._`${a} == "boolean" || ${o} === null
2
2
  || (${a} == "string" && ${o} && ${o} == +${o})`).assign(c,i._`+${o}`);case"integer":return void r.elseIf(i._`${a} === "boolean" || ${o} === null
3
3
  || (${a} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(c,i._`+${o}`);case"boolean":return void r.elseIf(i._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(c,!1).elseIf(i._`${o} === "true" || ${o} === 1`).assign(c,!0);case"null":return r.elseIf(i._`${o} === "" || ${o} === 0 || ${o} === false`),void r.assign(c,null);case"array":r.elseIf(i._`${a} === "string" || ${a} === "number"
4
4
  || ${a} === "boolean" || ${o} === null`).assign(c,i._`[${o}]`)}}r.else(),m(e),r.endIf(),r.if(i._`${c} !== undefined`,(()=>{r.assign(o,c),function({gen:e,parentData:t,parentDataProperty:n},r){e.if(i._`${t} !== undefined`,(()=>e.assign(i._`${t}[${n}]`,r)))}(e,c)}))}(e,t,a):m(e)}))}return l};const u=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,r=c.Correct){const o=r===c.Correct?i.operators.EQ:i.operators.NEQ;let s;switch(e){case"null":return i._`${t} ${o} null`;case"array":s=i._`Array.isArray(${t})`;break;case"object":s=i._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=a(i._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=a();break;default:return i._`typeof ${t} ${o} ${e}`}return r===c.Correct?s:(0,i.not)(s);function a(e=i.nil){return(0,i.and)(i._`typeof ${t} == "number"`,e,n?i._`isFinite(${t})`:i.nil)}}function h(e,t,n,r){if(1===e.length)return d(e[0],t,n,r);let o;const s=(0,a.toHash)(e);if(s.array&&s.object){const e=i._`typeof ${t} != "object"`;o=s.null?e:i._`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(const e in s)o=(0,i.and)(o,d(e,t,n,r));return o}t.checkDataType=d,t.checkDataTypes=h;const p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?i._`{type: ${e}}`:i._`{type: ${t}}`};function m(e){const t=function(e){const{gen:t,data:n,schema:r}=e,o=(0,a.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}(e);(0,s.reportError)(t,p)}t.reportTypeError=m},7870:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const r=n(9029),o=n(4227);function s(e,t,n){const{gen:s,compositeRule:i,data:a,opts:c}=e;if(void 0===n)return;const l=r._`${a}${(0,r.getProperty)(t)}`;if(i)return void(0,o.checkStrictMode)(e,`default is ignored for: ${l}`);let u=r._`${l} === undefined`;"empty"===c.useDefaults&&(u=r._`${u} || ${l} === null || ${l} === ""`),s.if(u,r._`${l} = ${(0,r.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:r}=e.schema;if("object"===t&&n)for(const t in n)s(e,t,n[t].default);else"array"===t&&Array.isArray(r)&&r.forEach(((t,n)=>s(e,n,t.default)))}},2586:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const r=n(8727),o=n(208),s=n(7887),i=n(208),a=n(7870),c=n(3673),l=n(4495),u=n(9029),d=n(2023),h=n(6939),p=n(4227),m=n(8708);function f({gen:e,validateName:t,schema:n,schemaEnv:r,opts:o},s){o.code.es5?e.func(t,u._`${d.default.data}, ${d.default.valCxt}`,r.$async,(()=>{e.code(u._`"use strict"; ${g(n,o)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,u._`""`),e.var(d.default.parentData,u._`undefined`),e.var(d.default.parentDataProperty,u._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`{}`)}))}(e,o),e.code(s)})):e.func(t,u._`${d.default.data}, ${function(e){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}(o)}`,r.$async,(()=>e.code(g(n,o)).code(s)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?u._`/*# sourceURL=${n} */`:u.nil}function y({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function b(e){return"boolean"!=typeof e.schema}function w(e){(0,p.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:r,self:o}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function v(e,t){if(e.opts.jtd)return E(e,[],!1,t);const n=(0,o.getSchemaTypes)(e.schema);E(e,n,!(0,o.coerceAndCheckDataType)(e,n),t)}function A({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:o}){const s=n.$comment;if(!0===o.$comment)e.code(u._`${d.default.self}.logger.log(${s})`);else if("function"==typeof o.$comment){const n=u.str`${r}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(u._`${d.default.self}.opts.$comment(${s}, ${n}, ${o}.schema)`)}}function E(e,t,n,r){const{gen:o,schema:a,data:c,allErrors:l,opts:h,self:m}=e,{RULES:f}=m;function g(p){(0,s.shouldUseGroup)(a,p)&&(p.type?(o.if((0,i.checkDataType)(p.type,c,h.strictNumbers)),C(e,p),1===t.length&&t[0]===p.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):C(e,p),l||o.if(u._`${d.default.errors} === ${r||0}`))}!a.$ref||!h.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(a,f)?(h.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{T(e.dataTypes,t)||S(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const n=[];for(const r of e.dataTypes)T(t,r)?n.push(r):t.includes("integer")&&"number"===r&&n.push("integer");e.dataTypes=n}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&S(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const n=e.self.RULES.all;for(const r in n){const o=n[r];if("object"==typeof o&&(0,s.shouldUseRule)(e.schema,o)){const{type:n}=o.definition;n.length&&!n.some((e=>{return r=e,(n=t).includes(r)||"number"===r&&n.includes("integer");var n,r}))&&S(e,`missing type "${n.join(",")}" for keyword "${r}"`)}}}(e,e.dataTypes))}(e,t),o.block((()=>{for(const e of f.rules)g(e);g(f.post)}))):o.block((()=>P(e,"$ref",f.all.$ref.definition)))}function C(e,t){const{gen:n,schema:r,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,s.shouldUseRule)(r,n)&&P(e,n.keyword,n.definition,t.type)}))}function T(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function S(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,p.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){b(e)&&(w(e),y(e))?function(e){const{schema:t,opts:n,gen:r}=e;f(e,(()=>{n.$comment&&t.$comment&&A(e),function(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,p.checkStrictMode)(e,"default is ignored in the schema root")}(e),r.let(d.default.vErrors,null),r.let(d.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",u._`${n}.evaluated`),t.if(u._`${e.evaluated}.dynamicProps`,(()=>t.assign(u._`${e.evaluated}.props`,u._`undefined`))),t.if(u._`${e.evaluated}.dynamicItems`,(()=>t.assign(u._`${e.evaluated}.items`,u._`undefined`)))}(e),v(e),function(e){const{gen:t,schemaEnv:n,validateName:r,ValidationError:o,opts:s}=e;n.$async?t.if(u._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(u._`new ${o}(${d.default.vErrors})`))):(t.assign(u._`${r}.errors`,d.default.vErrors),s.unevaluated&&function({gen:e,evaluated:t,props:n,items:r}){n instanceof u.Name&&e.assign(u._`${t}.props`,n),r instanceof u.Name&&e.assign(u._`${t}.items`,r)}(e),t.return(u._`${d.default.errors} === 0`))}(e)}))}(e):f(e,(()=>(0,r.topBoolOrEmptySchema)(e)))};class _{constructor(e,t,n){if((0,c.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",N(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,n){this.failResult((0,u.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(u._`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?m.reportExtraError:m.reportError)(this,this.def.error,t)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=u.nil){this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(e=u.nil,t=u.nil){if(!this.$data)return;const{gen:n,schemaCode:r,schemaType:o,def:s}=this;n.if((0,u.or)(u._`${r} === undefined`,t)),e!==u.nil&&n.assign(e,!0),(o.length||s.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:r,it:o}=this;return(0,u.or)(function(){if(n.length){if(!(t instanceof u.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return u._`${(0,i.checkDataTypes)(e,t,o.opts.strictNumbers,i.DataType.Wrong)}`}return u.nil}(),function(){if(r.validateSchema){const n=e.scopeValue("validate$data",{ref:r.validateSchema});return u._`!${n}(${t})`}return u.nil}())}subschema(e,t){const n=(0,l.getSubschema)(this.it,e);(0,l.extendSubschemaData)(n,this.it,e),(0,l.extendSubschemaMode)(n,e);const o={...this.it,...n,items:void 0,props:void 0};return function(e,t){b(e)&&(w(e),y(e))?function(e,t){const{schema:n,gen:r,opts:o}=e;o.$comment&&n.$comment&&A(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,h.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const s=r.const("_errs",d.default.errors);v(e,s),r.var(t,u._`${s} === ${d.default.errors}`)}(e,t):(0,r.boolOrEmptySchema)(e,t)}(o,t),o}mergeEvaluated(e,t){const{it:n,gen:r}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=p.mergeEvaluated.props(r,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=p.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:r}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return r.if(t,(()=>this.mergeEvaluated(e,u.Name))),!0}}function P(e,t,n,r){const o=new _(e,n,t);"code"in n?n.code(o,r):o.$data&&n.validate?(0,c.funcKeywordCode)(o,n):"macro"in n?(0,c.macroKeywordCode)(o,n):(n.compile||n.validate)&&(0,c.funcKeywordCode)(o,n)}t.KeywordCxt=_;const M=/^\/(?:[^~]|~0|~1)*$/,x=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function N(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let o,s;if(""===e)return d.default.rootData;if("/"===e[0]){if(!M.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,s=d.default.rootData}else{const i=x.exec(e);if(!i)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+i[1];if(o=i[2],"#"===o){if(a>=t)throw new Error(c("property/index",a));return r[t-a]}if(a>t)throw new Error(c("data",a));if(s=n[t-a],!o)return s}let i=s;const a=o.split("/");for(const e of a)e&&(s=u._`${s}${(0,u.getProperty)((0,p.unescapeJsonPointer)(e))}`,i=u._`${i} && ${s}`);return i;function c(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=N},3673:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const r=n(9029),o=n(2023),s=n(5765),i=n(8708);function a(e){const{gen:t,data:n,it:o}=e;t.if(o.parentData,(()=>t.assign(n,r._`${o.parentData}[${o.parentDataProperty}]`)))}function c(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,r.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:o,schema:s,parentSchema:i,it:a}=e,l=t.macro.call(a.self,s,i,a),u=c(n,o,l);!1!==a.opts.validateSchema&&a.self.validateSchema(l,!0);const d=n.name("valid");e.subschema({schema:l,schemaPath:r.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:l,keyword:u,schema:d,parentSchema:h,$data:p,it:m}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(m,t);const f=!p&&t.compile?t.compile.call(m.self,d,h,m):t.validate,g=c(l,u,f),y=l.let("valid");function b(n=(t.async?r._`await `:r.nil)){const i=m.opts.passContext?o.default.this:o.default.self,a=!("compile"in t&&!p||!1===t.schema);l.assign(y,r._`${n}${(0,s.callValidateCode)(e,g,i,a)}`,t.modifying)}function w(e){var n;l.if((0,r.not)(null!==(n=t.valid)&&void 0!==n?n:y),e)}e.block$data(y,(function(){if(!1===t.errors)b(),t.modifying&&a(e),w((()=>e.error()));else{const n=t.async?function(){const e=l.let("ruleErrs",null);return l.try((()=>b(r._`await `)),(t=>l.assign(y,!1).if(r._`${t} instanceof ${m.ValidationError}`,(()=>l.assign(e,r._`${t}.errors`)),(()=>l.throw(t))))),e}():function(){const e=r._`${g}.errors`;return l.assign(e,null),b(r.nil),e}();t.modifying&&a(e),w((()=>function(e,t){const{gen:n}=e;n.if(r._`Array.isArray(${t})`,(()=>{n.assign(o.default.vErrors,r._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,r._`${o.default.vErrors}.length`),(0,i.extendErrors)(e)}),(()=>e.error()))}(e,n)))}})),e.ok(null!==(n=t.valid)&&void 0!==n?n:y)},t.validSchemaType=function(e,t,n=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:n,errSchemaPath:r},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");const i=o.dependencies;if(null==i?void 0:i.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[s])){const e=`keyword "${s}" value is invalid at path "${r}": `+n.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}},4495:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const r=n(9029),o=n(4227);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:s,schemaPath:i,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==s)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const s=e.schema[t];return void 0===n?{schema:s,schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[n],schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}${(0,r.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(n)}`}}if(void 0!==s){if(void 0===i||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:i,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:s,data:i,dataTypes:a,propertyName:c}){if(void 0!==i&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(void 0!==n){const{errorPath:i,dataPathArr:a,opts:c}=t;u(l.let("data",r._`${t.data}${(0,r.getProperty)(n)}`,!0)),e.errorPath=r.str`${i}${(0,o.getErrorPath)(n,s,c.jsPropertySyntax)}`,e.parentDataProperty=r._`${n}`,e.dataPathArr=[...a,e.parentDataProperty]}function u(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}void 0!==i&&(u(i instanceof r.Name?i:l.let("data",i,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:o,allErrors:s}){void 0!==r&&(e.compositeRule=r),void 0!==o&&(e.createErrors=o),void 0!==s&&(e.allErrors=s),e.jtdDiscriminator=t,e.jtdMetadata=n}},4042:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var r=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return r.KeywordCxt}});var o=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const s=n(3558),i=n(4551),a=n(396),c=n(3835),l=n(9029),u=n(6939),d=n(208),h=n(4227),p=n(3837),m=n(5944),f=(e,t)=>new RegExp(e,t);f.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},w={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function v(e){var t,n,r,o,s,i,a,c,l,u,d,h,p,g,y,b,w,v,A,E,C,T,S,_,P;const M=e.strict,x=null===(t=e.code)||void 0===t?void 0:t.optimize,N=!0===x||void 0===x?1:x||0,$=null!==(r=null===(n=e.code)||void 0===n?void 0:n.regExp)&&void 0!==r?r:f,L=null!==(o=e.uriResolver)&&void 0!==o?o:m.default;return{strictSchema:null===(i=null!==(s=e.strictSchema)&&void 0!==s?s:M)||void 0===i||i,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:M)||void 0===c||c,strictTypes:null!==(u=null!==(l=e.strictTypes)&&void 0!==l?l:M)&&void 0!==u?u:"log",strictTuples:null!==(h=null!==(d=e.strictTuples)&&void 0!==d?d:M)&&void 0!==h?h:"log",strictRequired:null!==(g=null!==(p=e.strictRequired)&&void 0!==p?p:M)&&void 0!==g&&g,code:e.code?{...e.code,optimize:N,regExp:$}:{optimize:N,regExp:$},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(w=e.meta)||void 0===w||w,messages:null===(v=e.messages)||void 0===v||v,inlineRefs:null===(A=e.inlineRefs)||void 0===A||A,schemaId:null!==(E=e.schemaId)&&void 0!==E?E:"$id",addUsedSchema:null===(C=e.addUsedSchema)||void 0===C||C,validateSchema:null===(T=e.validateSchema)||void 0===T||T,validateFormats:null===(S=e.validateFormats)||void 0===S||S,unicodeRegExp:null===(_=e.unicodeRegExp)||void 0===_||_,int32range:null===(P=e.int32range)||void 0===P||P,uriResolver:L}}class A{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:t,lines:n}),this.logger=function(e){if(!1===e)return M;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),E.call(this,b,e,"NOT SUPPORTED"),E.call(this,w,e,"DEPRECATED","warn"),this._metaOpts=P.call(this),e.formats&&S.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&_.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),T.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let r=p;"id"===n&&(r={...p},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const r=n(t);return"$async"in n||(this.errors=n.errors),r}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await o.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||s.call(this,n)}async function o(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function s(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof i.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),s.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const n=await l.call(this,e);this.refs[e]||await o.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,r);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const r=this.validate(n,e);if(!r&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return r}getSchema(e){let t;for(;"string"==typeof(t=C.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,r=new c.SchemaEnv({schema:{},schemaId:n});if(t=c.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=C.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,u.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(N.call(this,n,t),!t)return(0,h.eachItem)(n,(e=>$.call(this,e))),this;I.call(this,t);const r={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,h.eachItem)(n,0===r.type.length?e=>$.call(this,e,r):e=>r.type.forEach((t=>$.call(this,e,r,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex((t=>t.keyword===e));t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return e&&0!==e.length?e.map((e=>`${n}${e.instancePath} ${e.message}`)).reduce(((e,n)=>e+t+n)):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const r of t){const t=r.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:r}=t.definition,s=o[e];r&&s&&(o[e]=O(s))}}return e}_removeAllSchemas(e,t){for(const n in e){const r=e[n];t&&!t.test(n)||("string"==typeof r?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let s;const{schemaId:i}=this.opts;if("object"==typeof e)s=e[i];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;n=(0,u.normalizeId)(s||n);const l=u.getSchemaRefs.call(this,e,n);return a=new c.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:n,localRefs:l}),this._cache.set(a.schema,a),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=a),r&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function E(e,t,n,r="error"){for(const o in e){const s=o;s in t&&this.logger[r](`${n}: option ${o}. ${e[s]}`)}}function C(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function T(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function S(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function _(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function P(){const e={...this.opts};for(const t of g)delete e[t];return e}A.ValidationError=s.default,A.MissingRefError=i.default,t.default=A;const M={log(){},warn(){},error(){}},x=/^[a-z_$][a-z0-9_$:-]*$/i;function N(e,t){const{RULES:n}=this;if((0,h.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!x.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function $(e,t,n){var r;const o=null==t?void 0:t.post;if(n&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:s}=this;let i=o?s.post:s.rules.find((({type:e})=>e===n));if(i||(i={type:n,rules:[]},s.rules.push(i)),s.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?L.call(this,i,a,t.before):i.rules.push(a),s.all[e]=a,null===(r=t.implements)||void 0===r||r.forEach((e=>this.addKeyword(e)))}function L(e,t,n){const r=e.rules.findIndex((e=>e.keyword===n));r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function I(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=O(t)),e.validateSchema=this.compile(t,!0))}const R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,R]}}},9572:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1678),o=n(7216),s=n(9547),i=n(8226),a=n(518),c=n(4588),l=n(5707),u=n(7082),d=["/properties"];t.default=function(e){return[r,o,s,i,a,t(this,c),l,t(this,u)].forEach((e=>this.addMetaSchema(e,void 0,!1))),this;function t(t,n){return e?t.$dataMetaSchema(n,d):n}}},6250:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2017);r.code='require("ajv/dist/runtime/equal").default',t.default=r},3853:(e,t)=>{"use strict";function n(e){const t=e.length;let n,r=0,o=0;for(;o<t;)r++,n=e.charCodeAt(o++),n>=55296&&n<=56319&&o<t&&(n=e.charCodeAt(o),56320==(64512&n)&&o++);return r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.code='require("ajv/dist/runtime/ucs2length").default'},5944:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8343);r.code='require("ajv/dist/runtime/uri").default',t.default=r},3558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=n},5457:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const r=n(9029),o=n(4227),s={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:r}=t;Array.isArray(r)?i(e,r):(0,o.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function i(e,t){const{gen:n,schema:s,data:i,keyword:a,it:c}=e;c.items=!0;const l=n.const("len",r._`${i}.length`);if(!1===s)e.setParams({len:t.length}),e.pass(r._`${l} <= ${t.length}`);else if("object"==typeof s&&!(0,o.alwaysValidSchema)(c,s)){const s=n.var("valid",r._`${l} <= ${t.length}`);n.if((0,r.not)(s),(()=>function(s){n.forRange("i",t.length,l,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},s),c.allErrors||n.if((0,r.not)(s),(()=>n.break()))}))}(s))),e.ok(s)}}t.validateAdditionalItems=i,t.default=s},8660:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),o=n(9029),s=n(2023),i=n(4227),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>o._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:a,data:c,errsCount:l,it:u}=e;if(!l)throw new Error("ajv implementation error");const{allErrors:d,opts:h}=u;if(u.props=!0,"all"!==h.removeAdditional&&(0,i.alwaysValidSchema)(u,n))return;const p=(0,r.allSchemaProperties)(a.properties),m=(0,r.allSchemaProperties)(a.patternProperties);function f(e){t.code(o._`delete ${c}[${e}]`)}function g(r){if("all"===h.removeAdditional||h.removeAdditional&&!1===n)f(r);else{if(!1===n)return e.setParams({additionalProperty:r}),e.error(),void(d||t.break());if("object"==typeof n&&!(0,i.alwaysValidSchema)(u,n)){const n=t.name("valid");"failing"===h.removeAdditional?(y(r,n,!1),t.if((0,o.not)(n),(()=>{e.reset(),f(r)}))):(y(r,n),d||t.if((0,o.not)(n),(()=>t.break())))}}}function y(t,n,r){const o={keyword:"additionalProperties",dataProp:t,dataPropType:i.Type.Str};!1===r&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,n)}t.forIn("key",c,(n=>{p.length||m.length?t.if(function(n){let s;if(p.length>8){const e=(0,i.schemaRefOrVal)(u,a.properties,"properties");s=(0,r.isOwnProperty)(t,e,n)}else s=p.length?(0,o.or)(...p.map((e=>o._`${n} === ${e}`))):o.nil;return m.length&&(s=(0,o.or)(s,...m.map((t=>o._`${(0,r.usePattern)(e,t)}.test(${n})`)))),(0,o.not)(s)}(n),(()=>g(n))):g(n)})),e.ok(o._`${l} === ${s.default.errors}`)}};t.default=a},5844:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),o={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const s=t.name("valid");n.forEach(((t,n)=>{if((0,r.alwaysValidSchema)(o,t))return;const i=e.subschema({keyword:"allOf",schemaProp:n},s);e.ok(s),e.mergeEvaluated(i)}))}};t.default=o},6505:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(5765).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r},2661:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?r.str`must contain at least ${e} valid item(s)`:r.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?r._`{minContains: ${e}}`:r._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:s,data:i,it:a}=e;let c,l;const{minContains:u,maxContains:d}=s;a.opts.next?(c=void 0===u?1:u,l=d):c=1;const h=t.const("len",r._`${i}.length`);if(e.setParams({min:c,max:l}),void 0===l&&0===c)return void(0,o.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==l&&c>l)return(0,o.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,o.alwaysValidSchema)(a,n)){let t=r._`${h} >= ${c}`;return void 0!==l&&(t=r._`${t} && ${h} <= ${l}`),void e.pass(t)}a.items=!0;const p=t.name("valid");function m(){const e=t.name("_valid"),n=t.let("count",0);f(e,(()=>t.if(e,(()=>function(e){t.code(r._`${e}++`),void 0===l?t.if(r._`${e} >= ${c}`,(()=>t.assign(p,!0).break())):(t.if(r._`${e} > ${l}`,(()=>t.assign(p,!1).break())),1===c?t.assign(p,!0):t.if(r._`${e} >= ${c}`,(()=>t.assign(p,!0))))}(n)))))}function f(n,r){t.forRange("i",0,h,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:o.Type.Num,compositeRule:!0},n),r()}))}void 0===l&&1===c?f(p,(()=>t.if(p,(()=>t.break())))):0===c?(t.let(p,!0),void 0!==l&&t.if(r._`${i}.length > 0`,m)):(t.let(p,!1),m()),e.result(p,(()=>e.reset()))}};t.default=s},3025:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const r=n(9029),o=n(4227),s=n(5765);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const o=1===t?"property":"properties";return r.str`must have ${o} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:o}})=>r._`{property: ${e},