@datagrok/bio 2.22.7 → 2.22.8
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.
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/package.json +2 -2
- package/test-console-output-1.log +365 -366
- package/test-record-1.mp4 +0 -0
package/dist/package-test.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var bio_test;(()=>{var e={8924:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var i=n(7362);class o extends i.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="",i="";for(const o of e)"("==o?t++:")"==o?t--:t?n+=o:i+=o;return isNaN(parseInt(n))?[i,n]:[i,""]}static getColorAAPivot(e="",t="grok"){const n=this.getPalette(t);let[i,o]=this.getInnerOuter(e);if(i=i.length>6?`${i.slice(0,3)}...`:i,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,i,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,i,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,i,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,i,o,4]}return[this.undefinedColor,i,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 i=n(6082);async function o(){const e=i.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:()=>i.o});var i=n(6869)},9124:(e,t,n)=>{"use strict";n.d(t,{b2:()=>s,fA:()=>r});var i=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 r(e,t){if(!e)throw new Error("Argument 'a' of type Atom or HelmType is mandatory.");let n,i;const o=e;return"ATOM"===o.T?(n=o.biotype(),i=o.elem):(n=e,i=t),[n,i]}o.JsInputBase,Error,i.input.helmAsync=async function(e,t){return(await s()).createHelmInput(e,t)}},8438:(e,t,n)=>{"use strict";function i(e){return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e}n.d(t,{D:()=>i})},8123:(e,t,n)=>{"use strict";n.d(t,{u:()=>i});const i={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:()=>r});var i=n(4328);const o="Libraries";let s=Promise.resolve();async function r(){let e;return s=s.then((async()=>{const t=i.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)}`),i.userSettings.add(o,"Settings",JSON.stringify(e),!0)})),await s}},5553:(e,t,n)=>{"use strict";n.d(t,{Qc:()=>C,WN:()=>T});var i=n(1991),o=n.n(i);const s="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,r=new Set,a="object"==typeof process&&process?process:{},l=(e,t,n,i)=>{"function"==typeof a.emitWarning?a.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)};let c=globalThis.AbortController,u=globalThis.AbortSignal;if(void 0===c){u=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},c=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,l("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 h=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),d=e=>h(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=d(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 g{#t;#n;#i;#o;#s;#r;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#l;#c;#u;#h;#d;#p;#m;#g;#f;#y;#b;#w;#v;#A;#C;#T;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#v,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#h,next:e.#d,prev:e.#p,get head(){return e.#m},get tail(){return e.#g},free:e.#f,isBackgroundFetch:t=>e.#S(t),backgroundFetch:(t,n,i,o)=>e.#E(t,n,i,o),moveToTail:t=>e.#M(t),indexes:t=>e.#x(t),rindexes:t=>e.#L(t),isStale:t=>e.#_(t)}}get max(){return this.#t}get maxSize(){return this.#n}get calculatedSize(){return this.#l}get size(){return this.#a}get fetchMethod(){return this.#s}get memoMethod(){return this.#r}get dispose(){return this.#i}get disposeAfter(){return this.#o}constructor(e){const{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:a,allowStale:c,dispose:u,disposeAfter:p,noDisposeOnSet:f,noUpdateTTL:y,maxSize:b=0,maxEntrySize:w=0,sizeCalculation:v,fetchMethod:A,memoMethod:C,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:M,ignoreFetchAbort:x}=e;if(0!==t&&!h(t))throw new TypeError("max option must be a nonnegative integer");const L=t?d(t):Array;if(!L)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!==C&&"function"!=typeof C)throw new TypeError("memoMethod must be a function if defined");if(this.#r=C,void 0!==A&&"function"!=typeof A)throw new TypeError("fetchMethod must be a function if specified");if(this.#s=A,this.#C=!!A,this.#c=new Map,this.#u=new Array(t).fill(void 0),this.#h=new Array(t).fill(void 0),this.#d=new L(t),this.#p=new L(t),this.#m=0,this.#g=0,this.#f=m.create(t),this.#a=0,this.#l=0,"function"==typeof u&&(this.#i=u),"function"==typeof p?(this.#o=p,this.#y=[]):(this.#o=void 0,this.#y=void 0),this.#A=!!this.#i,this.#T=!!this.#o,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!M,this.ignoreFetchAbort=!!x,0!==this.maxEntrySize){if(0!==this.#n&&!h(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!h(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#I()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!a,this.ttlResolution=h(i)||0===i?i:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!h(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}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=>!r.has(e))(e)&&(r.add(e),l("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,g))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#P(){const e=new p(this.#t),t=new p(this.#t);this.#v=e,this.#w=t,this.#N=(n,i,o=s.now())=>{if(t[n]=0!==i?o:0,e[n]=i,0!==i&&this.ttlAutopurge){const e=setTimeout((()=>{this.#_(n)&&this.#R(this.#u[n],"expire")}),i+1);e.unref&&e.unref()}},this.#$=n=>{t[n]=0!==e[n]?s.now():0},this.#O=(o,s)=>{if(e[s]){const r=e[s],a=t[s];if(!r||!a)return;o.ttl=r,o.start=a,o.now=n||i();const l=o.now-a;o.remainingTTL=r-l}};let n=0;const i=()=>{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.#c.get(o);if(void 0===s)return 0;const r=e[s],a=t[s];return r&&a?r-((n||i())-a):1/0},this.#_=o=>{const s=t[o],r=e[o];return!!r&&!!s&&(n||i())-s>r}}#$=()=>{};#O=()=>{};#N=()=>{};#_=()=>!1;#I(){const e=new p(this.#t);this.#l=0,this.#b=e,this.#H=t=>{this.#l-=e[t],e[t]=0},this.#k=(e,t,n,i)=>{if(this.#S(t))return 0;if(!h(n)){if(!i)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 i)throw new TypeError("sizeCalculation must be a function");if(n=i(t,e),!h(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n},this.#F=(t,n,i)=>{if(e[t]=n,this.#n){const n=this.#n-e[t];for(;this.#l>n;)this.#D(!0)}this.#l+=e[t],i&&(i.entrySize=n,i.totalCalculatedSize=this.#l)}}#H=e=>{};#F=(e,t,n)=>{};#k=(e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#g;this.#G(t)&&(!e&&this.#_(t)||(yield t),t!==this.#m);)t=this.#p[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#m;this.#G(t)&&(!e&&this.#_(t)||(yield t),t!==this.#g);)t=this.#d[t]}#G(e){return void 0!==e&&this.#c.get(this.#u[e])===e}*entries(){for(const e of this.#x())void 0===this.#h[e]||void 0===this.#u[e]||this.#S(this.#h[e])||(yield[this.#u[e],this.#h[e]])}*rentries(){for(const e of this.#L())void 0===this.#h[e]||void 0===this.#u[e]||this.#S(this.#h[e])||(yield[this.#u[e],this.#h[e]])}*keys(){for(const e of this.#x()){const t=this.#u[e];void 0===t||this.#S(this.#h[e])||(yield t)}}*rkeys(){for(const e of this.#L()){const t=this.#u[e];void 0===t||this.#S(this.#h[e])||(yield t)}}*values(){for(const e of this.#x())void 0===this.#h[e]||this.#S(this.#h[e])||(yield this.#h[e])}*rvalues(){for(const e of this.#L())void 0===this.#h[e]||this.#S(this.#h[e])||(yield this.#h[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const n of this.#x()){const i=this.#h[n],o=this.#S(i)?i.__staleWhileFetching:i;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.#x()){const i=this.#h[n],o=this.#S(i)?i.__staleWhileFetching:i;void 0!==o&&e.call(t,o,this.#u[n],this)}}rforEach(e,t=this){for(const n of this.#L()){const i=this.#h[n],o=this.#S(i)?i.__staleWhileFetching:i;void 0!==o&&e.call(t,o,this.#u[n],this)}}purgeStale(){let e=!1;for(const t of this.#L({allowStale:!0}))this.#_(t)&&(this.#R(this.#u[t],"expire"),e=!0);return e}info(e){const t=this.#c.get(e);if(void 0===t)return;const n=this.#h[t],i=this.#S(n)?n.__staleWhileFetching:n;if(void 0===i)return;const o={value:i};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.#x({allowStale:!0})){const n=this.#u[t],i=this.#h[t],o=this.#S(i)?i.__staleWhileFetching:i;if(void 0===o||void 0===n)continue;const r={value:o};if(this.#v&&this.#w){r.ttl=this.#v[t];const e=s.now()-this.#w[t];r.start=Math.floor(Date.now()-e)}this.#b&&(r.size=this.#b[t]),e.unshift([n,r])}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:i=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:r=this.sizeCalculation,status:a}=n;let{noUpdateTTL:l=this.noUpdateTTL}=n;const c=this.#k(e,t,n.size||0,r);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#R(e,"set"),this;let u=0===this.#a?void 0:this.#c.get(e);if(void 0===u)u=0===this.#a?this.#g:0!==this.#f.length?this.#f.pop():this.#a===this.#t?this.#D(!1):this.#a,this.#u[u]=e,this.#h[u]=t,this.#c.set(e,u),this.#d[this.#g]=u,this.#p[u]=this.#g,this.#g=u,this.#a++,this.#F(u,c,a),a&&(a.set="add"),l=!1;else{this.#M(u);const n=this.#h[u];if(t!==n){if(this.#C&&this.#S(n)){n.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=n;void 0===t||s||(this.#A&&this.#i?.(t,e,"set"),this.#T&&this.#y?.push([t,e,"set"]))}else s||(this.#A&&this.#i?.(n,e,"set"),this.#T&&this.#y?.push([n,e,"set"]));if(this.#H(u),this.#F(u,c,a),this.#h[u]=t,a){a.set="replace";const e=n&&this.#S(n)?n.__staleWhileFetching:n;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0===i||this.#v||this.#P(),this.#v&&(l||this.#N(u,i,o),a&&this.#O(a,u)),!s&&this.#T&&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.#h[this.#m];if(this.#D(!0),this.#S(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#T&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}}}#D(e){const t=this.#m,n=this.#u[t],i=this.#h[t];return this.#C&&this.#S(i)?i.__abortController.abort(new Error("evicted")):(this.#A||this.#T)&&(this.#A&&this.#i?.(i,n,"evict"),this.#T&&this.#y?.push([i,n,"evict"])),this.#H(t),e&&(this.#u[t]=void 0,this.#h[t]=void 0,this.#f.push(t)),1===this.#a?(this.#m=this.#g=0,this.#f.length=0):this.#m=this.#d[t],this.#c.delete(n),this.#a--,t}has(e,t={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,o=this.#c.get(e);if(void 0!==o){const e=this.#h[o];if(this.#S(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#_(o))return n&&this.#$(o),i&&(i.has="hit",this.#O(i,o)),!0;i&&(i.has="stale",this.#O(i,o))}else i&&(i.has="miss");return!1}peek(e,t={}){const{allowStale:n=this.allowStale}=t,i=this.#c.get(e);if(void 0===i||!n&&this.#_(i))return;const o=this.#h[i];return this.#S(o)?o.__staleWhileFetching:o}#E(e,t,n,i){const o=void 0===t?void 0:this.#h[t];if(this.#S(o))return o;const s=new c,{signal:r}=n;r?.addEventListener("abort",(()=>s.abort(r.reason)),{signal:s.signal});const a={signal:s.signal,options:n,context:i},l=(i,o=!1)=>{const{aborted:r}=s.signal,l=n.ignoreFetchAbort&&void 0!==i;if(n.status&&(r&&!o?(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,l&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),r&&!l&&!o)return u(s.signal.reason);const c=h;return this.#h[t]===h&&(void 0===i?c.__staleWhileFetching?this.#h[t]=c.__staleWhileFetching:this.#R(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,i,a.options))),i},u=i=>{const{aborted:o}=s.signal,r=o&&n.allowStaleOnFetchAbort,a=r||n.allowStaleOnFetchRejection,l=a||n.noDeleteOnFetchRejection,c=h;if(this.#h[t]===h&&(l&&void 0!==c.__staleWhileFetching?r||(this.#h[t]=c.__staleWhileFetching):this.#R(e,"fetch")),a)return n.status&&void 0!==c.__staleWhileFetching&&(n.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw i};n.status&&(n.status.fetchDispatched=!0);const h=new Promise(((t,i)=>{const r=this.#s?.(e,o,a);r&&r instanceof Promise&&r.then((e=>t(void 0===e?void 0:e)),i),s.signal.addEventListener("abort",(()=>{n.ignoreFetchAbort&&!n.allowStaleOnFetchAbort||(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))}))})).then(l,(e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e)))),d=Object.assign(h,{__abortController:s,__staleWhileFetching:o,__returned:void 0});return void 0===t?(this.set(e,d,{...a.options,status:void 0}),t=this.#c.get(e)):this.#h[t]=d,d}#S(e){if(!this.#C)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof c}async fetch(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:r=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:g=!1,status:f,signal:y}=t;if(!this.#C)return f&&(f.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:o,status:f});const b={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:r,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:d,status:f,signal:y};let w=this.#c.get(e);if(void 0===w){f&&(f.fetch="miss");const t=this.#E(e,w,b,m);return t.__returned=t}{const t=this.#h[w];if(this.#S(t)){const e=n&&void 0!==t.__staleWhileFetching;return f&&(f.fetch="inflight",e&&(f.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const o=this.#_(w);if(!g&&!o)return f&&(f.fetch="hit"),this.#M(w),i&&this.#$(w),f&&this.#O(f,w),t;const s=this.#E(e,w,b,m),r=void 0!==s.__staleWhileFetching&&n;return f&&(f.fetch=o?"stale":"refresh",r&&o&&(f.returnedStale=!0)),r?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.#r;if(!n)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:o,...s}=t,r=this.get(e,s);if(!o&&void 0!==r)return r;const a=n(e,r,{options:s,context:i});return this.set(e,a,s),a}get(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:s}=t,r=this.#c.get(e);if(void 0!==r){const t=this.#h[r],a=this.#S(t);return s&&this.#O(s,r),this.#_(r)?(s&&(s.get="stale"),a?(s&&n&&void 0!==t.__staleWhileFetching&&(s.returnedStale=!0),n?t.__staleWhileFetching:void 0):(o||this.#R(e,"expire"),s&&n&&(s.returnedStale=!0),n?t:void 0)):(s&&(s.get="hit"),a?t.__staleWhileFetching:(this.#M(r),i&&this.#$(r),t))}s&&(s.get="miss")}#B(e,t){this.#p[t]=e,this.#d[e]=t}#M(e){e!==this.#g&&(e===this.#m?this.#m=this.#d[e]:this.#B(this.#p[e],this.#d[e]),this.#B(this.#g,e),this.#g=e)}delete(e){return this.#R(e,"delete")}#R(e,t){let n=!1;if(0!==this.#a){const i=this.#c.get(e);if(void 0!==i)if(n=!0,1===this.#a)this.#V(t);else{this.#H(i);const n=this.#h[i];if(this.#S(n)?n.__abortController.abort(new Error("deleted")):(this.#A||this.#T)&&(this.#A&&this.#i?.(n,e,t),this.#T&&this.#y?.push([n,e,t])),this.#c.delete(e),this.#u[i]=void 0,this.#h[i]=void 0,i===this.#g)this.#g=this.#p[i];else if(i===this.#m)this.#m=this.#d[i];else{const e=this.#p[i];this.#d[e]=this.#d[i];const t=this.#d[i];this.#p[t]=this.#p[i]}this.#a--,this.#f.push(i)}}if(this.#T&&this.#y?.length){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}return n}clear(){return this.#V("delete")}#V(e){for(const t of this.#L({allowStale:!0})){const n=this.#h[t];if(this.#S(n))n.__abortController.abort(new Error("deleted"));else{const i=this.#u[t];this.#A&&this.#i?.(n,i,e),this.#T&&this.#y?.push([n,i,e])}}if(this.#c.clear(),this.#h.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.#g=0,this.#f.length=0,this.#l=0,this.#a=0,this.#T&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}}}function f(e){window.$monomerHover=e}var y=n(2003),b=n(6077),w=n(3561),v=n(9235);const A="MonomerHoverLinks";async function C(e,t,n,i,s,r=!1){const a=i.getSeqHandler(e),l=a.alphabet==y.YI.RNA||a.alphabet==y.YI.DNA,c=a.isHelm()&&l,u=!a.isHelm()&&l,h=e=>null==e?null:c?r?e:Math.floor(e/3):u&&r?3*e+1:e,d=r?await i.getHelmToMolfileConverter(n):null,p=new g({max:100});function m(e,t){const a=e.get(t);if(null==a)return null;let l=p.get(a);return l||p.set(a,l=function(e,t){const a=i.getSeqHandler(e);if(r){const e=a.getHelm(t);return i.helmToAtomicLevelSingle(e,d,!1,!1).monomers}{const e=a.getSplitted(t),i=a.defaultBiotype,r=o().count(0).take(e.length).map((t=>({position:t,symbol:e.getCanonical(t),biotype:i}))).toArray(),l=a.alphabet,c=l==y.YI.RNA||l==y.YI.DNA?"RNA":"PEPTIDE",u=(0,b.eM)([r],c,l,n,s);return(0,w.gU)(r,u,l,c).monomers}}(e,t)),l}const C={targetCol:t,handler:(t,i,o)=>{const s=o.grid,r=t.tableRowIndex,a=t.gridRow,l=s.cell(o.name,a),c=null!==(u=window.$monomerHover)&&void 0!==u?u:null;var u;if(!c||c&&(c.dataFrameId!=e.dataFrame.id||c.gridRowIdx!=a||c.seqColName!=e.name||c.seqPosition!=i?.position)){if(c&&(f(null),c.gridCell.render()),!i)return f(null),!0;f({gridCell:l,dataFrameId:e.dataFrame.id,gridRowIdx:a,seqColName:e.name,seqPosition:h(i?.position)??-1,getSubstruct:()=>{if(!i||"*"===i.symbol)return;const t=m(e,r);if(!t)return;const o=t.get(h(i?.position));return o?(0,v.H)([o],n):{atoms:[],bonds:[],highlightAtomColors:[],highlightBondColors:[]}}}),l.render()}return!0},getSubstruct:i=>{if("true"!=t.getTag(".sequence-src-highlight-monomers"))return;if(null==i)return;if(!e.get(i))return;const o=m(e,i);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,C),function(e,t){let n=e["substruct-providers"];n||(n=e["substruct-providers"]=[]),n.push(t),e["substruct-providers"]=n}(t.temp,C),C}function T(e,t){try{const n=e.tableColumn;if(!n)return;const i=function(e){return e.temp[A]??[]}(n);for(let n=i.length-1;n>=0;--n){const o=i[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:()=>p,pj:()=>u,uL:()=>h,uX:()=>c});var i=n(6082),o=n(4328),s=n(6295),r=n(3151),a=n(3077),l=n(439);function c(e){const t=[];for(let n=0;n<e.rowCount;n++){const i={};Object.keys(r.Ec).forEach((t=>{if("symbol"===t){const o=e.get(r.Ec[t],n);i[t]="."===o?e.get(r.yw,n):o}else if("rgroups"===t){const o=e.get(r.Ec[t],n).split("\n"),s=[];o.forEach((e=>{const t={},n=e.substring(e.lastIndexOf("]")+1),i=e.match(/\[R(\d+)\]/)[1];t.capGroupSmiles="H"===n?`[*:${i}][H]`:`O[*:${i}]`,t.alternateId="H"===n?`R${i}-H`:`R${i}-OH`,t.capGroupName="H"===n?"H":"OH",t.label=`R${i}`,s.push(t)})),i[t]=s}else r.Ec[t]&&(i[t]=e.get(r.Ec[t],n))})),i.author??(i.author=""),i.id??(i.id=0),i.smiles??(i.smiles=""),i.monomerType??(i.monomerType="Backbone"),i.createDate??(i.createDate=null),t.push(i)}return t}async function u(){const e=i.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 h(e,t,n){e instanceof i.Column&&(e=(0,a.R)(e,n).columns.toList());const s=(await u()).getMonomerLib(),r=new Array(e.length),c=e[0].length,h=new Float32Array(c);for(let n=0;n<e.length;++n){const a=n<t.length?t.getCanonical(n):l._S,u=s.getMonomer("PEPTIDE",a)?.smiles??"",d=e[n],p=d.getRawData(),m=d.categories,g=m.indexOf("");if(r[n]={categories:m,data:p,emptyIndex:g},void 0===a)continue;const f=i.Column.fromStrings("smiles",m.map((e=>s.getMonomer("PEPTIDE",e)?.smiles??""))),y=(i.DataFrame.fromColumns([f]),await o.chem.getSimilarities(f,u)),b=y?y.getRawData():null;for(let e=0;e<c;++e){const t=p[e];a!==l._S&&t!==g?h[e]+=b[t]:a===l._S&&t===g&&(h[e]+=1)}}for(let n=0;n<h.length;++n){let o=h[n]/t.length;for(let s=0;s<e.length;++s){const e=r[s];if(s>=t.length&&e.data[n]!==e.emptyIndex||e.data[n]===e.emptyIndex&&s<t.length){o=i.FLOAT_NULL;break}}h[n]=o}return i.Column.fromFloat32Array("Similarity",h)}async function d(e){const t=(await u()).getMonomerLib(),n=[],s={},r=e.map((e=>t.getMonomer("PEPTIDE",e)?.smiles??"")),a=i.Column.fromStrings("smiles",r);for(let t=0;t<r.length;++t){s[e[t]]=t;const i=r[t],l=""===i?new Array(r.length).fill(0):(await o.chem.getSimilarities(a,i)).getRawData();l[t]=1,n[t]=Array.from(l)}return{scoringMatrix:n,alphabetIndexes:s}}async function p(e,t="Morgan"){const n=(await u()).getMonomerLib(),o=new Array(e.length).fill(0).map((()=>new Array(e.length).fill(0))),r={},a=e.map((e=>n.getMonomer("PEPTIDE",e)?.molfile||n.getMonomer("PEPTIDE",e)?.smiles||"")),l=i.Func.find({package:"Chem",name:"getFingerprints"})[0];if(!l)return console.warn('Function "Chem:getFingerprints" is not found in chem package. falling back to Morgan fingerprints'),await d(e);const c=i.Column.fromStrings("smiles",a),h=(i.DataFrame.fromColumns([c]),(await l.apply({col:c,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 d(e);for(let t=0;t<h.length;++t)if(o[t][t]=1,r[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:r}}},6197:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var i=n(3599);function o(e){let t;switch(e){case i.o.BASE:case i.o.SUGAR:case i.o.LINKER:case i.o.NUCLEOTIDE:case"nucleotide":t="RNA";break;case i.o.AA:t="PEPTIDE";break;case i.o.CHEM:t="CHEM";break;case i.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:()=>c,R:()=>l});var i=n(6082),o=n(1991),s=n.n(o),r=n(330),a=n(3599);async function l(e,t,o,l,c,u,h){const d=e.length,p=e.dataFrame,m=Math.max(navigator.hardwareConcurrency-2,1),g=new Array(m).fill(null).map((()=>new Worker(new URL(n.p+n.u(455),n.b)))),f=d/m,y=new Array(m),b=u.getSeqHandler(e),w="RNA"==l?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=g[e],i=Math.floor(e*f),s=e===m-1?d:Math.floor((e+1)*f);y[e]=new Promise((e=>{n.onmessage=t=>{e(t.data)}})),n.postMessage({seqList:v,monomersDict:t,alphabet:o,polymerType:l,start:i,end:s})}const A=[],C=[];await Promise.all(y).then((e=>{for(const t of e)A.push(...t.molfiles),C.push(...t.warnings)})),setTimeout((()=>{g.forEach((e=>{e.terminate()}))}),0);const T=(0,r.qj)(p,e.name),S=i.Column.fromType(i.COLUMN_TYPE.STRING,T,e.length).init((e=>A[e]?.molfile));return S.semType=i.SEMTYPE.MOLECULE,S.meta.units=i.UNITS.Molecule.MOLBLOCK,S.setTag(".sequence-src-col",e.name),{molCol:S,warnings:C}}function c(e,t){const n={},o={};for(const s of e){const e=t.getWebEditorMonomer(s.biotype,s.symbol).backgroundcolor,a=(0,r.vG)(e??i.Color.toRgb(i.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:()=>l,YN:()=>g,gU:()=>c});var i=n(8123),o=n(294),s=n(3151),r=n(439),a=n(6197);function l(e,t,n){const o=new Map;for(const a of e.getMonomerSymbolsByType(t)){const l=e.getMonomer(t,a);if("RNA"===t&&("Branch"===l.monomerType||n===r.YI.DNA&&l.symbol===i.u.DEOXYRIBOSE.symbol||n===r.YI.RNA&&l.symbol===i.u.RIBOSE.symbol||l.symbol===i.u.PHOSPHATE.symbol)||"PEPTIDE"===t&&"Branch"!==l.monomerType){const e={};s.f6.forEach((t=>{e[t]=l[t]})),o.set(l.symbol,e)}}return o}function c(e,t,n,s){if(0===e.length)return o.vF.createEmpty();const l=m,{atomCount:c,bondCount:h,needsCapping:p}=l(e,t,n,s),f=new Array(c),y=new Array(h);let b,w=null,v=null;"PEPTIDE"===s?b=u:(b=d,w=n===r.YI.DNA?(0,o.xb)(t,i.u.DEOXYRIBOSE):(0,o.xb)(t,i.u.RIBOSE),v=(0,o.xb)(t,i.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},C={sugar:w,phosphate:v,seqLength:e.length,atomCount:c,bondCount:h},T=new o.Cg,S=[];let E,M=0;for(A.i=0;A.i<C.seqLength;++A.i){const n=e[A.i];if(n.symbol===r._S)continue;const i=(0,o.xb)(t,{symbol:n.symbol,polymerType:(0,a.Y)(n.biotype)});E=i.terminalR2Atom;const s=A.nodeShift,l=A.bondShift;b(i,f,y,A,C),i.stereoAtoms?.forEach((e=>S.push(e+M))),M+=i.atoms.x.length;const c=A.nodeShift-s,u=new Array(c);for(let e=0;e<c;++e)u[e]=s+e;const h=A.bondShift-l,d=new Array(h);for(let e=0;e<h;++e)d[e]=l+e;T.set(A.i,{biotype:n.biotype,symbol:n.symbol,atoms:u,bonds:d})}p&&function(e,t,n,o,s=i.u.OXYGEN){const r=n.nodeShift+1;e[o.atomCount]=i.u.V3K_BEGIN_DATA_LINE+r+" "+(s??i.u.OXYGEN)+" "+g(n.backbonePositionShift[0])+" "+n.flipFactor*g(n.backbonePositionShift[1])+" 0.000000 0\n";const a=n.backboneAttachNode,l=r;t[o.bondCount]=i.u.V3K_BEGIN_DATA_LINE+n.bondShift+" 1 "+a+" "+l+"\n"}(f,y,A,C,E??i.u.OXYGEN);const x=i.u.V3K_BEGIN_COUNTS_LINE+c+" "+h+i.u.V3K_COUNTS_LINE_ENDING;let L="";return L+=i.u.V3K_HEADER_FIRST_LINE,L+=i.u.V3K_HEADER_SECOND_LINE,L+=i.u.V3K_BEGIN_CTAB_BLOCK,L+=x,L+=i.u.V3K_BEGIN_ATOM_BLOCK,L+=f.join(""),L+=i.u.V3K_END_ATOM_BLOCK,L+=i.u.V3K_BEGIN_BOND_BLOCK,L+=y.join(""),L+=i.u.V3K_END_BOND_BLOCK,S.length>0&&(L+=function(e){const t=[];let n=`M V30 MDLV30/STEABS ATOMS=(${e.length}`;for(let i=0;i<e.length;i++){const o=`${n} ${e[i]}`;o.length>76?(t.push(`${n} -\n`),n=`M V30 ${e[i]}`):n=o,i===e.length-1&&t.push(`${n})\n`)}return`M V30 BEGIN COLLECTION\n${t.join("")}M V30 END COLLECTION\n`}(S)),L+=i.u.V3K_END_CTAB_BLOCK,L+=i.u.V3K_END,{molfile:L,monomers:T}}function u(e,t,n,i){i.flipFactor=(-1)**(i.i%2),h(e,t,n,i)}function h(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]=i.u.V3K_BEGIN_DATA_LINE+s+" "+e.atoms.atomTypes[o]+" "+g(n.backbonePositionShift[0]+e.atoms.x[o])+" "+g(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,r=e.meta.terminalNodes[0]+n.nodeShift;t[n.bondShift-1]=i.u.V3K_BEGIN_DATA_LINE+o+" 1 "+s+" "+r+"\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 d(e,t,n,o,s){if(0===o.i)h(s.sugar,t,n,o);else for(const e of[s.phosphate,s.sugar])h(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]=i.u.V3K_BEGIN_DATA_LINE+s+" "+e.atoms.atomTypes[o]+" "+g(n.branchPositionShift[0]+e.atoms.x[o])+" "+g(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,r=e.meta.terminalNodes[0]+n.nodeShift;t[o-1]=i.u.V3K_BEGIN_DATA_LINE+o+" 1 "+s+" "+r+"\n"}(e,n,o);const s=o.bondShift,r=o.branchAttachNode,a=e.meta.terminalNodes[0]+o.nodeShift;n[s-1]=i.u.V3K_BEGIN_DATA_LINE+s+" 1 "+r+" "+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,r=e.bonds.atomPairs[o][0]+n.nodeShift,a=e.bonds.atomPairs[o][1]+n.nodeShift;let l="";if(e.bonds.bondConfiguration.has(o)){let t=e.bonds.bondConfiguration.get(o);n.flipFactor<0&&(t=1===t?3:1),l=" CFG="+t}const c=e.bonds.kwargs.has(o)?" "+e.bonds.kwargs.get(o):"";t[n.bondShift+o]=i.u.V3K_BEGIN_DATA_LINE+s+" "+e.bonds.bondTypes[o]+" "+r+" "+a+l+c+"\n"}}function m(e,t,n,s){let l=0,c=0,u=0,h=!0,d=null;for(const n of e)if(n.symbol!==r._S){if("*"==n.symbol)throw new Error("Gap canonical symbol is '', not '*");d=(0,o.xb)(t,{symbol:n.symbol,polymerType:(0,a.Y)(n.biotype)}),l+=d.atoms.x.length,c+=d.bonds.bondTypes.length,u++}if("PEPTIDE"===s)l+=1,c+=u,u>0&&((d?.meta?.rNodes?.length??0)<2||d?.terminalR2Atom?.toLowerCase()===i.u.HYDROGEN.toLowerCase())&&(h=!1,l-=1,c-=1);else{const s=n===r.YI.DNA?(0,o.xb)(t,i.u.DEOXYRIBOSE):(0,o.xb)(t,i.u.RIBOSE),a=(0,o.xb)(t,i.u.PHOSPHATE);l+=(e.length-1)*a.atoms.x.length,l+=e.length*s.atoms.x.length,l+=1,c+=(e.length-1)*a.bonds.bondTypes.length,c+=e.length*s.bonds.bondTypes.length,c-=1,c+=3*e.length}return{atomCount:l,bondCount:c,needsCapping:h}}function g(e){return Math.round(i.u.PRECISION_FACTOR*e)/i.u.PRECISION_FACTOR}},6077:(e,t,n)=>{"use strict";n.d(t,{C4:()=>m,eM:()=>g});var i=n(4328),o=n(6082),s=n(1991),r=n.n(s),a=n(439),l=n(3561),c=n(9235),u=n(294),h=n(9192),d=n(330),p=n(8123);async function m(e,t,n,s,l){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,f;p.notation!==a.Hi.SEPARATOR&&(u=p.convert(a.Hi.SEPARATOR,"."),u.name=t.name);try{f=s.getSeqHandler(u).alphabet,m=(0,d.pz)(f)}catch(e){const[t,n]=(0,h.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 l=s.defaultBiotype;for(let e=0;e<n;++e){const t=s.getSplitted(e);a||(a=0===t.length),o[e]=r().count(0).take(t.length).filter((e=>!t.isGap(e))).map((e=>({position:e,biotype:l,symbol:t.getCanonical(e)}))).toArray()}return a&&i.shell.warning(`Some values in the "${e.name}" column are empty`),o}(u,s),b=g(y,m,f,n,l),w=u.length,v=await(0,c.R)(u,b,f,m,n,s,l);v.warnings.length>.05*w&&i.shell.warning(`Molfile conversion resulted in ${v.warnings.length} errors`);const A=o.Func.find({name:"convertToV3KViaOCL"})[0];if(A&&v.molCol)try{const e=v.molCol.toList(),t=await A.apply({mols:e});v.molCol.init((n=>t[n]?t[n]:e[n]))}catch(e){console.error(e)}return v}function g(e,t,n,i,o){const s=(0,l.Hb)(i,t,n),r={},c={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)f(r,n.symbol,s,o,t,c)}for(let n=0;n<e.length;++n){const i=e[n];for(const e of i){const n=e.symbol;if(""!==n)try{if("RNA"===t&&3===n.split(/\(|\)/).filter((e=>!!e)).length){const e=n.split(/\(|\)/)[1];f(r,e,s,o,t,c),r[t]?.[e]&&(r[t][n]=r[t][e])}else f(r,n,s,o,t,c)}catch(e){const t=e instanceof Error?e.message:e.toString(),i=e instanceof Error?e.stack:void 0;throw console.error(`bio lib: getMonomersDictFromLib() sym='${n}', error:\n${t}\n${i}`),new Error(`Can't get monomer '${n}' from library: ${t}`)}}}return r}function f(e,t,n,i,o,s){const r={polymerType:o,symbol:t};if(!(0,u.bq)(e,r)){const a=function(e,t,n,i,o){if(t.has(e)){const r=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}(r.rgroups),c=(s=r.molfile).includes("V3000")?function(e){const t=new Map,n=/M V30 (\d+) R#.+RGROUPS=\((\d+) (\d+)\).*/gm;let i;for(;null!==(i=n.exec(e));)i.index===n.lastIndex&&n.lastIndex++,t.set(parseInt(i[1]),parseInt(i[3]));return t}(s):function(e){const t=new Map;let n=e.indexOf(p.u.V2K_A_LINE,0),i=n;for(;-1!==n;){i=e.indexOf("\n",n);const o=parseInt(e.substring(n,i).replace(/^A\s+/,""));n=e.indexOf("R",i),i=e.indexOf("\n",n);const s=parseInt(e.substring(n,i).replace(/^R/,""));t.set(o,s),n=e.indexOf(p.u.V2K_A_LINE,i)}for(n=e.indexOf(p.u.V2K_RGP_LINE,0),i=e.indexOf("\n",n);-1!==n;){n+=p.u.V2K_RGP_SHIFT,i=e.indexOf("\n",n);const o=e.substring(n,i).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,i)}return t}(s),u=r.molfile.includes("V3000")?r.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 i=-1!==t?t:n,o=e.split("");for(let e=i+5;e<o.length;e++)" "!==o[e]&&(o[e]="0");return o.join("")})).join("\n")}(e)),i=n.get_v3Kmolblock();return n.delete(),i}(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)}(r.molfile),n),h=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 i=parseInt(e.substring(t,n));return t=n+1,n=e.indexOf(" ",t+1),{atomCount:i,bondCount:parseInt(e.substring(t,n))}}(u),d=function(e,t){const n=new Array(t),i=new Float32Array(t),o=new Float32Array(t),s=new Array(t);let r=e.indexOf(p.u.V3K_BEGIN_ATOM_BLOCK);r=e.indexOf("\n",r);let a=r;for(let l=0;l<t;l++){r=e.indexOf(p.u.V3K_BEGIN_DATA_LINE,r)+p.u.V3K_IDX_SHIFT,a=e.indexOf(" ",r),r=a+1,a=e.indexOf(" ",r),n[l]=e.substring(r,a);const t=new Array(2);for(let n=0;n<2;++n)r=a+1,a=e.indexOf(" ",r),t[n]=parseFloat(e.substring(r,a));i[l]=t[0],o[l]=t[1],r=a,a=e.indexOf("\n",r)+1,s[l]=e.slice(r,a),r=a}return{atomTypes:n,x:i,y:o,kwargs:s}}(u,h.atomCount),m=function(e,t){const n=new Uint32Array(t),i=new Array(t),o=new Map,s=new Map;let r=e.indexOf(p.u.V3K_BEGIN_BOND_BLOCK);r=e.indexOf("\n",r);let a=r;for(let l=0;l<t;++l){const t=new Array(3);r=e.indexOf(p.u.V3K_BEGIN_DATA_LINE,a)+p.u.V3K_IDX_SHIFT,a=e.indexOf(" ",r);for(let n=0;n<3;++n)r=a+1,a=Math.min(e.indexOf("\n",r),e.indexOf(" ",r)),t[n]=parseInt(e.slice(r,a));n[l]=t[0],i[l]=t.slice(1);const c=e.indexOf("\n",r);let u=e.slice(a,c),h=u.indexOf(p.u.V3K_BOND_CONFIG);if(-1!==h){h=u.indexOf("=",h)+1;let e=u.indexOf(" ",h);-1===e&&(e=u.length);const t=parseInt(u.slice(h,e));o.set(l,t);const n=p.u.V3K_BOND_CONFIG+t.toString();u=u.replace(n,"")}u||s.set(l,u)}return{bondTypes:n,atomPairs:i,bondConfiguration:o,kwargs:s}}(u,h.bondCount),g=function(e,t,n,i){const o={backboneShift:null,branchShift:null,terminalNodes:[],rNodes:[]};if(n&&i&&[1,2].some((e=>!Array.from(i.values()).find((t=>t==e))))){const o=[1,2].find((e=>!Array.from(i.values()).find((t=>t==e)))),s=[1,2].find((e=>Array.from(i.values()).find((t=>t==e)))),r=Array.from(i.keys()).find((e=>i.get(e)===s))-1,a=e.x[r],l=e.y[r],c=t.atomPairs.find((e=>e.includes(r+1))).find((e=>e!==r+1))-1;let u=e.x.reduce(((t,n,i)=>{if(i===r)return t;if(i===c)return t;const o=e.y[i];return Math.sqrt((n-a)**2+(o-l)**2)>Math.sqrt((e.x[t]-a)**2+(e.y[t]-l)**2)?i:t}),-1);if(-1===u&&(u=e.x.length,e.x=new Float32Array([...e.x,-a]),e.y=new Float32Array([...e.y,-l]),e.atomTypes=[...e.atomTypes,"H"],e.kwargs=[...e.kwargs,""],t.atomPairs.push([c+1,u+1]),t.bondTypes=new Uint32Array([...t.bondTypes,1]),t.kwargs.set(t.atomPairs.length-1,"")),i.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[i,o]of n)e.atomTypes[i-1]=t[o-1]}(e,n,i),function(e,t){t.rNodes=Array.from(e.keys());for(let n=0;n<t.rNodes.length;n++)for(const i of[1,2])if(e.get(t.rNodes[n])===i){const e=t.rNodes[i-1];t.rNodes[i-1]=t.rNodes[n],t.rNodes[n]=e}}(i,o),y(t,o),o}(d,m,a,c),f=function(e){let t=[],n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(");for(;-1!==n;){n+=28;const i=e.indexOf(")",n);t=t.concat(e.substring(n,i).split(" ").slice(1).map((e=>parseInt(e)))),n=i,n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(",n)}return t}(u),w={atoms:d,bonds:m,meta:g,stereoAtoms:f};return"PEPTIDE"===i?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,i=e.atoms.x,o=e.atoms.y;M(e,-i[t],-o[t]);const s=C(i[n],o[n]);T(e.atoms,-s),i[e.meta.rNodes[1]-1]<0&&S(e);const r=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 i=n[e],o=n[(e+1)%2];t.has(i)?t.get(i)?.push(o):t.set(i,new Array(1).fill(o))}return t}(e);let n=0;const i=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>i)return null}return n}(e);null!=r&&(function(e,t){e.atoms.y[e.meta.rNodes[1]-1]<0&&e.atoms.y[t-1]<0&&(function(e){E(e,!0)}(e),T(e.atoms,-function(e,t){return C(e,t)+Math.PI/2}(e.atoms.x[e.meta.terminalNodes[1]-1],e.atoms.y[e.meta.terminalNodes[1]-1])))}(e,r),function(e,t){const n=e.atoms.x;n[e.meta.rNodes[1]-1]>n[t-1]&&function(e,t,n){const i=t-1,o=n-1,s=e.atoms.x,r=e.atoms.y,a=s[i],l=r[i];s[i]=s[o],r[i]=r[o],s[o]=a,r[o]=l}(e,t,e.meta.rNodes[1])}(e,r))}(w):e===p.u.RIBOSE.symbol||e===p.u.DEOXYRIBOSE.symbol?function(e,t){const n=e.atoms.x,i=e.atoms.y;let o=e.meta.terminalNodes[0]-1;const s=e.meta.rNodes[1]-1;M(e,-n[o],-i[o]);const r=C(n[e.meta.rNodes[2]-1],i[e.meta.rNodes[2]-1]);T(e.atoms,-r),n[e.meta.rNodes[0]-1]>n[e.meta.rNodes[1]-1]&&S(e);const a=C(n[s],i[s]);T(e.atoms,3*Math.PI/2-a),t.value=function(e){const t=e.atoms.x,n=e.atoms.y,i=e.meta.rNodes[2]-1,o=e.meta.terminalNodes[2]-1,s=t[i]-t[o],r=n[i]-n[o];return Math.atan2(s,r)}(e),o=e.meta.terminalNodes[0]-1,M(e,-n[o],-i[o])}(w,o):e===p.u.PHOSPHATE.symbol?function(e){const t=e.meta.rNodes[1]-1,n=e.meta.rNodes[0]-1,i=e.atoms.x,o=e.atoms.y;M(e,-i[t],-o[t]);const s=C(i[n],o[n]);T(e.atoms,Math.PI/2-s)}(w):function(e,t){const n=e.atoms.x,i=e.atoms.y,o=e.meta.terminalNodes[0]-1,s=e.meta.rNodes[0]-1;M(e,-n[o],-i[o]);const r=C(n[s],i[s]),a=t.value;if(!a)throw new Error("The value of sugarBranchToOYAngle is null");T(e.atoms,Math.PI-r+a);const c=function(e,t){return(0,l.YN)(Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2))}({x:n[e.meta.rNodes[0]-1],y:i[e.meta.rNodes[0]-1]},{x:n[e.meta.terminalNodes[0]-1],y:i[e.meta.terminalNodes[0]-1]});if(1!=c)for(let e=0;e<n.length;++e)n[e]=(0,l.YN)(n[e]/c),i[e]=(0,l.YN)(i[e]/c)}(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],M(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]))}(i,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 i=e.atoms.kwargs[n];i&&i.includes(t)&&(e.atoms.kwargs[n]=i.replace(t,""))}}(w),w}var s;return null}(t,n,i,o,s);if(!a)throw new Error(`Monomer with symbol '${t}' is absent the monomer library`);(0,u.LQ)(e,r,a)}}function y(e,t){const n=t.rNodes;t.terminalNodes=new Array(n.length).fill(0);const i=t.terminalNodes,o=e.atomPairs;let s=0,r=0;for(;s<o.length&&r<i.length;){for(let e=0;e<i.length;++e)for(let t=0;t<2;++t)o[s][t]===n[e]&&(i[e]=o[s][(t+1)%2],n.length,++r);++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,l.YN)(e.atoms.x[t]-e.atoms.x[n]),(0,l.YN)(e.atoms.y[t]-e.atoms.y[n])]}function v(e,t){if(void 0!==t){const n=t-1,i=e.atoms,o=e.bonds,s=e.meta,r=i.atomTypes.splice(n,1)[0];i.x=A(Float32Array,i.x,n,1),i.y=A(Float32Array,i.y,n,1),i.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 l=Array.from(o.bondConfiguration.keys());return l.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)}})),l=Array.from(o.kwargs.keys()),l.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)}})),r?{removedAtom:r}:void 0}}function A(e,t,n,i){const o=new e(t.length-i);let s=0,r=0;for(;s<t.length;)s===n&&(s+=i),o[r]=t[s],++r,++s;return o}function C(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 i=t/e,o=Math.atan(i);n=e<0?Math.PI/2+o:-Math.PI/2+o}return n}function T(e,t){if(0!==t){const n=e.x,i=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,l.YN)(t*o-i[e]*s),i[e]=(0,l.YN)(t*s+i[e]*o)}}}function S(e){E(e,!1)}function E(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 i=1===t?3:1;n.set(e,i)}}function M(e,t,n){const i=e.atoms.x,o=e.atoms.y;for(let e=0;e<i.length;++e)i[e]=(0,l.YN)(i[e]+t),void 0!==n&&(o[e]=(0,l.YN)(o[e]+n))}},294:(e,t,n)=>{"use strict";function i(e,t){return e[t.polymerType]?.[t.symbol]}function o(e,t){return!!e[t.polymerType]?.[t.symbol]}function s(e,t,n){let i=e[t.polymerType];i||(i=e[t.polymerType]={}),i[t.symbol]=n}n.d(t,{Cg:()=>r,LQ:()=>s,bq:()=>o,vF:()=>a,xb:()=>i});class r extends Map{constructor(e){super(e)}}class a{constructor(e,t){this.molfile=e,this.monomers=t}static createEmpty(){return new a("",new r(null))}}},330:(e,t,n)=>{"use strict";n.d(t,{kA:()=>o,pz:()=>r,qj:()=>s,vG:()=>a});var i=n(2003);function o(e,t){return e?e.columns.getUnusedName(t):t}function s(e,t){return o(e,`molfile(${t})`)}function r(e){let t;if(e===i.YI.PT||e===i.YI.UN)t="PEPTIDE";else{if(e!==i.YI.RNA&&e!==i.YI.DNA)throw new Error(`Unexpected alphabet '${e}'.`);t="RNA"}return t}function a(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 i=n(7362);class o extends i.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:()=>i});class i{static makePalette(e,t=!1,n=i){const o={};return e.forEach((e=>{const n=e[0],i=e[1];n.forEach(((e,n)=>{o[e]=this.colourPalette[i][t?0:n]}))})),new n(o)}constructor(e){this._palette=e}get(e,t){return this._palette[e]}}i.undefinedColor="rgb(100,100,100)",i.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 i=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 i.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:()=>l,oT:()=>h});var i=n(6082),o=n(7362),s=n(6718);function r(e,t=!0){if(null==e)return"rgb(100,100,100)";const n=i.Color.fromHtml(e);if(t){const e=i.Color.g(n),t=i.Color.r(n),o=i.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 i.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 l{}class c extends l{get(e,t){return"#666666"}}class u extends l{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 i of n){const n=t.getMonomer(e,i);n?.meta?.colors?.default?.background&&(this.customMonomerColors[i]||(this.customMonomerColors[i]={}),this.customMonomerColors[i][e]=r(n.meta.colors.default.background))}}}))}))})),[].concat(...Object.values(o.e.colourPalette))}get(e,t){const n=u.palette.length,i=u.customMonomerColors[e],o=t??"PEPTIDE";if(i&&i[o])return i[o];const s=a.hashCode(e)%n;return r(u.palette[s])}}u._pallete=null,u.customMonomerColors={},u.polymerTypes=[];class h extends o.e{static get Gray(){return void 0===this.gray&&(this.gray=new c),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:()=>r,sD:()=>l});var i=n(4328),o=n(1858),s=n(8070);function r(e){let t=null,n=null;try{n=e.dart?e.gridColumn:null,t=n?n.temp:null}catch{[n,t]=[null,null]}const i=e.cell.column;if(t=t??(i?i.temp:null),!t)throw new Error("Grid cell renderer back store (GridColumn or Column) not found.");return[n,i,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 l 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=++l.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(i.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(i.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`)}}l.viewerCounter=-1},673:(e,t,n)=>{"use strict";n.d(t,{s:()=>i});const i={true:"1",false:"0"}},6882:(e,t,n)=>{"use strict";n.d(t,{Bb:()=>b,Jy:()=>w,S$:()=>y,U0:()=>v});var i=n(7389),o=n(6082),s=n(1991),r=n.n(s),a=n(8312),l=n(2003),c=n(6642),u=n(6718),h=n(9192),d=n(3856),p=n(673),m=n(3599),g=n(5553),f=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 i,o=100,s=0,r=e.length-1;for(;s<=r;){if(i=Math.floor((r+s)/2),e[i]<=t&&t<e[i+1])return i;if(t<e[i]?r=i-1:s=i+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 c.sD{get separatorWidth(){return this.props?.fontCharWidth?this.props?.fontCharWidth:5}constructor(e,t,n,i,s){if(super(e,t,n),this.monomerLengthLimit=i,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=[l.gp.positionShift,"renderMultiline"];this.subs.push(o.debounce(this.tableCol.dataFrame.onMetadataChanged.pipe(f.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(f.filter((e=>e.args.source===this.tableCol&&e.args.key===l.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,i,o,s){if(this.dirty)try{this.reset()}catch(e){const[t,n]=(0,h.AP)(e);this.logger.error(t,void 0,n)}const{lineHeight:r,monomerSpacing:a}=this.calculateFontBasedSpacing(e),l=t-2*this.padding;let c=0;const u=[];if(i.length>0)for(let t=o;t<i.length;t++){const n=i.getOriginal(t),o=this.props.monomerToShort(n,s);u.push({text:o,posIdx:t}),c=Math.max(c,e.measureText(o).width)}if(0===u.length)return{lineLayouts:[],lineHeight:r};const d=c;let p=Math.floor((l+a)/(d+a));p=Math.max(1,p);const m=n-2*this.padding,g=Math.max(0,Math.floor(m/r)),f=[];let y=0;for(let e=0;e<g&&y<u.length;e++){const t=[];for(let e=0;e<p&&y<u.length;e++){const n=u[y],i=this.padding+e*(d+a);t.push({posIdx:n.posIdx,x:i,width:d,om:n.text,isSeparator:!1}),y++}f.push({lineIdx:e,elements:t})}return{lineLayouts:f,lineHeight:r}}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,h.AP)(e);this.logger.error(t,void 0,n)}const i=n.isMsa()?this.getCellMonomerLengthsForSeqMsa():this.getCellMonomerLengthsForSeq(e);return[i,this.getSummedMonomerLengths(i)]}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),i=this.props.separatorWidth+1*this.props.fontCharWidth,o=this.positionShift,s=Math.ceil(t/i)+o,r=n.splitter(e),a=Math.min(s,r.length),l=new Array(a-o);let c=0;for(let e=o;e<a;++e){const i=r.getOriginal(e),s=this.props.monomerToShort(i,this.monomerLengthLimit),a=(n.isSeparator()?this.separatorWidth:this.props.separatorWidth)+s.length*this.props.fontCharWidth;if(l[e-o]=a,c+=a,c>t)break}return l}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),i=this.props.separatorWidth+1*this.props.fontCharWidth,o=Math.ceil(this.colWidth/i)+t,s=n.getSplitted(e),r=Math.min(o,s.length);let a=this._monomerLengthList[e];if(null===a||a.length!=r-t){a=this._monomerLengthList[e]=new Array(s.length);let i=0;for(let e=t;e<r;++e){const o=s.getOriginal(e),r=this.props.monomerToShort(o,this.monomerLengthLimit),l=(n.isSeparator()?this.separatorWidth:this.props.separatorWidth)+r.length*this.props.fontCharWidth;if(a[e-t]=l,i+=l,i>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:i}=(()=>{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,r=Math.ceil(this.colWidth/o)+s;for(let e=n;e<i;e++){if(this._processedRows.get(e)&&r<=this._processedMaxVisibleSeqLength)continue;const n=this.seqHelper.getSeqHandler(this.tableCol).getSplitted(e,r),i=Math.min(r,n.length);i-s>t.length&&t.push(...new Array(i-s-t.length).fill(o));let a=0;for(let e=s;e<i;++e){const i=n.getOriginal(e),o=this.props.monomerToShort(i,this.monomerLengthLimit),r=this.props.separatorWidth+o.length*this.props.fontCharWidth;if(t[e-s]=Math.max(t[e-s]??0,r),a+=r,a>=this.colWidth)break}this._processedMaxVisibleSeqLength=Math.max(this._processedMaxVisibleSeqLength,r),this._processedRows.set(e,!0)}return t}getPosition(e,t,n,i){const[o,s]=this.getCellMonomerLengths(e,n);return 0===this.seqHelper.getSeqHandler(this.tableCol).getSplitted(e).length?null:b(s,t,i)}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[l.gp.positionShift]??"0")??0;return isNaN(e)?0:Math.max(e,0)}render(e,t,n,i,s,a,c){const u=a.grid?.canvas===e.canvas;if(!this.seqHelper)return;const m=this.tableCol,g=this.positionShift;e.save();try{const c=this.seqHelper.getSeqHandler(m);let h=this.monomerLengthLimit;if(d.gp.maxMonomerLength in m.tags){const e=parseInt(m.getTag(d.gp.maxMonomerLength));h=!isNaN(e)&&e?e:50}if(m.temp[".mm.cellRenderer.settingsChanged"]===p.s.true||this.monomerLengthLimit!=h){let e=0;const t=8;e=m.temp[".mm.cellRenderer.gapLength"]??e,this.setMonomerLengthLimit(h),this.setSeparatorWidth(c.isMsa()?t:e),m.temp[".mm.cellRenderer.settingsChanged"]=p.s.false,this.dirty=!0}const f=a.cell.rowIndex,b=a.cell.value;u&&(i=v(a.grid,e,t,i,window.devicePixelRatio)),e.beginPath(),e.rect(t,n,i,s),e.clip(),e.font=this.props?.font??"12px monospace",e.textBaseline="top";const w=m.meta.units,A=m.getTag(l.gp.aligned),C=m.getTag(l.gp.separator)??"",T=u?c.getSplitted(f):c.splitter(b);let S=d.yg.classic;A?.includes("MSA")&&w===l.Hi.SEPARATOR&&(S=d.yg.MSA);const E=m.temp["reference-sequence"],M=this.tableCol.temp["current-word"],x=(()=>{const e=(0,c.splitter)(null!=E&&""!==E?E:M??"");return r().count(0).take(e.length).slice(g).map((t=>e.getCanonical(t))).toArray()})(),L=Number.parseInt(m.getTag(l.gp.selectedPosition)??"-200");if(this.shouldUseMultilineRendering(m)){const r=[],l=this.calculateMultiLineLayoutDynamic(e,i,s,T,g,h);let u=n+this.padding;1===l.lineLayouts.length&&(u=n+(s-l.lineHeight)/2);for(const i of l.lineLayouts){const s=u+i.lineIdx*l.lineHeight;for(const u of i.elements){const h=t+u.x,p=u,f=p.posIdx,b=T.getCanonical(f);let w=y;const v=this.getMonomerLib();v&&(w=v.getMonomerTextColor(c.defaultBiotype,b));let A=0;if(a.tableRowIndex!==m.dataFrame.currentRowIdx&&x.length>0){const e=f-g;e>=0&&e<x.length&&b===x[e]&&(A=.7)}r.push({lineIdx:i.lineIdx,monomerIdx:f-g,bounds:new o.Rect(u.x,s-n,u.width,l.lineHeight),sequencePosition:f}),(0,d.oZ)(e,p.om,h,s,u.width,l.lineHeight,{color:w,isMultiLineContext:!0,transparencyRate:A,selectedPosition:isNaN(L)||L<1?void 0:L,wordIdx:f})}}null!==a.tableRowIndex&&this._cellBounds.set(a.tableRowIndex,r)}else{this._leftThreeDotsPadding=this.shouldRenderShiftedThreeDots(g)?e.measureText("...").width:0;let[,o]=this.getCellMonomerLengths(a.tableRowIndex,i);u||(o=this.getSummedMonomerLengths(this.getCellMonomerLengthsForSeqValue(b,i)));const r=this.props.separatorWidth+1*this.props.fontCharWidth,l=Math.min(T.length,Math.ceil(i/r)+g);for(let r=g;r<l;++r){const l=r<T.length?T.getOriginal(r):c.defaultGapOriginal,u=r<T.length?T.getCanonical(r):c.defaultGapOriginal;let p=y;this.getMonomerLib()&&(p=this.getMonomerLib().getMonomerTextColor(c.defaultBiotype,u));const m={color:p,pivot:0,left:!0,transparencyRate:0,separator:C,last:r===T.length-1,drawStyle:S,maxWord:o,wordIdx:r-g,gridCell:a,referenceSequence:x,maxLengthOfMonomer:h,monomerTextSizeMap:this._monomerLengthMap,logger:this.logger,selectedPosition:isNaN(L)||L<1?void 0:L-g};(0,d.oZ)(e,l,t+this.padding+this._leftThreeDotsPadding,n,i,s,m)}if(this.shouldRenderShiftedThreeDots(g)){const r={color:y,pivot:0,left:!0,transparencyRate:0,separator:C,last:!1,drawStyle:S,maxWord:o,wordIdx:0,gridCell:a,maxLengthOfMonomer:h,monomerTextSizeMap:this._monomerLengthMap,logger:this.logger};(0,d.oZ)(e,"...",t+this.padding,n,i,s,r)}}}catch(e){const[t,n]=(0,h.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,r=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 c=null;const u=this._cellBounds.get(e.tableRowIndex);if(u){for(const e of u)if(e.bounds.contains(r,a)){c=e.monomerIdx;break}}else{const t=this.shouldRenderShiftedThreeDots(o)&&(this._leftThreeDotsPadding??0)>0?this._leftThreeDotsPadding:0;c=this.getPosition(e.tableRowIndex,r,s.width,t)}this.logger.debug(`${n}, argsX: ${r}, argsY: ${a}, left: ${c}`);const h=this.seqHelper.getSeqHandler(this.tableCol),d=h.getSplitted(e.tableRowIndex);if(null!==c&&c>=0&&c+o<d.length){const n=h.alphabet??l.YI.UN,s={position:c,biotype:n===l.YI.RNA||n===l.YI.DNA?m.o.NUCLEOTIDE:m.o.AA,symbol:d.getCanonical(c+o)},r=[];let a=this._monomerStructureMap[s.symbol];if(!a){const e=this.getMonomerLib();a=this._monomerStructureMap[s.symbol]=e?e.getTooltip(s.biotype,s.symbol):i.divText("Monomer library is not available")}r.push(a),i.tooltip.show(i.divV(r),t.x+16,t.y+16),(0,g.WN)(e,s)}else-1===c?i.tooltip.show(i.divText(`${Math.min(o,d.length)} hidden monomers`),t.x+16,t.y+16):i.tooltip.hide(),(0,g.WN)(e,null)}}function v(e,t,n,i,o){return e?Math.max(Math.min(e.canvas.width/o-n,i)):Math.max(t.canvas.width/o-n,0)}},3856:(e,t,n)=>{"use strict";n.d(t,{Mn:()=>u,gp:()=>c,oZ:()=>p,yg:()=>h});var i=n(6082),o=n(7278);const s="rgb(100,100,100)",r="#808080",a="rgb(0,0,0)",l=o.zS;var c,u,h;!function(e){e.maxMonomerLength=".mm.cellRenderer.maxMonomerLength"}(c||(c={})),function(e){e.applyToBackground=".m.cellRenderer.applyToBackground"}(u||(u={})),function(e){e.MSA="MSA",e.classic="classic"}(h||(h={}));const d=new class{constructor(){this.color=s,this.pivot=0,this.left=!1,this.transparencyRate=0,this.separator="",this.last=!1,this.drawStyle=h.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,c,u,p){var m,g,f;const y={...d,...p};if(y.isMultiLineContext){e.textBaseline="middle",e.textAlign="center";let i=t;null!=y.maxLengthOfMonomer&&(i=l(i,y.maxLengthOfMonomer));const r=Math.max(.1,1-(y.transparencyRate??0));e.globalAlpha=r;const h=e.measureText(i),d=h.fontBoundingBoxAscent+h.fontBoundingBoxDescent,p=o+(u-d)/2+h.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,c,u),e.restore(),e.fillStyle=m),e.fillText(i,n+c/2,p),e.globalAlpha=1,e.textBaseline="top",e.textAlign="start",n+c}p.logger?.debug("Bio: printLeftOrCentered(), start"),e.textAlign="start";let b=t.substring(0),w=y.last?"":y.separator;y.drawStyle===h.MSA&&(w="");let v=!0,A=!0,C="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,C=y.gridCell.cell.column.temp["highlight-difference"]??"difference"),y.referenceSequence){const e=y.referenceSequence[y.wordIdx];A&&y.referenceSequence.length>0&&"difference"===C&&(y.transparencyRate=b==e?.7:y.transparencyRate),A&&y.referenceSequence.length>0&&"equal"===C&&(y.transparencyRate=b!=e?.7:y.transparencyRate)}null!=y.maxLengthOfMonomer&&(b=l(b,y.maxLengthOfMonomer));const T=b+w;(m=y.monomerTextSizeMap)[T]??(m[T]=e.measureText(T));let S=y.monomerTextSizeMap[T];(g=y.monomerTextSizeMap)[b]??(g[b]=e.measureText(b));let E=y.monomerTextSizeMap[b].width;const M=u/2-(S.fontBoundingBoxAscent+S.fontBoundingBoxDescent)/2+1;(f=y.monomerTextSizeMap)[w]??(f[w]=e.measureText(w));const x=y.monomerTextSizeMap[w].width;function L(t,s){let l=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),l=i.Color.toHtml(i.Color.setAlpha(i.Color.fromHtml(l),255))),e.fillStyle=l,e.globalAlpha=1-y.transparencyRate,y.drawStyle===h.classic&&(e.fillText(b,n+t,o+M),e.fillStyle=r,e.fillText(w,n+s,o+M)),y.drawStyle===h.MSA&&e.fillText(b,n+t,o+M),e.globalAlpha=1}S=S.width,y.drawStyle===h.MSA&&(E=y.maxWord[y.wordIdx],S=y.maxWord[y.wordIdx]);const _=(y.maxWord[y.wordIdx]??0)-(y.maxWord[0]??0);if(y.left||S>c)return L(_,_+E),n+_+E+x;{const e=(c-S)/2;return L(e,e+E),n+_+e+E}}},6307:(e,t,n)=>{"use strict";n.d(t,{F:()=>r});var i=n(7389),o=n(6082),s=n(439);function r(e,t,n){let r=0,a=null;for(const t of Object.values(e))r+=t,a=null===a?t:Math.max(a,t);const l=a/r,c=Object.assign({},...Array.from(Object.entries(e)).sort(((e,t)=>t[1]-e[1])).map((([e,a])=>{const c=a/r;let u;try{const i=n.getMonomerColors(t,e);u=i?.backgroundcolor||"#CCCCCC"}catch(t){console.warn(`Failed to get colors for monomer ${e}:`,t),u="#CCCCCC"}const h=i.div("",{classes:"macromolecule-cell-comp-analysis-bar"});h.style.width=50*c/l+"px",h.style.backgroundColor=u,s._S===e&&(h.style.borderWidth="1px",h.style.borderStyle="solid",h.style.borderColor=o.Color.toHtml(o.Color.lightGray));const d=s._S===e?"-":e,p=i.div(`${(100*c).toFixed(2)}%`),m=i.div([h,p],{classes:"macromolecule-cell-comp-analysis-value"});return{[d]:m}}))),u=i.tableFromMap(c);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,{EK:()=>l,Ec:()=>s,f6:()=>i,pe:()=>r,q7:()=>a,yw:()=>o});const i=["symbol","molfile","rgroups","name"],o="MonomerName",s={monomerType:null,smiles:null,name:"Name",author:null,molfile:"molecule",naturalAnalog:"MonomerNaturalAnalogCode",rgroups:"MonomerCaps",createDate:null,id:null,polymerType:"MonomerType",symbol:"MonomerName"},r={monomerType:"Backbone",smiles:"",name:"",author:"Datagrok",molfile:"",naturalAnalog:"",rgroups:[],createDate:null,id:0,polymerType:"PEPTIDE",symbol:""},a="p",l=new RegExp(`[rd]\\((\\w)\\)${a}?`,"g")},9192:(e,t,n)=>{"use strict";function i(e){return"string"==typeof e||e instanceof String?e:"StateError"===e.constructor.name?e.message:"StateError"===e.constructor.name&&"$thrownJsError"in e?i(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[i(e),o(e)]}n.d(t,{AP:()=>s})},3516:(e,t,n)=>{"use strict";n.d(t,{m:()=>s});var i=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 i=this._fileContent.substring(t.index+1,e.lastIndex);this._descriptionsArray.push(i),0!==n&&this._sequencesArray.push(this.parseMacromolecule(n,t.index)),n=e.lastIndex+1}this._sequencesArray.push(this.parseMacromolecule(n,-1))}importFasta(){const e=i.Column.fromStrings("description",this.descriptionsArray),t=i.Column.fromStrings("sequence",this.sequencesArray);return t.semType=i.SEMTYPE.MACROMOLECULE,t.meta.units=o.Hi.FASTA,[i.DataFrame.fromColumns([e,t])]}constructor(e){this._descriptionsArray=[],this._sequencesArray=[],this._fileContent=e,this.parseColumns()}}},6873:(e,t,n)=>{"use strict";n.d(t,{Hx:()=>h,dW:()=>u,fD:()=>c});var i=n(6082),o=n(1991),s=n.n(o),r=n(2003),a=n(7278),l=n(439);function c(){const e=[];return e.push(i.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(i.Column.fromList(i.COLUMN_TYPE.FLOAT,"Activity",new Array(10**6).fill(5.30751))),e}function u(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=i.Column.fromList(i.COLUMN_TYPE.STRING,"MSA",new Array(100).fill(t));n.semType=i.SEMTYPE.MACROMOLECULE,n.meta.units=r.Hi.SEPARATOR,n.setTag(r.gp.separator,"/"),n.setTag(r.gp.alphabet,r.YI.UN),n.setTag(r.gp.alphabetIsMultichar,"true");const o=[];return o.push(n),o.push(i.Column.fromList(i.COLUMN_TYPE.FLOAT,"Activity",new Array(100).fill(7.30751))),o}function h(e,t=r.Hi.SEPARATOR,n=r.YI.PT,o=(t===r.Hi.SEPARATOR?"-":void 0),c=void 0,u="seq",h=100,d=10**6){const p=n===r.YI.UN?c?.getMonomerSymbolsByType("PEPTIDE")??[]:Array.from((0,r.Qf)(n)),m=p.length,g=i.Column.fromType(i.COLUMN_TYPE.STRING,u,h);g.semType=i.SEMTYPE.MACROMOLECULE,g.meta.units=t,g.setTag(r.gp.alphabet,n),t==r.Hi.SEPARATOR&&g.setTag(r.gp.separator,o);const f=e.getSeqHandler(g);for(let e=0;e<h;e++){const n=s().count(0).take(d).map((e=>p[Math.floor(Math.random()*m)])).toArray(),i=f.joiner(new a.Mu(n,l.b9[t]));g.set(e,i)}return g}},439:(e,t,n)=>{"use strict";n.d(t,{B5:()=>l,Hi:()=>i,Vl:()=>c,YI:()=>o,_S:()=>h,b9:()=>d,gp:()=>s,ot:()=>p,q7:()=>u,z1:()=>a});var i,o,s,r=n(2738);!function(e){e.FASTA="fasta",e.SEPARATOR="separator",e.HELM="helm",e.CUSTOM="custom"}(i||(i={})),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=", ",l=/(?:\[([A-Za-z0-9_\-,()]+)\])|([A-Za-z\-])/g,c=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 r.a(o.PT,c.fasta.peptide,.5),new r.a(o.DNA,c.fasta.dna,.55),new r.a(o.RNA,c.fasta.rna,.55)],h="",d={[i.FASTA]:"-",[i.SEPARATOR]:"",[i.HELM]:"*"},p=" , "},2003:(e,t,n)=>{"use strict";n.d(t,{Hi:()=>i.Hi,J9:()=>o.J9,Qf:()=>o.Qf,SM:()=>o.SM,YI:()=>i.YI,dh:()=>o.dh,gp:()=>i.gp,mn:()=>o.mn,nq:()=>o.nq,q7:()=>i.q7,qp:()=>o.qp,z1:()=>i.z1,zS:()=>o.zS});var i=n(439),o=n(7278)},2738:(e,t,n)=>{"use strict";n.d(t,{X:()=>o,a:()=>i});class i{constructor(e,t,n){this.name=e,this.alphabet=t,this.cutoff=n}}class o extends i{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:()=>A,J9:()=>y,Mu:()=>m,Qf:()=>S,SM:()=>L,dh:()=>w,mn:()=>_,nq:()=>E,p0:()=>x,pc:()=>M,qp:()=>v,tm:()=>b,vZ:()=>f,zS:()=>T});var i=n(6082),o=n(1991),s=n.n(o),r=n(3527),a=n(3629),l=n(2738),c=n(439),u=n(8924),h=n(1093),d=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:c._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),i=Math.max(Math.min(this.length,t),0)-n,o=this.gapOriginalMonomer;return new Array(i).fill(null).map(((e,t)=>{const i=this.mList[t+n];return i===o?c._S:i}))}getOriginalRegion(e,t){const n=Math.min(Math.max(0,e),this.length),i=Math.max(Math.min(this.length,t),0);return new Array(i-n).fill(null).map(((e,t)=>this.mList[t+n]))}get gapOriginal(){return this.gapOriginalMonomer}constructor(e,t){this.mList=e,this.gapOriginalMonomer=t}}class g{get length(){return this.seqS.length}isGap(e){return this.getOriginal(e)===c.b9[c.Hi.FASTA]}getCanonical(e){if(this.length<=e)throw new Error("Index out of bounds");return this.isGap(e)?c._S:this.seqS[e]}getOriginal(e){if(this.length<=e)throw new Error("Index out of bounds");return this.seqS[e]}getCanonicalRegion(e,t){const n=Math.max(0,e),i=Math.min(this.length,t)-n,o=c.b9[c.Hi.FASTA];return new Array(i).fill(null).map(((e,t)=>{const i=this.seqS[t+n];return i===o?c._S:i}))}getOriginalRegion(e,t){const n=Math.max(0,e),i=Math.min(this.length,t);return this.seqS.slice(n,i)}get gapOriginal(){return c.b9[c.Hi.FASTA]}constructor(e){this.seqS=e}}function f(e,t,n){const i=e.categories;return function(e,t){const n={};let i=!0,o=null;for(const s of e)if(null==o?o=s.length:s.length!==o&&(i=!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:i}}(s().enumerate(e.getRawData()).map((([e,t])=>n(i[e]))),t)}const y=e=>{const t=s()(e.toString().matchAll(c.B5)).map((e=>e[2]??e[1])).toArray();return new m(t,c.b9[c.Hi.FASTA])},b=e=>e?new g(e):new m([],c.b9[c.Hi.FASTA]);function w(e,t=void 0){return n=>{if(n){let i;const o=new RegExp(`(?<=^|\\${e})("-"|'-'|[^\\${e}]*)(?=\\${e}|$)`,"g");return void 0!==t?(o.lastIndex=0,i=s()(n.matchAll(o)).take(t).map((e=>e[0])).toArray()):i=n.replaceAll('"-"',"").replaceAll("'-'","").split(e,t),new m(i,c.b9[c.Hi.SEPARATOR])}return new m([],c.b9[c.Hi.SEPARATOR])}}const v=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,c.b9[c.Hi.HELM])};function A(e,t,n=void 0){if(e.toLowerCase().startsWith(c.Hi.FASTA))return y;if(e.toLowerCase().startsWith(c.Hi.SEPARATOR))return w(t,n);if(e.toLowerCase().startsWith(c.Hi.HELM))return v;throw new Error(`Unexpected units ${e} .`)}const C=/([^\W_]+)/g;function T(e,t){if(e.length<=t)return e;const n=e.match(C),i=e.length>t||(n?.length??0)>1,o=n?.[0]??" ";return i?o.substring(0,t-1)+"…":o}function S(e){switch(e){case c.YI.DNA:return c.Vl.fasta.dna;case c.YI.RNA:return c.Vl.fasta.rna;case c.YI.PT:return c.Vl.fasta.peptide;default:throw new Error(`Unsupported alphabet '${e}'.`)}}function E(e,t,n="-"){const i=new Set([...new Set(Object.keys(e)),...t]);i.delete(n);const o=[],s=[];for(const n of i)o.push(n in e?e[n]:0),s.push(t.has(n)?1:0);const l=new r.Mi(o),c=new r.Mi(s);return(0,a.KE)(l,c)/((0,a.wQ)(l)*(0,a.wQ)(c))}function M(e,t,n="-"){const i=t.map((t=>{const i=E(e,t.alphabet,n);return new l.X(t,e,i)}));let o;const s=Math.max(...i.map((e=>e.similarity>e.cutoff?e.similarity:-1)));return o=s>0?i.find((e=>e.similarity===s)).name:c.YI.UN,o}function x(e,t,n="-"){const i=Object.keys(e),o=/\(|\)/;return M(i.filter((e=>3===e.split(o).filter((e=>!!e)).length)).length>.8*i.length?Object.entries(e).reduce(((e,[t,n])=>{const i=t.split(o)[1];return i&&(e[i]=n),e}),{}):e,t,n)}function L(e,t,n=5){let o;return o=e.semType==i.SEMTYPE.MACROMOLECULE?t.getSeqHandler(e).alphabet:M(f(e,n,y).freq,c.q7),function(e){switch(e){case c.YI.PT:return u.X.GrokGroups;case c.YI.DNA:case c.YI.RNA:return h.A.Chromatogram;default:return d.oT.Color}}(o)}function _(e){const t=e.columns.bySemTypeAll(i.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 i=n(6082);async function o(){const e=i.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.d(t,{R:()=>o});var i=n(6082);function o(e,t){const n=e=>{const t=r.columns.addNewString((e+1).toString());return o.push(t),t},o=[],s=e.length,r=i.DataFrame.create(s),a=t.getSeqHandler(e);for(let e=0;e<s;++e){const t=a.getSplitted(e);for(let i=0;i<t.length;++i){const s=t.getCanonical(i);((o[i]??null)||n(i)).set(e,s,!1)}}return r}},7602:(e,t,n)=>{"use strict";n.d(t,{g:()=>s});var i,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"}(i||(i={}));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[i,s]=(0,o.AP)(t);this.logger.error(`${e}, SYNC syncId = ${n}, ERROR:\n${i}`,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:()=>r,fH:()=>o,gp:()=>i,lT:()=>l,mH:()=>a});var i,o,s,r,a,l,c=n(6082);!function(e){e.tooltipWebLogo=".tooltipWebLogo"}(i||(i={})),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"}(r||(r={})),function(e){e.AUTO="auto",e.ON="on",e.OFF="off"}(a||(a={})),function(e){e.Filtered="Filtered",e.Selected="Selected"}(l||(l={}));const u=new class{constructor(){this.sequenceColumnName=null,this.valueAggrType=c.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=r.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=l.Filtered}}},6869:(e,t,n)=>{"use strict";var i;n.d(t,{o:()=>i}),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"}(i||(i={}))},5540:(e,t,n)=>{"use strict";e=n.hmd(e);var i,o=(i="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,i){t=e,n=i}));var s,r=Object.assign({},o),a="object"==typeof window,l="function"==typeof importScripts,c=("object"==typeof process&&"object"==typeof process.versions&&process.versions.node,"");(a||l)&&(l?c=self.location.href:"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),i&&(c=i),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"",l&&(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,h,d=o.printErr||console.warn.bind(console);Object.assign(o,r),r=null,o.arguments&&o.arguments,o.thisProgram&&o.thisProgram,o.quit&&o.quit,o.wasmBinary&&(u=o.wasmBinary),o.noExitRuntime,"object"!=typeof WebAssembly&&M("no native wasm support detected");var p,m,g,f=!1;function y(){var e=h.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=g=new Uint32Array(e),o.HEAPF32=new Float32Array(e),o.HEAPF64=new Float64Array(e)}var b,w,v=[],A=[],C=[],T=0,S=null,E=null;function M(e){o.onAbort&&o.onAbort(e),d(e="Aborted("+e+")"),f=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}function x(e){return e.startsWith("data:application/octet-stream;base64,")}function L(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){M(e)}}function _(e,t,n){return function(e){return u||!a&&!l||"function"!=typeof fetch?Promise.resolve().then((function(){return L(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 L(e)}))}(e).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(n,(function(e){d("failed to asynchronously prepare wasm: "+e),M(e)}))}function I(e){for(;e.length>0;)e.shift()(o)}function P(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){g[this.ptr+4>>2]=e},this.get_type=function(){return g[this.ptr+4>>2]},this.set_destructor=function(e){g[this.ptr+8>>2]=e},this.get_destructor=function(){return g[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){g[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return g[this.ptr+16>>2]},this.get_exception_ptr=function(){if(B(this.get_type()))return g[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function N(e){var t=h.buffer;try{return h.grow(e-t.byteLength+65535>>>16),y(),1}catch(e){}}function R(e){return o["_"+e]}x(b="wasmDbscan.wasm")||(w=b,b=o.locateFile?o.locateFile(w,c):c+w);var $="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(e,t,n,i,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 i=e.charCodeAt(n);i<=127?t++:i<=2047?t+=2:i>=55296&&i<=57343?(t+=4,++n):t+=3}return t}(e)+1,n=G(t);return function(e,t,n){!function(e,t,n,i){if(!(i>0))return 0;for(var o=n+i-1,s=0;s<e.length;++s){var r=e.charCodeAt(s);if(r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++s)),r<=127){if(n>=o)break;t[n++]=r}else if(r<=2047){if(n+1>=o)break;t[n++]=192|r>>6,t[n++]=128|63&r}else if(r<=65535){if(n+2>=o)break;t[n++]=224|r>>12,t[n++]=128|r>>6&63,t[n++]=128|63&r}else{if(n+3>=o)break;t[n++]=240|r>>18,t[n++]=128|r>>12&63,t[n++]=128|r>>6&63,t[n++]=128|63&r}}t[n]=0}(e,m,t,n)}(e,n,t),n}(e)),t},array:e=>{var t,n,i=G(e.length);return t=e,n=i,p.set(t,n),i}},r=R(e),a=[],l=0;if(i)for(var c=0;c<i.length;c++){var u=s[n[c]];u?(0===l&&(l=F()),a[c]=u(i[c])):a[c]=i[c]}var h=r.apply(null,a);return function(e){return 0!==l&&D(l),function(e){return"string"===t?(n=e)?function(e,t,n){for(var i=t+n,o=t;e[o]&&!(o>=i);)++o;if(o-t>16&&e.buffer&&$)return $.decode(e.subarray(t,o));for(var s="";t<o;){var r=e[t++];if(128&r){var a=63&e[t++];if(192!=(224&r)){var l=63&e[t++];if((r=224==(240&r)?(15&r)<<12|a<<6|l:(7&r)<<18|a<<12|l<<6|63&e[t++])<65536)s+=String.fromCharCode(r);else{var c=r-65536;s+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else s+=String.fromCharCode((31&r)<<6|a)}else s+=String.fromCharCode(r)}return s}(m,n,i):"":"boolean"===t?Boolean(e):e;var n,i}(e)}(h)}var H,k={__cxa_throw:function(e,t,n){throw new P(e).init(t,n),e},abort:function(){M("")},emscripten_memcpy_big:function(e,t,n){m.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=m.length,i=2147483648;if((e>>>=0)>i)return!1;for(var o=1;o<=4;o*=2){var s=n*(1+.2/o);if(s=Math.min(s,e+100663296),N(Math.min(i,(t=Math.max(e,s))+(65536-t%65536)%65536)))return!0}return!1}},F=(function(){var e,t,i,s,r={env:k,wasi_snapshot_preview1:k};function a(e,t){var n,i=e.exports;return o.asm=i,h=o.asm.memory,y(),o.asm.__indirect_function_table,n=o.asm.__wasm_call_ctors,A.unshift(n),function(){if(T--,o.monitorRunDependencies&&o.monitorRunDependencies(T),0==T&&(null!==S&&(clearInterval(S),S=null),E)){var e=E;E=null,e()}}(),i}if(T++,o.monitorRunDependencies&&o.monitorRunDependencies(T),o.instantiateWasm)try{return o.instantiateWasm(r,a)}catch(e){d("Module.instantiateWasm callback failed with error: "+e),n(e)}(e=u,t=b,i=r,s=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||x(t)||"function"!=typeof fetch?_(t,i,s):fetch(t,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,i).then(s,(function(e){return d("wasm streaming compile failed: "+e),d("falling back to ArrayBuffer instantiation"),_(t,i,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(F=o.asm.stackSave).apply(null,arguments)}),D=function(){return(D=o.asm.stackRestore).apply(null,arguments)},G=function(){return(G=o.asm.stackAlloc).apply(null,arguments)},B=function(){return(B=o.asm.__cxa_is_pointer_type).apply(null,arguments)};function V(){function e(){H||(H=!0,o.calledRun=!0,f||(I(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(),C.unshift(e);var e;I(C)}()))}T>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;I(v)}(),T>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,i){var o=!n||n.every((e=>"number"===e||"boolean"===e));return"string"!==t&&o&&!i?R(e):function(){return O(e,t,n,arguments)}},E=function e(){H||V(),H||(E=e)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return V(),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:()=>r,Hf:()=>u,Hr:()=>E,Ii:()=>f,Qj:()=>m,T6:()=>S,TK:()=>C,be:()=>g,gt:()=>w,ij:()=>v,jL:()=>c,lO:()=>p,lP:()=>b,rR:()=>y,tO:()=>a,v_:()=>l,w_:()=>h,yK:()=>A,zn:()=>d});var i=n(8774),o=n(8498),s=n(6863);function r(e,t){const n=e.trueCount()+t.trueCount();if(0==n)return 1;const i=e.andWithCountBits(t,!0);return i/(n-i)}function a(e,t){return 1-r(e,t)}function l(e,t){return T(r(new i.A(e,32*e.length),new i.A(t,32*t.length)))}function c(e,t){let n=0;for(let i=0;i<e.length;i++)n+=Math.pow(e[i]-t[i],2);return Math.sqrt(n)}function u(e,t){let n=0;for(let i=0;i<e.length;i++)n+=Math.abs(e[i]-t[i]);return n}function h(e,t){let n=0,i=0,o=0;for(let s=0;s<e.length;s++)n+=e[s]*t[s],i+=e[s]*e[s],o+=t[s]*t[s];return(1-n/(Math.sqrt(i)*Math.sqrt(o)))/2}function d(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 g(e,t){return e.trueCount()+t.trueCount()-2*e.andWithCountBits(t,!0)}function f(e,t){return 1-function(e,t){const n=e.trueCount()+t.trueCount(),i=e.andWithCountBits(t,!0);return i/(2*n-3*i)}(e,t)}function y(e,t){return T(function(e,t){const n=e.trueCount()+t.trueCount(),i=e.trueCount()*t.trueCount();return 0==i?0:e.andWithCountBits(t,!0)*n/(2*i)}(e,t))}function b(e,t){return T(function(e,t){const n=e.trueCount()+t.trueCount(),i=e.trueCount()*t.trueCount();return 0==i?0:(e.andWithCountBits(t,!0)*n-i)/i}(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 T(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 T(function(e,t){return 0==e.length?0:e.andWithCountBits(t,!0)/e.length}(e,t))}function C(e,t){return T(function(e,t){const n=e.andWithCountBits(t,!0),i=e.countBits(!0)+t.countBits(!0),o=e.length,s=o-i+n;return n==o||s==o?1:n/i+s/(2*o-i)}(e,t))}function T(e){return e<=0?3402823e32:1/e-1}function S(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 E(e){const t=function(e){const t=e?.mostCommon??new Set;return(e,n)=>{const i=e.length,o=n.length;let s=0,r=0,a=0;for(;r<i&&a<o;)e[r]===n[a]?(t?.has(e[r])||++s,++r,++a):e[r]<n[a]?++r:++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:()=>i,Gi:()=>a,YP:()=>c,_X:()=>r,n3:()=>o,vb:()=>l});const i="dim-red-preprocessing-function",o="supportedSemTypes",s="supportedTypes",r="supportedUnits",a="supportedDistanceFunctions",l="bypassLargeDataWarning",c="show-scatterplot-progress"},6863:(e,t,n)=>{"use strict";function i(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,i=Math.min(...Object.keys(t).map((e=>e.charCodeAt(0))))+1,o=new Float32Array((n.length+i)*(n.length+i));return Object.entries(t).forEach((([e,i])=>{const s=n[i];Object.entries(t).forEach((([t,i])=>{o[e.charCodeAt(0)*n.length+t.charCodeAt(0)]=s[i]}))})),(e,t)=>1-o[e.charCodeAt(0)*n.length+t.charCodeAt(0)]}(),n=e?.threshold??0;return(e,i)=>{let o=0;const s=e.length,r=i.length,a=Math.ceil(Math.max(s,r)*(1-n));s!==r&&(o=Math.abs(s-r));let l=0;for(let n=0;n<Math.min(s,r);n++)if(e[n]!==i[n]&&(l+=t(e[n],i[n]),l>a))return 1;return l+=o,l/=Math.max(s,r),l}}n.d(t,{Z:()=>r,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 r;!function(e){e.HAMMING="Hamming",e.LEVENSHTEIN="Levenshtein",e.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",e.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(r||(r={}));const a={[r.HAMMING]:i,[r.LEVENSHTEIN]:function(){return(e,t)=>(0,o.I)(e,t)/Math.max(e.length,t.length)},[r.NEEDLEMANN_WUNSCH]:function(e){const t=new Uint16Array(65536),{gapOpen:n,gapExtend:i,scoringMatrix:o,alphabetIndexes:r}={...s,...e};Object.entries(r).forEach((([e,n])=>t[e.charCodeAt(0)]=n));const a=[new Float32Array(1e4),new Float32Array(1e4)];return(e,s)=>{const r=new Array(e.length+1).fill(!1),l=new Array(e.length+1).fill(!1);let c=0,u=1;for(let t=1;t<e.length+1;t++)a[0][t]=-i-(t-1)*i,a[1][t]=0;a[0][0]=0;for(let h=1;h<s.length+1;h++){a[u][0]=-i-(h-1)*i;for(let d=1;d<e.length+1;d++){const p=a[c][d-1]+o[t[e.charCodeAt(d-1)]][t[s.charCodeAt(h-1)]],m=a[c][d]-(r[d]||1===h||h===s.length?i:n),g=a[u][d-1]-(l[d-1]||1===d||d===e.length?i:n);a[u][d]=Math.max(p,g,m),a[u][d]===p?(r[d]=!1,l[d]=!1):a[u][d]===g?(r[d]=!1,l[d]=!0):(r[d]=!0,l[d]=!1)}c=u,u=(u+1)%2}const h=Math.min(e.length,s.length);return(h-a[c][e.length])/h}},[r.MONOMER_CHEMICAL_DISTANCE]:i}},9039:(e,t,n)=>{"use strict";var i;n.d(t,{c:()=>i}),function(e){e.UMAP="UMAP",e.T_SNE="t-SNE"}(i||(i={}))},8498:(e,t,n)=>{"use strict";var i,o,s,r,a,l,c;n.d(t,{EG:()=>a,Pn:()=>o,RR:()=>l,Wn:()=>c,aT:()=>s,m6:()=>r,xL:()=>i}),function(e){e.Levenshtein="Levenshtein",e.JaroWinkler="Jaro-Winkler",e.Manhattan="Manhattan String",e.Onehot="One-Hot"}(i||(i={})),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"}(r||(r={})),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"}(l||(l={})),function(e){e.CommonItems="Common Items"}(c||(c={}))},2780:(e,t,n)=>{"use strict";n.d(t,{aT:()=>i.aT});var i=n(8498);n(9336)},9336:(e,t,n)=>{"use strict";var i=n(2787),o=n(944),s=n(6295),r=n(6863),a=n(8498);const l={[a.Pn.Euclidean]:s.jL,[a.Pn.Manhattan]:s.Hf,[a.Pn.Cosine]:s.w_},c={[a.xL.Levenshtein]:i.I,[a.xL.JaroWinkler]:o.Vb,[a.xL.Manhattan]:function(e,t){if(e.length!==t.length)return 1;{let n=0;for(let i=1;i<e.length;i++)n+=e[i]==t[i]?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},h={[a.m6.TanimotoIntArray]:s.v_},d={[a.RR.Difference]:s.T6},p={[a.Wn.CommonItems]:s.Hr},m={[a.EG.Vector]:{[a.Pn.Euclidean]:l[a.Pn.Euclidean],[a.Pn.Manhattan]:l[a.Pn.Manhattan],[a.Pn.Cosine]:l[a.Pn.Cosine]},[a.EG.String]:{[a.xL.Levenshtein]:c[a.xL.Levenshtein],[a.xL.JaroWinkler]:c[a.xL.JaroWinkler],[a.xL.Manhattan]:c[a.xL.Manhattan],[a.xL.Onehot]:c[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]:{[r.Z.HAMMING]:r.V[r.Z.HAMMING],[r.Z.LEVENSHTEIN]:r.V[r.Z.LEVENSHTEIN],[r.Z.NEEDLEMANN_WUNSCH]:r.V[r.Z.NEEDLEMANN_WUNSCH],[r.Z.MONOMER_CHEMICAL_DISTANCE]:r.V[r.Z.MONOMER_CHEMICAL_DISTANCE]},[a.EG.Number]:{[a.RR.Difference]:d[a.RR.Difference]},[a.EG.IntArray]:{[a.m6.TanimotoIntArray]:h[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:()=>i});class i{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=i._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,i){if(e<t||e>n)throw new Error(`Argument ${i} (${e}) out of range (${t}, ${n})`)}copy(e,t,n){for(let i=0;i<n;i++)t[i]=e[i]}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 i(e._length);n._length=e._length,n._data=i._createBuffer(n._length),n._version=0;const o=e.lengthInInts;for(let i=0;i<o;i++)n._data[i]=e._data[i]&t._data[i];return n}static _createBuffer(e){return new Uint32Array(Math.floor((e+31)/32))}static fromValues(e){const t=new i(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 i(e);for(let i=0;i<e;++i)n.setBit(i,t(i));return n._version=0,n}static fromString(e){return i.fromSeq(e.length,(t=>"1"==e.charAt(t)))}static fromUint32Array(e,t){const n=new i(e);return n._data=t,n}static fromBytes(e){const t=e.length,n=new i(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 i(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,i=this.lengthInInts;for(let e=0;e<i;e++)this._data[e]=n;this.incrementVersion(t)}setIndexes(e,t=!0,n=!0,i=!0){n&&this.setAll(!t,!1);for(const n of e)this.setFast(n,t);this.incrementVersion(i)}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,i=!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(i)}getRange(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let i=e;i<t;++i)n.push(this.getBit(i));return i.fromValues(n)}getRangeAsList(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let i=e;i<t;++i)n.push(this.getBit(i));return n}setRange(e,t,n,i=!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(i),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 i=this._length;this.setLength(this._length+t);for(let n=i-1;n>=e;n--)this.setBit(n+t,this.getBit(n));for(let i=e;i<e+t;i++)this.setBit(i,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 i=-1;-1!=(i=e.findNext(i,!t));)this.setFast(n++,this.getBit(i));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+=i._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+=i._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+=i._onBitCount[255&t];let r=this._data[s]&e._data[s];const a=31&this._length;for(0!=a&&(r&=~(4294967295<<a));0!=r;r>>>=8)n+=i._onBitCount[255&r];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=i._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=i._lastOnBit[e>>>24];if(n>=0)return n+32*o+t}}return-1}}i._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]),i._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]),i._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:()=>F,bk:()=>j,gM:()=>k,L1:()=>H,cb:()=>Y,E3:()=>N,J6:()=>O,Wj:()=>R,Xk:()=>$,Xb:()=>G,N$:()=>B,t6:()=>P,PE:()=>_,rd:()=>I,Bl:()=>Z,CN:()=>w});var i=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 r=function(e,t,n,i){return new(n||(n=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}l((i=i.apply(e,t||[])).next())}))};function a(e,t,n,o,s,a,l,c,u=!0){return r(this,void 0,void 0,(function*(){let h=null;if(yield I(o,(n=>r(this,void 0,void 0,(function*(){let n=null;for(const i of e.viewers)i.type===t&&(n=i);if(!n)throw Error("Viewer hasn't been added");if(yield Promise.resolve(),a&&(yield a(n)),s){const t=null!=c?c:{};t.tv=e,t.viewer=n,h=yield s(t,u)}yield _(i.events.onViewerClosed,(()=>{N(n.subs.some((e=>!e.closed)),!1)}),(()=>n.close()),3e3)}))),(()=>r(this,void 0,void 0,(function*(){l?e.loadLayout(l):yield function(e,t,n){return r(this,void 0,void 0,(function*(){let i;return n?(i=yield e.dataFrame.plot.fromType(t),e.dockManager.dock(i)):i=e.addViewer(t),i}))}(e,t,n)}))),6e4,"TEST_EVENT_ASYNC"),h)return h}))}function l(e,t=!0){return r(this,void 0,void 0,(function*(){const n=e.tv.dataFrame,i=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 Y(50));for(let e=o;e<2*o;e++)n.filter.set(e,!1);t&&(yield Y(50)),n.currentRowIdx=1,n.columns.names().slice(0,Math.ceil(n.columns.length/2)).forEach((e=>n.columns.remove(e))),t&&(yield Y(100)),e.tv.dataFrame=i,yield Y(50)}))}function c(e,t=!0){return r(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 r(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 i={};return Object.keys(t).filter((e=>"boolean"==typeof t[e])).forEach((e=>i[e]=!t[e])),n.filter((e=>null!==e.choices)).forEach((e=>i[e.name]=e.choices.find((n=>n!==t[e.name])))),e.viewer.setOptions(i),yield Y(300),{layout:e.tv.saveLayout(),savedProps:e.viewer.getOptions().look}}))}function h(e,t=!0){return r(this,void 0,void 0,(function*(){N(JSON.stringify(e.viewer.getOptions().look),JSON.stringify(e.savedProps))}))}var d=function(e,t,n,i){return new(n||(n=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}l((i=i.apply(e,t||[])).next())}))};const p=3e4,m=108e5,g=console.log.bind(console),f=console.info.bind(console),y=console.warn.bind(console),b=console.error.bind(console),w={},v="Auto Tests",A="Demo",C="Detectors",T="Core",S={};let E;var M;!function(e){e.notNull=function(e,t){if(null==e)throw new Error(`${null==t?"Value":t} not defined`)}}(M||(M={}));class x{constructor(e,t){this.catchUnhandled=!0,this.report=!1,void 0!==e&&(this.catchUnhandled=e),void 0!==t&&(this.report=t)}}class L{constructor(e,t,n,i){var s;this.category=e,this.name=t,null!=i||(i={}),null!==(s=i.timeout)&&void 0!==s||(i.timeout=p),this.options=i,this.test=()=>d(this,void 0,void 0,(function*(){return new Promise(((e,t)=>d(this,void 0,void 0,(function*(){var i;let s="";try{o.Test.isInDebug;let e=yield n();try{s=null!==(i=null==e?void 0:e.toString())&&void 0!==i?i:""}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 _(e,t,n,i=0,o="timeout"){return d(this,void 0,void 0,(function*(){return new Promise(((s,r)=>{const a=e.subscribe((e=>{try{t(e),s("OK")}catch(e){r(e)}finally{a.unsubscribe(),clearTimeout(l)}})),l=setTimeout((()=>{a.unsubscribe(),r(o)}),i);n()}))}))}function I(e,t,n,i=0,o="timeout"){return d(this,void 0,void 0,(function*(){return new Promise(((s,r)=>{const a=e.subscribe((e=>{t(e).then((()=>{s("OK")})).catch((e=>{r(e)})).finally((()=>{a.unsubscribe(),clearTimeout(l)}))})),l=setTimeout((()=>{a.unsubscribe(),r(o)}),i);n()}))}))}function P(e,t,n){null==w[E]&&(w[E]={}),null==w[E].tests&&(w[E].tests=[]),w[E].tests.push(new L(E,e,t,n))}function N(e,t=!0,n){if(n=n?`${n}, `:"",e!==t)throw new Error(`${n}Expected "${t}", got "${e}"`)}function R(e,t,n=.001,i){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(N(o,!0,`${null!=i?i:""} (tolerance = ${n})`),!o)throw new Error(`Expected ${t}, got ${e} (tolerance = ${n})`)}function $(e,t){for(const[n,i]of Object.entries(t)){if(!e.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const t=e[n];if(t instanceof Array&&i instanceof Array)O(t,i);else if(t instanceof Object&&i instanceof Object)$(t,i);else if(Number.isFinite(t)&&Number.isFinite(i))R(t,i);else if(t!=i)throw new Error(`Expected (${i}) for key '${n}', got (${t})`)}}function O(e,t){const n=e.length,i=t.length;if(n!=i)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${i}`);for(let i=0;i<n;i++)if(e[i]instanceof Array&&t[i]instanceof Array)O(e[i],t[i]);else if(e[i]instanceof Object&&t[i]instanceof Object)$(e[i],t[i]);else if(e[i]!=t[i])throw new Error(`Expected ${t[i]} at position ${i}, got ${e[i]}`)}function H(e,t,n){var i;E=e,t(),w[E]&&(w[E].clear=null===(i=null==n?void 0:n.clear)||void 0===i||i,w[E].timeout=null==n?void 0:n.timeout,w[E].benchmarks=null==n?void 0:n.benchmarks,w[E].stressTests=null==n?void 0:n.stressTests,w[E].owner=null==n?void 0:n.owner)}function k(e){null==w[E]&&(w[E]={}),w[E].before=e}function F(e){null==w[E]&&(w[E]={}),w[E].after=e}function D(e,t){return e.replace(new RegExp(t.name,"gi"),t.nqName)}function G(e,t){var n,r,a,l,c,u,h,g,f,y;return d(this,void 0,void 0,(function*(){const b=e.id;if(S[b])return;const E=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 i=null!==(n=t.pop())&&void 0!==n?n:e.name,o=t.length?T+": "+t.join(": "):T,s=i.split(" | ");i=s[s.length-1],s.unshift(o),s.pop(),o=s.join(": "),void 0===E[o]&&(E[o]={tests:[],clear:!0}),E[o].tests.push(new L(o,i,e.test,{isAggregated:!1,timeout:null!==(a=null===(r=e.options)||void 0===r?void 0:r.timeout)&&void 0!==a?a:p,skipReason:null===(l=e.options)||void 0===l?void 0:l.skipReason,owner:null===(c=e.options)||void 0===c?void 0:c.owner,benchmark:null!==(h=null===(u=e.options)||void 0===u?void 0:u.benchmark)&&void 0!==h&&h}))}const M=[],x=[],_=[],I=yield i.dapi.functions.filter(`package.id = "${b}"`).list(),P=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const t of I){const n=t.options.test,r=t.options.demoPath;if(n&&Array.isArray(n)&&n.length)for(let e=0;e<n.length;e++){const s=n[e].matchAll(P),r={};Array.from(s).forEach((e=>{e[0].startsWith("skip")?r.skip=e[1]:e[0].startsWith("wait")?r.wait=parseInt(e[2]):e[0].startsWith("cat")?r.cat=e[3]:e[0].startsWith("timeout")&&(r.timeout=parseInt(e[4]))}));const a=new L(null!==(g=r.cat)&&void 0!==g?g:v,1===n.length?t.name:`${t.name} ${e+1}`,(()=>d(this,void 0,void 0,(function*(){const o=yield i.functions.eval(D(n[e],t));if(r.wait&&(yield Y(r.wait)),"boolean"==typeof o&&!o)throw`Failed: ${n[e]}, expected true, got ${o}`}))),{skipReason:r.skip,timeout:o.Test.isInBenchmark?null!==(f=r.benchmarkTimeout)&&void 0!==f?f:m:null!==(y=r.timeout)&&void 0!==y?y:p});if(r.cat){const e=r.cat;void 0===E[e]&&(E[e]={tests:[],clear:!0}),E[e].tests||(E[e].tests=[]),E[e].tests.push(a)}else M.push(a)}if(r){const e=t.options.demoWait?parseInt(t.options.demoWait):void 0,n=new L(A,t.friendlyName,(()=>d(this,void 0,void 0,(function*(){yield Y(300),i.shell.clearLastError(),yield t.apply(),yield Y(e||2e3);const n=yield i.shell.lastError;if(n)throw new Error(n)}))),{skipReason:t.options.demoSkip});x.push(n)}if(t.hasTag("semTypeDetector")){let n=s;t.options.testData&&(n=yield i.data.files.openTable(`System:AppData/${e.nqName}/${t.options.testData}`));const o=new L(C,t.friendlyName,(()=>d(this,void 0,void 0,(function*(){const i=[];console.log(`System:AppData/${e.nqName}/${t.options.testData}`);for(const e of n.clone().columns){const n=yield t.apply([e]);i.push(n||e.semType)}const o=i.filter((e=>e));N(o.length,1),t.options.testDataColumnName&&N(o[0],t.options.testDataColumnName)}))),{skipReason:t.options.skipTest});_.push(o)}}S[b]=!0,M.length>0&&(E[v]={tests:M,clear:!0}),x.length>0&&(E[A]={tests:x,clear:!0}),_.length>0&&(E[C]={tests:_,clear:!1})}))}function B(e){var t,n,s,r,a,l;return d(this,void 0,void 0,(function*(){console.log("--------------------");const c=null===(n=null===(t=i.functions.getCurrentCall())||void 0===t?void 0:t.func)||void 0===n?void 0:n.package,u=(null!==(r=(null!==(s=null==c?void 0:c.packageOwner)&&void 0!==s?s:"").match(new RegExp("[^<]*<([^>]*)>")))&&void 0!==r?r:["",""])[1];yield G(c);const h=[];console.log("Running tests"),console.log(e),null!=e||(e={}),null!==(a=(l=e).testContext)&&void 0!==a||(l.testContext=new x),i.shell.clearLastError();const v=function(){const e=[];return console.log=(...t)=>{e.push(...t),g(...t)},console.info=(...t)=>{e.push(...t),f(...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,r,a,l,p,m;return d(this,void 0,void 0,(function*(){try{for(const[i,u]of Object.entries(e)){if((null==t?void 0:t.category)&&!i.toLowerCase().startsWith(null==t?void 0:t.category.toLowerCase())||(null===(n=t.exclude)||void 0===n?void 0:n.some((e=>i.startsWith(e)))))continue;g(`Started ${i} 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!==(r=t.category)&&void 0!==r?r:""));let f,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=q(y)),(null!==(p=null===(l=t.tags)||void 0===l?void 0:l.length)&&void 0!==p?p:0)>0&&(y=y.filter((e=>{var n,i;return null===(i=null===(n=e.options)||void 0===n?void 0:n.tags)||void 0===i?void 0:i.some((e=>{var n;return(null!==(n=null==t?void 0:t.tags)&&void 0!==n?n:[]).includes(e)}))}))),u.beforeStatus?(f=Array.from(y.map((e=>({date:(new Date).toISOString(),category:i,name:e.name,success:!1,result:"before() failed",ms:0,skipped:!1,logs:"",owner:null==c?void 0:c.packageOwner,package:c.name,widgetsDifference:0,flaking:o.Test.isReproducing})))),f.forEach((e=>d(this,void 0,void 0,(function*(){return V("package",e)}))))):f=yield C(u,t);const b=f.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:i,name:"after",success:!1,result:u.afterStatus,ms:0,skipped:!1,logs:"",owner:null==c?void 0:c.packageOwner,package:c.name,widgetsDifference:0,flaking:o.Test.isReproducing}),u.beforeStatus&&b.push({date:(new Date).toISOString(),category:i,name:"before",success:!1,result:u.beforeStatus,ms:0,skipped:!1,logs:"",owner:null==c?void 0:c.packageOwner,package:c.name,widgetsDifference:0,flaking:o.Test.isReproducing}),h.push(...b)}}finally{console.log=g,console.info=f,console.warn=y,console.error=b}if(t.testContext.catchUnhandled&&!o.Test.isInBenchmark){yield Y(1e3);const e=yield i.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:c.name,widgetsDifference:0};h.push(Object.assign(Object.assign({},t),{flaking:o.Test.isReproducing&&!e})),t.package=c.name,yield V("package",t)}}))}(w,e);for(let e of h)e.result=e.result.toString().replace(/"/g,"'"),null!=e.logs&&(e.logs=e.logs.toString().replace(/"/g,"'"));return h;function A(e,t){return d(this,void 0,void 0,(function*(){let n;try{void 0!==e&&(yield K((()=>d(this,void 0,void 0,(function*(){yield e()}))),1e5,`before ${t}: timeout error`))}catch(e){n=yield U(e)}return n}))}function C(e,t){var n,s,r,a,l,h,g,f,y,b,w,A,C,S,E,M,x,L;return d(this,void 0,void 0,(function*(){let d=null!==(n=e.tests)&&void 0!==n?n:[];const _=[],I=T();if(e.clear)for(let n=0;n<d.length;n++){d[n].options&&void 0===(null===(s=d[n].options)||void 0===s?void 0:s.benchmark)&&(d[n].options||(d[n].options={}),d[n].options.benchmark=null!==(r=e.benchmarks)&&void 0!==r&&r);let A=d[n];if(t.test&&t.test.toLowerCase()!==A.name.toLowerCase())continue;(null==A?void 0:A.options)&&(A.options.owner=null!==(g=null!==(h=null!==(l=null===(a=d[n].options)||void 0===a?void 0:a.owner)&&void 0!==l?l:null==e?void 0:e.owner)&&void 0!==h?h:u)&&void 0!==g?g:"");let C=yield W(A,null==t?void 0:t.test,v,o.Test.isInBenchmark?null!==(y=null===(f=d[n].options)||void 0===f?void 0:f.benchmarkTimeout)&&void 0!==y?y:m:null!==(w=null===(b=d[n].options)||void 0===b?void 0:b.timeout)&&void 0!==w?w:p,c.name,t.verbose);C&&_.push(Object.assign(Object.assign({},C),{widgetsDifference:T()-I})),i.shell.closeAll(),o.Balloon.closeAll()}else for(let n=0;n<d.length;n++){let i=d[n];if(t.test&&t.test.toLowerCase()!==i.name.toLowerCase())continue;(null==i?void 0:i.options)&&(i.options.owner=null!==(E=null!==(S=null!==(C=null===(A=d[n].options)||void 0===A?void 0:A.owner)&&void 0!==C?C:null==e?void 0:e.owner)&&void 0!==S?S:u)&&void 0!==E?E:"");let s=yield W(i,null==t?void 0:t.test,v,o.Test.isInBenchmark?null!==(x=null===(M=d[n].options)||void 0===M?void 0:M.benchmarkTimeout)&&void 0!==x?x:m:null===(L=d[n].options)||void 0===L?void 0:L.timeout,c.name,t.verbose);s&&_.push(Object.assign(Object.assign({},s),{widgetsDifference:T()-I}))}return _}))}function T(){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 V(e,t){return d(this,void 0,void 0,(function*(){null!=i.shell.reportTest?yield i.shell.reportTest(e,t):yield fetch(`${i.dapi.root}/log/tests/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)})}))}function U(e){return d(this,void 0,void 0,(function*(){return`${e.toString()}\n${e.stack?yield o.Logger.translateStackTrace(e.stack):""}`}))}function W(e,t,n,s,r,a){var l,c,u,h,m,f,y,w,v,A,C,T,S,E;return d(this,void 0,void 0,(function*(){let d;n.length=0;const M=null!=t&&e.name.toLowerCase()!==t.toLowerCase();let x=(null===(l=e.options)||void 0===l?void 0:l.skipReason)||M,L=M?"skipped":null===(c=e.options)||void 0===c?void 0:c.skipReason;if(console.log(P.name,x),o.Test.isInBenchmark&&!(null===(u=e.options)||void 0===u?void 0:u.benchmark))return void g(`SKIPPED: ${e.category} ${e.name} doesnt available in benchmark mode`);x||g(`Started ${e.category} ${e.name}`);const _=Date.now(),I=new Date(_).toISOString();try{if(x)d={name:e.name,owner:null!==(m=null===(h=e.options)||void 0===h?void 0:h.owner)&&void 0!==m?m:"",category:e.category,logs:"",date:I,success:!0,result:L,ms:0,skipped:!0,package:null!=r?r:"",flaking:o.Test.isReproducing};else{let t=null!=s?s:p;o.Test.isProfiling&&console.profile(`${e.category}: ${e.name}`),d={name:e.name,owner:null!==(y=null===(f=e.options)||void 0===f?void 0:f.owner)&&void 0!==y?y:"",category:e.category,logs:"",date:I,success:!0,result:null!==(w=yield K(e.test,t))&&void 0!==w?w:"OK",ms:0,skipped:!1,package:null!=r?r:"",flaking:o.Test.isReproducing},o.Test.isProfiling&&(console.profileEnd(`${e.category}: ${e.name}`),i.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),d={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:I,success:!1,result:yield U(t),ms:0,skipped:!1,package:null!=r?r:"",flaking:!1}}if((null===(C=e.options)||void 0===C?void 0:C.isAggregated)&&d.result.constructor===o.DataFrame){const e=d.result.col("success");if(e&&(d.success=e.stats.sum===e.length),!a){const e=d.result;e.columns.remove("stack"),e.rows.removeWhere((e=>e.get("success"))),d.result=e}d.result=d.result.toCsv()}if(d.logs=n.join("\n"),d.ms=Date.now()-_,x||g(`Finished ${e.category} ${e.name} for ${d.ms} ms`),d.category=e.category,d.name=e.name,d.owner=null!==(S=null===(T=e.options)||void 0===T?void 0:T.owner)&&void 0!==S?S:"",!M){let t={success:d.success,result:d.result,ms:d.ms,date:d.date,skipped:d.skipped,category:e.category,name:e.name,logs:d.logs,owner:d.owner,flaking:o.Test.isReproducing&&d.success,package:d.package};if(d.result.constructor==Object){const e=Object.keys(d.result).reduce(((e,t)=>Object.assign(Object.assign({},e),{["result."+t]:d.result[t]})),{});t=Object.assign(Object.assign({},t),e)}t.result instanceof o.DataFrame&&(t.result=JSON.stringify(null===(E=t.result)||void 0===E?void 0:E.toJson())||""),yield V("package",t)}return d}))}function q(e){const t=e.slice();return t.sort((()=>Math.random()-.5)),t}function Y(e){return d(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,e)))}))}function j(e,t="Timeout exceeded",n=500,i=50){return d(this,void 0,void 0,(function*(){return new Promise(((o,s)=>{setTimeout((()=>{clearInterval(r),s(new Error(t))}),n);const r=setInterval((()=>{e()&&(clearInterval(r),o(null))}),i)}))}))}function K(e,t,n="EXECUTION TIMEOUT"){return d(this,void 0,void 0,(function*(){let i=null;const o=new Promise(((e,o)=>{i=setTimeout((()=>{o(n)}),t)}));try{return yield Promise.race([e(),o])}finally{i&&clearTimeout(i)}}))}const z=o.DataFrame.fromColumns([o.Column.fromStrings("col",["val1","val2","val3"])]);function Z(e,t,n){var o;return d(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 i.data.detectSemanticTypes(t));const r=i.shell.addTableView(t);try{yield a(r,e,s,i.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield a(r,e,s,i.events.onViewerAdded,void 0,n.awaitViewer)),(null==n?void 0:n.readOnly)||(yield a(r,e,s,i.events.onViewerAdded,l),(null==n?void 0:n.awaitViewer)&&(yield a(r,e,s,i.events.onViewerAdded,l,n.awaitViewer)));let t=null;t=yield a(r,e,s,i.events.onViewerAdded,u),(null==n?void 0:n.awaitViewer)&&(t=yield a(r,e,s,i.events.onViewerAdded,u,n.awaitViewer)),yield a(r,e,s,i.events.onViewLayoutApplied,h,void 0,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps}),(null==n?void 0:n.awaitViewer)&&(yield a(r,e,s,i.events.onViewLayoutApplied,h,n.awaitViewer,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps})),!1!==(null==n?void 0:n.arbitraryDfTest)&&(r.dataFrame=z,yield Y(50),yield a(r,e,s,i.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield a(r,e,s,i.events.onViewerAdded,void 0,n.awaitViewer))),yield a(r,e,s,i.events.onViewerAdded,c),(null==n?void 0:n.awaitViewer)&&(yield a(r,e,s,i.events.onViewerAdded,c,n.awaitViewer))}finally{}}))}},3527:(e,t,n)=>{"use strict";n.d(t,{Mi:()=>i});class i extends Float32Array{}},3629:(e,t,n)=>{"use strict";n.d(t,{KE:()=>a,S8:()=>l,dC:()=>s,vA:()=>o,wQ:()=>r});var i=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 r=new i.Mi(s);for(let i=0;i<e.length;++i)r[i]=e[i]+n*t[i];return r}function r(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 i=0;i<e.length;i++)n+=e[i]*t[i];return n}function l(e){const t=e.length;let n=0,i=0;for(let o=0;o<t;++o)n+=e[o],i+=Math.pow(e[o],2);const o=n/t,s=1/Math.sqrt(i/t-Math.pow(o,2));for(let n=0;n<t;++n)e[n]=(e[n]-o)*s;return e}},1913:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(3282),o=n(9029),s=n(1520),r=n(2586),a=n(8708),l=n(2023),c="errorMessage",u=new i.Name("emUsed"),h={required:"missingProperty",dependencies:"property",dependentRequired:"property"},d=/\$\{[^}]+\}/,p=/\$\{([^}]+)\}/g,m=/^""\s*\+\s*|\s*\+\s*""$/g;const g=(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:c,schemaType:["string","object"],post:!0,code(t){const{gen:n,data:g,schema:f,schemaValue:y,it:b}=t;if(!1===b.createErrors)return;const w=f,v=o.strConcat(l.default.instancePath,b.errorPath);function A(e,t){return o.and(i._`${e}.keyword !== ${c}`,i._`!${e}.${u}`,i._`${e}.instancePath === ${v}`,i._`${e}.keyword in ${t}`,i._`${e}.schemaPath.indexOf(${b.errSchemaPath}) === 0`,i._`/^\\/[^\\/]*$/.test(${e}.schemaPath.slice(${b.errSchemaPath.length}))`)}function C(e,t){const i=[];for(const n in e){const e=t[n];d.test(e)&&i.push([n,S(e)])}return n.object(...i)}function T(e){return d.test(e)?new s._Code(s.safeStringify(e).replace(p,((e,t)=>`" + JSON.stringify(${r.getData(t,b)}) + "`)).replace(m,"")):i.stringify(e)}function S(e){return i._`function(){return ${T(e)}}`}n.if(i._`${l.default.errors} > 0`,(()=>{if("object"==typeof w){const[s,r]=function(e){let t,n;for(const i in e){if("properties"===i||"items"===i)continue;const o=e[i];if("object"==typeof o){t||(t={});const e=t[i]={};for(const t in o)e[t]=[]}else n||(n={}),n[i]=[]}return[t,n]}(w);r&&function(o){const s=n.const("emErrors",i.stringify(o)),r=n.const("templates",C(o,f));n.forOf("err",l.default.vErrors,(e=>n.if(A(e,s),(()=>n.code(i._`${s}[${e}.keyword].push(${e})`).assign(i._`${e}.${u}`,!0)))));const{singleError:c}=e;if(c){const e=n.let("message",i._`""`),o=n.let("paramsErrors",i._`[]`);h((t=>{n.if(e,(()=>n.code(i._`${e} += ${"string"==typeof c?c:";"}`))),n.code(i._`${e} += ${d(t)}`),n.assign(o,i._`${o}.concat(${s}[${t}])`)})),a.reportError(t,{message:e,params:i._`{errors: ${o}}`})}else h((e=>a.reportError(t,{message:d(e),params:i._`{errors: ${s}[${e}]}`})));function h(e){n.forIn("key",s,(t=>n.if(i._`${s}[${t}].length`,(()=>e(t)))))}function d(e){return i._`${e} in ${r} ? ${r}[${e}]() : ${y}[${e}]`}}(r),s&&function(e){const o=n.const("emErrors",i.stringify(e)),s=[];for(const t in e)s.push([t,C(e[t],f[t])]);const r=n.const("templates",n.object(...s)),c=n.scopeValue("obj",{ref:h,code:i.stringify(h)}),d=n.let("emPropParams"),p=n.let("emParamsErrors");n.forOf("err",l.default.vErrors,(e=>n.if(A(e,o),(()=>{n.assign(d,i._`${c}[${e}.keyword]`),n.assign(p,i._`${o}[${e}.keyword][${e}.params[${d}]]`),n.if(p,(()=>n.code(i._`${p}.push(${e})`).assign(i._`${e}.${u}`,!0)))})))),n.forIn("key",o,(e=>n.forIn("keyProp",i._`${o}[${e}]`,(s=>{n.assign(p,i._`${o}[${e}][${s}]`),n.if(i._`${p}.length`,(()=>{const o=n.const("tmpl",i._`${r}[${e}] && ${r}[${e}][${s}]`);a.reportError(t,{message:i._`${o} ? ${o}() : ${y}[${e}][${s}]`,params:i._`{errors: ${p}}`})}))}))))}(s),function(e){const{props:s,items:r}=e;if(!s&&!r)return;const h=i._`typeof ${g} == "object"`,d=i._`Array.isArray(${g})`,p=n.let("emErrors");let m,b;const w=n.let("templates");function A(e,t){n.assign(p,i.stringify(e)),n.assign(w,C(e,t))}s&&r?(m=n.let("emChildKwd"),n.if(h),n.if(d,(()=>{A(r,f.items),n.assign(m,i.str`items`)}),(()=>{A(s,f.properties),n.assign(m,i.str`properties`)})),b=i._`[${m}]`):r?(n.if(d),A(r,f.items),b=i._`.items`):s&&(n.if(o.and(h,o.not(d))),A(s,f.properties),b=i._`.properties`),n.forOf("err",l.default.vErrors,(e=>function(e,t,s){n.if(o.and(i._`${e}.keyword !== ${c}`,i._`!${e}.${u}`,i._`${e}.instancePath.indexOf(${v}) === 0`),(()=>{const o=n.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:i._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),r=n.const("emMatches",i._`${o}.exec(${e}.instancePath.slice(${v}.length))`),a=n.const("emChild",i._`${r} && ${r}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);n.if(i._`${a} !== undefined && ${a} in ${t}`,(()=>s(a)))}))}(e,p,(t=>n.code(i._`${p}[${t}].push(${e})`).assign(i._`${e}.${u}`,!0))))),n.forIn("key",p,(e=>n.if(i._`${p}[${e}].length`,(()=>{a.reportError(t,{message:i._`${e} in ${w} ? ${w}[${e}]() : ${y}${b}[${e}]`,params:i._`{errors: ${p}[${e}]}`}),n.assign(i._`${l.default.vErrors}[${l.default.errors}-1].instancePath`,i._`${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",i._`[]`);n.forOf("err",l.default.vErrors,(e=>n.if(function(e){return o.and(i._`${e}.keyword !== ${c}`,i._`!${e}.${u}`,o.or(i._`${e}.instancePath === ${v}`,o.and(i._`${e}.instancePath.indexOf(${v}) === 0`,i._`${e}.instancePath[${v}.length] === "/"`)),i._`${e}.schemaPath.indexOf(${b.errSchemaPath}) === 0`,i._`${e}.schemaPath[${b.errSchemaPath}.length] === "/"`)}(e),(()=>n.code(i._`${s}.push(${e})`).assign(i._`${e}.${u}`,!0))))),n.if(i._`${s}.length`,(()=>a.reportError(t,{message:T(e),params:i._`{errors: ${s}}`})))}(s),e.keepErrors||function(){const e=n.const("emErrs",i._`[]`);n.forOf("err",l.default.vErrors,(t=>n.if(i._`!${t}.${u}`,(()=>n.code(i._`${e}.push(${t})`))))),n.assign(l.default.vErrors,e).assign(l.default.errors,i._`${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=g,e.exports=g,e.exports.default=g},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 i=n(4042),o=n(6105),s=n(6653),r=n(9572),a="https://json-schema.org/draft/2020-12/schema";class l extends i.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&&(r.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=l,e.exports=t=l,e.exports.Ajv2020=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var c=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.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 h=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var d=n(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.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 i=n(4042),o=n(6144),s=n(6653),r=n(2079),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends i.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(r,a):r;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var h=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var d=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.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 i 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=i;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 i&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function s(e,...t){const n=[e[0]];let i=0;for(;i<t.length;)l(n,t[i]),n.push(e[++i]);return new o(n)}t._Code=o,t.nil=new o(""),t._=s;const r=new o("+");function a(e,...t){const n=[u(e[0])];let i=0;for(;i<t.length;)n.push(r),l(n,t[i]),n.push(r,u(e[++i]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===r){const n=c(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 l(e,t){var n;t instanceof o?e.push(...t._items):t instanceof i?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:u(Array.isArray(n)?n.join(","):n))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof i||'"'!==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 i?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=l,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 i=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 r=n(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return r.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return r.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return r.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return r.varKinds}}),t.operators={GT:new i._Code(">"),GTE:new i._Code(">="),LT:new i._Code("<"),LTE:new i._Code("<="),EQ:new i._Code("==="),NEQ:new i._Code("!=="),NOT:new i._Code("!"),OR:new i._Code("||"),AND:new i._Code("&&"),ADD:new i._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l 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,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=P(this.rhs,e,t)),this}get names(){return this.rhs instanceof i._CodeOrName?this.rhs.names:{}}}class c 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 i.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=P(this.rhs,e,t),this}get names(){return I(this.lhs instanceof i.Name?{}:{...this.lhs.names},this.rhs)}}class u extends c{constructor(e,t,n,i){super(e,n,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class d 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=P(this.code,e,t),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class g 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 i=n.length;for(;i--;){const o=n[i];o.optimizeNames(e,t)||(N(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>_(e,t.names)),{})}}class f extends g{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends g{}class b extends f{}b.kind="else";class w extends f{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(R(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=P(this.condition,e,t),this}get names(){const e=super.names;return I(e,this.condition),this.else&&_(e,this.else.names),e}}w.kind="if";class v extends f{}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=P(this.iteration,e,t),this}get names(){return _(super.names,this.iteration.names)}}class C extends v{constructor(e,t,n,i){super(),this.varKind=e,this.name=t,this.from=n,this.to=i}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${t} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){const e=I(super.names,this.from);return I(e,this.to)}}class T extends v{constructor(e,t,n,i){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=i}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=P(this.iterable,e,t),this}get names(){return _(super.names,this.iterable.names)}}class S extends f{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)}}S.kind="func";class E extends g{render(e){return"return "+super.render(e)}}E.kind="return";class M extends f{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,i;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(i=this.finally)||void 0===i||i.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&_(e,this.catch.names),this.finally&&_(e,this.finally.names),e}}class x extends f{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}x.kind="catch";class L extends f{render(e){return"finally"+super.render(e)}}function _(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function I(e,t){return t instanceof i._CodeOrName?_(e,t.names):e}function P(e,t,n){return e instanceof i.Name?s(e):(o=e)instanceof i._Code&&o._items.some((e=>e instanceof i.Name&&1===t[e.str]&&void 0!==n[e.str]))?new i._Code(e._items.reduce(((e,t)=>(t instanceof i.Name&&(t=s(t)),t instanceof i._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function s(e){const i=n[e.str];return void 0===i||1!==t[e.str]?e:(delete t[e.str],i)}}function N(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:i._`!${k(e)}`}L.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,i){const o=this._scope.toName(t);return void 0!==n&&i&&(this._constants[o.str]=n),this._leafNode(new l(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 c(e,t,n))}add(e,n){return this._leafNode(new u(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==i.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,i.addCodeArg)(t,o));return t.push("}"),new i._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,i,s=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const r=this._scope.toName(e);return this._for(new C(s,r,t,n),(()=>i(r)))}forOf(e,t,n,s=o.varKinds.const){const r=this._scope.toName(e);if(this.opts.es5){const e=t instanceof i.Name?t:this.var("_arr",t);return this.forRange("_i",0,i._`${e}.length`,(t=>{this.var(r,i._`${e}[${t}]`),n(r)}))}return this._for(new T("of",s,r,t),(()=>n(r)))}forIn(e,t,n,s=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,i._`Object.keys(${t})`,n);const r=this._scope.toName(e);return this._for(new T("in",s,r,t),(()=>n(r)))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new h(e))}break(e){return this._leafNode(new d(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const i=new M;if(this._blockNode(i),this.code(e),t){const e=this.name("e");this._currNode=i.catch=new x(e),t(e)}return n&&(this._currNode=i.finally=new L,this.code(n)),this._endBlockNode(x,L)}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=i.nil,n,o){return this._blockNode(new S(e,t,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(S)}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=R;const $=H(t.operators.AND);t.and=function(...e){return e.reduce($)};const O=H(t.operators.OR);function H(e){return(t,n)=>t===i.nil?n:n===i.nil?t:i._`${k(t)} ${e} ${k(n)}`}function k(e){return e instanceof i.Name?e:i._`(${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 i=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 i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class r{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.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=r;class a extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=i._`.${new i.Name(t)}[${n}]`}}t.ValueScopeName=a;const l=i._`\n`;t.ValueScope=class extends r{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:i.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 i=this.toName(e),{prefix:o}=i,s=null!==(n=t.key)&&void 0!==n?n:t.ref;let r=this._values[o];if(r){const e=r.get(s);if(e)return e}else r=this._values[o]=new Map;r.set(s,i);const a=this._scope[o]||(this._scope[o]=[]),l=a.length;return a[l]=t.ref,i.setValue(t,{property:o,itemIndex:l}),i}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 i._`${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,r={},a){let l=i.nil;for(const c in e){const u=e[c];if(!u)continue;const h=r[c]=r[c]||new Map;u.forEach((e=>{if(h.has(e))return;h.set(e,s.Started);let r=n(e);if(r){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;l=i._`${l}${n} ${e} = ${r};${this.opts._n}`}else{if(!(r=null==a?void 0:a(e)))throw new o(e);l=i._`${l}${r}${this.opts._n}`}h.set(e,s.Completed)}))}return l}}},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 i=n(9029),o=n(4227),s=n(2023);function r(e,t){const n=e.const("err",t);e.if(i._`${s.default.vErrors} === null`,(()=>e.assign(s.default.vErrors,i._`[${n}]`)),i._`${s.default.vErrors}.push(${n})`),e.code(i._`${s.default.errors}++`)}function a(e,t){const{gen:n,validateName:o,schemaEnv:s}=e;s.$async?n.throw(i._`new ${e.ValidationError}(${t})`):(n.assign(i._`${o}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>i.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?i.str`"${e}" keyword must be ${t} ($data)`:i.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,o,s){const{it:l}=e,{gen:u,compositeRule:h,allErrors:d}=l,p=c(e,n,o);(null!=s?s:h||d)?r(u,p):a(l,i._`[${p}]`)},t.reportExtraError=function(e,n=t.keywordError,i){const{it:o}=e,{gen:l,compositeRule:u,allErrors:h}=o;r(l,c(e,n,i)),u||h||a(o,s.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(s.default.errors,t),e.if(i._`${s.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(i._`${s.default.vErrors}.length`,t)),(()=>e.assign(s.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:o,errsCount:r,it:a}){if(void 0===r)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",r,s.default.errors,(r=>{e.const(l,i._`${s.default.vErrors}[${r}]`),e.if(i._`${l}.instancePath === undefined`,(()=>e.assign(i._`${l}.instancePath`,(0,i.strConcat)(s.default.instancePath,a.errorPath)))),e.assign(i._`${l}.schemaPath`,i.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(i._`${l}.schema`,n),e.assign(i._`${l}.data`,o))}))};const l={keyword:new i.Name("keyword"),schemaPath:new i.Name("schemaPath"),params:new i.Name("params"),propertyName:new i.Name("propertyName"),message:new i.Name("message"),schema:new i.Name("schema"),parentSchema:new i.Name("parentSchema")};function c(e,t,n){const{createErrors:o}=e.it;return!1===o?i._`{}`:function(e,t,n={}){const{gen:o,it:r}=e,a=[u(r,n),h(e,n)];return function(e,{params:t,message:n},o){const{keyword:r,data:a,schemaValue:c,it:u}=e,{opts:h,propertyName:d,topSchemaRef:p,schemaPath:m}=u;o.push([l.keyword,r],[l.params,"function"==typeof t?t(e):t||i._`{}`]),h.messages&&o.push([l.message,"function"==typeof n?n(e):n]),h.verbose&&o.push([l.schema,c],[l.parentSchema,i._`${p}${m}`],[s.default.data,a]),d&&o.push([l.propertyName,d])}(e,t,a),o.object(...a)}(e,t,n)}function u({errorPath:e},{instancePath:t}){const n=t?i.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[s.default.instancePath,(0,i.strConcat)(s.default.instancePath,n)]}function h({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:s}){let r=s?t:i.str`${t}/${e}`;return n&&(r=i.str`${r}${(0,o.getErrorPath)(n,o.Type.Str)}`),[l.schemaPath,r]}},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 i=n(9029),o=n(3558),s=n(2023),r=n(6939),a=n(4227),l=n(2586);class c{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,r.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=d.call(this,e);if(t)return t;const n=(0,r.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:u}=this.opts,h=new i.CodeGen(this.scope,{es5:a,lines:c,ownProperties:u});let p;e.$async&&(p=h.scopeValue("Error",{ref:o.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const m=h.scopeName("validate");e.validateName=m;const g={gen:h,allErrors:this.opts.allErrors,data:s.default.data,parentData:s.default.parentData,parentDataProperty:s.default.parentDataProperty,dataNames:[s.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,i.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:i.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:i._`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,l.validateFunctionCode)(g),h.optimize(this.opts.code.optimize);const t=h.toString();f=`${h.scopeRefs(s.default.scope)}return ${t}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const n=new Function(`${s.default.self}`,`${s.default.scope}`,f)(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:h._values}),this.opts.unevaluated){const{props:e,items:t}=g;n.evaluated={props:e instanceof i.Name?void 0:e,items:t instanceof i.Name?void 0:t,dynamicProps:e instanceof i.Name,dynamicItems:t instanceof i.Name},n.source&&(n.source.evaluated=(0,i.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),t}finally{this._compilations.delete(e)}}function h(e){return(0,r.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function d(e){for(const i of this._compilations)if(n=e,(t=i).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return i;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),i=(0,r._getFullPath)(this.opts.uriResolver,n);let o=(0,r.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===o)return f.call(this,n,e);const s=(0,r.normalizeId)(i),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 f.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||u.call(this,a),s===(0,r.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,i=t[n];return i&&(o=(0,r.resolveUrl)(this.opts.uriResolver,o,i)),new c({schema:t,schemaId:n,root:e,baseId:o})}return f.call(this,n,a)}}t.SchemaEnv=c,t.compileSchema=u,t.resolveRef=function(e,t,n){var i;n=(0,r.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===(i=e.localRefs)||void 0===i?void 0:i[n],{schemaId:r}=this.opts;o&&(s=new c({schema:o,schemaId:r,root:e,baseId:t}))}return void 0!==s?e.refs[n]=h.call(this,s):void 0},t.getCompilingSchema=d,t.resolveSchema=m;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function f(e,{baseId:t,schema:n,root:i}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const i of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,a.unescapeFragment)(i)];if(void 0===e)return;const o="object"==typeof(n=e)&&n[this.opts.schemaId];!g.has(i)&&o&&(t=(0,r.resolveUrl)(this.opts.uriResolver,t,o))}let s;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,r.resolveUrl)(this.opts.uriResolver,t,n.$ref);s=m.call(this,i,e)}const{schemaId:l}=this.opts;return s=s||new c({schema:n,schemaId:l,root:i,baseId:t}),s.schema!==s.root.schema?s:void 0}},2023:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(9029),o={data:new i.Name("data"),valCxt:new i.Name("valCxt"),instancePath:new i.Name("instancePath"),parentData:new i.Name("parentData"),parentDataProperty:new i.Name("parentDataProperty"),rootData:new i.Name("rootData"),dynamicAnchors:new i.Name("dynamicAnchors"),vErrors:new i.Name("vErrors"),errors:new i.Name("errors"),this:new i.Name("this"),self:new i.Name("self"),scope:new i.Name("scope"),json:new i.Name("json"),jsonPos:new i.Name("jsonPos"),jsonLen:new i.Name("jsonLen"),jsonPart:new i.Name("jsonPart")};t.default=o},4551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6939);class o extends Error{constructor(e,t,n,o){super(o||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,i.resolveUrl)(e,t,n),this.missingSchema=(0,i.normalizeId)((0,i.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 i=n(4227),o=n(2017),s=n(7106),r=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?!l(e):!!t&&c(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(a.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(l))return!0;if("object"==typeof n&&l(n))return!0}return!1}function c(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!r.has(n)&&("object"==typeof e[n]&&(0,i.eachItem)(e[n],(e=>t+=c(e))),t===1/0))return 1/0}return t}function u(e,t="",n){!1!==n&&(t=p(t));const i=e.parse(t);return h(e,i)}function h(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=h;const d=/#\/?$/;function p(e){return e?e.replace(d,""):""}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:i}=this.opts,r=p(e[n]||t),a={"":r},l=u(i,r,!1),c={},h=new Set;return s(e,{allKeys:!0},((e,t,i,o)=>{if(void 0===o)return;const s=l+t;let r=a[o];function u(t){const n=this.opts.uriResolver.resolve;if(t=p(r?n(r,t):t),h.has(t))throw g(t);h.add(t);let i=this.refs[t];return"string"==typeof i&&(i=this.refs[i]),"object"==typeof i?d(e,i.schema,t):t!==p(s)&&("#"===t[0]?(d(e,c[t],t),c[t]=e):this.refs[t]=s),t}function f(e){if("string"==typeof e){if(!m.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[n]&&(r=u.call(this,e[n])),f.call(this,e.$anchor),f.call(this,e.$dynamicAnchor),a[t]=r})),c;function d(e,t,n){if(void 0!==t&&!o(e,t))throw g(n)}function g(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 i=n(9029),o=n(1520);function s(e,t=e.schema){const{opts:n,self:i}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const o=i.RULES.keywords;for(const n in t)o[n]||m(e,`unknown keyword: "${n}"`)}function r(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 l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:o}){return(s,r,a,l)=>{const c=void 0===a?r:a instanceof i.Name?(r instanceof i.Name?e(s,r,a):t(s,r,a),a):r instanceof i.Name?(t(s,a,r),r):n(r,a);return l!==i.Name||c instanceof i.Name?c:o(s,c)}}function u(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",i._`{}`);return void 0!==t&&h(e,n,t),n}function h(e,t,n){Object.keys(n).forEach((n=>e.assign(i._`${t}${(0,i.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),!r(t,e.self.RULES.all))},t.checkUnknownRules=s,t.schemaHasRules=r,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 i._`${n}`}return i._`${e}${t}${(0,i.getProperty)(o)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>{e.if(i._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,i._`${n} || {}`).code(i._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,i._`${n} || {}`),h(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,i._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>e.assign(n,!0===t||i._`${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=h;const d={};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:d[t.code]||(d[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 i.Name){const o=t===p.Num;return n?o?i._`"[" + ${e} + "]"`:i._`"['" + ${e} + "']"`:o?i._`"/" + ${e}`:i._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,i.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=m},7887:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>i(e,t)))}function i(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},i){const o=t.RULES.types[i];return o&&!0!==o&&n(e,o)},t.shouldUseGroup=n,t.shouldUseRule=i},8727:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const i=n(8708),o=n(9029),s=n(2023),r={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,i.reportError)(s,r,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:i}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(s.default.data):(t.assign(o._`${i}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:i}=e;!1===i?(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 i=n(396),o=n(7887),s=n(8708),r=n(9029),a=n(4227);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.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"}(l||(t.DataType=l={})),t.getSchemaTypes=function(e){const t=c(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=c,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:i,opts:s}=e,a=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,s.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(c){const o=d(t,i,s.strictNumbers,l.Wrong);n.if(o,(()=>{a.length?function(e,t,n){const{gen:i,data:o,opts:s}=e,a=i.let("dataType",r._`typeof ${o}`),l=i.let("coerced",r._`undefined`);"array"===s.coerceTypes&&i.if(r._`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>i.assign(o,r._`${o}[0]`).assign(a,r._`typeof ${o}`).if(d(t,o,s.strictNumbers),(()=>i.assign(l,o))))),i.if(r._`${l} !== undefined`);for(const e of n)(u.has(e)||"array"===e&&"array"===s.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void i.elseIf(r._`${a} == "number" || ${a} == "boolean"`).assign(l,r._`"" + ${o}`).elseIf(r._`${o} === null`).assign(l,r._`""`);case"number":return void i.elseIf(r._`${a} == "boolean" || ${o} === null
|
|
1
|
+
var bio_test;(()=>{var e={8924:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var i=n(7362);class o extends i.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="",i="";for(const o of e)"("==o?t++:")"==o?t--:t?n+=o:i+=o;return isNaN(parseInt(n))?[i,n]:[i,""]}static getColorAAPivot(e="",t="grok"){const n=this.getPalette(t);let[i,o]=this.getInnerOuter(e);if(i=i.length>6?`${i.slice(0,3)}...`:i,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,i,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,i,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,i,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,i,o,4]}return[this.undefinedColor,i,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 i=n(6082);async function o(){const e=i.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:()=>i.o});var i=n(6869)},9124:(e,t,n)=>{"use strict";n.d(t,{b2:()=>s,fA:()=>r});var i=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 r(e,t){if(!e)throw new Error("Argument 'a' of type Atom or HelmType is mandatory.");let n,i;const o=e;return"ATOM"===o.T?(n=o.biotype(),i=o.elem):(n=e,i=t),[n,i]}o.JsInputBase,Error,i.input.helmAsync=async function(e,t){return(await s()).createHelmInput(e,t)}},8438:(e,t,n)=>{"use strict";function i(e){return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e}n.d(t,{D:()=>i})},8123:(e,t,n)=>{"use strict";n.d(t,{u:()=>i});const i={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:()=>r});var i=n(4328);const o="Libraries";let s=Promise.resolve();async function r(){let e;return s=s.then((async()=>{const t=i.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)}`),i.userSettings.add(o,"Settings",JSON.stringify(e),!0)})),await s}},5553:(e,t,n)=>{"use strict";n.d(t,{Qc:()=>C,WN:()=>T});var i=n(1991),o=n.n(i);const s="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,r=new Set,a="object"==typeof process&&process?process:{},l=(e,t,n,i)=>{"function"==typeof a.emitWarning?a.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)};let c=globalThis.AbortController,u=globalThis.AbortSignal;if(void 0===c){u=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},c=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,l("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 h=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),d=e=>h(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=d(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 g{#t;#n;#i;#o;#s;#r;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#l;#c;#u;#h;#d;#p;#m;#g;#f;#y;#b;#w;#v;#A;#C;#T;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#v,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#h,next:e.#d,prev:e.#p,get head(){return e.#m},get tail(){return e.#g},free:e.#f,isBackgroundFetch:t=>e.#S(t),backgroundFetch:(t,n,i,o)=>e.#E(t,n,i,o),moveToTail:t=>e.#M(t),indexes:t=>e.#x(t),rindexes:t=>e.#L(t),isStale:t=>e.#_(t)}}get max(){return this.#t}get maxSize(){return this.#n}get calculatedSize(){return this.#l}get size(){return this.#a}get fetchMethod(){return this.#s}get memoMethod(){return this.#r}get dispose(){return this.#i}get disposeAfter(){return this.#o}constructor(e){const{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:a,allowStale:c,dispose:u,disposeAfter:p,noDisposeOnSet:f,noUpdateTTL:y,maxSize:b=0,maxEntrySize:w=0,sizeCalculation:v,fetchMethod:A,memoMethod:C,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:M,ignoreFetchAbort:x}=e;if(0!==t&&!h(t))throw new TypeError("max option must be a nonnegative integer");const L=t?d(t):Array;if(!L)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!==C&&"function"!=typeof C)throw new TypeError("memoMethod must be a function if defined");if(this.#r=C,void 0!==A&&"function"!=typeof A)throw new TypeError("fetchMethod must be a function if specified");if(this.#s=A,this.#C=!!A,this.#c=new Map,this.#u=new Array(t).fill(void 0),this.#h=new Array(t).fill(void 0),this.#d=new L(t),this.#p=new L(t),this.#m=0,this.#g=0,this.#f=m.create(t),this.#a=0,this.#l=0,"function"==typeof u&&(this.#i=u),"function"==typeof p?(this.#o=p,this.#y=[]):(this.#o=void 0,this.#y=void 0),this.#A=!!this.#i,this.#T=!!this.#o,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!M,this.ignoreFetchAbort=!!x,0!==this.maxEntrySize){if(0!==this.#n&&!h(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!h(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#I()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!a,this.ttlResolution=h(i)||0===i?i:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!h(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}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=>!r.has(e))(e)&&(r.add(e),l("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,g))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#P(){const e=new p(this.#t),t=new p(this.#t);this.#v=e,this.#w=t,this.#N=(n,i,o=s.now())=>{if(t[n]=0!==i?o:0,e[n]=i,0!==i&&this.ttlAutopurge){const e=setTimeout((()=>{this.#_(n)&&this.#R(this.#u[n],"expire")}),i+1);e.unref&&e.unref()}},this.#$=n=>{t[n]=0!==e[n]?s.now():0},this.#O=(o,s)=>{if(e[s]){const r=e[s],a=t[s];if(!r||!a)return;o.ttl=r,o.start=a,o.now=n||i();const l=o.now-a;o.remainingTTL=r-l}};let n=0;const i=()=>{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.#c.get(o);if(void 0===s)return 0;const r=e[s],a=t[s];return r&&a?r-((n||i())-a):1/0},this.#_=o=>{const s=t[o],r=e[o];return!!r&&!!s&&(n||i())-s>r}}#$=()=>{};#O=()=>{};#N=()=>{};#_=()=>!1;#I(){const e=new p(this.#t);this.#l=0,this.#b=e,this.#H=t=>{this.#l-=e[t],e[t]=0},this.#k=(e,t,n,i)=>{if(this.#S(t))return 0;if(!h(n)){if(!i)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 i)throw new TypeError("sizeCalculation must be a function");if(n=i(t,e),!h(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n},this.#F=(t,n,i)=>{if(e[t]=n,this.#n){const n=this.#n-e[t];for(;this.#l>n;)this.#D(!0)}this.#l+=e[t],i&&(i.entrySize=n,i.totalCalculatedSize=this.#l)}}#H=e=>{};#F=(e,t,n)=>{};#k=(e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#g;this.#G(t)&&(!e&&this.#_(t)||(yield t),t!==this.#m);)t=this.#p[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#m;this.#G(t)&&(!e&&this.#_(t)||(yield t),t!==this.#g);)t=this.#d[t]}#G(e){return void 0!==e&&this.#c.get(this.#u[e])===e}*entries(){for(const e of this.#x())void 0===this.#h[e]||void 0===this.#u[e]||this.#S(this.#h[e])||(yield[this.#u[e],this.#h[e]])}*rentries(){for(const e of this.#L())void 0===this.#h[e]||void 0===this.#u[e]||this.#S(this.#h[e])||(yield[this.#u[e],this.#h[e]])}*keys(){for(const e of this.#x()){const t=this.#u[e];void 0===t||this.#S(this.#h[e])||(yield t)}}*rkeys(){for(const e of this.#L()){const t=this.#u[e];void 0===t||this.#S(this.#h[e])||(yield t)}}*values(){for(const e of this.#x())void 0===this.#h[e]||this.#S(this.#h[e])||(yield this.#h[e])}*rvalues(){for(const e of this.#L())void 0===this.#h[e]||this.#S(this.#h[e])||(yield this.#h[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const n of this.#x()){const i=this.#h[n],o=this.#S(i)?i.__staleWhileFetching:i;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.#x()){const i=this.#h[n],o=this.#S(i)?i.__staleWhileFetching:i;void 0!==o&&e.call(t,o,this.#u[n],this)}}rforEach(e,t=this){for(const n of this.#L()){const i=this.#h[n],o=this.#S(i)?i.__staleWhileFetching:i;void 0!==o&&e.call(t,o,this.#u[n],this)}}purgeStale(){let e=!1;for(const t of this.#L({allowStale:!0}))this.#_(t)&&(this.#R(this.#u[t],"expire"),e=!0);return e}info(e){const t=this.#c.get(e);if(void 0===t)return;const n=this.#h[t],i=this.#S(n)?n.__staleWhileFetching:n;if(void 0===i)return;const o={value:i};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.#x({allowStale:!0})){const n=this.#u[t],i=this.#h[t],o=this.#S(i)?i.__staleWhileFetching:i;if(void 0===o||void 0===n)continue;const r={value:o};if(this.#v&&this.#w){r.ttl=this.#v[t];const e=s.now()-this.#w[t];r.start=Math.floor(Date.now()-e)}this.#b&&(r.size=this.#b[t]),e.unshift([n,r])}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:i=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:r=this.sizeCalculation,status:a}=n;let{noUpdateTTL:l=this.noUpdateTTL}=n;const c=this.#k(e,t,n.size||0,r);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#R(e,"set"),this;let u=0===this.#a?void 0:this.#c.get(e);if(void 0===u)u=0===this.#a?this.#g:0!==this.#f.length?this.#f.pop():this.#a===this.#t?this.#D(!1):this.#a,this.#u[u]=e,this.#h[u]=t,this.#c.set(e,u),this.#d[this.#g]=u,this.#p[u]=this.#g,this.#g=u,this.#a++,this.#F(u,c,a),a&&(a.set="add"),l=!1;else{this.#M(u);const n=this.#h[u];if(t!==n){if(this.#C&&this.#S(n)){n.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=n;void 0===t||s||(this.#A&&this.#i?.(t,e,"set"),this.#T&&this.#y?.push([t,e,"set"]))}else s||(this.#A&&this.#i?.(n,e,"set"),this.#T&&this.#y?.push([n,e,"set"]));if(this.#H(u),this.#F(u,c,a),this.#h[u]=t,a){a.set="replace";const e=n&&this.#S(n)?n.__staleWhileFetching:n;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0===i||this.#v||this.#P(),this.#v&&(l||this.#N(u,i,o),a&&this.#O(a,u)),!s&&this.#T&&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.#h[this.#m];if(this.#D(!0),this.#S(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#T&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}}}#D(e){const t=this.#m,n=this.#u[t],i=this.#h[t];return this.#C&&this.#S(i)?i.__abortController.abort(new Error("evicted")):(this.#A||this.#T)&&(this.#A&&this.#i?.(i,n,"evict"),this.#T&&this.#y?.push([i,n,"evict"])),this.#H(t),e&&(this.#u[t]=void 0,this.#h[t]=void 0,this.#f.push(t)),1===this.#a?(this.#m=this.#g=0,this.#f.length=0):this.#m=this.#d[t],this.#c.delete(n),this.#a--,t}has(e,t={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,o=this.#c.get(e);if(void 0!==o){const e=this.#h[o];if(this.#S(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#_(o))return n&&this.#$(o),i&&(i.has="hit",this.#O(i,o)),!0;i&&(i.has="stale",this.#O(i,o))}else i&&(i.has="miss");return!1}peek(e,t={}){const{allowStale:n=this.allowStale}=t,i=this.#c.get(e);if(void 0===i||!n&&this.#_(i))return;const o=this.#h[i];return this.#S(o)?o.__staleWhileFetching:o}#E(e,t,n,i){const o=void 0===t?void 0:this.#h[t];if(this.#S(o))return o;const s=new c,{signal:r}=n;r?.addEventListener("abort",(()=>s.abort(r.reason)),{signal:s.signal});const a={signal:s.signal,options:n,context:i},l=(i,o=!1)=>{const{aborted:r}=s.signal,l=n.ignoreFetchAbort&&void 0!==i;if(n.status&&(r&&!o?(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,l&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),r&&!l&&!o)return u(s.signal.reason);const c=h;return this.#h[t]===h&&(void 0===i?c.__staleWhileFetching?this.#h[t]=c.__staleWhileFetching:this.#R(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,i,a.options))),i},u=i=>{const{aborted:o}=s.signal,r=o&&n.allowStaleOnFetchAbort,a=r||n.allowStaleOnFetchRejection,l=a||n.noDeleteOnFetchRejection,c=h;if(this.#h[t]===h&&(l&&void 0!==c.__staleWhileFetching?r||(this.#h[t]=c.__staleWhileFetching):this.#R(e,"fetch")),a)return n.status&&void 0!==c.__staleWhileFetching&&(n.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw i};n.status&&(n.status.fetchDispatched=!0);const h=new Promise(((t,i)=>{const r=this.#s?.(e,o,a);r&&r instanceof Promise&&r.then((e=>t(void 0===e?void 0:e)),i),s.signal.addEventListener("abort",(()=>{n.ignoreFetchAbort&&!n.allowStaleOnFetchAbort||(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))}))})).then(l,(e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e)))),d=Object.assign(h,{__abortController:s,__staleWhileFetching:o,__returned:void 0});return void 0===t?(this.set(e,d,{...a.options,status:void 0}),t=this.#c.get(e)):this.#h[t]=d,d}#S(e){if(!this.#C)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof c}async fetch(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:r=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:g=!1,status:f,signal:y}=t;if(!this.#C)return f&&(f.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:o,status:f});const b={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:r,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:d,status:f,signal:y};let w=this.#c.get(e);if(void 0===w){f&&(f.fetch="miss");const t=this.#E(e,w,b,m);return t.__returned=t}{const t=this.#h[w];if(this.#S(t)){const e=n&&void 0!==t.__staleWhileFetching;return f&&(f.fetch="inflight",e&&(f.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const o=this.#_(w);if(!g&&!o)return f&&(f.fetch="hit"),this.#M(w),i&&this.#$(w),f&&this.#O(f,w),t;const s=this.#E(e,w,b,m),r=void 0!==s.__staleWhileFetching&&n;return f&&(f.fetch=o?"stale":"refresh",r&&o&&(f.returnedStale=!0)),r?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.#r;if(!n)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:o,...s}=t,r=this.get(e,s);if(!o&&void 0!==r)return r;const a=n(e,r,{options:s,context:i});return this.set(e,a,s),a}get(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:s}=t,r=this.#c.get(e);if(void 0!==r){const t=this.#h[r],a=this.#S(t);return s&&this.#O(s,r),this.#_(r)?(s&&(s.get="stale"),a?(s&&n&&void 0!==t.__staleWhileFetching&&(s.returnedStale=!0),n?t.__staleWhileFetching:void 0):(o||this.#R(e,"expire"),s&&n&&(s.returnedStale=!0),n?t:void 0)):(s&&(s.get="hit"),a?t.__staleWhileFetching:(this.#M(r),i&&this.#$(r),t))}s&&(s.get="miss")}#B(e,t){this.#p[t]=e,this.#d[e]=t}#M(e){e!==this.#g&&(e===this.#m?this.#m=this.#d[e]:this.#B(this.#p[e],this.#d[e]),this.#B(this.#g,e),this.#g=e)}delete(e){return this.#R(e,"delete")}#R(e,t){let n=!1;if(0!==this.#a){const i=this.#c.get(e);if(void 0!==i)if(n=!0,1===this.#a)this.#V(t);else{this.#H(i);const n=this.#h[i];if(this.#S(n)?n.__abortController.abort(new Error("deleted")):(this.#A||this.#T)&&(this.#A&&this.#i?.(n,e,t),this.#T&&this.#y?.push([n,e,t])),this.#c.delete(e),this.#u[i]=void 0,this.#h[i]=void 0,i===this.#g)this.#g=this.#p[i];else if(i===this.#m)this.#m=this.#d[i];else{const e=this.#p[i];this.#d[e]=this.#d[i];const t=this.#d[i];this.#p[t]=this.#p[i]}this.#a--,this.#f.push(i)}}if(this.#T&&this.#y?.length){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}return n}clear(){return this.#V("delete")}#V(e){for(const t of this.#L({allowStale:!0})){const n=this.#h[t];if(this.#S(n))n.__abortController.abort(new Error("deleted"));else{const i=this.#u[t];this.#A&&this.#i?.(n,i,e),this.#T&&this.#y?.push([n,i,e])}}if(this.#c.clear(),this.#h.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.#g=0,this.#f.length=0,this.#l=0,this.#a=0,this.#T&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#o?.(...t)}}}function f(e){window.$monomerHover=e}var y=n(2003),b=n(6077),w=n(3561),v=n(9235);const A="MonomerHoverLinks";async function C(e,t,n,i,s,r=!1){const a=i.getSeqHandler(e),l=a.alphabet==y.YI.RNA||a.alphabet==y.YI.DNA,c=a.isHelm()&&l,u=!a.isHelm()&&l,h=e=>null==e?null:c?r?e:Math.floor(e/3):u&&r?3*e+1:e,d=r?await i.getHelmToMolfileConverter(n):null,p=new g({max:100});function m(e,t){const a=e.get(t);if(null==a)return null;let l=p.get(a);return l||p.set(a,l=function(e,t){const a=i.getSeqHandler(e);if(r){const e=a.getHelm(t);return i.helmToAtomicLevelSingle(e,d,!1,!1).monomers}{const e=a.getSplitted(t),i=a.defaultBiotype,r=o().count(0).take(e.length).map((t=>({position:t,symbol:e.getCanonical(t),biotype:i}))).toArray(),l=a.alphabet,c=l==y.YI.RNA||l==y.YI.DNA?"RNA":"PEPTIDE",u=(0,b.eM)([r],c,l,n,s);return(0,w.gU)(r,u,l,c).monomers}}(e,t)),l}const C={targetCol:t,handler:(t,i,o)=>{const s=o.grid,r=t.tableRowIndex,a=t.gridRow,l=s.cell(o.name,a),c=null!==(u=window.$monomerHover)&&void 0!==u?u:null;var u;if(!c||c&&(c.dataFrameId!=e.dataFrame.id||c.gridRowIdx!=a||c.seqColName!=e.name||c.seqPosition!=i?.position)){if(c&&(f(null),c.gridCell.render()),!i)return f(null),!0;f({gridCell:l,dataFrameId:e.dataFrame.id,gridRowIdx:a,seqColName:e.name,seqPosition:h(i?.position)??-1,getSubstruct:()=>{if(!i||"*"===i.symbol)return;const t=m(e,r);if(!t)return;const o=t.get(h(i?.position));return o?(0,v.H)([o],n):{atoms:[],bonds:[],highlightAtomColors:[],highlightBondColors:[]}}}),l.render()}return!0},getSubstruct:i=>{if("true"!=t.getTag(".sequence-src-highlight-monomers"))return;if(null==i)return;if(!e.get(i))return;const o=m(e,i);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,C),function(e,t){let n=e["substruct-providers"];n||(n=e["substruct-providers"]=[]),n.push(t),e["substruct-providers"]=n}(t.temp,C),C}function T(e,t){try{const n=e.tableColumn;if(!n)return;const i=function(e){return e.temp[A]??[]}(n);for(let n=i.length-1;n>=0;--n){const o=i[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:()=>p,pj:()=>u,uL:()=>h,uX:()=>c});var i=n(6082),o=n(4328),s=n(6295),r=n(3151),a=n(3077),l=n(439);function c(e){const t=[];for(let n=0;n<e.rowCount;n++){const i={};Object.keys(r.Ec).forEach((t=>{if("symbol"===t){const o=e.get(r.Ec[t],n);i[t]="."===o?e.get(r.yw,n):o}else if("rgroups"===t){const o=e.get(r.Ec[t],n).split("\n"),s=[];o.forEach((e=>{const t={},n=e.substring(e.lastIndexOf("]")+1),i=e.match(/\[R(\d+)\]/)[1];t.capGroupSmiles="H"===n?`[*:${i}][H]`:`O[*:${i}]`,t.alternateId="H"===n?`R${i}-H`:`R${i}-OH`,t.capGroupName="H"===n?"H":"OH",t.label=`R${i}`,s.push(t)})),i[t]=s}else r.Ec[t]&&(i[t]=e.get(r.Ec[t],n))})),i.author??(i.author=""),i.id??(i.id=0),i.smiles??(i.smiles=""),i.monomerType??(i.monomerType="Backbone"),i.createDate??(i.createDate=null),t.push(i)}return t}async function u(){const e=i.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 h(e,t,n){e instanceof i.Column&&(e=(0,a.R)(e,n).columns.toList());const s=(await u()).getMonomerLib(),r=new Array(e.length),c=e[0].length,h=new Float32Array(c);for(let n=0;n<e.length;++n){const a=n<t.length?t.getCanonical(n):l._S,u=s.getMonomer("PEPTIDE",a)?.smiles??"",d=e[n],p=d.getRawData(),m=d.categories,g=m.indexOf("");if(r[n]={categories:m,data:p,emptyIndex:g},void 0===a)continue;const f=i.Column.fromStrings("smiles",m.map((e=>s.getMonomer("PEPTIDE",e)?.smiles??""))),y=(i.DataFrame.fromColumns([f]),await o.chem.getSimilarities(f,u)),b=y?y.getRawData():null;for(let e=0;e<c;++e){const t=p[e];a!==l._S&&t!==g?h[e]+=b[t]:a===l._S&&t===g&&(h[e]+=1)}}for(let n=0;n<h.length;++n){let o=h[n]/t.length;for(let s=0;s<e.length;++s){const e=r[s];if(s>=t.length&&e.data[n]!==e.emptyIndex||e.data[n]===e.emptyIndex&&s<t.length){o=i.FLOAT_NULL;break}}h[n]=o}return i.Column.fromFloat32Array("Similarity",h)}async function d(e){const t=(await u()).getMonomerLib(),n=[],s={},r=e.map((e=>t.getMonomer("PEPTIDE",e)?.smiles??"")),a=i.Column.fromStrings("smiles",r);for(let t=0;t<r.length;++t){s[e[t]]=t;const i=r[t],l=""===i?new Array(r.length).fill(0):(await o.chem.getSimilarities(a,i)).getRawData();l[t]=1,n[t]=Array.from(l)}return{scoringMatrix:n,alphabetIndexes:s}}async function p(e,t="Morgan"){const n=(await u()).getMonomerLib(),o=new Array(e.length).fill(0).map((()=>new Array(e.length).fill(0))),r={},a=e.map((e=>n.getMonomer("PEPTIDE",e)?.molfile||n.getMonomer("PEPTIDE",e)?.smiles||"")),l=i.Func.find({package:"Chem",name:"getFingerprints"})[0];if(!l)return console.warn('Function "Chem:getFingerprints" is not found in chem package. falling back to Morgan fingerprints'),await d(e);const c=i.Column.fromStrings("smiles",a),h=(i.DataFrame.fromColumns([c]),(await l.apply({col:c,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 d(e);for(let t=0;t<h.length;++t)if(o[t][t]=1,r[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:r}}},6197:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var i=n(3599);function o(e){let t;switch(e){case i.o.BASE:case i.o.SUGAR:case i.o.LINKER:case i.o.NUCLEOTIDE:case"nucleotide":t="RNA";break;case i.o.AA:t="PEPTIDE";break;case i.o.CHEM:t="CHEM";break;case i.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:()=>c,R:()=>l});var i=n(6082),o=n(1991),s=n.n(o),r=n(330),a=n(3599);async function l(e,t,o,l,c,u,h){const d=e.length,p=e.dataFrame,m=Math.max(navigator.hardwareConcurrency-2,1),g=new Array(m).fill(null).map((()=>new Worker(new URL(n.p+n.u(455),n.b)))),f=d/m,y=new Array(m),b=u.getSeqHandler(e),w="RNA"==l?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=g[e],i=Math.floor(e*f),s=e===m-1?d:Math.floor((e+1)*f);y[e]=new Promise((e=>{n.onmessage=t=>{e(t.data)}})),n.postMessage({seqList:v,monomersDict:t,alphabet:o,polymerType:l,start:i,end:s})}const A=[],C=[];await Promise.all(y).then((e=>{for(const t of e)A.push(...t.molfiles),C.push(...t.warnings)})),setTimeout((()=>{g.forEach((e=>{e.terminate()}))}),0);const T=(0,r.qj)(p,e.name),S=i.Column.fromType(i.COLUMN_TYPE.STRING,T,e.length).init((e=>A[e]?.molfile));return S.semType=i.SEMTYPE.MOLECULE,S.meta.units=i.UNITS.Molecule.MOLBLOCK,S.setTag(".sequence-src-col",e.name),{molCol:S,warnings:C}}function c(e,t){const n={},o={};for(const s of e){const e=t.getWebEditorMonomer(s.biotype,s.symbol).backgroundcolor,a=(0,r.vG)(e??i.Color.toRgb(i.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:()=>l,YN:()=>g,gU:()=>c});var i=n(8123),o=n(294),s=n(3151),r=n(439),a=n(6197);function l(e,t,n){const o=new Map;for(const a of e.getMonomerSymbolsByType(t)){const l=e.getMonomer(t,a);if("RNA"===t&&("Branch"===l.monomerType||n===r.YI.DNA&&l.symbol===i.u.DEOXYRIBOSE.symbol||n===r.YI.RNA&&l.symbol===i.u.RIBOSE.symbol||l.symbol===i.u.PHOSPHATE.symbol)||"PEPTIDE"===t&&"Branch"!==l.monomerType){const e={};s.f6.forEach((t=>{e[t]=l[t]})),o.set(l.symbol,e)}}return o}function c(e,t,n,s){if(0===e.length)return o.vF.createEmpty();const l=m,{atomCount:c,bondCount:h,needsCapping:p}=l(e,t,n,s),f=new Array(c),y=new Array(h);let b,w=null,v=null;"PEPTIDE"===s?b=u:(b=d,w=n===r.YI.DNA?(0,o.xb)(t,i.u.DEOXYRIBOSE):(0,o.xb)(t,i.u.RIBOSE),v=(0,o.xb)(t,i.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},C={sugar:w,phosphate:v,seqLength:e.length,atomCount:c,bondCount:h},T=new o.Cg,S=[];let E,M=0;for(A.i=0;A.i<C.seqLength;++A.i){const n=e[A.i];if(n.symbol===r._S)continue;const i=(0,o.xb)(t,{symbol:n.symbol,polymerType:(0,a.Y)(n.biotype)});E=i.terminalR2Atom;const s=A.nodeShift,l=A.bondShift;b(i,f,y,A,C),i.stereoAtoms?.forEach((e=>S.push(e+M))),M+=i.atoms.x.length;const c=A.nodeShift-s,u=new Array(c);for(let e=0;e<c;++e)u[e]=s+e;const h=A.bondShift-l,d=new Array(h);for(let e=0;e<h;++e)d[e]=l+e;T.set(A.i,{biotype:n.biotype,symbol:n.symbol,atoms:u,bonds:d})}p&&function(e,t,n,o,s=i.u.OXYGEN){const r=n.nodeShift+1;e[o.atomCount]=i.u.V3K_BEGIN_DATA_LINE+r+" "+(s??i.u.OXYGEN)+" "+g(n.backbonePositionShift[0])+" "+n.flipFactor*g(n.backbonePositionShift[1])+" 0.000000 0\n";const a=n.backboneAttachNode,l=r;t[o.bondCount]=i.u.V3K_BEGIN_DATA_LINE+n.bondShift+" 1 "+a+" "+l+"\n"}(f,y,A,C,E??i.u.OXYGEN);const x=i.u.V3K_BEGIN_COUNTS_LINE+c+" "+h+i.u.V3K_COUNTS_LINE_ENDING;let L="";return L+=i.u.V3K_HEADER_FIRST_LINE,L+=i.u.V3K_HEADER_SECOND_LINE,L+=i.u.V3K_BEGIN_CTAB_BLOCK,L+=x,L+=i.u.V3K_BEGIN_ATOM_BLOCK,L+=f.join(""),L+=i.u.V3K_END_ATOM_BLOCK,L+=i.u.V3K_BEGIN_BOND_BLOCK,L+=y.join(""),L+=i.u.V3K_END_BOND_BLOCK,S.length>0&&(L+=function(e){const t=[];let n=`M V30 MDLV30/STEABS ATOMS=(${e.length}`;for(let i=0;i<e.length;i++){const o=`${n} ${e[i]}`;o.length>76?(t.push(`${n} -\n`),n=`M V30 ${e[i]}`):n=o,i===e.length-1&&t.push(`${n})\n`)}return`M V30 BEGIN COLLECTION\n${t.join("")}M V30 END COLLECTION\n`}(S)),L+=i.u.V3K_END_CTAB_BLOCK,L+=i.u.V3K_END,{molfile:L,monomers:T}}function u(e,t,n,i){i.flipFactor=(-1)**(i.i%2),h(e,t,n,i)}function h(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]=i.u.V3K_BEGIN_DATA_LINE+s+" "+e.atoms.atomTypes[o]+" "+g(n.backbonePositionShift[0]+e.atoms.x[o])+" "+g(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,r=e.meta.terminalNodes[0]+n.nodeShift;t[n.bondShift-1]=i.u.V3K_BEGIN_DATA_LINE+o+" 1 "+s+" "+r+"\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 d(e,t,n,o,s){if(0===o.i)h(s.sugar,t,n,o);else for(const e of[s.phosphate,s.sugar])h(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]=i.u.V3K_BEGIN_DATA_LINE+s+" "+e.atoms.atomTypes[o]+" "+g(n.branchPositionShift[0]+e.atoms.x[o])+" "+g(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,r=e.meta.terminalNodes[0]+n.nodeShift;t[o-1]=i.u.V3K_BEGIN_DATA_LINE+o+" 1 "+s+" "+r+"\n"}(e,n,o);const s=o.bondShift,r=o.branchAttachNode,a=e.meta.terminalNodes[0]+o.nodeShift;n[s-1]=i.u.V3K_BEGIN_DATA_LINE+s+" 1 "+r+" "+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,r=e.bonds.atomPairs[o][0]+n.nodeShift,a=e.bonds.atomPairs[o][1]+n.nodeShift;let l="";if(e.bonds.bondConfiguration.has(o)){let t=e.bonds.bondConfiguration.get(o);n.flipFactor<0&&(t=1===t?3:1),l=" CFG="+t}const c=e.bonds.kwargs.has(o)?" "+e.bonds.kwargs.get(o):"";t[n.bondShift+o]=i.u.V3K_BEGIN_DATA_LINE+s+" "+e.bonds.bondTypes[o]+" "+r+" "+a+l+c+"\n"}}function m(e,t,n,s){let l=0,c=0,u=0,h=!0,d=null;for(const n of e)if(n.symbol!==r._S){if("*"==n.symbol)throw new Error("Gap canonical symbol is '', not '*");d=(0,o.xb)(t,{symbol:n.symbol,polymerType:(0,a.Y)(n.biotype)}),l+=d.atoms.x.length,c+=d.bonds.bondTypes.length,u++}if("PEPTIDE"===s)l+=1,c+=u,u>0&&((d?.meta?.rNodes?.length??0)<2||d?.terminalR2Atom?.toLowerCase()===i.u.HYDROGEN.toLowerCase())&&(h=!1,l-=1,c-=1);else{const s=n===r.YI.DNA?(0,o.xb)(t,i.u.DEOXYRIBOSE):(0,o.xb)(t,i.u.RIBOSE),a=(0,o.xb)(t,i.u.PHOSPHATE);l+=(e.length-1)*a.atoms.x.length,l+=e.length*s.atoms.x.length,l+=1,c+=(e.length-1)*a.bonds.bondTypes.length,c+=e.length*s.bonds.bondTypes.length,c-=1,c+=3*e.length}return{atomCount:l,bondCount:c,needsCapping:h}}function g(e){return Math.round(i.u.PRECISION_FACTOR*e)/i.u.PRECISION_FACTOR}},6077:(e,t,n)=>{"use strict";n.d(t,{C4:()=>m,eM:()=>g});var i=n(4328),o=n(6082),s=n(1991),r=n.n(s),a=n(439),l=n(3561),c=n(9235),u=n(294),h=n(9192),d=n(330),p=n(8123);async function m(e,t,n,s,l){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,f;p.notation!==a.Hi.SEPARATOR&&(u=p.convert(a.Hi.SEPARATOR,"."),u.name=t.name);try{f=s.getSeqHandler(u).alphabet,m=(0,d.pz)(f)}catch(e){const[t,n]=(0,h.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 l=s.defaultBiotype;for(let e=0;e<n;++e){const t=s.getSplitted(e);a||(a=0===t.length),o[e]=r().count(0).take(t.length).filter((e=>!t.isGap(e))).map((e=>({position:e,biotype:l,symbol:t.getCanonical(e)}))).toArray()}return a&&i.shell.warning(`Some values in the "${e.name}" column are empty`),o}(u,s),b=g(y,m,f,n,l),w=u.length,v=await(0,c.R)(u,b,f,m,n,s,l);v.warnings.length>.05*w&&i.shell.warning(`Molfile conversion resulted in ${v.warnings.length} errors`);const A=o.Func.find({name:"convertToV3KViaOCL"})[0];if(A&&v.molCol)try{const e=v.molCol.toList(),t=await A.apply({mols:e});v.molCol.init((n=>t[n]?t[n]:e[n]))}catch(e){console.error(e)}return v}function g(e,t,n,i,o){const s=(0,l.Hb)(i,t,n),r={},c={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)f(r,n.symbol,s,o,t,c)}for(let n=0;n<e.length;++n){const i=e[n];for(const e of i){const n=e.symbol;if(""!==n)try{if("RNA"===t&&3===n.split(/\(|\)/).filter((e=>!!e)).length){const e=n.split(/\(|\)/)[1];f(r,e,s,o,t,c),r[t]?.[e]&&(r[t][n]=r[t][e])}else f(r,n,s,o,t,c)}catch(e){const t=e instanceof Error?e.message:e.toString(),i=e instanceof Error?e.stack:void 0;throw console.error(`bio lib: getMonomersDictFromLib() sym='${n}', error:\n${t}\n${i}`),new Error(`Can't get monomer '${n}' from library: ${t}`)}}}return r}function f(e,t,n,i,o,s){const r={polymerType:o,symbol:t};if(!(0,u.bq)(e,r)){const a=function(e,t,n,i,o){if(t.has(e)){const r=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}(r.rgroups),c=(s=r.molfile).includes("V3000")?function(e){const t=new Map,n=/M V30 (\d+) R#.+RGROUPS=\((\d+) (\d+)\).*/gm;let i;for(;null!==(i=n.exec(e));)i.index===n.lastIndex&&n.lastIndex++,t.set(parseInt(i[1]),parseInt(i[3]));return t}(s):function(e){const t=new Map;let n=e.indexOf(p.u.V2K_A_LINE,0),i=n;for(;-1!==n;){i=e.indexOf("\n",n);const o=parseInt(e.substring(n,i).replace(/^A\s+/,""));n=e.indexOf("R",i),i=e.indexOf("\n",n);const s=parseInt(e.substring(n,i).replace(/^R/,""));t.set(o,s),n=e.indexOf(p.u.V2K_A_LINE,i)}for(n=e.indexOf(p.u.V2K_RGP_LINE,0),i=e.indexOf("\n",n);-1!==n;){n+=p.u.V2K_RGP_SHIFT,i=e.indexOf("\n",n);const o=e.substring(n,i).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,i)}return t}(s),u=r.molfile.includes("V3000")?r.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 i=-1!==t?t:n,o=e.split("");for(let e=i+5;e<o.length;e++)" "!==o[e]&&(o[e]="0");return o.join("")})).join("\n")}(e)),i=n.get_v3Kmolblock();return n.delete(),i}(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)}(r.molfile),n),h=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 i=parseInt(e.substring(t,n));return t=n+1,n=e.indexOf(" ",t+1),{atomCount:i,bondCount:parseInt(e.substring(t,n))}}(u),d=function(e,t){const n=new Array(t),i=new Float32Array(t),o=new Float32Array(t),s=new Array(t);let r=e.indexOf(p.u.V3K_BEGIN_ATOM_BLOCK);r=e.indexOf("\n",r);let a=r;for(let l=0;l<t;l++){r=e.indexOf(p.u.V3K_BEGIN_DATA_LINE,r)+p.u.V3K_IDX_SHIFT,a=e.indexOf(" ",r),r=a+1,a=e.indexOf(" ",r),n[l]=e.substring(r,a);const t=new Array(2);for(let n=0;n<2;++n)r=a+1,a=e.indexOf(" ",r),t[n]=parseFloat(e.substring(r,a));i[l]=t[0],o[l]=t[1],r=a,a=e.indexOf("\n",r)+1,s[l]=e.slice(r,a),r=a}return{atomTypes:n,x:i,y:o,kwargs:s}}(u,h.atomCount),m=function(e,t){const n=new Uint32Array(t),i=new Array(t),o=new Map,s=new Map;let r=e.indexOf(p.u.V3K_BEGIN_BOND_BLOCK);r=e.indexOf("\n",r);let a=r;for(let l=0;l<t;++l){const t=new Array(3);r=e.indexOf(p.u.V3K_BEGIN_DATA_LINE,a)+p.u.V3K_IDX_SHIFT,a=e.indexOf(" ",r);for(let n=0;n<3;++n)r=a+1,a=Math.min(e.indexOf("\n",r),e.indexOf(" ",r)),t[n]=parseInt(e.slice(r,a));n[l]=t[0],i[l]=t.slice(1);const c=e.indexOf("\n",r);let u=e.slice(a,c),h=u.indexOf(p.u.V3K_BOND_CONFIG);if(-1!==h){h=u.indexOf("=",h)+1;let e=u.indexOf(" ",h);-1===e&&(e=u.length);const t=parseInt(u.slice(h,e));o.set(l,t);const n=p.u.V3K_BOND_CONFIG+t.toString();u=u.replace(n,"")}u||s.set(l,u)}return{bondTypes:n,atomPairs:i,bondConfiguration:o,kwargs:s}}(u,h.bondCount),g=function(e,t,n,i){const o={backboneShift:null,branchShift:null,terminalNodes:[],rNodes:[]};if(n&&i&&[1,2].some((e=>!Array.from(i.values()).find((t=>t==e))))){const o=[1,2].find((e=>!Array.from(i.values()).find((t=>t==e)))),s=[1,2].find((e=>Array.from(i.values()).find((t=>t==e)))),r=Array.from(i.keys()).find((e=>i.get(e)===s))-1,a=e.x[r],l=e.y[r],c=t.atomPairs.find((e=>e.includes(r+1))).find((e=>e!==r+1))-1;let u=e.x.reduce(((t,n,i)=>{if(i===r)return t;if(i===c)return t;const o=e.y[i];return Math.sqrt((n-a)**2+(o-l)**2)>Math.sqrt((e.x[t]-a)**2+(e.y[t]-l)**2)?i:t}),-1);if(-1===u&&(u=e.x.length,e.x=new Float32Array([...e.x,-a]),e.y=new Float32Array([...e.y,-l]),e.atomTypes=[...e.atomTypes,"H"],e.kwargs=[...e.kwargs,""],t.atomPairs.push([c+1,u+1]),t.bondTypes=new Uint32Array([...t.bondTypes,1]),t.kwargs.set(t.atomPairs.length-1,"")),i.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[i,o]of n)e.atomTypes[i-1]=t[o-1]}(e,n,i),function(e,t){t.rNodes=Array.from(e.keys());for(let n=0;n<t.rNodes.length;n++)for(const i of[1,2])if(e.get(t.rNodes[n])===i){const e=t.rNodes[i-1];t.rNodes[i-1]=t.rNodes[n],t.rNodes[n]=e}}(i,o),y(t,o),o}(d,m,a,c),f=function(e){let t=[],n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(");for(;-1!==n;){n+=28;const i=e.indexOf(")",n);t=t.concat(e.substring(n,i).split(" ").slice(1).map((e=>parseInt(e)))),n=i,n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(",n)}return t}(u),w={atoms:d,bonds:m,meta:g,stereoAtoms:f};return"PEPTIDE"===i?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,i=e.atoms.x,o=e.atoms.y;M(e,-i[t],-o[t]);const s=C(i[n],o[n]);T(e.atoms,-s),i[e.meta.rNodes[1]-1]<0&&S(e);const r=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 i=n[e],o=n[(e+1)%2];t.has(i)?t.get(i)?.push(o):t.set(i,new Array(1).fill(o))}return t}(e);let n=0;const i=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>i)return null}return n}(e);null!=r&&(function(e,t){e.atoms.y[e.meta.rNodes[1]-1]<0&&e.atoms.y[t-1]<0&&(function(e){E(e,!0)}(e),T(e.atoms,-function(e,t){return C(e,t)+Math.PI/2}(e.atoms.x[e.meta.terminalNodes[1]-1],e.atoms.y[e.meta.terminalNodes[1]-1])))}(e,r),function(e,t){const n=e.atoms.x;n[e.meta.rNodes[1]-1]>n[t-1]&&function(e,t,n){const i=t-1,o=n-1,s=e.atoms.x,r=e.atoms.y,a=s[i],l=r[i];s[i]=s[o],r[i]=r[o],s[o]=a,r[o]=l}(e,t,e.meta.rNodes[1])}(e,r))}(w):e===p.u.RIBOSE.symbol||e===p.u.DEOXYRIBOSE.symbol?function(e,t){const n=e.atoms.x,i=e.atoms.y;let o=e.meta.terminalNodes[0]-1;const s=e.meta.rNodes[1]-1;M(e,-n[o],-i[o]);const r=C(n[e.meta.rNodes[2]-1],i[e.meta.rNodes[2]-1]);T(e.atoms,-r),n[e.meta.rNodes[0]-1]>n[e.meta.rNodes[1]-1]&&S(e);const a=C(n[s],i[s]);T(e.atoms,3*Math.PI/2-a),t.value=function(e){const t=e.atoms.x,n=e.atoms.y,i=e.meta.rNodes[2]-1,o=e.meta.terminalNodes[2]-1,s=t[i]-t[o],r=n[i]-n[o];return Math.atan2(s,r)}(e),o=e.meta.terminalNodes[0]-1,M(e,-n[o],-i[o])}(w,o):e===p.u.PHOSPHATE.symbol?function(e){const t=e.meta.rNodes[1]-1,n=e.meta.rNodes[0]-1,i=e.atoms.x,o=e.atoms.y;M(e,-i[t],-o[t]);const s=C(i[n],o[n]);T(e.atoms,Math.PI/2-s)}(w):function(e,t){const n=e.atoms.x,i=e.atoms.y,o=e.meta.terminalNodes[0]-1,s=e.meta.rNodes[0]-1;M(e,-n[o],-i[o]);const r=C(n[s],i[s]),a=t.value;if(!a)throw new Error("The value of sugarBranchToOYAngle is null");T(e.atoms,Math.PI-r+a);const c=function(e,t){return(0,l.YN)(Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2))}({x:n[e.meta.rNodes[0]-1],y:i[e.meta.rNodes[0]-1]},{x:n[e.meta.terminalNodes[0]-1],y:i[e.meta.terminalNodes[0]-1]});if(1!=c)for(let e=0;e<n.length;++e)n[e]=(0,l.YN)(n[e]/c),i[e]=(0,l.YN)(i[e]/c)}(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],M(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]))}(i,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 i=e.atoms.kwargs[n];i&&i.includes(t)&&(e.atoms.kwargs[n]=i.replace(t,""))}}(w),w}var s;return null}(t,n,i,o,s);if(!a)throw new Error(`Monomer with symbol '${t}' is absent the monomer library`);(0,u.LQ)(e,r,a)}}function y(e,t){const n=t.rNodes;t.terminalNodes=new Array(n.length).fill(0);const i=t.terminalNodes,o=e.atomPairs;let s=0,r=0;for(;s<o.length&&r<i.length;){for(let e=0;e<i.length;++e)for(let t=0;t<2;++t)o[s][t]===n[e]&&(i[e]=o[s][(t+1)%2],n.length,++r);++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,l.YN)(e.atoms.x[t]-e.atoms.x[n]),(0,l.YN)(e.atoms.y[t]-e.atoms.y[n])]}function v(e,t){if(void 0!==t){const n=t-1,i=e.atoms,o=e.bonds,s=e.meta,r=i.atomTypes.splice(n,1)[0];i.x=A(Float32Array,i.x,n,1),i.y=A(Float32Array,i.y,n,1),i.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 l=Array.from(o.bondConfiguration.keys());return l.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)}})),l=Array.from(o.kwargs.keys()),l.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)}})),r?{removedAtom:r}:void 0}}function A(e,t,n,i){const o=new e(t.length-i);let s=0,r=0;for(;s<t.length;)s===n&&(s+=i),o[r]=t[s],++r,++s;return o}function C(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 i=t/e,o=Math.atan(i);n=e<0?Math.PI/2+o:-Math.PI/2+o}return n}function T(e,t){if(0!==t){const n=e.x,i=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,l.YN)(t*o-i[e]*s),i[e]=(0,l.YN)(t*s+i[e]*o)}}}function S(e){E(e,!1)}function E(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 i=1===t?3:1;n.set(e,i)}}function M(e,t,n){const i=e.atoms.x,o=e.atoms.y;for(let e=0;e<i.length;++e)i[e]=(0,l.YN)(i[e]+t),void 0!==n&&(o[e]=(0,l.YN)(o[e]+n))}},294:(e,t,n)=>{"use strict";function i(e,t){return e[t.polymerType]?.[t.symbol]}function o(e,t){return!!e[t.polymerType]?.[t.symbol]}function s(e,t,n){let i=e[t.polymerType];i||(i=e[t.polymerType]={}),i[t.symbol]=n}n.d(t,{Cg:()=>r,LQ:()=>s,bq:()=>o,vF:()=>a,xb:()=>i});class r extends Map{constructor(e){super(e)}}class a{constructor(e,t){this.molfile=e,this.monomers=t}static createEmpty(){return new a("",new r(null))}}},330:(e,t,n)=>{"use strict";n.d(t,{kA:()=>o,pz:()=>r,qj:()=>s,vG:()=>a});var i=n(2003);function o(e,t){return e?e.columns.getUnusedName(t):t}function s(e,t){return o(e,`molfile(${t})`)}function r(e){let t;if(e===i.YI.PT||e===i.YI.UN)t="PEPTIDE";else{if(e!==i.YI.RNA&&e!==i.YI.DNA)throw new Error(`Unexpected alphabet '${e}'.`);t="RNA"}return t}function a(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 i=n(7362);class o extends i.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:()=>i});class i{static makePalette(e,t=!1,n=i){const o={};return e.forEach((e=>{const n=e[0],i=e[1];n.forEach(((e,n)=>{o[e]=this.colourPalette[i][t?0:n]}))})),new n(o)}constructor(e){this._palette=e}get(e,t){return this._palette[e]}}i.undefinedColor="rgb(100,100,100)",i.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 i=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 i.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:()=>l,oT:()=>h});var i=n(6082),o=n(7362),s=n(6718);function r(e,t=!0){if(null==e)return"rgb(100,100,100)";const n=i.Color.fromHtml(e);if(t){const e=i.Color.g(n),t=i.Color.r(n),o=i.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 i.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 l{}class c extends l{get(e,t){return"#666666"}}class u extends l{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 i of n){const n=t.getMonomer(e,i);n?.meta?.colors?.default?.background&&(this.customMonomerColors[i]||(this.customMonomerColors[i]={}),this.customMonomerColors[i][e]=r(n.meta.colors.default.background))}}}))}))})),[].concat(...Object.values(o.e.colourPalette))}get(e,t){const n=u.palette.length,i=u.customMonomerColors[e],o=t??"PEPTIDE";if(i&&i[o])return i[o];const s=a.hashCode(e)%n;return r(u.palette[s])}}u._pallete=null,u.customMonomerColors={},u.polymerTypes=[];class h extends o.e{static get Gray(){return void 0===this.gray&&(this.gray=new c),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:()=>r,sD:()=>l});var i=n(4328),o=n(1858),s=n(8070);function r(e){let t=null,n=null;try{n=e.dart?e.gridColumn:null,t=n?n.temp:null}catch{[n,t]=[null,null]}const i=e.cell.column;if(t=t??(i?i.temp:null),!t)throw new Error("Grid cell renderer back store (GridColumn or Column) not found.");return[n,i,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 l 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=++l.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(i.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(i.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`)}}l.viewerCounter=-1},673:(e,t,n)=>{"use strict";n.d(t,{s:()=>i});const i={true:"1",false:"0"}},6882:(e,t,n)=>{"use strict";n.d(t,{Bb:()=>b,Jy:()=>w,S$:()=>y,U0:()=>v});var i=n(7389),o=n(6082),s=n(1991),r=n.n(s),a=n(8312),l=n(2003),c=n(6642),u=n(6718),h=n(9192),d=n(3856),p=n(673),m=n(3599),g=n(5553),f=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 i,o=100,s=0,r=e.length-1;for(;s<=r;){if(i=Math.floor((r+s)/2),e[i]<=t&&t<e[i+1])return i;if(t<e[i]?r=i-1:s=i+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 c.sD{get separatorWidth(){return this.props?.fontCharWidth?this.props?.fontCharWidth:5}constructor(e,t,n,i,s){if(super(e,t,n),this.monomerLengthLimit=i,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=[l.gp.positionShift,"renderMultiline"];this.subs.push(o.debounce(this.tableCol.dataFrame.onMetadataChanged.pipe(f.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(f.filter((e=>e.args.source===this.tableCol&&e.args.key===l.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,i,o,s){if(this.dirty)try{this.reset()}catch(e){const[t,n]=(0,h.AP)(e);this.logger.error(t,void 0,n)}const{lineHeight:r,monomerSpacing:a}=this.calculateFontBasedSpacing(e),l=t-2*this.padding;let c=0;const u=[];if(i.length>0)for(let t=o;t<i.length;t++){const n=i.getOriginal(t),o=this.props.monomerToShort(n,s);u.push({text:o,posIdx:t}),c=Math.max(c,e.measureText(o).width)}if(0===u.length)return{lineLayouts:[],lineHeight:r};const d=c;let p=Math.floor((l+a)/(d+a));p=Math.max(1,p);const m=n-2*this.padding,g=Math.max(0,Math.floor(m/r)),f=[];let y=0;for(let e=0;e<g&&y<u.length;e++){const t=[];for(let e=0;e<p&&y<u.length;e++){const n=u[y],i=this.padding+e*(d+a);t.push({posIdx:n.posIdx,x:i,width:d,om:n.text,isSeparator:!1}),y++}f.push({lineIdx:e,elements:t})}return{lineLayouts:f,lineHeight:r}}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,h.AP)(e);this.logger.error(t,void 0,n)}const i=n.isMsa()?this.getCellMonomerLengthsForSeqMsa():this.getCellMonomerLengthsForSeq(e);return[i,this.getSummedMonomerLengths(i)]}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),i=this.props.separatorWidth+1*this.props.fontCharWidth,o=this.positionShift,s=Math.ceil(t/i)+o,r=n.splitter(e),a=Math.min(s,r.length),l=new Array(a-o);let c=0;for(let e=o;e<a;++e){const i=r.getOriginal(e),s=this.props.monomerToShort(i,this.monomerLengthLimit),a=(n.isSeparator()?this.separatorWidth:this.props.separatorWidth)+s.length*this.props.fontCharWidth;if(l[e-o]=a,c+=a,c>t)break}return l}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),i=this.props.separatorWidth+1*this.props.fontCharWidth,o=Math.ceil(this.colWidth/i)+t,s=n.getSplitted(e),r=Math.min(o,s.length);let a=this._monomerLengthList[e];if(null===a||a.length!=r-t){a=this._monomerLengthList[e]=new Array(s.length);let i=0;for(let e=t;e<r;++e){const o=s.getOriginal(e),r=this.props.monomerToShort(o,this.monomerLengthLimit),l=(n.isSeparator()?this.separatorWidth:this.props.separatorWidth)+r.length*this.props.fontCharWidth;if(a[e-t]=l,i+=l,i>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:i}=(()=>{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,r=Math.ceil(this.colWidth/o)+s;for(let e=n;e<i;e++){if(this._processedRows.get(e)&&r<=this._processedMaxVisibleSeqLength)continue;const n=this.seqHelper.getSeqHandler(this.tableCol).getSplitted(e,r),i=Math.min(r,n.length);i-s>t.length&&t.push(...new Array(i-s-t.length).fill(o));let a=0;for(let e=s;e<i;++e){const i=n.getOriginal(e),o=this.props.monomerToShort(i,this.monomerLengthLimit),r=this.props.separatorWidth+o.length*this.props.fontCharWidth;if(t[e-s]=Math.max(t[e-s]??0,r),a+=r,a>=this.colWidth)break}this._processedMaxVisibleSeqLength=Math.max(this._processedMaxVisibleSeqLength,r),this._processedRows.set(e,!0)}return t}getPosition(e,t,n,i){const[o,s]=this.getCellMonomerLengths(e,n);return 0===this.seqHelper.getSeqHandler(this.tableCol).getSplitted(e).length?null:b(s,t,i)}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[l.gp.positionShift]??"0")??0;return isNaN(e)?0:Math.max(e,0)}render(e,t,n,i,s,a,c){const u=a.grid?.canvas===e.canvas;if(!this.seqHelper)return;const m=this.tableCol,g=this.positionShift;e.save();try{const c=this.seqHelper.getSeqHandler(m);let h=this.monomerLengthLimit;if(d.gp.maxMonomerLength in m.tags){const e=parseInt(m.getTag(d.gp.maxMonomerLength));h=!isNaN(e)&&e?e:50}if(".mm.cellRenderer.maxMonomerLength"in m.temp){const e=m.temp[".mm.cellRenderer.maxMonomerLength"],t="number"==typeof e?e:parseInt(e);h=!isNaN(t)&&t?t:50}if(m.temp[".mm.cellRenderer.settingsChanged"]===p.s.true||this.monomerLengthLimit!=h){let e=0;const t=8;e=m.temp[".mm.cellRenderer.gapLength"]??e,this.setMonomerLengthLimit(h),this.setSeparatorWidth(c.isMsa()?t:e),m.temp[".mm.cellRenderer.settingsChanged"]=p.s.false,this.dirty=!0}const f=a.cell.rowIndex,b=a.cell.value;u&&(i=v(a.grid,e,t,i,window.devicePixelRatio)),e.beginPath(),e.rect(t,n,i,s),e.clip(),e.font=this.props?.font??"12px monospace",e.textBaseline="top";const w=m.meta.units,A=m.getTag(l.gp.aligned),C=m.getTag(l.gp.separator)??"",T=u?c.getSplitted(f):c.splitter(b);let S=d.yg.classic;A?.includes("MSA")&&w===l.Hi.SEPARATOR&&(S=d.yg.MSA);const E=m.temp["reference-sequence"],M=this.tableCol.temp["current-word"],x=(()=>{const e=(0,c.splitter)(null!=E&&""!==E?E:M??"");return r().count(0).take(e.length).slice(g).map((t=>e.getCanonical(t))).toArray()})(),L=Number.parseInt(m.getTag(l.gp.selectedPosition)??"-200");if(this.shouldUseMultilineRendering(m)){const r=[],l=this.calculateMultiLineLayoutDynamic(e,i,s,T,g,h);let u=n+this.padding;1===l.lineLayouts.length&&(u=n+(s-l.lineHeight)/2);for(const i of l.lineLayouts){const s=u+i.lineIdx*l.lineHeight;for(const u of i.elements){const h=t+u.x,p=u,f=p.posIdx,b=T.getCanonical(f);let w=y;const v=this.getMonomerLib();v&&(w=v.getMonomerTextColor(c.defaultBiotype,b));let A=0;if(a.tableRowIndex!==m.dataFrame.currentRowIdx&&x.length>0){const e=f-g;e>=0&&e<x.length&&b===x[e]&&(A=.7)}r.push({lineIdx:i.lineIdx,monomerIdx:f-g,bounds:new o.Rect(u.x,s-n,u.width,l.lineHeight),sequencePosition:f}),(0,d.oZ)(e,p.om,h,s,u.width,l.lineHeight,{color:w,isMultiLineContext:!0,transparencyRate:A,selectedPosition:isNaN(L)||L<1?void 0:L,wordIdx:f})}}null!==a.tableRowIndex&&this._cellBounds.set(a.tableRowIndex,r)}else{this._leftThreeDotsPadding=this.shouldRenderShiftedThreeDots(g)?e.measureText("...").width:0;let[,o]=this.getCellMonomerLengths(a.tableRowIndex,i);u||(o=this.getSummedMonomerLengths(this.getCellMonomerLengthsForSeqValue(b,i)));const r=this.props.separatorWidth+1*this.props.fontCharWidth,l=Math.min(T.length,Math.ceil(i/r)+g);for(let r=g;r<l;++r){const l=r<T.length?T.getOriginal(r):c.defaultGapOriginal,u=r<T.length?T.getCanonical(r):c.defaultGapOriginal;let p=y;this.getMonomerLib()&&(p=this.getMonomerLib().getMonomerTextColor(c.defaultBiotype,u));const m={color:p,pivot:0,left:!0,transparencyRate:0,separator:C,last:r===T.length-1,drawStyle:S,maxWord:o,wordIdx:r-g,gridCell:a,referenceSequence:x,maxLengthOfMonomer:h,monomerTextSizeMap:this._monomerLengthMap,logger:this.logger,selectedPosition:isNaN(L)||L<1?void 0:L-g};(0,d.oZ)(e,l,t+this.padding+this._leftThreeDotsPadding,n,i,s,m)}if(this.shouldRenderShiftedThreeDots(g)){const r={color:y,pivot:0,left:!0,transparencyRate:0,separator:C,last:!1,drawStyle:S,maxWord:o,wordIdx:0,gridCell:a,maxLengthOfMonomer:h,monomerTextSizeMap:this._monomerLengthMap,logger:this.logger};(0,d.oZ)(e,"...",t+this.padding,n,i,s,r)}}}catch(e){const[t,n]=(0,h.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,r=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 c=null;const u=this._cellBounds.get(e.tableRowIndex);if(u){for(const e of u)if(e.bounds.contains(r,a)){c=e.monomerIdx;break}}else{const t=this.shouldRenderShiftedThreeDots(o)&&(this._leftThreeDotsPadding??0)>0?this._leftThreeDotsPadding:0;c=this.getPosition(e.tableRowIndex,r,s.width,t)}this.logger.debug(`${n}, argsX: ${r}, argsY: ${a}, left: ${c}`);const h=this.seqHelper.getSeqHandler(this.tableCol),d=h.getSplitted(e.tableRowIndex);if(null!==c&&c>=0&&c+o<d.length){const n=h.alphabet??l.YI.UN,s={position:c,biotype:n===l.YI.RNA||n===l.YI.DNA?m.o.NUCLEOTIDE:m.o.AA,symbol:d.getCanonical(c+o)},r=[];let a=this._monomerStructureMap[s.symbol];if(!a){const e=this.getMonomerLib();a=this._monomerStructureMap[s.symbol]=e?e.getTooltip(s.biotype,s.symbol):i.divText("Monomer library is not available")}r.push(a),i.tooltip.show(i.divV(r),t.x+16,t.y+16),(0,g.WN)(e,s)}else-1===c?i.tooltip.show(i.divText(`${Math.min(o,d.length)} hidden monomers`),t.x+16,t.y+16):i.tooltip.hide(),(0,g.WN)(e,null)}}function v(e,t,n,i,o){return e?Math.max(Math.min(e.canvas.width/o-n,i)):Math.max(t.canvas.width/o-n,0)}},3856:(e,t,n)=>{"use strict";n.d(t,{Mn:()=>u,gp:()=>c,oZ:()=>p,yg:()=>h});var i=n(6082),o=n(7278);const s="rgb(100,100,100)",r="#808080",a="rgb(0,0,0)",l=o.zS;var c,u,h;!function(e){e.maxMonomerLength=".mm.cellRenderer.maxMonomerLength"}(c||(c={})),function(e){e.applyToBackground=".m.cellRenderer.applyToBackground"}(u||(u={})),function(e){e.MSA="MSA",e.classic="classic"}(h||(h={}));const d=new class{constructor(){this.color=s,this.pivot=0,this.left=!1,this.transparencyRate=0,this.separator="",this.last=!1,this.drawStyle=h.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,c,u,p){var m,g,f;const y={...d,...p};if(y.isMultiLineContext){e.textBaseline="middle",e.textAlign="center";let i=t;null!=y.maxLengthOfMonomer&&(i=l(i,y.maxLengthOfMonomer));const r=Math.max(.1,1-(y.transparencyRate??0));e.globalAlpha=r;const h=e.measureText(i),d=h.fontBoundingBoxAscent+h.fontBoundingBoxDescent,p=o+(u-d)/2+h.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,c,u),e.restore(),e.fillStyle=m),e.fillText(i,n+c/2,p),e.globalAlpha=1,e.textBaseline="top",e.textAlign="start",n+c}p.logger?.debug("Bio: printLeftOrCentered(), start"),e.textAlign="start";let b=t.substring(0),w=y.last?"":y.separator;y.drawStyle===h.MSA&&(w="");let v=!0,A=!0,C="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,C=y.gridCell.cell.column.temp["highlight-difference"]??"difference"),y.referenceSequence){const e=y.referenceSequence[y.wordIdx];A&&y.referenceSequence.length>0&&"difference"===C&&(y.transparencyRate=b==e?.7:y.transparencyRate),A&&y.referenceSequence.length>0&&"equal"===C&&(y.transparencyRate=b!=e?.7:y.transparencyRate)}null!=y.maxLengthOfMonomer&&(b=l(b,y.maxLengthOfMonomer));const T=b+w;(m=y.monomerTextSizeMap)[T]??(m[T]=e.measureText(T));let S=y.monomerTextSizeMap[T];(g=y.monomerTextSizeMap)[b]??(g[b]=e.measureText(b));let E=y.monomerTextSizeMap[b].width;const M=u/2-(S.fontBoundingBoxAscent+S.fontBoundingBoxDescent)/2+1;(f=y.monomerTextSizeMap)[w]??(f[w]=e.measureText(w));const x=y.monomerTextSizeMap[w].width;function L(t,s){let l=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),l=i.Color.toHtml(i.Color.setAlpha(i.Color.fromHtml(l),255))),e.fillStyle=l,e.globalAlpha=1-y.transparencyRate,y.drawStyle===h.classic&&(e.fillText(b,n+t,o+M),e.fillStyle=r,e.fillText(w,n+s,o+M)),y.drawStyle===h.MSA&&e.fillText(b,n+t,o+M),e.globalAlpha=1}S=S.width,y.drawStyle===h.MSA&&(E=y.maxWord[y.wordIdx],S=y.maxWord[y.wordIdx]);const _=(y.maxWord[y.wordIdx]??0)-(y.maxWord[0]??0);if(y.left||S>c)return L(_,_+E),n+_+E+x;{const e=(c-S)/2;return L(e,e+E),n+_+e+E}}},6307:(e,t,n)=>{"use strict";n.d(t,{F:()=>r});var i=n(7389),o=n(6082),s=n(439);function r(e,t,n){let r=0,a=null;for(const t of Object.values(e))r+=t,a=null===a?t:Math.max(a,t);const l=a/r,c=Object.assign({},...Array.from(Object.entries(e)).sort(((e,t)=>t[1]-e[1])).map((([e,a])=>{const c=a/r;let u;try{const i=n.getMonomerColors(t,e);u=i?.backgroundcolor||"#CCCCCC"}catch(t){console.warn(`Failed to get colors for monomer ${e}:`,t),u="#CCCCCC"}const h=i.div("",{classes:"macromolecule-cell-comp-analysis-bar"});h.style.width=50*c/l+"px",h.style.backgroundColor=u,s._S===e&&(h.style.borderWidth="1px",h.style.borderStyle="solid",h.style.borderColor=o.Color.toHtml(o.Color.lightGray));const d=s._S===e?"-":e,p=i.div(`${(100*c).toFixed(2)}%`),m=i.div([h,p],{classes:"macromolecule-cell-comp-analysis-value"});return{[d]:m}}))),u=i.tableFromMap(c);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,{EK:()=>l,Ec:()=>s,f6:()=>i,pe:()=>r,q7:()=>a,yw:()=>o});const i=["symbol","molfile","rgroups","name"],o="MonomerName",s={monomerType:null,smiles:null,name:"Name",author:null,molfile:"molecule",naturalAnalog:"MonomerNaturalAnalogCode",rgroups:"MonomerCaps",createDate:null,id:null,polymerType:"MonomerType",symbol:"MonomerName"},r={monomerType:"Backbone",smiles:"",name:"",author:"Datagrok",molfile:"",naturalAnalog:"",rgroups:[],createDate:null,id:0,polymerType:"PEPTIDE",symbol:""},a="p",l=new RegExp(`[rd]\\((\\w)\\)${a}?`,"g")},9192:(e,t,n)=>{"use strict";function i(e){return"string"==typeof e||e instanceof String?e:"StateError"===e.constructor.name?e.message:"StateError"===e.constructor.name&&"$thrownJsError"in e?i(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[i(e),o(e)]}n.d(t,{AP:()=>s})},3516:(e,t,n)=>{"use strict";n.d(t,{m:()=>s});var i=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 i=this._fileContent.substring(t.index+1,e.lastIndex);this._descriptionsArray.push(i),0!==n&&this._sequencesArray.push(this.parseMacromolecule(n,t.index)),n=e.lastIndex+1}this._sequencesArray.push(this.parseMacromolecule(n,-1))}importFasta(){const e=i.Column.fromStrings("description",this.descriptionsArray),t=i.Column.fromStrings("sequence",this.sequencesArray);return t.semType=i.SEMTYPE.MACROMOLECULE,t.meta.units=o.Hi.FASTA,[i.DataFrame.fromColumns([e,t])]}constructor(e){this._descriptionsArray=[],this._sequencesArray=[],this._fileContent=e,this.parseColumns()}}},6873:(e,t,n)=>{"use strict";n.d(t,{Hx:()=>h,dW:()=>u,fD:()=>c});var i=n(6082),o=n(1991),s=n.n(o),r=n(2003),a=n(7278),l=n(439);function c(){const e=[];return e.push(i.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(i.Column.fromList(i.COLUMN_TYPE.FLOAT,"Activity",new Array(10**6).fill(5.30751))),e}function u(e=1e4){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=i.Column.fromList(i.COLUMN_TYPE.STRING,"MSA",new Array(100).fill(t));n.semType=i.SEMTYPE.MACROMOLECULE,n.meta.units=r.Hi.SEPARATOR,n.setTag(r.gp.separator,"/"),n.setTag(r.gp.alphabet,r.YI.UN),n.setTag(r.gp.alphabetIsMultichar,"true");const o=[];return o.push(n),o.push(i.Column.fromList(i.COLUMN_TYPE.FLOAT,"Activity",new Array(100).fill(7.30751))),o}function h(e,t=r.Hi.SEPARATOR,n=r.YI.PT,o=(t===r.Hi.SEPARATOR?"-":void 0),c=void 0,u="seq",h=100,d=10**6){const p=n===r.YI.UN?c?.getMonomerSymbolsByType("PEPTIDE")??[]:Array.from((0,r.Qf)(n)),m=p.length,g=i.Column.fromType(i.COLUMN_TYPE.STRING,u,h);g.semType=i.SEMTYPE.MACROMOLECULE,g.meta.units=t,g.setTag(r.gp.alphabet,n),t==r.Hi.SEPARATOR&&g.setTag(r.gp.separator,o);const f=e.getSeqHandler(g);for(let e=0;e<h;e++){const n=s().count(0).take(d).map((e=>p[Math.floor(Math.random()*m)])).toArray(),i=f.joiner(new a.Mu(n,l.b9[t]));g.set(e,i)}return g}},439:(e,t,n)=>{"use strict";n.d(t,{B5:()=>l,Hi:()=>i,Vl:()=>c,YI:()=>o,_S:()=>h,b9:()=>d,gp:()=>s,ot:()=>p,q7:()=>u,z1:()=>a});var i,o,s,r=n(2738);!function(e){e.FASTA="fasta",e.SEPARATOR="separator",e.HELM="helm",e.CUSTOM="custom"}(i||(i={})),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=", ",l=/(?:\[([A-Za-z0-9_\-,()]+)\])|([A-Za-z\-])/g,c=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 r.a(o.PT,c.fasta.peptide,.5),new r.a(o.DNA,c.fasta.dna,.55),new r.a(o.RNA,c.fasta.rna,.55)],h="",d={[i.FASTA]:"-",[i.SEPARATOR]:"",[i.HELM]:"*"},p=" , "},2003:(e,t,n)=>{"use strict";n.d(t,{Hi:()=>i.Hi,J9:()=>o.J9,Qf:()=>o.Qf,SM:()=>o.SM,YI:()=>i.YI,dh:()=>o.dh,gp:()=>i.gp,mn:()=>o.mn,nq:()=>o.nq,q7:()=>i.q7,qp:()=>o.qp,z1:()=>i.z1,zS:()=>o.zS});var i=n(439),o=n(7278)},2738:(e,t,n)=>{"use strict";n.d(t,{X:()=>o,a:()=>i});class i{constructor(e,t,n){this.name=e,this.alphabet=t,this.cutoff=n}}class o extends i{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:()=>A,J9:()=>y,Mu:()=>m,Qf:()=>S,SM:()=>L,dh:()=>w,mn:()=>_,nq:()=>E,p0:()=>x,pc:()=>M,qp:()=>v,tm:()=>b,vZ:()=>f,zS:()=>T});var i=n(6082),o=n(1991),s=n.n(o),r=n(3527),a=n(3629),l=n(2738),c=n(439),u=n(8924),h=n(1093),d=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:c._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),i=Math.max(Math.min(this.length,t),0)-n,o=this.gapOriginalMonomer;return new Array(i).fill(null).map(((e,t)=>{const i=this.mList[t+n];return i===o?c._S:i}))}getOriginalRegion(e,t){const n=Math.min(Math.max(0,e),this.length),i=Math.max(Math.min(this.length,t),0);return new Array(i-n).fill(null).map(((e,t)=>this.mList[t+n]))}get gapOriginal(){return this.gapOriginalMonomer}constructor(e,t){this.mList=e,this.gapOriginalMonomer=t}}class g{get length(){return this.seqS.length}isGap(e){return this.getOriginal(e)===c.b9[c.Hi.FASTA]}getCanonical(e){if(this.length<=e)throw new Error("Index out of bounds");return this.isGap(e)?c._S:this.seqS[e]}getOriginal(e){if(this.length<=e)throw new Error("Index out of bounds");return this.seqS[e]}getCanonicalRegion(e,t){const n=Math.max(0,e),i=Math.min(this.length,t)-n,o=c.b9[c.Hi.FASTA];return new Array(i).fill(null).map(((e,t)=>{const i=this.seqS[t+n];return i===o?c._S:i}))}getOriginalRegion(e,t){const n=Math.max(0,e),i=Math.min(this.length,t);return this.seqS.slice(n,i)}get gapOriginal(){return c.b9[c.Hi.FASTA]}constructor(e){this.seqS=e}}function f(e,t,n){const i=e.categories;return function(e,t){const n={};let i=!0,o=null;for(const s of e)if(null==o?o=s.length:s.length!==o&&(i=!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:i}}(s().enumerate(e.getRawData()).map((([e,t])=>n(i[e]))),t)}const y=e=>{const t=s()(e.toString().matchAll(c.B5)).map((e=>e[2]??e[1])).toArray();return new m(t,c.b9[c.Hi.FASTA])},b=e=>e?new g(e):new m([],c.b9[c.Hi.FASTA]);function w(e,t=void 0){return n=>{if(n){let i;const o=new RegExp(`(?<=^|\\${e})("-"|'-'|[^\\${e}]*)(?=\\${e}|$)`,"g");return void 0!==t?(o.lastIndex=0,i=s()(n.matchAll(o)).take(t).map((e=>e[0])).toArray()):i=n.replaceAll('"-"',"").replaceAll("'-'","").split(e,t),new m(i,c.b9[c.Hi.SEPARATOR])}return new m([],c.b9[c.Hi.SEPARATOR])}}const v=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,c.b9[c.Hi.HELM])};function A(e,t,n=void 0){if(e.toLowerCase().startsWith(c.Hi.FASTA))return y;if(e.toLowerCase().startsWith(c.Hi.SEPARATOR))return w(t,n);if(e.toLowerCase().startsWith(c.Hi.HELM))return v;throw new Error(`Unexpected units ${e} .`)}const C=/([^\W_]+)/g;function T(e,t){if(e.length<=t)return e;const n=e.match(C),i=e.length>t||(n?.length??0)>1,o=n?.[0]??" ";return i?o.substring(0,t-1)+"…":o}function S(e){switch(e){case c.YI.DNA:return c.Vl.fasta.dna;case c.YI.RNA:return c.Vl.fasta.rna;case c.YI.PT:return c.Vl.fasta.peptide;default:throw new Error(`Unsupported alphabet '${e}'.`)}}function E(e,t,n="-"){const i=new Set([...new Set(Object.keys(e)),...t]);i.delete(n);const o=[],s=[];for(const n of i)o.push(n in e?e[n]:0),s.push(t.has(n)?1:0);const l=new r.Mi(o),c=new r.Mi(s);return(0,a.KE)(l,c)/((0,a.wQ)(l)*(0,a.wQ)(c))}function M(e,t,n="-"){const i=t.map((t=>{const i=E(e,t.alphabet,n);return new l.X(t,e,i)}));let o;const s=Math.max(...i.map((e=>e.similarity>e.cutoff?e.similarity:-1)));return o=s>0?i.find((e=>e.similarity===s)).name:c.YI.UN,o}function x(e,t,n="-"){const i=Object.keys(e),o=/\(|\)/;return M(i.filter((e=>3===e.split(o).filter((e=>!!e)).length)).length>.8*i.length?Object.entries(e).reduce(((e,[t,n])=>{const i=t.split(o)[1];return i&&(e[i]=n),e}),{}):e,t,n)}function L(e,t,n=5){let o;return o=e.semType==i.SEMTYPE.MACROMOLECULE?t.getSeqHandler(e).alphabet:M(f(e,n,y).freq,c.q7),function(e){switch(e){case c.YI.PT:return u.X.GrokGroups;case c.YI.DNA:case c.YI.RNA:return h.A.Chromatogram;default:return d.oT.Color}}(o)}function _(e){const t=e.columns.bySemTypeAll(i.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 i=n(6082);async function o(){const e=i.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.d(t,{R:()=>o});var i=n(6082);function o(e,t){const n=e=>{const t=r.columns.addNewString((e+1).toString());return o.push(t),t},o=[],s=e.length,r=i.DataFrame.create(s),a=t.getSeqHandler(e);for(let e=0;e<s;++e){const t=a.getSplitted(e);for(let i=0;i<t.length;++i){const s=t.getCanonical(i);((o[i]??null)||n(i)).set(e,s,!1)}}return r}},7602:(e,t,n)=>{"use strict";n.d(t,{g:()=>s});var i,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"}(i||(i={}));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[i,s]=(0,o.AP)(t);this.logger.error(`${e}, SYNC syncId = ${n}, ERROR:\n${i}`,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:()=>r,fH:()=>o,gp:()=>i,lT:()=>l,mH:()=>a});var i,o,s,r,a,l,c=n(6082);!function(e){e.tooltipWebLogo=".tooltipWebLogo"}(i||(i={})),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"}(r||(r={})),function(e){e.AUTO="auto",e.ON="on",e.OFF="off"}(a||(a={})),function(e){e.Filtered="Filtered",e.Selected="Selected"}(l||(l={}));const u=new class{constructor(){this.sequenceColumnName=null,this.valueAggrType=c.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=r.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=l.Filtered}}},6869:(e,t,n)=>{"use strict";var i;n.d(t,{o:()=>i}),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"}(i||(i={}))},5540:(e,t,n)=>{"use strict";e=n.hmd(e);var i,o=(i="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,i){t=e,n=i}));var s,r=Object.assign({},o),a="object"==typeof window,l="function"==typeof importScripts,c=("object"==typeof process&&"object"==typeof process.versions&&process.versions.node,"");(a||l)&&(l?c=self.location.href:"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),i&&(c=i),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"",l&&(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,h,d=o.printErr||console.warn.bind(console);Object.assign(o,r),r=null,o.arguments&&o.arguments,o.thisProgram&&o.thisProgram,o.quit&&o.quit,o.wasmBinary&&(u=o.wasmBinary),o.noExitRuntime,"object"!=typeof WebAssembly&&M("no native wasm support detected");var p,m,g,f=!1;function y(){var e=h.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=g=new Uint32Array(e),o.HEAPF32=new Float32Array(e),o.HEAPF64=new Float64Array(e)}var b,w,v=[],A=[],C=[],T=0,S=null,E=null;function M(e){o.onAbort&&o.onAbort(e),d(e="Aborted("+e+")"),f=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}function x(e){return e.startsWith("data:application/octet-stream;base64,")}function L(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){M(e)}}function _(e,t,n){return function(e){return u||!a&&!l||"function"!=typeof fetch?Promise.resolve().then((function(){return L(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 L(e)}))}(e).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(n,(function(e){d("failed to asynchronously prepare wasm: "+e),M(e)}))}function I(e){for(;e.length>0;)e.shift()(o)}function P(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){g[this.ptr+4>>2]=e},this.get_type=function(){return g[this.ptr+4>>2]},this.set_destructor=function(e){g[this.ptr+8>>2]=e},this.get_destructor=function(){return g[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){g[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return g[this.ptr+16>>2]},this.get_exception_ptr=function(){if(B(this.get_type()))return g[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function N(e){var t=h.buffer;try{return h.grow(e-t.byteLength+65535>>>16),y(),1}catch(e){}}function R(e){return o["_"+e]}x(b="wasmDbscan.wasm")||(w=b,b=o.locateFile?o.locateFile(w,c):c+w);var $="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(e,t,n,i,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 i=e.charCodeAt(n);i<=127?t++:i<=2047?t+=2:i>=55296&&i<=57343?(t+=4,++n):t+=3}return t}(e)+1,n=G(t);return function(e,t,n){!function(e,t,n,i){if(!(i>0))return 0;for(var o=n+i-1,s=0;s<e.length;++s){var r=e.charCodeAt(s);if(r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++s)),r<=127){if(n>=o)break;t[n++]=r}else if(r<=2047){if(n+1>=o)break;t[n++]=192|r>>6,t[n++]=128|63&r}else if(r<=65535){if(n+2>=o)break;t[n++]=224|r>>12,t[n++]=128|r>>6&63,t[n++]=128|63&r}else{if(n+3>=o)break;t[n++]=240|r>>18,t[n++]=128|r>>12&63,t[n++]=128|r>>6&63,t[n++]=128|63&r}}t[n]=0}(e,m,t,n)}(e,n,t),n}(e)),t},array:e=>{var t,n,i=G(e.length);return t=e,n=i,p.set(t,n),i}},r=R(e),a=[],l=0;if(i)for(var c=0;c<i.length;c++){var u=s[n[c]];u?(0===l&&(l=F()),a[c]=u(i[c])):a[c]=i[c]}var h=r.apply(null,a);return function(e){return 0!==l&&D(l),function(e){return"string"===t?(n=e)?function(e,t,n){for(var i=t+n,o=t;e[o]&&!(o>=i);)++o;if(o-t>16&&e.buffer&&$)return $.decode(e.subarray(t,o));for(var s="";t<o;){var r=e[t++];if(128&r){var a=63&e[t++];if(192!=(224&r)){var l=63&e[t++];if((r=224==(240&r)?(15&r)<<12|a<<6|l:(7&r)<<18|a<<12|l<<6|63&e[t++])<65536)s+=String.fromCharCode(r);else{var c=r-65536;s+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else s+=String.fromCharCode((31&r)<<6|a)}else s+=String.fromCharCode(r)}return s}(m,n,i):"":"boolean"===t?Boolean(e):e;var n,i}(e)}(h)}var H,k={__cxa_throw:function(e,t,n){throw new P(e).init(t,n),e},abort:function(){M("")},emscripten_memcpy_big:function(e,t,n){m.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=m.length,i=2147483648;if((e>>>=0)>i)return!1;for(var o=1;o<=4;o*=2){var s=n*(1+.2/o);if(s=Math.min(s,e+100663296),N(Math.min(i,(t=Math.max(e,s))+(65536-t%65536)%65536)))return!0}return!1}},F=(function(){var e,t,i,s,r={env:k,wasi_snapshot_preview1:k};function a(e,t){var n,i=e.exports;return o.asm=i,h=o.asm.memory,y(),o.asm.__indirect_function_table,n=o.asm.__wasm_call_ctors,A.unshift(n),function(){if(T--,o.monitorRunDependencies&&o.monitorRunDependencies(T),0==T&&(null!==S&&(clearInterval(S),S=null),E)){var e=E;E=null,e()}}(),i}if(T++,o.monitorRunDependencies&&o.monitorRunDependencies(T),o.instantiateWasm)try{return o.instantiateWasm(r,a)}catch(e){d("Module.instantiateWasm callback failed with error: "+e),n(e)}(e=u,t=b,i=r,s=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||x(t)||"function"!=typeof fetch?_(t,i,s):fetch(t,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,i).then(s,(function(e){return d("wasm streaming compile failed: "+e),d("falling back to ArrayBuffer instantiation"),_(t,i,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(F=o.asm.stackSave).apply(null,arguments)}),D=function(){return(D=o.asm.stackRestore).apply(null,arguments)},G=function(){return(G=o.asm.stackAlloc).apply(null,arguments)},B=function(){return(B=o.asm.__cxa_is_pointer_type).apply(null,arguments)};function V(){function e(){H||(H=!0,o.calledRun=!0,f||(I(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(),C.unshift(e);var e;I(C)}()))}T>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;I(v)}(),T>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,i){var o=!n||n.every((e=>"number"===e||"boolean"===e));return"string"!==t&&o&&!i?R(e):function(){return O(e,t,n,arguments)}},E=function e(){H||V(),H||(E=e)},o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return V(),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:()=>r,Hf:()=>u,Hr:()=>E,Ii:()=>f,Qj:()=>m,T6:()=>S,TK:()=>C,be:()=>g,gt:()=>w,ij:()=>v,jL:()=>c,lO:()=>p,lP:()=>b,rR:()=>y,tO:()=>a,v_:()=>l,w_:()=>h,yK:()=>A,zn:()=>d});var i=n(8774),o=n(8498),s=n(6863);function r(e,t){const n=e.trueCount()+t.trueCount();if(0==n)return 1;const i=e.andWithCountBits(t,!0);return i/(n-i)}function a(e,t){return 1-r(e,t)}function l(e,t){return T(r(new i.A(e,32*e.length),new i.A(t,32*t.length)))}function c(e,t){let n=0;for(let i=0;i<e.length;i++)n+=Math.pow(e[i]-t[i],2);return Math.sqrt(n)}function u(e,t){let n=0;for(let i=0;i<e.length;i++)n+=Math.abs(e[i]-t[i]);return n}function h(e,t){let n=0,i=0,o=0;for(let s=0;s<e.length;s++)n+=e[s]*t[s],i+=e[s]*e[s],o+=t[s]*t[s];return(1-n/(Math.sqrt(i)*Math.sqrt(o)))/2}function d(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 g(e,t){return e.trueCount()+t.trueCount()-2*e.andWithCountBits(t,!0)}function f(e,t){return 1-function(e,t){const n=e.trueCount()+t.trueCount(),i=e.andWithCountBits(t,!0);return i/(2*n-3*i)}(e,t)}function y(e,t){return T(function(e,t){const n=e.trueCount()+t.trueCount(),i=e.trueCount()*t.trueCount();return 0==i?0:e.andWithCountBits(t,!0)*n/(2*i)}(e,t))}function b(e,t){return T(function(e,t){const n=e.trueCount()+t.trueCount(),i=e.trueCount()*t.trueCount();return 0==i?0:(e.andWithCountBits(t,!0)*n-i)/i}(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 T(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 T(function(e,t){return 0==e.length?0:e.andWithCountBits(t,!0)/e.length}(e,t))}function C(e,t){return T(function(e,t){const n=e.andWithCountBits(t,!0),i=e.countBits(!0)+t.countBits(!0),o=e.length,s=o-i+n;return n==o||s==o?1:n/i+s/(2*o-i)}(e,t))}function T(e){return e<=0?3402823e32:1/e-1}function S(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 E(e){const t=function(e){const t=e?.mostCommon??new Set;return(e,n)=>{const i=e.length,o=n.length;let s=0,r=0,a=0;for(;r<i&&a<o;)e[r]===n[a]?(t?.has(e[r])||++s,++r,++a):e[r]<n[a]?++r:++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:()=>i,Gi:()=>a,YP:()=>c,_X:()=>r,n3:()=>o,vb:()=>l});const i="dim-red-preprocessing-function",o="supportedSemTypes",s="supportedTypes",r="supportedUnits",a="supportedDistanceFunctions",l="bypassLargeDataWarning",c="show-scatterplot-progress"},6863:(e,t,n)=>{"use strict";function i(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,i=Math.min(...Object.keys(t).map((e=>e.charCodeAt(0))))+1,o=new Float32Array((n.length+i)*(n.length+i));return Object.entries(t).forEach((([e,i])=>{const s=n[i];Object.entries(t).forEach((([t,i])=>{o[e.charCodeAt(0)*n.length+t.charCodeAt(0)]=s[i]}))})),(e,t)=>1-o[e.charCodeAt(0)*n.length+t.charCodeAt(0)]}(),n=e?.threshold??0;return(e,i)=>{let o=0;const s=e.length,r=i.length,a=Math.ceil(Math.max(s,r)*(1-n));s!==r&&(o=Math.abs(s-r));let l=0;for(let n=0;n<Math.min(s,r);n++)if(e[n]!==i[n]&&(l+=t(e[n],i[n]),l>a))return 1;return l+=o,l/=Math.max(s,r),l}}n.d(t,{Z:()=>r,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 r;!function(e){e.HAMMING="Hamming",e.LEVENSHTEIN="Levenshtein",e.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",e.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(r||(r={}));const a={[r.HAMMING]:i,[r.LEVENSHTEIN]:function(){return(e,t)=>(0,o.I)(e,t)/Math.max(e.length,t.length)},[r.NEEDLEMANN_WUNSCH]:function(e){const t=new Uint16Array(65536),{gapOpen:n,gapExtend:i,scoringMatrix:o,alphabetIndexes:r}={...s,...e};Object.entries(r).forEach((([e,n])=>t[e.charCodeAt(0)]=n));const a=[new Float32Array(1e4),new Float32Array(1e4)];return(e,s)=>{const r=new Array(e.length+1).fill(!1),l=new Array(e.length+1).fill(!1);let c=0,u=1;for(let t=1;t<e.length+1;t++)a[0][t]=-i-(t-1)*i,a[1][t]=0;a[0][0]=0;for(let h=1;h<s.length+1;h++){a[u][0]=-i-(h-1)*i;for(let d=1;d<e.length+1;d++){const p=a[c][d-1]+o[t[e.charCodeAt(d-1)]][t[s.charCodeAt(h-1)]],m=a[c][d]-(r[d]||1===h||h===s.length?i:n),g=a[u][d-1]-(l[d-1]||1===d||d===e.length?i:n);a[u][d]=Math.max(p,g,m),a[u][d]===p?(r[d]=!1,l[d]=!1):a[u][d]===g?(r[d]=!1,l[d]=!0):(r[d]=!0,l[d]=!1)}c=u,u=(u+1)%2}const h=Math.min(e.length,s.length);return(h-a[c][e.length])/h}},[r.MONOMER_CHEMICAL_DISTANCE]:i}},9039:(e,t,n)=>{"use strict";var i;n.d(t,{c:()=>i}),function(e){e.UMAP="UMAP",e.T_SNE="t-SNE"}(i||(i={}))},8498:(e,t,n)=>{"use strict";var i,o,s,r,a,l,c;n.d(t,{EG:()=>a,Pn:()=>o,RR:()=>l,Wn:()=>c,aT:()=>s,m6:()=>r,xL:()=>i}),function(e){e.Levenshtein="Levenshtein",e.JaroWinkler="Jaro-Winkler",e.Manhattan="Manhattan String",e.Onehot="One-Hot"}(i||(i={})),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"}(r||(r={})),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"}(l||(l={})),function(e){e.CommonItems="Common Items"}(c||(c={}))},2780:(e,t,n)=>{"use strict";n.d(t,{aT:()=>i.aT});var i=n(8498);n(9336)},9336:(e,t,n)=>{"use strict";var i=n(2787),o=n(944),s=n(6295),r=n(6863),a=n(8498);const l={[a.Pn.Euclidean]:s.jL,[a.Pn.Manhattan]:s.Hf,[a.Pn.Cosine]:s.w_},c={[a.xL.Levenshtein]:i.I,[a.xL.JaroWinkler]:o.Vb,[a.xL.Manhattan]:function(e,t){if(e.length!==t.length)return 1;{let n=0;for(let i=1;i<e.length;i++)n+=e[i]==t[i]?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},h={[a.m6.TanimotoIntArray]:s.v_},d={[a.RR.Difference]:s.T6},p={[a.Wn.CommonItems]:s.Hr},m={[a.EG.Vector]:{[a.Pn.Euclidean]:l[a.Pn.Euclidean],[a.Pn.Manhattan]:l[a.Pn.Manhattan],[a.Pn.Cosine]:l[a.Pn.Cosine]},[a.EG.String]:{[a.xL.Levenshtein]:c[a.xL.Levenshtein],[a.xL.JaroWinkler]:c[a.xL.JaroWinkler],[a.xL.Manhattan]:c[a.xL.Manhattan],[a.xL.Onehot]:c[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]:{[r.Z.HAMMING]:r.V[r.Z.HAMMING],[r.Z.LEVENSHTEIN]:r.V[r.Z.LEVENSHTEIN],[r.Z.NEEDLEMANN_WUNSCH]:r.V[r.Z.NEEDLEMANN_WUNSCH],[r.Z.MONOMER_CHEMICAL_DISTANCE]:r.V[r.Z.MONOMER_CHEMICAL_DISTANCE]},[a.EG.Number]:{[a.RR.Difference]:d[a.RR.Difference]},[a.EG.IntArray]:{[a.m6.TanimotoIntArray]:h[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:()=>i});class i{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=i._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,i){if(e<t||e>n)throw new Error(`Argument ${i} (${e}) out of range (${t}, ${n})`)}copy(e,t,n){for(let i=0;i<n;i++)t[i]=e[i]}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 i(e._length);n._length=e._length,n._data=i._createBuffer(n._length),n._version=0;const o=e.lengthInInts;for(let i=0;i<o;i++)n._data[i]=e._data[i]&t._data[i];return n}static _createBuffer(e){return new Uint32Array(Math.floor((e+31)/32))}static fromValues(e){const t=new i(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 i(e);for(let i=0;i<e;++i)n.setBit(i,t(i));return n._version=0,n}static fromString(e){return i.fromSeq(e.length,(t=>"1"==e.charAt(t)))}static fromUint32Array(e,t){const n=new i(e);return n._data=t,n}static fromBytes(e){const t=e.length,n=new i(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 i(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,i=this.lengthInInts;for(let e=0;e<i;e++)this._data[e]=n;this.incrementVersion(t)}setIndexes(e,t=!0,n=!0,i=!0){n&&this.setAll(!t,!1);for(const n of e)this.setFast(n,t);this.incrementVersion(i)}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,i=!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(i)}getRange(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let i=e;i<t;++i)n.push(this.getBit(i));return i.fromValues(n)}getRangeAsList(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let i=e;i<t;++i)n.push(this.getBit(i));return n}setRange(e,t,n,i=!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(i),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 i=this._length;this.setLength(this._length+t);for(let n=i-1;n>=e;n--)this.setBit(n+t,this.getBit(n));for(let i=e;i<e+t;i++)this.setBit(i,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 i=-1;-1!=(i=e.findNext(i,!t));)this.setFast(n++,this.getBit(i));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+=i._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+=i._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+=i._onBitCount[255&t];let r=this._data[s]&e._data[s];const a=31&this._length;for(0!=a&&(r&=~(4294967295<<a));0!=r;r>>>=8)n+=i._onBitCount[255&r];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=i._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=i._lastOnBit[e>>>24];if(n>=0)return n+32*o+t}}return-1}}i._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]),i._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]),i._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:()=>F,bk:()=>j,gM:()=>k,L1:()=>H,cb:()=>Y,E3:()=>N,J6:()=>O,Wj:()=>R,Xk:()=>$,Xb:()=>G,N$:()=>B,t6:()=>P,PE:()=>_,rd:()=>I,Bl:()=>Z,CN:()=>w});var i=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 r=function(e,t,n,i){return new(n||(n=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}l((i=i.apply(e,t||[])).next())}))};function a(e,t,n,o,s,a,l,c,u=!0){return r(this,void 0,void 0,(function*(){let h=null;if(yield I(o,(n=>r(this,void 0,void 0,(function*(){let n=null;for(const i of e.viewers)i.type===t&&(n=i);if(!n)throw Error("Viewer hasn't been added");if(yield Promise.resolve(),a&&(yield a(n)),s){const t=null!=c?c:{};t.tv=e,t.viewer=n,h=yield s(t,u)}yield _(i.events.onViewerClosed,(()=>{N(n.subs.some((e=>!e.closed)),!1)}),(()=>n.close()),3e3)}))),(()=>r(this,void 0,void 0,(function*(){l?e.loadLayout(l):yield function(e,t,n){return r(this,void 0,void 0,(function*(){let i;return n?(i=yield e.dataFrame.plot.fromType(t),e.dockManager.dock(i)):i=e.addViewer(t),i}))}(e,t,n)}))),6e4,"TEST_EVENT_ASYNC"),h)return h}))}function l(e,t=!0){return r(this,void 0,void 0,(function*(){const n=e.tv.dataFrame,i=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 Y(50));for(let e=o;e<2*o;e++)n.filter.set(e,!1);t&&(yield Y(50)),n.currentRowIdx=1,n.columns.names().slice(0,Math.ceil(n.columns.length/2)).forEach((e=>n.columns.remove(e))),t&&(yield Y(100)),e.tv.dataFrame=i,yield Y(50)}))}function c(e,t=!0){return r(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 r(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 i={};return Object.keys(t).filter((e=>"boolean"==typeof t[e])).forEach((e=>i[e]=!t[e])),n.filter((e=>null!==e.choices)).forEach((e=>i[e.name]=e.choices.find((n=>n!==t[e.name])))),e.viewer.setOptions(i),yield Y(300),{layout:e.tv.saveLayout(),savedProps:e.viewer.getOptions().look}}))}function h(e,t=!0){return r(this,void 0,void 0,(function*(){N(JSON.stringify(e.viewer.getOptions().look),JSON.stringify(e.savedProps))}))}var d=function(e,t,n,i){return new(n||(n=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}l((i=i.apply(e,t||[])).next())}))};const p=3e4,m=108e5,g=console.log.bind(console),f=console.info.bind(console),y=console.warn.bind(console),b=console.error.bind(console),w={},v="Auto Tests",A="Demo",C="Detectors",T="Core",S={};let E;var M;!function(e){e.notNull=function(e,t){if(null==e)throw new Error(`${null==t?"Value":t} not defined`)}}(M||(M={}));class x{constructor(e,t){this.catchUnhandled=!0,this.report=!1,void 0!==e&&(this.catchUnhandled=e),void 0!==t&&(this.report=t)}}class L{constructor(e,t,n,i){var s;this.category=e,this.name=t,null!=i||(i={}),null!==(s=i.timeout)&&void 0!==s||(i.timeout=p),this.options=i,this.test=()=>d(this,void 0,void 0,(function*(){return new Promise(((e,t)=>d(this,void 0,void 0,(function*(){var i;let s="";try{o.Test.isInDebug;let e=yield n();try{s=null!==(i=null==e?void 0:e.toString())&&void 0!==i?i:""}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 _(e,t,n,i=0,o="timeout"){return d(this,void 0,void 0,(function*(){return new Promise(((s,r)=>{const a=e.subscribe((e=>{try{t(e),s("OK")}catch(e){r(e)}finally{a.unsubscribe(),clearTimeout(l)}})),l=setTimeout((()=>{a.unsubscribe(),r(o)}),i);n()}))}))}function I(e,t,n,i=0,o="timeout"){return d(this,void 0,void 0,(function*(){return new Promise(((s,r)=>{const a=e.subscribe((e=>{t(e).then((()=>{s("OK")})).catch((e=>{r(e)})).finally((()=>{a.unsubscribe(),clearTimeout(l)}))})),l=setTimeout((()=>{a.unsubscribe(),r(o)}),i);n()}))}))}function P(e,t,n){null==w[E]&&(w[E]={}),null==w[E].tests&&(w[E].tests=[]),w[E].tests.push(new L(E,e,t,n))}function N(e,t=!0,n){if(n=n?`${n}, `:"",e!==t)throw new Error(`${n}Expected "${t}", got "${e}"`)}function R(e,t,n=.001,i){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(N(o,!0,`${null!=i?i:""} (tolerance = ${n})`),!o)throw new Error(`Expected ${t}, got ${e} (tolerance = ${n})`)}function $(e,t){for(const[n,i]of Object.entries(t)){if(!e.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const t=e[n];if(t instanceof Array&&i instanceof Array)O(t,i);else if(t instanceof Object&&i instanceof Object)$(t,i);else if(Number.isFinite(t)&&Number.isFinite(i))R(t,i);else if(t!=i)throw new Error(`Expected (${i}) for key '${n}', got (${t})`)}}function O(e,t){const n=e.length,i=t.length;if(n!=i)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${i}`);for(let i=0;i<n;i++)if(e[i]instanceof Array&&t[i]instanceof Array)O(e[i],t[i]);else if(e[i]instanceof Object&&t[i]instanceof Object)$(e[i],t[i]);else if(e[i]!=t[i])throw new Error(`Expected ${t[i]} at position ${i}, got ${e[i]}`)}function H(e,t,n){var i;E=e,t(),w[E]&&(w[E].clear=null===(i=null==n?void 0:n.clear)||void 0===i||i,w[E].timeout=null==n?void 0:n.timeout,w[E].benchmarks=null==n?void 0:n.benchmarks,w[E].stressTests=null==n?void 0:n.stressTests,w[E].owner=null==n?void 0:n.owner)}function k(e){null==w[E]&&(w[E]={}),w[E].before=e}function F(e){null==w[E]&&(w[E]={}),w[E].after=e}function D(e,t){return e.replace(new RegExp(t.name,"gi"),t.nqName)}function G(e,t){var n,r,a,l,c,u,h,g,f,y;return d(this,void 0,void 0,(function*(){const b=e.id;if(S[b])return;const E=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 i=null!==(n=t.pop())&&void 0!==n?n:e.name,o=t.length?T+": "+t.join(": "):T,s=i.split(" | ");i=s[s.length-1],s.unshift(o),s.pop(),o=s.join(": "),void 0===E[o]&&(E[o]={tests:[],clear:!0}),E[o].tests.push(new L(o,i,e.test,{isAggregated:!1,timeout:null!==(a=null===(r=e.options)||void 0===r?void 0:r.timeout)&&void 0!==a?a:p,skipReason:null===(l=e.options)||void 0===l?void 0:l.skipReason,owner:null===(c=e.options)||void 0===c?void 0:c.owner,benchmark:null!==(h=null===(u=e.options)||void 0===u?void 0:u.benchmark)&&void 0!==h&&h}))}const M=[],x=[],_=[],I=yield i.dapi.functions.filter(`package.id = "${b}"`).list(),P=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const t of I){const n=t.options.test,r=t.options.demoPath;if(n&&Array.isArray(n)&&n.length)for(let e=0;e<n.length;e++){const s=n[e].matchAll(P),r={};Array.from(s).forEach((e=>{e[0].startsWith("skip")?r.skip=e[1]:e[0].startsWith("wait")?r.wait=parseInt(e[2]):e[0].startsWith("cat")?r.cat=e[3]:e[0].startsWith("timeout")&&(r.timeout=parseInt(e[4]))}));const a=new L(null!==(g=r.cat)&&void 0!==g?g:v,1===n.length?t.name:`${t.name} ${e+1}`,(()=>d(this,void 0,void 0,(function*(){const o=yield i.functions.eval(D(n[e],t));if(r.wait&&(yield Y(r.wait)),"boolean"==typeof o&&!o)throw`Failed: ${n[e]}, expected true, got ${o}`}))),{skipReason:r.skip,timeout:o.Test.isInBenchmark?null!==(f=r.benchmarkTimeout)&&void 0!==f?f:m:null!==(y=r.timeout)&&void 0!==y?y:p});if(r.cat){const e=r.cat;void 0===E[e]&&(E[e]={tests:[],clear:!0}),E[e].tests||(E[e].tests=[]),E[e].tests.push(a)}else M.push(a)}if(r){const e=t.options.demoWait?parseInt(t.options.demoWait):void 0,n=new L(A,t.friendlyName,(()=>d(this,void 0,void 0,(function*(){yield Y(300),i.shell.clearLastError(),yield t.apply(),yield Y(e||2e3);const n=yield i.shell.lastError;if(n)throw new Error(n)}))),{skipReason:t.options.demoSkip});x.push(n)}if(t.hasTag("semTypeDetector")){let n=s;t.options.testData&&(n=yield i.data.files.openTable(`System:AppData/${e.nqName}/${t.options.testData}`));const o=new L(C,t.friendlyName,(()=>d(this,void 0,void 0,(function*(){const i=[];console.log(`System:AppData/${e.nqName}/${t.options.testData}`);for(const e of n.clone().columns){const n=yield t.apply([e]);i.push(n||e.semType)}const o=i.filter((e=>e));N(o.length,1),t.options.testDataColumnName&&N(o[0],t.options.testDataColumnName)}))),{skipReason:t.options.skipTest});_.push(o)}}S[b]=!0,M.length>0&&(E[v]={tests:M,clear:!0}),x.length>0&&(E[A]={tests:x,clear:!0}),_.length>0&&(E[C]={tests:_,clear:!1})}))}function B(e){var t,n,s,r,a,l;return d(this,void 0,void 0,(function*(){console.log("--------------------");const c=null===(n=null===(t=i.functions.getCurrentCall())||void 0===t?void 0:t.func)||void 0===n?void 0:n.package,u=(null!==(r=(null!==(s=null==c?void 0:c.packageOwner)&&void 0!==s?s:"").match(new RegExp("[^<]*<([^>]*)>")))&&void 0!==r?r:["",""])[1];yield G(c);const h=[];console.log("Running tests"),console.log(e),null!=e||(e={}),null!==(a=(l=e).testContext)&&void 0!==a||(l.testContext=new x),i.shell.clearLastError();const v=function(){const e=[];return console.log=(...t)=>{e.push(...t),g(...t)},console.info=(...t)=>{e.push(...t),f(...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,r,a,l,p,m;return d(this,void 0,void 0,(function*(){try{for(const[i,u]of Object.entries(e)){if((null==t?void 0:t.category)&&!i.toLowerCase().startsWith(null==t?void 0:t.category.toLowerCase())||(null===(n=t.exclude)||void 0===n?void 0:n.some((e=>i.startsWith(e)))))continue;g(`Started ${i} 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!==(r=t.category)&&void 0!==r?r:""));let f,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=q(y)),(null!==(p=null===(l=t.tags)||void 0===l?void 0:l.length)&&void 0!==p?p:0)>0&&(y=y.filter((e=>{var n,i;return null===(i=null===(n=e.options)||void 0===n?void 0:n.tags)||void 0===i?void 0:i.some((e=>{var n;return(null!==(n=null==t?void 0:t.tags)&&void 0!==n?n:[]).includes(e)}))}))),u.beforeStatus?(f=Array.from(y.map((e=>({date:(new Date).toISOString(),category:i,name:e.name,success:!1,result:"before() failed",ms:0,skipped:!1,logs:"",owner:null==c?void 0:c.packageOwner,package:c.name,widgetsDifference:0,flaking:o.Test.isReproducing})))),f.forEach((e=>d(this,void 0,void 0,(function*(){return V("package",e)}))))):f=yield C(u,t);const b=f.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:i,name:"after",success:!1,result:u.afterStatus,ms:0,skipped:!1,logs:"",owner:null==c?void 0:c.packageOwner,package:c.name,widgetsDifference:0,flaking:o.Test.isReproducing}),u.beforeStatus&&b.push({date:(new Date).toISOString(),category:i,name:"before",success:!1,result:u.beforeStatus,ms:0,skipped:!1,logs:"",owner:null==c?void 0:c.packageOwner,package:c.name,widgetsDifference:0,flaking:o.Test.isReproducing}),h.push(...b)}}finally{console.log=g,console.info=f,console.warn=y,console.error=b}if(t.testContext.catchUnhandled&&!o.Test.isInBenchmark){yield Y(1e3);const e=yield i.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:c.name,widgetsDifference:0};h.push(Object.assign(Object.assign({},t),{flaking:o.Test.isReproducing&&!e})),t.package=c.name,yield V("package",t)}}))}(w,e);for(let e of h)e.result=e.result.toString().replace(/"/g,"'"),null!=e.logs&&(e.logs=e.logs.toString().replace(/"/g,"'"));return h;function A(e,t){return d(this,void 0,void 0,(function*(){let n;try{void 0!==e&&(yield K((()=>d(this,void 0,void 0,(function*(){yield e()}))),1e5,`before ${t}: timeout error`))}catch(e){n=yield U(e)}return n}))}function C(e,t){var n,s,r,a,l,h,g,f,y,b,w,A,C,S,E,M,x,L;return d(this,void 0,void 0,(function*(){let d=null!==(n=e.tests)&&void 0!==n?n:[];const _=[],I=T();if(e.clear)for(let n=0;n<d.length;n++){d[n].options&&void 0===(null===(s=d[n].options)||void 0===s?void 0:s.benchmark)&&(d[n].options||(d[n].options={}),d[n].options.benchmark=null!==(r=e.benchmarks)&&void 0!==r&&r);let A=d[n];if(t.test&&t.test.toLowerCase()!==A.name.toLowerCase())continue;(null==A?void 0:A.options)&&(A.options.owner=null!==(g=null!==(h=null!==(l=null===(a=d[n].options)||void 0===a?void 0:a.owner)&&void 0!==l?l:null==e?void 0:e.owner)&&void 0!==h?h:u)&&void 0!==g?g:"");let C=yield W(A,null==t?void 0:t.test,v,o.Test.isInBenchmark?null!==(y=null===(f=d[n].options)||void 0===f?void 0:f.benchmarkTimeout)&&void 0!==y?y:m:null!==(w=null===(b=d[n].options)||void 0===b?void 0:b.timeout)&&void 0!==w?w:p,c.name,t.verbose);C&&_.push(Object.assign(Object.assign({},C),{widgetsDifference:T()-I})),i.shell.closeAll(),o.Balloon.closeAll()}else for(let n=0;n<d.length;n++){let i=d[n];if(t.test&&t.test.toLowerCase()!==i.name.toLowerCase())continue;(null==i?void 0:i.options)&&(i.options.owner=null!==(E=null!==(S=null!==(C=null===(A=d[n].options)||void 0===A?void 0:A.owner)&&void 0!==C?C:null==e?void 0:e.owner)&&void 0!==S?S:u)&&void 0!==E?E:"");let s=yield W(i,null==t?void 0:t.test,v,o.Test.isInBenchmark?null!==(x=null===(M=d[n].options)||void 0===M?void 0:M.benchmarkTimeout)&&void 0!==x?x:m:null===(L=d[n].options)||void 0===L?void 0:L.timeout,c.name,t.verbose);s&&_.push(Object.assign(Object.assign({},s),{widgetsDifference:T()-I}))}return _}))}function T(){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 V(e,t){return d(this,void 0,void 0,(function*(){null!=i.shell.reportTest?yield i.shell.reportTest(e,t):yield fetch(`${i.dapi.root}/log/tests/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)})}))}function U(e){return d(this,void 0,void 0,(function*(){return`${e.toString()}\n${e.stack?yield o.Logger.translateStackTrace(e.stack):""}`}))}function W(e,t,n,s,r,a){var l,c,u,h,m,f,y,w,v,A,C,T,S,E;return d(this,void 0,void 0,(function*(){let d;n.length=0;const M=null!=t&&e.name.toLowerCase()!==t.toLowerCase();let x=(null===(l=e.options)||void 0===l?void 0:l.skipReason)||M,L=M?"skipped":null===(c=e.options)||void 0===c?void 0:c.skipReason;if(console.log(P.name,x),o.Test.isInBenchmark&&!(null===(u=e.options)||void 0===u?void 0:u.benchmark))return void g(`SKIPPED: ${e.category} ${e.name} doesnt available in benchmark mode`);x||g(`Started ${e.category} ${e.name}`);const _=Date.now(),I=new Date(_).toISOString();try{if(x)d={name:e.name,owner:null!==(m=null===(h=e.options)||void 0===h?void 0:h.owner)&&void 0!==m?m:"",category:e.category,logs:"",date:I,success:!0,result:L,ms:0,skipped:!0,package:null!=r?r:"",flaking:o.Test.isReproducing};else{let t=null!=s?s:p;o.Test.isProfiling&&console.profile(`${e.category}: ${e.name}`),d={name:e.name,owner:null!==(y=null===(f=e.options)||void 0===f?void 0:f.owner)&&void 0!==y?y:"",category:e.category,logs:"",date:I,success:!0,result:null!==(w=yield K(e.test,t))&&void 0!==w?w:"OK",ms:0,skipped:!1,package:null!=r?r:"",flaking:o.Test.isReproducing},o.Test.isProfiling&&(console.profileEnd(`${e.category}: ${e.name}`),i.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),d={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:I,success:!1,result:yield U(t),ms:0,skipped:!1,package:null!=r?r:"",flaking:!1}}if((null===(C=e.options)||void 0===C?void 0:C.isAggregated)&&d.result.constructor===o.DataFrame){const e=d.result.col("success");if(e&&(d.success=e.stats.sum===e.length),!a){const e=d.result;e.columns.remove("stack"),e.rows.removeWhere((e=>e.get("success"))),d.result=e}d.result=d.result.toCsv()}if(d.logs=n.join("\n"),d.ms=Date.now()-_,x||g(`Finished ${e.category} ${e.name} for ${d.ms} ms`),d.category=e.category,d.name=e.name,d.owner=null!==(S=null===(T=e.options)||void 0===T?void 0:T.owner)&&void 0!==S?S:"",!M){let t={success:d.success,result:d.result,ms:d.ms,date:d.date,skipped:d.skipped,category:e.category,name:e.name,logs:d.logs,owner:d.owner,flaking:o.Test.isReproducing&&d.success,package:d.package};if(d.result.constructor==Object){const e=Object.keys(d.result).reduce(((e,t)=>Object.assign(Object.assign({},e),{["result."+t]:d.result[t]})),{});t=Object.assign(Object.assign({},t),e)}t.result instanceof o.DataFrame&&(t.result=JSON.stringify(null===(E=t.result)||void 0===E?void 0:E.toJson())||""),yield V("package",t)}return d}))}function q(e){const t=e.slice();return t.sort((()=>Math.random()-.5)),t}function Y(e){return d(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,e)))}))}function j(e,t="Timeout exceeded",n=500,i=50){return d(this,void 0,void 0,(function*(){return new Promise(((o,s)=>{setTimeout((()=>{clearInterval(r),s(new Error(t))}),n);const r=setInterval((()=>{e()&&(clearInterval(r),o(null))}),i)}))}))}function K(e,t,n="EXECUTION TIMEOUT"){return d(this,void 0,void 0,(function*(){let i=null;const o=new Promise(((e,o)=>{i=setTimeout((()=>{o(n)}),t)}));try{return yield Promise.race([e(),o])}finally{i&&clearTimeout(i)}}))}const z=o.DataFrame.fromColumns([o.Column.fromStrings("col",["val1","val2","val3"])]);function Z(e,t,n){var o;return d(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 i.data.detectSemanticTypes(t));const r=i.shell.addTableView(t);try{yield a(r,e,s,i.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield a(r,e,s,i.events.onViewerAdded,void 0,n.awaitViewer)),(null==n?void 0:n.readOnly)||(yield a(r,e,s,i.events.onViewerAdded,l),(null==n?void 0:n.awaitViewer)&&(yield a(r,e,s,i.events.onViewerAdded,l,n.awaitViewer)));let t=null;t=yield a(r,e,s,i.events.onViewerAdded,u),(null==n?void 0:n.awaitViewer)&&(t=yield a(r,e,s,i.events.onViewerAdded,u,n.awaitViewer)),yield a(r,e,s,i.events.onViewLayoutApplied,h,void 0,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps}),(null==n?void 0:n.awaitViewer)&&(yield a(r,e,s,i.events.onViewLayoutApplied,h,n.awaitViewer,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps})),!1!==(null==n?void 0:n.arbitraryDfTest)&&(r.dataFrame=z,yield Y(50),yield a(r,e,s,i.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield a(r,e,s,i.events.onViewerAdded,void 0,n.awaitViewer))),yield a(r,e,s,i.events.onViewerAdded,c),(null==n?void 0:n.awaitViewer)&&(yield a(r,e,s,i.events.onViewerAdded,c,n.awaitViewer))}finally{}}))}},3527:(e,t,n)=>{"use strict";n.d(t,{Mi:()=>i});class i extends Float32Array{}},3629:(e,t,n)=>{"use strict";n.d(t,{KE:()=>a,S8:()=>l,dC:()=>s,vA:()=>o,wQ:()=>r});var i=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 r=new i.Mi(s);for(let i=0;i<e.length;++i)r[i]=e[i]+n*t[i];return r}function r(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 i=0;i<e.length;i++)n+=e[i]*t[i];return n}function l(e){const t=e.length;let n=0,i=0;for(let o=0;o<t;++o)n+=e[o],i+=Math.pow(e[o],2);const o=n/t,s=1/Math.sqrt(i/t-Math.pow(o,2));for(let n=0;n<t;++n)e[n]=(e[n]-o)*s;return e}},1913:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(3282),o=n(9029),s=n(1520),r=n(2586),a=n(8708),l=n(2023),c="errorMessage",u=new i.Name("emUsed"),h={required:"missingProperty",dependencies:"property",dependentRequired:"property"},d=/\$\{[^}]+\}/,p=/\$\{([^}]+)\}/g,m=/^""\s*\+\s*|\s*\+\s*""$/g;const g=(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:c,schemaType:["string","object"],post:!0,code(t){const{gen:n,data:g,schema:f,schemaValue:y,it:b}=t;if(!1===b.createErrors)return;const w=f,v=o.strConcat(l.default.instancePath,b.errorPath);function A(e,t){return o.and(i._`${e}.keyword !== ${c}`,i._`!${e}.${u}`,i._`${e}.instancePath === ${v}`,i._`${e}.keyword in ${t}`,i._`${e}.schemaPath.indexOf(${b.errSchemaPath}) === 0`,i._`/^\\/[^\\/]*$/.test(${e}.schemaPath.slice(${b.errSchemaPath.length}))`)}function C(e,t){const i=[];for(const n in e){const e=t[n];d.test(e)&&i.push([n,S(e)])}return n.object(...i)}function T(e){return d.test(e)?new s._Code(s.safeStringify(e).replace(p,((e,t)=>`" + JSON.stringify(${r.getData(t,b)}) + "`)).replace(m,"")):i.stringify(e)}function S(e){return i._`function(){return ${T(e)}}`}n.if(i._`${l.default.errors} > 0`,(()=>{if("object"==typeof w){const[s,r]=function(e){let t,n;for(const i in e){if("properties"===i||"items"===i)continue;const o=e[i];if("object"==typeof o){t||(t={});const e=t[i]={};for(const t in o)e[t]=[]}else n||(n={}),n[i]=[]}return[t,n]}(w);r&&function(o){const s=n.const("emErrors",i.stringify(o)),r=n.const("templates",C(o,f));n.forOf("err",l.default.vErrors,(e=>n.if(A(e,s),(()=>n.code(i._`${s}[${e}.keyword].push(${e})`).assign(i._`${e}.${u}`,!0)))));const{singleError:c}=e;if(c){const e=n.let("message",i._`""`),o=n.let("paramsErrors",i._`[]`);h((t=>{n.if(e,(()=>n.code(i._`${e} += ${"string"==typeof c?c:";"}`))),n.code(i._`${e} += ${d(t)}`),n.assign(o,i._`${o}.concat(${s}[${t}])`)})),a.reportError(t,{message:e,params:i._`{errors: ${o}}`})}else h((e=>a.reportError(t,{message:d(e),params:i._`{errors: ${s}[${e}]}`})));function h(e){n.forIn("key",s,(t=>n.if(i._`${s}[${t}].length`,(()=>e(t)))))}function d(e){return i._`${e} in ${r} ? ${r}[${e}]() : ${y}[${e}]`}}(r),s&&function(e){const o=n.const("emErrors",i.stringify(e)),s=[];for(const t in e)s.push([t,C(e[t],f[t])]);const r=n.const("templates",n.object(...s)),c=n.scopeValue("obj",{ref:h,code:i.stringify(h)}),d=n.let("emPropParams"),p=n.let("emParamsErrors");n.forOf("err",l.default.vErrors,(e=>n.if(A(e,o),(()=>{n.assign(d,i._`${c}[${e}.keyword]`),n.assign(p,i._`${o}[${e}.keyword][${e}.params[${d}]]`),n.if(p,(()=>n.code(i._`${p}.push(${e})`).assign(i._`${e}.${u}`,!0)))})))),n.forIn("key",o,(e=>n.forIn("keyProp",i._`${o}[${e}]`,(s=>{n.assign(p,i._`${o}[${e}][${s}]`),n.if(i._`${p}.length`,(()=>{const o=n.const("tmpl",i._`${r}[${e}] && ${r}[${e}][${s}]`);a.reportError(t,{message:i._`${o} ? ${o}() : ${y}[${e}][${s}]`,params:i._`{errors: ${p}}`})}))}))))}(s),function(e){const{props:s,items:r}=e;if(!s&&!r)return;const h=i._`typeof ${g} == "object"`,d=i._`Array.isArray(${g})`,p=n.let("emErrors");let m,b;const w=n.let("templates");function A(e,t){n.assign(p,i.stringify(e)),n.assign(w,C(e,t))}s&&r?(m=n.let("emChildKwd"),n.if(h),n.if(d,(()=>{A(r,f.items),n.assign(m,i.str`items`)}),(()=>{A(s,f.properties),n.assign(m,i.str`properties`)})),b=i._`[${m}]`):r?(n.if(d),A(r,f.items),b=i._`.items`):s&&(n.if(o.and(h,o.not(d))),A(s,f.properties),b=i._`.properties`),n.forOf("err",l.default.vErrors,(e=>function(e,t,s){n.if(o.and(i._`${e}.keyword !== ${c}`,i._`!${e}.${u}`,i._`${e}.instancePath.indexOf(${v}) === 0`),(()=>{const o=n.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:i._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),r=n.const("emMatches",i._`${o}.exec(${e}.instancePath.slice(${v}.length))`),a=n.const("emChild",i._`${r} && ${r}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);n.if(i._`${a} !== undefined && ${a} in ${t}`,(()=>s(a)))}))}(e,p,(t=>n.code(i._`${p}[${t}].push(${e})`).assign(i._`${e}.${u}`,!0))))),n.forIn("key",p,(e=>n.if(i._`${p}[${e}].length`,(()=>{a.reportError(t,{message:i._`${e} in ${w} ? ${w}[${e}]() : ${y}${b}[${e}]`,params:i._`{errors: ${p}[${e}]}`}),n.assign(i._`${l.default.vErrors}[${l.default.errors}-1].instancePath`,i._`${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",i._`[]`);n.forOf("err",l.default.vErrors,(e=>n.if(function(e){return o.and(i._`${e}.keyword !== ${c}`,i._`!${e}.${u}`,o.or(i._`${e}.instancePath === ${v}`,o.and(i._`${e}.instancePath.indexOf(${v}) === 0`,i._`${e}.instancePath[${v}.length] === "/"`)),i._`${e}.schemaPath.indexOf(${b.errSchemaPath}) === 0`,i._`${e}.schemaPath[${b.errSchemaPath}.length] === "/"`)}(e),(()=>n.code(i._`${s}.push(${e})`).assign(i._`${e}.${u}`,!0))))),n.if(i._`${s}.length`,(()=>a.reportError(t,{message:T(e),params:i._`{errors: ${s}}`})))}(s),e.keepErrors||function(){const e=n.const("emErrs",i._`[]`);n.forOf("err",l.default.vErrors,(t=>n.if(i._`!${t}.${u}`,(()=>n.code(i._`${e}.push(${t})`))))),n.assign(l.default.vErrors,e).assign(l.default.errors,i._`${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=g,e.exports=g,e.exports.default=g},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 i=n(4042),o=n(6105),s=n(6653),r=n(9572),a="https://json-schema.org/draft/2020-12/schema";class l extends i.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&&(r.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=l,e.exports=t=l,e.exports.Ajv2020=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var c=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.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 h=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var d=n(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.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 i=n(4042),o=n(6144),s=n(6653),r=n(2079),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends i.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(r,a):r;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var h=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var d=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.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 i 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=i;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 i&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function s(e,...t){const n=[e[0]];let i=0;for(;i<t.length;)l(n,t[i]),n.push(e[++i]);return new o(n)}t._Code=o,t.nil=new o(""),t._=s;const r=new o("+");function a(e,...t){const n=[u(e[0])];let i=0;for(;i<t.length;)n.push(r),l(n,t[i]),n.push(r,u(e[++i]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===r){const n=c(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 l(e,t){var n;t instanceof o?e.push(...t._items):t instanceof i?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:u(Array.isArray(n)?n.join(","):n))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof i||'"'!==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 i?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=l,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 i=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 r=n(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return r.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return r.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return r.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return r.varKinds}}),t.operators={GT:new i._Code(">"),GTE:new i._Code(">="),LT:new i._Code("<"),LTE:new i._Code("<="),EQ:new i._Code("==="),NEQ:new i._Code("!=="),NOT:new i._Code("!"),OR:new i._Code("||"),AND:new i._Code("&&"),ADD:new i._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l 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,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=P(this.rhs,e,t)),this}get names(){return this.rhs instanceof i._CodeOrName?this.rhs.names:{}}}class c 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 i.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=P(this.rhs,e,t),this}get names(){return I(this.lhs instanceof i.Name?{}:{...this.lhs.names},this.rhs)}}class u extends c{constructor(e,t,n,i){super(e,n,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class d 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=P(this.code,e,t),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class g 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 i=n.length;for(;i--;){const o=n[i];o.optimizeNames(e,t)||(N(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>_(e,t.names)),{})}}class f extends g{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends g{}class b extends f{}b.kind="else";class w extends f{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(R(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=P(this.condition,e,t),this}get names(){const e=super.names;return I(e,this.condition),this.else&&_(e,this.else.names),e}}w.kind="if";class v extends f{}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=P(this.iteration,e,t),this}get names(){return _(super.names,this.iteration.names)}}class C extends v{constructor(e,t,n,i){super(),this.varKind=e,this.name=t,this.from=n,this.to=i}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${t} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){const e=I(super.names,this.from);return I(e,this.to)}}class T extends v{constructor(e,t,n,i){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=i}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=P(this.iterable,e,t),this}get names(){return _(super.names,this.iterable.names)}}class S extends f{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)}}S.kind="func";class E extends g{render(e){return"return "+super.render(e)}}E.kind="return";class M extends f{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,i;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(i=this.finally)||void 0===i||i.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&_(e,this.catch.names),this.finally&&_(e,this.finally.names),e}}class x extends f{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}x.kind="catch";class L extends f{render(e){return"finally"+super.render(e)}}function _(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function I(e,t){return t instanceof i._CodeOrName?_(e,t.names):e}function P(e,t,n){return e instanceof i.Name?s(e):(o=e)instanceof i._Code&&o._items.some((e=>e instanceof i.Name&&1===t[e.str]&&void 0!==n[e.str]))?new i._Code(e._items.reduce(((e,t)=>(t instanceof i.Name&&(t=s(t)),t instanceof i._Code?e.push(...t._items):e.push(t),e)),[])):e;var o;function s(e){const i=n[e.str];return void 0===i||1!==t[e.str]?e:(delete t[e.str],i)}}function N(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:i._`!${k(e)}`}L.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,i){const o=this._scope.toName(t);return void 0!==n&&i&&(this._constants[o.str]=n),this._leafNode(new l(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 c(e,t,n))}add(e,n){return this._leafNode(new u(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==i.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,i.addCodeArg)(t,o));return t.push("}"),new i._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,i,s=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const r=this._scope.toName(e);return this._for(new C(s,r,t,n),(()=>i(r)))}forOf(e,t,n,s=o.varKinds.const){const r=this._scope.toName(e);if(this.opts.es5){const e=t instanceof i.Name?t:this.var("_arr",t);return this.forRange("_i",0,i._`${e}.length`,(t=>{this.var(r,i._`${e}[${t}]`),n(r)}))}return this._for(new T("of",s,r,t),(()=>n(r)))}forIn(e,t,n,s=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,i._`Object.keys(${t})`,n);const r=this._scope.toName(e);return this._for(new T("in",s,r,t),(()=>n(r)))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new h(e))}break(e){return this._leafNode(new d(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const i=new M;if(this._blockNode(i),this.code(e),t){const e=this.name("e");this._currNode=i.catch=new x(e),t(e)}return n&&(this._currNode=i.finally=new L,this.code(n)),this._endBlockNode(x,L)}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=i.nil,n,o){return this._blockNode(new S(e,t,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(S)}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=R;const $=H(t.operators.AND);t.and=function(...e){return e.reduce($)};const O=H(t.operators.OR);function H(e){return(t,n)=>t===i.nil?n:n===i.nil?t:i._`${k(t)} ${e} ${k(n)}`}function k(e){return e instanceof i.Name?e:i._`(${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 i=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 i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class r{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.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=r;class a extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=i._`.${new i.Name(t)}[${n}]`}}t.ValueScopeName=a;const l=i._`\n`;t.ValueScope=class extends r{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:i.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 i=this.toName(e),{prefix:o}=i,s=null!==(n=t.key)&&void 0!==n?n:t.ref;let r=this._values[o];if(r){const e=r.get(s);if(e)return e}else r=this._values[o]=new Map;r.set(s,i);const a=this._scope[o]||(this._scope[o]=[]),l=a.length;return a[l]=t.ref,i.setValue(t,{property:o,itemIndex:l}),i}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 i._`${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,r={},a){let l=i.nil;for(const c in e){const u=e[c];if(!u)continue;const h=r[c]=r[c]||new Map;u.forEach((e=>{if(h.has(e))return;h.set(e,s.Started);let r=n(e);if(r){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;l=i._`${l}${n} ${e} = ${r};${this.opts._n}`}else{if(!(r=null==a?void 0:a(e)))throw new o(e);l=i._`${l}${r}${this.opts._n}`}h.set(e,s.Completed)}))}return l}}},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 i=n(9029),o=n(4227),s=n(2023);function r(e,t){const n=e.const("err",t);e.if(i._`${s.default.vErrors} === null`,(()=>e.assign(s.default.vErrors,i._`[${n}]`)),i._`${s.default.vErrors}.push(${n})`),e.code(i._`${s.default.errors}++`)}function a(e,t){const{gen:n,validateName:o,schemaEnv:s}=e;s.$async?n.throw(i._`new ${e.ValidationError}(${t})`):(n.assign(i._`${o}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>i.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?i.str`"${e}" keyword must be ${t} ($data)`:i.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,o,s){const{it:l}=e,{gen:u,compositeRule:h,allErrors:d}=l,p=c(e,n,o);(null!=s?s:h||d)?r(u,p):a(l,i._`[${p}]`)},t.reportExtraError=function(e,n=t.keywordError,i){const{it:o}=e,{gen:l,compositeRule:u,allErrors:h}=o;r(l,c(e,n,i)),u||h||a(o,s.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(s.default.errors,t),e.if(i._`${s.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(i._`${s.default.vErrors}.length`,t)),(()=>e.assign(s.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:o,errsCount:r,it:a}){if(void 0===r)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",r,s.default.errors,(r=>{e.const(l,i._`${s.default.vErrors}[${r}]`),e.if(i._`${l}.instancePath === undefined`,(()=>e.assign(i._`${l}.instancePath`,(0,i.strConcat)(s.default.instancePath,a.errorPath)))),e.assign(i._`${l}.schemaPath`,i.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(i._`${l}.schema`,n),e.assign(i._`${l}.data`,o))}))};const l={keyword:new i.Name("keyword"),schemaPath:new i.Name("schemaPath"),params:new i.Name("params"),propertyName:new i.Name("propertyName"),message:new i.Name("message"),schema:new i.Name("schema"),parentSchema:new i.Name("parentSchema")};function c(e,t,n){const{createErrors:o}=e.it;return!1===o?i._`{}`:function(e,t,n={}){const{gen:o,it:r}=e,a=[u(r,n),h(e,n)];return function(e,{params:t,message:n},o){const{keyword:r,data:a,schemaValue:c,it:u}=e,{opts:h,propertyName:d,topSchemaRef:p,schemaPath:m}=u;o.push([l.keyword,r],[l.params,"function"==typeof t?t(e):t||i._`{}`]),h.messages&&o.push([l.message,"function"==typeof n?n(e):n]),h.verbose&&o.push([l.schema,c],[l.parentSchema,i._`${p}${m}`],[s.default.data,a]),d&&o.push([l.propertyName,d])}(e,t,a),o.object(...a)}(e,t,n)}function u({errorPath:e},{instancePath:t}){const n=t?i.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[s.default.instancePath,(0,i.strConcat)(s.default.instancePath,n)]}function h({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:s}){let r=s?t:i.str`${t}/${e}`;return n&&(r=i.str`${r}${(0,o.getErrorPath)(n,o.Type.Str)}`),[l.schemaPath,r]}},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 i=n(9029),o=n(3558),s=n(2023),r=n(6939),a=n(4227),l=n(2586);class c{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,r.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=d.call(this,e);if(t)return t;const n=(0,r.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:u}=this.opts,h=new i.CodeGen(this.scope,{es5:a,lines:c,ownProperties:u});let p;e.$async&&(p=h.scopeValue("Error",{ref:o.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const m=h.scopeName("validate");e.validateName=m;const g={gen:h,allErrors:this.opts.allErrors,data:s.default.data,parentData:s.default.parentData,parentDataProperty:s.default.parentDataProperty,dataNames:[s.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,i.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:i.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:i._`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,l.validateFunctionCode)(g),h.optimize(this.opts.code.optimize);const t=h.toString();f=`${h.scopeRefs(s.default.scope)}return ${t}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const n=new Function(`${s.default.self}`,`${s.default.scope}`,f)(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:h._values}),this.opts.unevaluated){const{props:e,items:t}=g;n.evaluated={props:e instanceof i.Name?void 0:e,items:t instanceof i.Name?void 0:t,dynamicProps:e instanceof i.Name,dynamicItems:t instanceof i.Name},n.source&&(n.source.evaluated=(0,i.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),t}finally{this._compilations.delete(e)}}function h(e){return(0,r.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function d(e){for(const i of this._compilations)if(n=e,(t=i).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return i;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),i=(0,r._getFullPath)(this.opts.uriResolver,n);let o=(0,r.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===o)return f.call(this,n,e);const s=(0,r.normalizeId)(i),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 f.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||u.call(this,a),s===(0,r.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,i=t[n];return i&&(o=(0,r.resolveUrl)(this.opts.uriResolver,o,i)),new c({schema:t,schemaId:n,root:e,baseId:o})}return f.call(this,n,a)}}t.SchemaEnv=c,t.compileSchema=u,t.resolveRef=function(e,t,n){var i;n=(0,r.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===(i=e.localRefs)||void 0===i?void 0:i[n],{schemaId:r}=this.opts;o&&(s=new c({schema:o,schemaId:r,root:e,baseId:t}))}return void 0!==s?e.refs[n]=h.call(this,s):void 0},t.getCompilingSchema=d,t.resolveSchema=m;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function f(e,{baseId:t,schema:n,root:i}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const i of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,a.unescapeFragment)(i)];if(void 0===e)return;const o="object"==typeof(n=e)&&n[this.opts.schemaId];!g.has(i)&&o&&(t=(0,r.resolveUrl)(this.opts.uriResolver,t,o))}let s;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,r.resolveUrl)(this.opts.uriResolver,t,n.$ref);s=m.call(this,i,e)}const{schemaId:l}=this.opts;return s=s||new c({schema:n,schemaId:l,root:i,baseId:t}),s.schema!==s.root.schema?s:void 0}},2023:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(9029),o={data:new i.Name("data"),valCxt:new i.Name("valCxt"),instancePath:new i.Name("instancePath"),parentData:new i.Name("parentData"),parentDataProperty:new i.Name("parentDataProperty"),rootData:new i.Name("rootData"),dynamicAnchors:new i.Name("dynamicAnchors"),vErrors:new i.Name("vErrors"),errors:new i.Name("errors"),this:new i.Name("this"),self:new i.Name("self"),scope:new i.Name("scope"),json:new i.Name("json"),jsonPos:new i.Name("jsonPos"),jsonLen:new i.Name("jsonLen"),jsonPart:new i.Name("jsonPart")};t.default=o},4551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6939);class o extends Error{constructor(e,t,n,o){super(o||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,i.resolveUrl)(e,t,n),this.missingSchema=(0,i.normalizeId)((0,i.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 i=n(4227),o=n(2017),s=n(7106),r=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?!l(e):!!t&&c(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(a.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(l))return!0;if("object"==typeof n&&l(n))return!0}return!1}function c(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!r.has(n)&&("object"==typeof e[n]&&(0,i.eachItem)(e[n],(e=>t+=c(e))),t===1/0))return 1/0}return t}function u(e,t="",n){!1!==n&&(t=p(t));const i=e.parse(t);return h(e,i)}function h(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=h;const d=/#\/?$/;function p(e){return e?e.replace(d,""):""}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:i}=this.opts,r=p(e[n]||t),a={"":r},l=u(i,r,!1),c={},h=new Set;return s(e,{allKeys:!0},((e,t,i,o)=>{if(void 0===o)return;const s=l+t;let r=a[o];function u(t){const n=this.opts.uriResolver.resolve;if(t=p(r?n(r,t):t),h.has(t))throw g(t);h.add(t);let i=this.refs[t];return"string"==typeof i&&(i=this.refs[i]),"object"==typeof i?d(e,i.schema,t):t!==p(s)&&("#"===t[0]?(d(e,c[t],t),c[t]=e):this.refs[t]=s),t}function f(e){if("string"==typeof e){if(!m.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[n]&&(r=u.call(this,e[n])),f.call(this,e.$anchor),f.call(this,e.$dynamicAnchor),a[t]=r})),c;function d(e,t,n){if(void 0!==t&&!o(e,t))throw g(n)}function g(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 i=n(9029),o=n(1520);function s(e,t=e.schema){const{opts:n,self:i}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const o=i.RULES.keywords;for(const n in t)o[n]||m(e,`unknown keyword: "${n}"`)}function r(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 l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:o}){return(s,r,a,l)=>{const c=void 0===a?r:a instanceof i.Name?(r instanceof i.Name?e(s,r,a):t(s,r,a),a):r instanceof i.Name?(t(s,a,r),r):n(r,a);return l!==i.Name||c instanceof i.Name?c:o(s,c)}}function u(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",i._`{}`);return void 0!==t&&h(e,n,t),n}function h(e,t,n){Object.keys(n).forEach((n=>e.assign(i._`${t}${(0,i.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),!r(t,e.self.RULES.all))},t.checkUnknownRules=s,t.schemaHasRules=r,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 i._`${n}`}return i._`${e}${t}${(0,i.getProperty)(o)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>{e.if(i._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,i._`${n} || {}`).code(i._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,i._`${n} || {}`),h(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,i._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>e.assign(n,!0===t||i._`${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=h;const d={};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:d[t.code]||(d[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 i.Name){const o=t===p.Num;return n?o?i._`"[" + ${e} + "]"`:i._`"['" + ${e} + "']"`:o?i._`"/" + ${e}`:i._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,i.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=m},7887:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>i(e,t)))}function i(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},i){const o=t.RULES.types[i];return o&&!0!==o&&n(e,o)},t.shouldUseGroup=n,t.shouldUseRule=i},8727:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const i=n(8708),o=n(9029),s=n(2023),r={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,i.reportError)(s,r,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:i}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(s.default.data):(t.assign(o._`${i}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:i}=e;!1===i?(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 i=n(396),o=n(7887),s=n(8708),r=n(9029),a=n(4227);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.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"}(l||(t.DataType=l={})),t.getSchemaTypes=function(e){const t=c(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=c,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:i,opts:s}=e,a=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,s.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(c){const o=d(t,i,s.strictNumbers,l.Wrong);n.if(o,(()=>{a.length?function(e,t,n){const{gen:i,data:o,opts:s}=e,a=i.let("dataType",r._`typeof ${o}`),l=i.let("coerced",r._`undefined`);"array"===s.coerceTypes&&i.if(r._`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>i.assign(o,r._`${o}[0]`).assign(a,r._`typeof ${o}`).if(d(t,o,s.strictNumbers),(()=>i.assign(l,o))))),i.if(r._`${l} !== undefined`);for(const e of n)(u.has(e)||"array"===e&&"array"===s.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void i.elseIf(r._`${a} == "number" || ${a} == "boolean"`).assign(l,r._`"" + ${o}`).elseIf(r._`${o} === null`).assign(l,r._`""`);case"number":return void i.elseIf(r._`${a} == "boolean" || ${o} === null
|
|
2
2
|
|| (${a} == "string" && ${o} && ${o} == +${o})`).assign(l,r._`+${o}`);case"integer":return void i.elseIf(r._`${a} === "boolean" || ${o} === null
|
|
3
3
|
|| (${a} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,r._`+${o}`);case"boolean":return void i.elseIf(r._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf(r._`${o} === "true" || ${o} === 1`).assign(l,!0);case"null":return i.elseIf(r._`${o} === "" || ${o} === 0 || ${o} === false`),void i.assign(l,null);case"array":i.elseIf(r._`${a} === "string" || ${a} === "number"
|
|
4
4
|
|| ${a} === "boolean" || ${o} === null`).assign(l,r._`[${o}]`)}}i.else(),m(e),i.endIf(),i.if(r._`${l} !== undefined`,(()=>{i.assign(o,l),function({gen:e,parentData:t,parentDataProperty:n},i){e.if(r._`${t} !== undefined`,(()=>e.assign(r._`${t}[${n}]`,i)))}(e,l)}))}(e,t,a):m(e)}))}return c};const u=new Set(["string","number","integer","boolean","null"]);function h(e,t,n,i=l.Correct){const o=i===l.Correct?r.operators.EQ:r.operators.NEQ;let s;switch(e){case"null":return r._`${t} ${o} null`;case"array":s=r._`Array.isArray(${t})`;break;case"object":s=r._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=a(r._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=a();break;default:return r._`typeof ${t} ${o} ${e}`}return i===l.Correct?s:(0,r.not)(s);function a(e=r.nil){return(0,r.and)(r._`typeof ${t} == "number"`,e,n?r._`isFinite(${t})`:r.nil)}}function d(e,t,n,i){if(1===e.length)return h(e[0],t,n,i);let o;const s=(0,a.toHash)(e);if(s.array&&s.object){const e=r._`typeof ${t} != "object"`;o=s.null?e:r._`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=r.nil;s.number&&delete s.integer;for(const e in s)o=(0,r.and)(o,h(e,t,n,i));return o}t.checkDataType=h,t.checkDataTypes=d;const p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?r._`{type: ${e}}`:r._`{type: ${t}}`};function m(e){const t=function(e){const{gen:t,data:n,schema:i}=e,o=(0,a.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:n,schema:i.type,schemaCode:o,schemaValue:o,parentSchema:i,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 i=n(9029),o=n(4227);function s(e,t,n){const{gen:s,compositeRule:r,data:a,opts:l}=e;if(void 0===n)return;const c=i._`${a}${(0,i.getProperty)(t)}`;if(r)return void(0,o.checkStrictMode)(e,`default is ignored for: ${c}`);let u=i._`${c} === undefined`;"empty"===l.useDefaults&&(u=i._`${u} || ${c} === null || ${c} === ""`),s.if(u,i._`${c} = ${(0,i.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:i}=e.schema;if("object"===t&&n)for(const t in n)s(e,t,n[t].default);else"array"===t&&Array.isArray(i)&&i.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 i=n(8727),o=n(208),s=n(7887),r=n(208),a=n(7870),l=n(3673),c=n(4495),u=n(9029),h=n(2023),d=n(6939),p=n(4227),m=n(8708);function g({gen:e,validateName:t,schema:n,schemaEnv:i,opts:o},s){o.code.es5?e.func(t,u._`${h.default.data}, ${h.default.valCxt}`,i.$async,(()=>{e.code(u._`"use strict"; ${f(n,o)}`),function(e,t){e.if(h.default.valCxt,(()=>{e.var(h.default.instancePath,u._`${h.default.valCxt}.${h.default.instancePath}`),e.var(h.default.parentData,u._`${h.default.valCxt}.${h.default.parentData}`),e.var(h.default.parentDataProperty,u._`${h.default.valCxt}.${h.default.parentDataProperty}`),e.var(h.default.rootData,u._`${h.default.valCxt}.${h.default.rootData}`),t.dynamicRef&&e.var(h.default.dynamicAnchors,u._`${h.default.valCxt}.${h.default.dynamicAnchors}`)}),(()=>{e.var(h.default.instancePath,u._`""`),e.var(h.default.parentData,u._`undefined`),e.var(h.default.parentDataProperty,u._`undefined`),e.var(h.default.rootData,h.default.data),t.dynamicRef&&e.var(h.default.dynamicAnchors,u._`{}`)}))}(e,o),e.code(s)})):e.func(t,u._`${h.default.data}, ${function(e){return u._`{${h.default.instancePath}="", ${h.default.parentData}, ${h.default.parentDataProperty}, ${h.default.rootData}=${h.default.data}${e.dynamicRef?u._`, ${h.default.dynamicAnchors}={}`:u.nil}}={}`}(o)}`,i.$async,(()=>e.code(f(n,o)).code(s)))}function f(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:i,self:o}=e;t.$ref&&i.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 C(e,[],!1,t);const n=(0,o.getSchemaTypes)(e.schema);C(e,n,!(0,o.coerceAndCheckDataType)(e,n),t)}function A({gen:e,schemaEnv:t,schema:n,errSchemaPath:i,opts:o}){const s=n.$comment;if(!0===o.$comment)e.code(u._`${h.default.self}.logger.log(${s})`);else if("function"==typeof o.$comment){const n=u.str`${i}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(u._`${h.default.self}.opts.$comment(${s}, ${n}, ${o}.schema)`)}}function C(e,t,n,i){const{gen:o,schema:a,data:l,allErrors:c,opts:d,self:m}=e,{RULES:g}=m;function f(p){(0,s.shouldUseGroup)(a,p)&&(p.type?(o.if((0,r.checkDataType)(p.type,l,d.strictNumbers)),T(e,p),1===t.length&&t[0]===p.type&&n&&(o.else(),(0,r.reportTypeError)(e)),o.endIf()):T(e,p),c||o.if(u._`${h.default.errors} === ${i||0}`))}!a.$ref||!d.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(a,g)?(d.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{S(e.dataTypes,t)||E(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const n=[];for(const i of e.dataTypes)S(t,i)?n.push(i):t.includes("integer")&&"number"===i&&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"))&&E(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const n=e.self.RULES.all;for(const i in n){const o=n[i];if("object"==typeof o&&(0,s.shouldUseRule)(e.schema,o)){const{type:n}=o.definition;n.length&&!n.some((e=>{return i=e,(n=t).includes(i)||"number"===i&&n.includes("integer");var n,i}))&&E(e,`missing type "${n.join(",")}" for keyword "${i}"`)}}}(e,e.dataTypes))}(e,t),o.block((()=>{for(const e of g.rules)f(e);f(g.post)}))):o.block((()=>x(e,"$ref",g.all.$ref.definition)))}function T(e,t){const{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,s.shouldUseRule)(i,n)&&x(e,n.keyword,n.definition,t.type)}))}function S(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function E(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:i}=e;g(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),i.let(h.default.vErrors,null),i.let(h.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:i,ValidationError:o,opts:s}=e;n.$async?t.if(u._`${h.default.errors} === 0`,(()=>t.return(h.default.data)),(()=>t.throw(u._`new ${o}(${h.default.vErrors})`))):(t.assign(u._`${i}.errors`,h.default.vErrors),s.unevaluated&&function({gen:e,evaluated:t,props:n,items:i}){n instanceof u.Name&&e.assign(u._`${t}.props`,n),i instanceof u.Name&&e.assign(u._`${t}.items`,i)}(e),t.return(u._`${h.default.errors} === 0`))}(e)}))}(e):g(e,(()=>(0,i.topBoolOrEmptySchema)(e)))};class M{constructor(e,t,n){if((0,l.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",I(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.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",h.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:i,schemaType:o,def:s}=this;n.if((0,u.or)(u._`${i} === 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:i,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,r.checkDataTypes)(e,t,o.opts.strictNumbers,r.DataType.Wrong)}`}return u.nil}(),function(){if(i.validateSchema){const n=e.scopeValue("validate$data",{ref:i.validateSchema});return u._`!${n}(${t})`}return u.nil}())}subschema(e,t){const n=(0,c.getSubschema)(this.it,e);(0,c.extendSubschemaData)(n,this.it,e),(0,c.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:i,opts:o}=e;o.$comment&&n.$comment&&A(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,d.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=i.const("_errs",h.default.errors);v(e,s),i.var(t,u._`${s} === ${h.default.errors}`)}(e,t):(0,i.boolOrEmptySchema)(e,t)}(o,t),o}mergeEvaluated(e,t){const{it:n,gen:i}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=p.mergeEvaluated.props(i,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=p.mergeEvaluated.items(i,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:i}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return i.if(t,(()=>this.mergeEvaluated(e,u.Name))),!0}}function x(e,t,n,i){const o=new M(e,n,t);"code"in n?n.code(o,i):o.$data&&n.validate?(0,l.funcKeywordCode)(o,n):"macro"in n?(0,l.macroKeywordCode)(o,n):(n.compile||n.validate)&&(0,l.funcKeywordCode)(o,n)}t.KeywordCxt=M;const L=/^\/(?:[^~]|~0|~1)*$/,_=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function I(e,{dataLevel:t,dataNames:n,dataPathArr:i}){let o,s;if(""===e)return h.default.rootData;if("/"===e[0]){if(!L.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,s=h.default.rootData}else{const r=_.exec(e);if(!r)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+r[1];if(o=r[2],"#"===o){if(a>=t)throw new Error(l("property/index",a));return i[t-a]}if(a>t)throw new Error(l("data",a));if(s=n[t-a],!o)return s}let r=s;const a=o.split("/");for(const e of a)e&&(s=u._`${s}${(0,u.getProperty)((0,p.unescapeJsonPointer)(e))}`,r=u._`${r} && ${s}`);return r;function l(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=I},3673:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const i=n(9029),o=n(2023),s=n(5765),r=n(8708);function a(e){const{gen:t,data:n,it:o}=e;t.if(o.parentData,(()=>t.assign(n,i._`${o.parentData}[${o.parentDataProperty}]`)))}function l(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,i.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:o,schema:s,parentSchema:r,it:a}=e,c=t.macro.call(a.self,s,r,a),u=l(n,o,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);const h=n.name("valid");e.subschema({schema:c,schemaPath:i.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:u,compositeRule:!0},h),e.pass(h,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:c,keyword:u,schema:h,parentSchema:d,$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 g=!p&&t.compile?t.compile.call(m.self,h,d,m):t.validate,f=l(c,u,g),y=c.let("valid");function b(n=(t.async?i._`await `:i.nil)){const r=m.opts.passContext?o.default.this:o.default.self,a=!("compile"in t&&!p||!1===t.schema);c.assign(y,i._`${n}${(0,s.callValidateCode)(e,f,r,a)}`,t.modifying)}function w(e){var n;c.if((0,i.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=c.let("ruleErrs",null);return c.try((()=>b(i._`await `)),(t=>c.assign(y,!1).if(i._`${t} instanceof ${m.ValidationError}`,(()=>c.assign(e,i._`${t}.errors`)),(()=>c.throw(t))))),e}():function(){const e=i._`${f}.errors`;return c.assign(e,null),b(i.nil),e}();t.modifying&&a(e),w((()=>function(e,t){const{gen:n}=e;n.if(i._`Array.isArray(${t})`,(()=>{n.assign(o.default.vErrors,i._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,i._`${o.default.vErrors}.length`),(0,r.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:i},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");const r=o.dependencies;if(null==r?void 0:r.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${s}: ${r.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[s])){const e=`keyword "${s}" value is invalid at path "${i}": `+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 i=n(9029),o=n(4227);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:s,schemaPath:r,errSchemaPath:a,topSchemaRef:l}){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:i._`${e.schemaPath}${(0,i.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[n],schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}${(0,i.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(n)}`}}if(void 0!==s){if(void 0===r||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:r,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:s,data:r,dataTypes:a,propertyName:l}){if(void 0!==r&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=t;if(void 0!==n){const{errorPath:r,dataPathArr:a,opts:l}=t;u(c.let("data",i._`${t.data}${(0,i.getProperty)(n)}`,!0)),e.errorPath=i.str`${r}${(0,o.getErrorPath)(n,s,l.jsPropertySyntax)}`,e.parentDataProperty=i._`${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!==r&&(u(r instanceof i.Name?r:c.let("data",r,!0)),void 0!==l&&(e.propertyName=l)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:i,createErrors:o,allErrors:s}){void 0!==i&&(e.compositeRule=i),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 i=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return i.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),r=n(4551),a=n(396),l=n(3835),c=n(9029),u=n(6939),h=n(208),d=n(4227),p=n(3837),m=n(5944),g=(e,t)=>new RegExp(e,t);g.code="new RegExp";const f=["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,i,o,s,r,a,l,c,u,h,d,p,f,y,b,w,v,A,C,T,S,E,M,x;const L=e.strict,_=null===(t=e.code)||void 0===t?void 0:t.optimize,I=!0===_||void 0===_?1:_||0,P=null!==(i=null===(n=e.code)||void 0===n?void 0:n.regExp)&&void 0!==i?i:g,N=null!==(o=e.uriResolver)&&void 0!==o?o:m.default;return{strictSchema:null===(r=null!==(s=e.strictSchema)&&void 0!==s?s:L)||void 0===r||r,strictNumbers:null===(l=null!==(a=e.strictNumbers)&&void 0!==a?a:L)||void 0===l||l,strictTypes:null!==(u=null!==(c=e.strictTypes)&&void 0!==c?c:L)&&void 0!==u?u:"log",strictTuples:null!==(d=null!==(h=e.strictTuples)&&void 0!==h?h:L)&&void 0!==d?d:"log",strictRequired:null!==(f=null!==(p=e.strictRequired)&&void 0!==p?p:L)&&void 0!==f&&f,code:e.code?{...e.code,optimize:I,regExp:P}:{optimize:I,regExp:P},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!==(C=e.schemaId)&&void 0!==C?C:"$id",addUsedSchema:null===(T=e.addUsedSchema)||void 0===T||T,validateSchema:null===(S=e.validateSchema)||void 0===S||S,validateFormats:null===(E=e.validateFormats)||void 0===E||E,unicodeRegExp:null===(M=e.unicodeRegExp)||void 0===M||M,int32range:null===(x=e.int32range)||void 0===x||x,uriResolver:N}}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 c.ValueScope({scope:{},prefixes:y,es5:t,lines:n}),this.logger=function(e){if(!1===e)return L;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 i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),C.call(this,b,e,"NOT SUPPORTED"),C.call(this,w,e,"DEPRECATED","warn"),this._metaOpts=x.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&M.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let i=p;"id"===n&&(i={...p},i.id=i.$id,delete i.$id),t&&e&&this.addMetaSchema(i,i[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 i=n(t);return"$async"in n||(this.errors=n.errors),i}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 i.call(this,e,t);async function i(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 i.call(this,{$ref:e},!0)}async function s(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof r.default))throw t;return a.call(this,t),await l.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 l(e){const n=await c.call(this,e);this.refs[e]||await o.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function c(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,i=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,i);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,i,!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 i=this.validate(n,e);if(!i&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return i}getSchema(e){let t;for(;"string"==typeof(t=T.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,i=new l.SchemaEnv({schema:{},schemaId:n});if(t=l.resolveSchema.call(this,i,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=T.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(I.call(this,n,t),!t)return(0,d.eachItem)(n,(e=>P.call(this,e))),this;R.call(this,t);const i={...t,type:(0,h.getJSONTypes)(t.type),schemaType:(0,h.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(n,0===i.type.length?e=>P.call(this,e,i):e=>i.type.forEach((t=>P.call(this,e,i,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 i of t){const t=i.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:i}=t.definition,s=o[e];i&&s&&(o[e]=O(s))}}return e}_removeAllSchemas(e,t){for(const n in e){const i=e[n];t&&!t.test(n)||("string"==typeof i?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,t,n,i=this.opts.validateSchema,o=this.opts.addUsedSchema){let s;const{schemaId:r}=this.opts;if("object"==typeof e)s=e[r];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 c=u.getSchemaRefs.call(this,e,n);return a=new l.SchemaEnv({schema:e,schemaId:r,meta:t,baseId:n,localRefs:c}),this._cache.set(a.schema,a),o&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=a),i&&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):l.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{l.compileSchema.call(this,e)}finally{this.opts=t}}}function C(e,t,n,i="error"){for(const o in e){const s=o;s in t&&this.logger[i](`${n}: option ${o}. ${e[s]}`)}}function T(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){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 E(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function M(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 x(){const e={...this.opts};for(const t of f)delete e[t];return e}A.ValidationError=s.default,A.MissingRefError=r.default,t.default=A;const L={log(){},warn(){},error(){}},_=/^[a-z_$][a-z0-9_$:-]*$/i;function I(e,t){const{RULES:n}=this;if((0,d.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!_.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 P(e,t,n){var i;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 r=o?s.post:s.rules.find((({type:e})=>e===n));if(r||(r={type:n,rules:[]},s.rules.push(r)),s.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,h.getJSONTypes)(t.type),schemaType:(0,h.getJSONTypes)(t.schemaType)}};t.before?N.call(this,r,a,t.before):r.rules.push(a),s.all[e]=a,null===(i=t.implements)||void 0===i||i.forEach((e=>this.addKeyword(e)))}function N(e,t,n){const i=e.rules.findIndex((e=>e.keyword===n));i>=0?e.rules.splice(i,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function R(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=O(t)),e.validateSchema=this.compile(t,!0))}const $={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,$]}}},9572:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(1678),o=n(7216),s=n(9547),r=n(8226),a=n(518),l=n(4588),c=n(5707),u=n(7082),h=["/properties"];t.default=function(e){return[i,o,s,r,a,t(this,l),c,t(this,u)].forEach((e=>this.addMetaSchema(e,void 0,!1))),this;function t(t,n){return e?t.$dataMetaSchema(n,h):n}}},6250:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(2017);i.code='require("ajv/dist/runtime/equal").default',t.default=i},3853:(e,t)=>{"use strict";function n(e){const t=e.length;let n,i=0,o=0;for(;o<t;)i++,n=e.charCodeAt(o++),n>=55296&&n<=56319&&o<t&&(n=e.charCodeAt(o),56320==(64512&n)&&o++);return i}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 i=n(8343);i.code='require("ajv/dist/runtime/uri").default',t.default=i},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 i=n(9029),o=n(4227),s={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>i.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>i._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:i}=t;Array.isArray(i)?r(e,i):(0,o.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function r(e,t){const{gen:n,schema:s,data:r,keyword:a,it:l}=e;l.items=!0;const c=n.const("len",i._`${r}.length`);if(!1===s)e.setParams({len:t.length}),e.pass(i._`${c} <= ${t.length}`);else if("object"==typeof s&&!(0,o.alwaysValidSchema)(l,s)){const s=n.var("valid",i._`${c} <= ${t.length}`);n.if((0,i.not)(s),(()=>function(s){n.forRange("i",t.length,c,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},s),l.allErrors||n.if((0,i.not)(s),(()=>n.break()))}))}(s))),e.ok(s)}}t.validateAdditionalItems=r,t.default=s},8660:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(5765),o=n(9029),s=n(2023),r=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:l,errsCount:c,it:u}=e;if(!c)throw new Error("ajv implementation error");const{allErrors:h,opts:d}=u;if(u.props=!0,"all"!==d.removeAdditional&&(0,r.alwaysValidSchema)(u,n))return;const p=(0,i.allSchemaProperties)(a.properties),m=(0,i.allSchemaProperties)(a.patternProperties);function g(e){t.code(o._`delete ${l}[${e}]`)}function f(i){if("all"===d.removeAdditional||d.removeAdditional&&!1===n)g(i);else{if(!1===n)return e.setParams({additionalProperty:i}),e.error(),void(h||t.break());if("object"==typeof n&&!(0,r.alwaysValidSchema)(u,n)){const n=t.name("valid");"failing"===d.removeAdditional?(y(i,n,!1),t.if((0,o.not)(n),(()=>{e.reset(),g(i)}))):(y(i,n),h||t.if((0,o.not)(n),(()=>t.break())))}}}function y(t,n,i){const o={keyword:"additionalProperties",dataProp:t,dataPropType:r.Type.Str};!1===i&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,n)}t.forIn("key",l,(n=>{p.length||m.length?t.if(function(n){let s;if(p.length>8){const e=(0,r.schemaRefOrVal)(u,a.properties,"properties");s=(0,i.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,i.usePattern)(e,t)}.test(${n})`)))),(0,o.not)(s)}(n),(()=>f(n))):f(n)})),e.ok(o._`${c} === ${s.default.errors}`)}};t.default=a},5844:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=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,i.alwaysValidSchema)(o,t))return;const r=e.subschema({keyword:"allOf",schemaProp:n},s);e.ok(s),e.mergeEvaluated(r)}))}};t.default=o},6505:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(5765).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=i},2661:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=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?i.str`must contain at least ${e} valid item(s)`:i.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?i._`{minContains: ${e}}`:i._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:s,data:r,it:a}=e;let l,c;const{minContains:u,maxContains:h}=s;a.opts.next?(l=void 0===u?1:u,c=h):l=1;const d=t.const("len",i._`${r}.length`);if(e.setParams({min:l,max:c}),void 0===c&&0===l)return void(0,o.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==c&&l>c)return(0,o.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,o.alwaysValidSchema)(a,n)){let t=i._`${d} >= ${l}`;return void 0!==c&&(t=i._`${t} && ${d} <= ${c}`),void e.pass(t)}a.items=!0;const p=t.name("valid");function m(){const e=t.name("_valid"),n=t.let("count",0);g(e,(()=>t.if(e,(()=>function(e){t.code(i._`${e}++`),void 0===c?t.if(i._`${e} >= ${l}`,(()=>t.assign(p,!0).break())):(t.if(i._`${e} > ${c}`,(()=>t.assign(p,!1).break())),1===l?t.assign(p,!0):t.if(i._`${e} >= ${l}`,(()=>t.assign(p,!0))))}(n)))))}function g(n,i){t.forRange("i",0,d,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:o.Type.Num,compositeRule:!0},n),i()}))}void 0===c&&1===l?g(p,(()=>t.if(p,(()=>t.break())))):0===l?(t.let(p,!0),void 0!==c&&t.if(i._`${r}.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 i=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 i.str`must have ${o} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:o}})=>i._`{property: ${e},
|