@datagrok/bio 2.20.3 → 2.20.4

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.js CHANGED
@@ -1,4 +1,4 @@
1
- var bio;(()=>{var e={8924:(e,t,n)=>{"use strict";var i=n(7362);class r 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,r)),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,r)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new r({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 r.aaSynonyms?r.aaSynonyms[e]:e;return super.get(t)}}r.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class o{static getPalette(e="grok"){switch(e){case"grok":return r.GrokGroups;case"lesk":return r.Lesk;default:throw new Error(`ChemPalette: scheme \`${e}\` does not exist`)}}static getInnerOuter(e){let t=0,n="",i="";for(const r of e)"("==r?t++:")"==r?t--:t?n+=r:i+=r;return isNaN(parseInt(n))?[i,n]:[i,""]}static getColorAAPivot(e="",t="grok"){const n=this.getPalette(t);let[i,r]=this.getInnerOuter(e);if(i=i.length>6?`${i.slice(0,3)}...`:i,r=r.length>6?`${r.slice(0,3)}...`:r,1==e.length||"("==e[1]){const t=e[0]?.toUpperCase();return t in n?[n.get(t),t,r,1]:[this.undefinedColor,i,r,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,r,2]:[this.undefinedColor,i,r,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,r,3]:[this.undefinedColor,i,r,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,r,4]:[this.undefinedColor,i,r,4]}return[this.undefinedColor,i,r,0]}}o.SemType="Aminoacids",o.SemTypeMultipleAlignment="AminoacidsMultipleAlignment",o.undefinedColor="rgb(100,100,100)",o.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"},o.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"},o.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(*)*"},o.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:()=>r});var i=n(6082);async function r(){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:()=>o,fA:()=>s});var i=n(7389),r=n(6082);async function o(){const e="Helm",t=r.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 s(e,t){if(!e)throw new Error("Argument 'a' of type Atom or HelmType is mandatory.");let n,i;const r=e;return"ATOM"===r.T?(n=r.biotype(),i=r.elem):(n=e,i=t),[n,i]}r.JsInputBase,Error,i.input.helmAsync=async function(e,t){return(await o()).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:()=>s});var i=n(4328);const r="Libraries";let o=Promise.resolve();async function s(){let e;return o=o.then((async()=>{const t=i.userSettings.getValue(r,"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 o,e}async function a(e){o=o.then((async()=>{console.debug(`Bio: setUserLibSettings()\n${JSON.stringify(e,void 0,2)}`),i.userSettings.add(r,"Settings",JSON.stringify(e),!0)})),await o}},5553:(e,t,n)=>{"use strict";n.d(t,{Qc:()=>A,WN:()=>S});var i=n(1991),r=n.n(i);const o="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,s=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,h=globalThis.AbortSignal;if(void 0===c){h=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},c=class{constructor(){t()}signal=new h;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 u=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),d=e=>u(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 f{#t;#n;#i;#r;#o;#s;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#l;#c;#h;#u;#d;#p;#m;#f;#g;#y;#b;#v;#w;#C;#A;#S;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#w,sizes:e.#b,keyMap:e.#c,keyList:e.#h,valList:e.#u,next:e.#d,prev:e.#p,get head(){return e.#m},get tail(){return e.#f},free:e.#g,isBackgroundFetch:t=>e.#x(t),backgroundFetch:(t,n,i,r)=>e.#E(t,n,i,r),moveToTail:t=>e.#_(t),indexes:t=>e.#M(t),rindexes:t=>e.#I(t),isStale:t=>e.#T(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.#o}get memoMethod(){return this.#s}get dispose(){return this.#i}get disposeAfter(){return this.#r}constructor(e){const{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:h,disposeAfter:p,noDisposeOnSet:g,noUpdateTTL:y,maxSize:b=0,maxEntrySize:v=0,sizeCalculation:w,fetchMethod:C,memoMethod:A,noDeleteOnFetchRejection:S,noDeleteOnStaleGet:x,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:_,ignoreFetchAbort:M}=e;if(0!==t&&!u(t))throw new TypeError("max option must be a nonnegative integer");const I=t?d(t):Array;if(!I)throw new Error("invalid max value: "+t);if(this.#t=t,this.#n=b,this.maxEntrySize=v||this.#n,this.sizeCalculation=w,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!==A&&"function"!=typeof A)throw new TypeError("memoMethod must be a function if defined");if(this.#s=A,void 0!==C&&"function"!=typeof C)throw new TypeError("fetchMethod must be a function if specified");if(this.#o=C,this.#A=!!C,this.#c=new Map,this.#h=new Array(t).fill(void 0),this.#u=new Array(t).fill(void 0),this.#d=new I(t),this.#p=new I(t),this.#m=0,this.#f=0,this.#g=m.create(t),this.#a=0,this.#l=0,"function"==typeof h&&(this.#i=h),"function"==typeof p?(this.#r=p,this.#y=[]):(this.#r=void 0,this.#y=void 0),this.#C=!!this.#i,this.#S=!!this.#r,this.noDisposeOnSet=!!g,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!S,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!M,0!==this.maxEntrySize){if(0!==this.#n&&!u(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!u(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#L()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!x,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=u(i)||0===i?i:1,this.ttlAutopurge=!!r,this.ttl=n||0,this.ttl){if(!u(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#N()}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=>!s.has(e))(e)&&(s.add(e),l("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,f))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#N(){const e=new p(this.#t),t=new p(this.#t);this.#w=e,this.#v=t,this.#$=(n,i,r=o.now())=>{if(t[n]=0!==i?r:0,e[n]=i,0!==i&&this.ttlAutopurge){const e=setTimeout((()=>{this.#T(n)&&this.#P(this.#h[n],"expire")}),i+1);e.unref&&e.unref()}},this.#R=n=>{t[n]=0!==e[n]?o.now():0},this.#O=(r,o)=>{if(e[o]){const s=e[o],a=t[o];if(!s||!a)return;r.ttl=s,r.start=a,r.now=n||i();const l=r.now-a;r.remainingTTL=s-l}};let n=0;const i=()=>{const e=o.now();if(this.ttlResolution>0){n=e;const t=setTimeout((()=>n=0),this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=r=>{const o=this.#c.get(r);if(void 0===o)return 0;const s=e[o],a=t[o];return s&&a?s-((n||i())-a):1/0},this.#T=r=>{const o=t[r],s=e[r];return!!s&&!!o&&(n||i())-o>s}}#R=()=>{};#O=()=>{};#$=()=>{};#T=()=>!1;#L(){const e=new p(this.#t);this.#l=0,this.#b=e,this.#k=t=>{this.#l-=e[t],e[t]=0},this.#G=(e,t,n,i)=>{if(this.#x(t))return 0;if(!u(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),!u(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.#H(!0)}this.#l+=e[t],i&&(i.entrySize=n,i.totalCalculatedSize=this.#l)}}#k=e=>{};#F=(e,t,n)=>{};#G=(e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#M({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#f;this.#B(t)&&(!e&&this.#T(t)||(yield t),t!==this.#m);)t=this.#p[t]}*#I({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#m;this.#B(t)&&(!e&&this.#T(t)||(yield t),t!==this.#f);)t=this.#d[t]}#B(e){return void 0!==e&&this.#c.get(this.#h[e])===e}*entries(){for(const e of this.#M())void 0===this.#u[e]||void 0===this.#h[e]||this.#x(this.#u[e])||(yield[this.#h[e],this.#u[e]])}*rentries(){for(const e of this.#I())void 0===this.#u[e]||void 0===this.#h[e]||this.#x(this.#u[e])||(yield[this.#h[e],this.#u[e]])}*keys(){for(const e of this.#M()){const t=this.#h[e];void 0===t||this.#x(this.#u[e])||(yield t)}}*rkeys(){for(const e of this.#I()){const t=this.#h[e];void 0===t||this.#x(this.#u[e])||(yield t)}}*values(){for(const e of this.#M())void 0===this.#u[e]||this.#x(this.#u[e])||(yield this.#u[e])}*rvalues(){for(const e of this.#I())void 0===this.#u[e]||this.#x(this.#u[e])||(yield this.#u[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const n of this.#M()){const i=this.#u[n],r=this.#x(i)?i.__staleWhileFetching:i;if(void 0!==r&&e(r,this.#h[n],this))return this.get(this.#h[n],t)}}forEach(e,t=this){for(const n of this.#M()){const i=this.#u[n],r=this.#x(i)?i.__staleWhileFetching:i;void 0!==r&&e.call(t,r,this.#h[n],this)}}rforEach(e,t=this){for(const n of this.#I()){const i=this.#u[n],r=this.#x(i)?i.__staleWhileFetching:i;void 0!==r&&e.call(t,r,this.#h[n],this)}}purgeStale(){let e=!1;for(const t of this.#I({allowStale:!0}))this.#T(t)&&(this.#P(this.#h[t],"expire"),e=!0);return e}info(e){const t=this.#c.get(e);if(void 0===t)return;const n=this.#u[t],i=this.#x(n)?n.__staleWhileFetching:n;if(void 0===i)return;const r={value:i};if(this.#w&&this.#v){const e=this.#w[t],n=this.#v[t];if(e&&n){const t=e-(o.now()-n);r.ttl=t,r.start=Date.now()}}return this.#b&&(r.size=this.#b[t]),r}dump(){const e=[];for(const t of this.#M({allowStale:!0})){const n=this.#h[t],i=this.#u[t],r=this.#x(i)?i.__staleWhileFetching:i;if(void 0===r||void 0===n)continue;const s={value:r};if(this.#w&&this.#v){s.ttl=this.#w[t];const e=o.now()-this.#v[t];s.start=Math.floor(Date.now()-e)}this.#b&&(s.size=this.#b[t]),e.unshift([n,s])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const e=Date.now()-n.start;n.start=o.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:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=n;let{noUpdateTTL:l=this.noUpdateTTL}=n;const c=this.#G(e,t,n.size||0,s);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let h=0===this.#a?void 0:this.#c.get(e);if(void 0===h)h=0===this.#a?this.#f:0!==this.#g.length?this.#g.pop():this.#a===this.#t?this.#H(!1):this.#a,this.#h[h]=e,this.#u[h]=t,this.#c.set(e,h),this.#d[this.#f]=h,this.#p[h]=this.#f,this.#f=h,this.#a++,this.#F(h,c,a),a&&(a.set="add"),l=!1;else{this.#_(h);const n=this.#u[h];if(t!==n){if(this.#A&&this.#x(n)){n.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=n;void 0===t||o||(this.#C&&this.#i?.(t,e,"set"),this.#S&&this.#y?.push([t,e,"set"]))}else o||(this.#C&&this.#i?.(n,e,"set"),this.#S&&this.#y?.push([n,e,"set"]));if(this.#k(h),this.#F(h,c,a),this.#u[h]=t,a){a.set="replace";const e=n&&this.#x(n)?n.__staleWhileFetching:n;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0===i||this.#w||this.#N(),this.#w&&(l||this.#$(h,i,r),a&&this.#O(a,h)),!o&&this.#S&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#r?.(...t)}return this}pop(){try{for(;this.#a;){const e=this.#u[this.#m];if(this.#H(!0),this.#x(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#S&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#r?.(...t)}}}#H(e){const t=this.#m,n=this.#h[t],i=this.#u[t];return this.#A&&this.#x(i)?i.__abortController.abort(new Error("evicted")):(this.#C||this.#S)&&(this.#C&&this.#i?.(i,n,"evict"),this.#S&&this.#y?.push([i,n,"evict"])),this.#k(t),e&&(this.#h[t]=void 0,this.#u[t]=void 0,this.#g.push(t)),1===this.#a?(this.#m=this.#f=0,this.#g.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,r=this.#c.get(e);if(void 0!==r){const e=this.#u[r];if(this.#x(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#T(r))return n&&this.#R(r),i&&(i.has="hit",this.#O(i,r)),!0;i&&(i.has="stale",this.#O(i,r))}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.#T(i))return;const r=this.#u[i];return this.#x(r)?r.__staleWhileFetching:r}#E(e,t,n,i){const r=void 0===t?void 0:this.#u[t];if(this.#x(r))return r;const o=new c,{signal:s}=n;s?.addEventListener("abort",(()=>o.abort(s.reason)),{signal:o.signal});const a={signal:o.signal,options:n,context:i},l=(i,r=!1)=>{const{aborted:s}=o.signal,l=n.ignoreFetchAbort&&void 0!==i;if(n.status&&(s&&!r?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,l&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),s&&!l&&!r)return h(o.signal.reason);const c=u;return this.#u[t]===u&&(void 0===i?c.__staleWhileFetching?this.#u[t]=c.__staleWhileFetching:this.#P(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,i,a.options))),i},h=i=>{const{aborted:r}=o.signal,s=r&&n.allowStaleOnFetchAbort,a=s||n.allowStaleOnFetchRejection,l=a||n.noDeleteOnFetchRejection,c=u;if(this.#u[t]===u&&(l&&void 0!==c.__staleWhileFetching?s||(this.#u[t]=c.__staleWhileFetching):this.#P(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 u=new Promise(((t,i)=>{const s=this.#o?.(e,r,a);s&&s instanceof Promise&&s.then((e=>t(void 0===e?void 0:e)),i),o.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),h(e)))),d=Object.assign(u,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return void 0===t?(this.set(e,d,{...a.options,status:void 0}),t=this.#c.get(e)):this.#u[t]=d,d}#x(e){if(!this.#A)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:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:f=!1,status:g,signal:y}=t;if(!this.#A)return g&&(g.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:g});const b={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:p,ignoreFetchAbort:d,status:g,signal:y};let v=this.#c.get(e);if(void 0===v){g&&(g.fetch="miss");const t=this.#E(e,v,b,m);return t.__returned=t}{const t=this.#u[v];if(this.#x(t)){const e=n&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const r=this.#T(v);if(!f&&!r)return g&&(g.fetch="hit"),this.#_(v),i&&this.#R(v),g&&this.#O(g,v),t;const o=this.#E(e,v,b,m),s=void 0!==o.__staleWhileFetching&&n;return g&&(g.fetch=r?"stale":"refresh",s&&r&&(g.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}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.#s;if(!n)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:r,...o}=t,s=this.get(e,o);if(!r&&void 0!==s)return s;const a=n(e,s,{options:o,context:i});return this.set(e,a,o),a}get(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=t,s=this.#c.get(e);if(void 0!==s){const t=this.#u[s],a=this.#x(t);return o&&this.#O(o,s),this.#T(s)?(o&&(o.get="stale"),a?(o&&n&&void 0!==t.__staleWhileFetching&&(o.returnedStale=!0),n?t.__staleWhileFetching:void 0):(r||this.#P(e,"expire"),o&&n&&(o.returnedStale=!0),n?t:void 0)):(o&&(o.get="hit"),a?t.__staleWhileFetching:(this.#_(s),i&&this.#R(s),t))}o&&(o.get="miss")}#D(e,t){this.#p[t]=e,this.#d[e]=t}#_(e){e!==this.#f&&(e===this.#m?this.#m=this.#d[e]:this.#D(this.#p[e],this.#d[e]),this.#D(this.#f,e),this.#f=e)}delete(e){return this.#P(e,"delete")}#P(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.#k(i);const n=this.#u[i];if(this.#x(n)?n.__abortController.abort(new Error("deleted")):(this.#C||this.#S)&&(this.#C&&this.#i?.(n,e,t),this.#S&&this.#y?.push([n,e,t])),this.#c.delete(e),this.#h[i]=void 0,this.#u[i]=void 0,i===this.#f)this.#f=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.#g.push(i)}}if(this.#S&&this.#y?.length){const e=this.#y;let t;for(;t=e?.shift();)this.#r?.(...t)}return n}clear(){return this.#V("delete")}#V(e){for(const t of this.#I({allowStale:!0})){const n=this.#u[t];if(this.#x(n))n.__abortController.abort(new Error("deleted"));else{const i=this.#h[t];this.#C&&this.#i?.(n,i,e),this.#S&&this.#y?.push([n,i,e])}}if(this.#c.clear(),this.#u.fill(void 0),this.#h.fill(void 0),this.#w&&this.#v&&(this.#w.fill(0),this.#v.fill(0)),this.#b&&this.#b.fill(0),this.#m=0,this.#f=0,this.#g.length=0,this.#l=0,this.#a=0,this.#S&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#r?.(...t)}}}function g(e){window.$monomerHover=e}var y=n(2003),b=n(6077),v=n(3561),w=n(9235);const C="MonomerHoverLinks";async function A(e,t,n,i,o,s=!1){const a=i.getSeqHandler(e),l=a.alphabet==y.YI.RNA||a.alphabet==y.YI.DNA,c=a.isHelm()&&l,h=!a.isHelm()&&l,u=e=>null==e?null:c?s?e:Math.floor(e/3):h&&s?3*e+1:e,d=s?await i.getHelmToMolfileConverter(n):null,p=new f({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(s){const e=a.getHelm(t);return i.helmToAtomicLevelSingle(e,d,!1,!1).monomers}{const e=a.getSplitted(t),i=a.defaultBiotype,s=r().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",h=(0,b.eM)([s],c,l,n,o);return(0,v.gU)(s,h,l,c).monomers}}(e,t)),l}const A={targetCol:t,handler:(t,i,r)=>{const o=r.grid,s=t.tableRowIndex,a=t.gridRow,l=o.cell(r.name,a),c=null!==(h=window.$monomerHover)&&void 0!==h?h:null;var h;if(!c||c&&(c.dataFrameId!=e.dataFrame.id||c.gridRowIdx!=a||c.seqColName!=e.name||c.seqPosition!=i?.position)){if(c&&(g(null),c.gridCell.render()),!i)return g(null),!0;g({gridCell:l,dataFrameId:e.dataFrame.id,gridRowIdx:a,seqColName:e.name,seqPosition:u(i?.position)??-1,getSubstruct:()=>{if(!i||"*"===i.symbol)return;const t=m(e,s);if(!t)return;const r=t.get(u(i?.position));return r?(0,w.H)([r],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 r=m(e,i);return r?(0,w.H)(r.values(),n):void 0}};return function(e,t){let n=e[C];n||(n=e[C]=[]),n.push(t),e[C]=n}(e.temp,A),function(e,t){let n=e["substruct-providers"];n||(n=e["substruct-providers"]=[]),n.push(t),e["substruct-providers"]=n}(t.temp,A),A}function S(e,t){try{const n=e.tableColumn;if(!n)return;const i=function(e){return e.temp[C]??[]}(n);for(let n=i.length-1;n>=0;--n){const r=i[n],o=e.grid.col(r.targetCol.name);if(o&&!r.handler(e,t,o))break}}catch(e){console.error(e)}}},6718:(e,t,n)=>{"use strict";n.d(t,{A7:()=>p,pj:()=>h,uL:()=>u,uX:()=>c});var i=n(6082),r=n(4328),o=n(6295),s=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(s.Ec).forEach((t=>{if("symbol"===t){const r=e.get(s.Ec[t],n);i[t]="."===r?e.get(s.yw,n):r}else if("rgroups"===t){const r=e.get(s.Ec[t],n).split("\n"),o=[];r.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}`,o.push(t)})),i[t]=o}else s.Ec[t]&&(i[t]=e.get(s.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 h(){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 u(e,t,n){e instanceof i.Column&&(e=(0,a.R)(e,n).columns.toList());const o=(await h()).getMonomerLib(),s=new Array(e.length),c=e[0].length,u=new Float32Array(c);for(let n=0;n<e.length;++n){const a=n<t.length?t.getCanonical(n):l._S,h=o.getMonomer("PEPTIDE",a)?.smiles??"",d=e[n],p=d.getRawData(),m=d.categories,f=m.indexOf("");if(s[n]={categories:m,data:p,emptyIndex:f},void 0===a)continue;const g=i.Column.fromStrings("smiles",m.map((e=>o.getMonomer("PEPTIDE",e)?.smiles??""))),y=(i.DataFrame.fromColumns([g]),await r.chem.getSimilarities(g,h)),b=y?y.getRawData():null;for(let e=0;e<c;++e){const t=p[e];a!==l._S&&t!==f?u[e]+=b[t]:a===l._S&&t===f&&(u[e]+=1)}}for(let n=0;n<u.length;++n){let r=u[n]/t.length;for(let o=0;o<e.length;++o){const e=s[o];if(o>=t.length&&e.data[n]!==e.emptyIndex||e.data[n]===e.emptyIndex&&o<t.length){r=i.FLOAT_NULL;break}}u[n]=r}return i.Column.fromFloat32Array("Similarity",u)}async function d(e){const t=(await h()).getMonomerLib(),n=[],o={},s=e.map((e=>t.getMonomer("PEPTIDE",e)?.smiles??"")),a=i.Column.fromStrings("smiles",s);for(let t=0;t<s.length;++t){o[e[t]]=t;const i=s[t],l=""===i?new Array(s.length).fill(0):(await r.chem.getSimilarities(a,i)).getRawData();l[t]=1,n[t]=Array.from(l)}return{scoringMatrix:n,alphabetIndexes:o}}async function p(e,t="Morgan"){const n=(await h()).getMonomerLib(),r=new Array(e.length).fill(0).map((()=>new Array(e.length).fill(0))),s={},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),u=(i.DataFrame.fromColumns([c]),(await l.apply({col:c,fingerprintType:t}))?.entries);if(!u)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<u.length;++t)if(r[t][t]=1,s[e[t]]=t,u[t])for(let e=t+1;e<u.length;++e)u[e]&&(r[t][e]=r[e][t]=(0,o.$1)(u[t],u[e]));return{scoringMatrix:r,alphabetIndexes:s}}},6197:(e,t,n)=>{"use strict";n.d(t,{Y:()=>r});var i=n(3599);function r(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),r=n(1991),o=n.n(r),s=n(330),a=n(3599);async function l(e,t,r,l,c,h,u){const d=e.length,p=e.dataFrame,m=Math.max(navigator.hardwareConcurrency-2,1),f=new Array(m).fill(null).map((()=>new Worker(new URL(n.p+n.u(455),n.b)))),g=d/m,y=new Array(m),b=h.getSeqHandler(e),v="RNA"==l?a.o.NUCLEOTIDE:a.o.AA,w=o().count(0).take(e.length).map((e=>{const t=b.getSplitted(e);return o().count(0).take(t.length).map((e=>({position:e,symbol:t.getCanonical(e),biotype:v}))).toArray()})).toArray();for(let e=0;e<m;e++){const n=f[e],i=Math.floor(e*g),o=e===m-1?d:Math.floor((e+1)*g);y[e]=new Promise((e=>{n.onmessage=t=>{e(t.data)}})),n.postMessage({seqList:w,monomersDict:t,alphabet:r,polymerType:l,start:i,end:o})}const C=[],A=[];await Promise.all(y).then((e=>{for(const t of e)C.push(...t.molfiles),A.push(...t.warnings)})),setTimeout((()=>{f.forEach((e=>{e.terminate()}))}),0);const S=(0,s.qj)(p,e.name),x=i.Column.fromType(i.COLUMN_TYPE.STRING,S,e.length).init((e=>C[e]?.molfile));return x.semType=i.SEMTYPE.MOLECULE,x.meta.units=i.UNITS.Molecule.MOLBLOCK,x.setTag(".sequence-src-col",e.name),{molCol:x,warnings:A}}function c(e,t){const n={},r={};for(const o of e){const e=t.getWebEditorMonomer(o.biotype,o.symbol).backgroundcolor,a=(0,s.vG)(e??i.Color.toRgb(i.Color.mouseOverRows))??[1,0,0,.7];for(const e of o.atoms)n[e]=a;for(const e of o.bonds)r[e]=a}return{atoms:Object.keys(n).map((e=>parseInt(e))),bonds:Object.keys(r).map((e=>parseInt(e))),highlightAtomColors:n,highlightBondColors:r}}},3561:(e,t,n)=>{"use strict";n.d(t,{Hb:()=>l,YN:()=>f,gU:()=>c});var i=n(8123),r=n(294),o=n(3151),s=n(439),a=n(6197);function l(e,t,n){const r=new Map;for(const a of e.getMonomerSymbolsByType(t)){const l=e.getMonomer(t,a);if("RNA"===t&&("Branch"===l.monomerType||n===s.YI.DNA&&l.symbol===i.u.DEOXYRIBOSE.symbol||n===s.YI.RNA&&l.symbol===i.u.RIBOSE.symbol||l.symbol===i.u.PHOSPHATE.symbol)||"PEPTIDE"===t&&"Branch"!==l.monomerType){const e={};o.f6.forEach((t=>{e[t]=l[t]})),r.set(l.symbol,e)}}return r}function c(e,t,n,o){if(0===e.length)return r.vF.createEmpty();const l=m,{atomCount:c,bondCount:u}=l(e,t,n,o),p=new Array(c),g=new Array(u);let y,b=null,v=null;"PEPTIDE"===o?y=h:(y=d,b=n===s.YI.DNA?(0,r.xb)(t,i.u.DEOXYRIBOSE):(0,r.xb)(t,i.u.RIBOSE),v=(0,r.xb)(t,i.u.PHOSPHATE));const w={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:b,phosphate:v,seqLength:e.length,atomCount:c,bondCount:u},A=new r.Cg,S=[];let x=0;for(w.i=0;w.i<C.seqLength;++w.i){const n=e[w.i];if(n.symbol===s._S)continue;const i=(0,r.xb)(t,{symbol:n.symbol,polymerType:(0,a.Y)(n.biotype)}),o=w.nodeShift,l=w.bondShift;y(i,p,g,w,C),i.stereoAtoms?.forEach((e=>S.push(e+x))),x+=i.atoms.x.length;const c=w.nodeShift-o,h=new Array(c);for(let e=0;e<c;++e)h[e]=o+e;const u=w.bondShift-l,d=new Array(u);for(let e=0;e<u;++e)d[e]=l+e;A.set(w.i,{biotype:n.biotype,symbol:n.symbol,atoms:h,bonds:d})}!function(e,t,n,r){const o=n.nodeShift+1;e[r.atomCount]=i.u.V3K_BEGIN_DATA_LINE+o+" "+i.u.OXYGEN+" "+f(n.backbonePositionShift[0])+" "+n.flipFactor*f(n.backbonePositionShift[1])+" 0.000000 0\n";const s=n.backboneAttachNode,a=o;t[r.bondCount]=i.u.V3K_BEGIN_DATA_LINE+n.bondShift+" 1 "+s+" "+a+"\n"}(p,g,w,C);const E=i.u.V3K_BEGIN_COUNTS_LINE+c+" "+u+i.u.V3K_COUNTS_LINE_ENDING;let _="";return _+=i.u.V3K_HEADER_FIRST_LINE,_+=i.u.V3K_HEADER_SECOND_LINE,_+=i.u.V3K_BEGIN_CTAB_BLOCK,_+=E,_+=i.u.V3K_BEGIN_ATOM_BLOCK,_+=p.join(""),_+=i.u.V3K_END_ATOM_BLOCK,_+=i.u.V3K_BEGIN_BOND_BLOCK,_+=g.join(""),_+=i.u.V3K_END_BOND_BLOCK,S.length>0&&(_+=function(e){const t=[];let n=`M V30 MDLV30/STEABS ATOMS=(${e.length}`;for(let i=0;i<e.length;i++){const r=`${n} ${e[i]}`;r.length>76?(t.push(`${n} -\n`),n=`M V30 ${e[i]}`):n=r,i===e.length-1&&t.push(`${n})\n`)}return`M V30 BEGIN COLLECTION\n${t.join("")}M V30 END COLLECTION\n`}(S)),_+=i.u.V3K_END_CTAB_BLOCK,_+=i.u.V3K_END,{molfile:_,monomers:A}}function h(e,t,n,i){i.flipFactor=(-1)**(i.i%2),u(e,t,n,i)}function u(e,t,n,r){!function(e,t,n){for(let r=0;r<e.atoms.atomTypes.length;++r){const o=n.nodeShift+r+1;t[n.nodeShift+r]=i.u.V3K_BEGIN_DATA_LINE+o+" "+e.atoms.atomTypes[r]+" "+f(n.backbonePositionShift[0]+e.atoms.x[r])+" "+f(n.backbonePositionShift[1]+n.flipFactor*e.atoms.y[r])+" "+e.atoms.kwargs[r]}}(e,t,r),p(e,n,r),function(e,t,n){if(0!==n.backboneAttachNode){const r=n.bondShift,o=n.backboneAttachNode,s=e.meta.terminalNodes[0]+n.nodeShift;t[n.bondShift-1]=i.u.V3K_BEGIN_DATA_LINE+r+" 1 "+o+" "+s+"\n"}}(e,n,r),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,r),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,r)}function d(e,t,n,r,o){if(0===r.i)u(o.sugar,t,n,r);else for(const e of[o.phosphate,o.sugar])u(e,t,n,r);!function(e,t,n,r){(function(e,t,n){for(let r=0;r<e.atoms.atomTypes.length;++r){const o=n.nodeShift+r+1;t[n.nodeShift+r]=i.u.V3K_BEGIN_DATA_LINE+o+" "+e.atoms.atomTypes[r]+" "+f(n.branchPositionShift[0]+e.atoms.x[r])+" "+f(n.branchPositionShift[1]+n.flipFactor*e.atoms.y[r])+" "+e.atoms.kwargs[r]}})(e,t,r),p(e,n,r),function(e,t,n){const r=n.bondShift,o=n.branchAttachNode,s=e.meta.terminalNodes[0]+n.nodeShift;t[r-1]=i.u.V3K_BEGIN_DATA_LINE+r+" 1 "+o+" "+s+"\n"}(e,n,r);const o=r.bondShift,s=r.branchAttachNode,a=e.meta.terminalNodes[0]+r.nodeShift;n[o-1]=i.u.V3K_BEGIN_DATA_LINE+o+" 1 "+s+" "+a+"\n",r.bondShift+=e.bonds.atomPairs.length+1,r.nodeShift+=e.atoms.atomTypes.length}(e,t,n,r)}function p(e,t,n){for(let r=0;r<e.bonds.atomPairs.length;++r){const o=n.bondShift+r+1,s=e.bonds.atomPairs[r][0]+n.nodeShift,a=e.bonds.atomPairs[r][1]+n.nodeShift;let l="";if(e.bonds.bondConfiguration.has(r)){let t=e.bonds.bondConfiguration.get(r);n.flipFactor<0&&(t=1===t?3:1),l=" CFG="+t}const c=e.bonds.kwargs.has(r)?" "+e.bonds.kwargs.get(r):"";t[n.bondShift+r]=i.u.V3K_BEGIN_DATA_LINE+o+" "+e.bonds.bondTypes[r]+" "+s+" "+a+l+c+"\n"}}function m(e,t,n,o){let l=0,c=0,h=0;for(const n of e){if(n.symbol===s._S)continue;if("*"==n.symbol)throw new Error("Gap canonical symbol is '', not '*");const e=(0,r.xb)(t,{symbol:n.symbol,polymerType:(0,a.Y)(n.biotype)});l+=e.atoms.x.length,c+=e.bonds.bondTypes.length,h++}if("PEPTIDE"===o)l+=1,c+=h;else{const o=n===s.YI.DNA?(0,r.xb)(t,i.u.DEOXYRIBOSE):(0,r.xb)(t,i.u.RIBOSE),a=(0,r.xb)(t,i.u.PHOSPHATE);l+=(e.length-1)*a.atoms.x.length,l+=e.length*o.atoms.x.length,l+=1,c+=(e.length-1)*a.bonds.bondTypes.length,c+=e.length*o.bonds.bondTypes.length,c-=1,c+=3*e.length}return{atomCount:l,bondCount:c}}function f(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:()=>f});var i=n(4328),r=n(6082),o=n(1991),s=n.n(o),a=n(439),l=n(3561),c=n(9235),h=n(294),u=n(9192),d=n(330),p=n(8123);async function m(e,t,n,o,l){if(t.semType!==r.SEMTYPE.MACROMOLECULE)return{molCol:null,warnings:[`Only the ${r.SEMTYPE.MACROMOLECULE} columns can be converted to atomic level, the chosen column has semType '${t.semType}'`]};let h=t;const p=o.getSeqHandler(t);let m,g;p.notation!==a.Hi.SEPARATOR&&(h=p.convert(a.Hi.SEPARATOR,"."),h.name=t.name);try{g=o.getSeqHandler(h).alphabet,m=(0,d.pz)(g)}catch(e){const[t,n]=(0,u.AP)(e);return{molCol:null,warnings:[t]}}const y=function(e,t){const n=e.length,r=new Array(n),o=t.getSeqHandler(e);let a=!1;const l=o.defaultBiotype;for(let e=0;e<n;++e){const t=o.getSplitted(e);a||(a=0===t.length),r[e]=s().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`),r}(h,o),b=f(y,m,g,n,l),v=h.length,w=await(0,c.R)(h,b,g,m,n,o,l);return w.warnings.length>.05*v&&i.shell.warning(`Molfile conversion resulted in ${w.warnings.length} errors`),w}function f(e,t,n,i,r){const o=(0,l.Hb)(i,t,n),s={},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)g(s,n.symbol,o,r,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];g(s,e,o,r,t,c),s[t]?.[e]&&(s[t][n]=s[t][e])}else g(s,n,o,r,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 s}function g(e,t,n,i,r,o){const s={polymerType:r,symbol:t};if(!(0,h.bq)(e,s)){const a=function(e,t,n,i,r){if(t.has(e)){const s=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,""),t.push(e)}return t}(s.rgroups),c=(o=s.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}(o):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 r=parseInt(e.substring(n,i).replace(/^A\s+/,""));n=e.indexOf("R",i),i=e.indexOf("\n",n);const o=parseInt(e.substring(n,i).replace(/^R/,""));t.set(r,o),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 r=e.substring(n,i).replaceAll(/\s+/g," ").split(" ").map((e=>parseInt(e))).slice(1);for(let e=0;e<r.length;e+=2){if(t.has(r[e])&&t.get(r[e])!==r[e+1])throw new Error(`r-group index ${r[e]} has already been added with a different value`);t.set(r[e],r[e+1])}n=e.indexOf(p.u.V2K_RGP_LINE,i)}return t}(o),h=s.molfile.includes("V3000")?s.molfile:function(e,t){const n=t.get_mol(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)}(s.molfile),n),u=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))}}(h),d=function(e,t){const n=new Array(t),i=new Float32Array(t),r=new Float32Array(t),o=new Array(t);let s=e.indexOf(p.u.V3K_BEGIN_ATOM_BLOCK);s=e.indexOf("\n",s);let a=s;for(let l=0;l<t;l++){s=e.indexOf(p.u.V3K_BEGIN_DATA_LINE,s)+p.u.V3K_IDX_SHIFT,a=e.indexOf(" ",s),s=a+1,a=e.indexOf(" ",s),n[l]=e.substring(s,a);const t=new Array(2);for(let n=0;n<2;++n)s=a+1,a=e.indexOf(" ",s),t[n]=parseFloat(e.substring(s,a));i[l]=t[0],r[l]=t[1],s=a,a=e.indexOf("\n",s)+1,o[l]=e.slice(s,a),s=a}return{atomTypes:n,x:i,y:r,kwargs:o}}(h,u.atomCount),m=function(e,t){const n=new Uint32Array(t),i=new Array(t),r=new Map,o=new Map;let s=e.indexOf(p.u.V3K_BEGIN_BOND_BLOCK);s=e.indexOf("\n",s);let a=s;for(let l=0;l<t;++l){const t=new Array(3);s=e.indexOf(p.u.V3K_BEGIN_DATA_LINE,a)+p.u.V3K_IDX_SHIFT,a=e.indexOf(" ",s);for(let n=0;n<3;++n)s=a+1,a=Math.min(e.indexOf("\n",s),e.indexOf(" ",s)),t[n]=parseInt(e.slice(s,a));n[l]=t[0],i[l]=t.slice(1);const c=e.indexOf("\n",s);let h=e.slice(a,c),u=h.indexOf(p.u.V3K_BOND_CONFIG);if(-1!==u){u=h.indexOf("=",u)+1;let e=h.indexOf(" ",u);-1===e&&(e=h.length);const t=parseInt(h.slice(u,e));r.set(l,t);const n=p.u.V3K_BOND_CONFIG+t.toString();h=h.replace(n,"")}h||o.set(l,h)}return{bondTypes:n,atomPairs:i,bondConfiguration:r,kwargs:o}}(h,u.bondCount),f=function(e,t,n,i){const r={backboneShift:null,branchShift:null,terminalNodes:[],rNodes:[]};return function(e,t,n){for(const[i,r]of n)e.atomTypes[i-1]=t[r-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,r),y(t,r),r}(d,m,a,c),g=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}(h),v={atoms:d,bonds:m,meta:f,stereoAtoms:g};return"PEPTIDE"===i?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,i=e.atoms.x,r=e.atoms.y;_(e,-i[t],-r[t]);const o=A(i[n],r[n]);S(e.atoms,-o),i[e.meta.rNodes[1]-1]<0&&x(e);const s=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],r=n[(e+1)%2];t.has(i)?t.get(i)?.push(r):t.set(i,new Array(1).fill(r))}return t}(e);let n=0;const i=e.atoms.atomTypes.length;let r=0;if(e.meta.terminalNodes.length<2)return null;for(;0===n;){const o=t.get(e.meta.terminalNodes[1])[r];if(e.atoms.atomTypes[o-1]===p.u.OXYGEN&&o!==e.meta.rNodes[1]&&(n=o),r++,r>i)return null}return n}(e);null!=s&&(function(e,t){e.atoms.y[e.meta.rNodes[1]-1]<0&&e.atoms.y[t-1]<0&&(function(e){E(e,!0)}(e),S(e.atoms,-function(e,t){return A(e,t)+Math.PI/2}(e.atoms.x[e.meta.terminalNodes[1]-1],e.atoms.y[e.meta.terminalNodes[1]-1])))}(e,s),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,r=n-1,o=e.atoms.x,s=e.atoms.y,a=o[i],l=s[i];o[i]=o[r],s[i]=s[r],o[r]=a,s[r]=l}(e,t,e.meta.rNodes[1])}(e,s))}(v):e===p.u.RIBOSE.symbol||e===p.u.DEOXYRIBOSE.symbol?function(e,t){const n=e.atoms.x,i=e.atoms.y;let r=e.meta.terminalNodes[0]-1;const o=e.meta.rNodes[1]-1;_(e,-n[r],-i[r]);const s=A(n[e.meta.rNodes[2]-1],i[e.meta.rNodes[2]-1]);S(e.atoms,-s),n[e.meta.rNodes[0]-1]>n[e.meta.rNodes[1]-1]&&x(e);const a=A(n[o],i[o]);S(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,r=e.meta.terminalNodes[2]-1,o=t[i]-t[r],s=n[i]-n[r];return Math.atan2(o,s)}(e),r=e.meta.terminalNodes[0]-1,_(e,-n[r],-i[r])}(v,r):e===p.u.PHOSPHATE.symbol?function(e){const t=e.meta.rNodes[1]-1,n=e.meta.rNodes[0]-1,i=e.atoms.x,r=e.atoms.y;_(e,-i[t],-r[t]);const o=A(i[n],r[n]);S(e.atoms,Math.PI/2-o)}(v):function(e,t){const n=e.atoms.x,i=e.atoms.y,r=e.meta.terminalNodes[0]-1,o=e.meta.rNodes[0]-1;_(e,-n[r],-i[r]);const s=A(n[o],i[o]),a=t.value;if(!a)throw new Error("The value of sugarBranchToOYAngle is null");S(e.atoms,Math.PI-s+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)}(v,r),function(e,t,n){"PEPTIDE"===e?(b(t,e),w(t,t.meta.rNodes[1])):n===p.u.RIBOSE.symbol||n===p.u.DEOXYRIBOSE.symbol?(w(t,t.meta.rNodes[1]),t.meta.rNodes[1]=t.meta.terminalNodes[1],y(t.bonds,t.meta),b(t,e),w(t,t.meta.rNodes[1]),w(t,t.meta.rNodes[0]),w(t,t.meta.rNodes[2])):n===p.u.PHOSPHATE.symbol&&(t.meta.terminalNodes[0]=t.meta.rNodes[0],_(t,-t.atoms.x[t.meta.terminalNodes[0]-1],-t.atoms.y[t.meta.terminalNodes[0]-1]),b(t,e),w(t,t.meta.rNodes[1]))}(i,v,e),function(e){let t=0;for(;t<e.atoms.atomTypes.length;)e.atoms.atomTypes[t]===p.u.HYDROGEN&&(w(e,t+1),--t),++t}(v),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,""))}}(v),v}var o;return null}(t,n,i,r,o);if(!a)throw new Error(`Monomer with symbol '${t}' is absent the monomer library`);(0,h.LQ)(e,s,a)}}function y(e,t){const n=t.rNodes;t.terminalNodes=new Array(n.length).fill(0);const i=t.terminalNodes,r=e.atomPairs;let o=0,s=0;for(;o<r.length&&s<i.length;){for(let e=0;e<i.length;++e)for(let t=0;t<2;++t)r[o][t]===n[e]&&(i[e]=r[o][(t+1)%2],n.length,++s);++o}}function b(e,t){e.meta.rNodes.length>1&&(e.meta.backboneShift=v(e,e.meta.rNodes[1]-1,e.meta.terminalNodes[0]-1)),"RNA"===t&&e.meta.rNodes.length>2&&(e.meta.branchShift=v(e,e.meta.rNodes[2]-1,e.meta.terminalNodes[0]-1))}function v(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 w(e,t){if(void 0!==t){const n=t-1,i=e.atoms,r=e.bonds,o=e.meta;i.atomTypes.splice(n,1),i.x=C(Float32Array,i.x,n,1),i.y=C(Float32Array,i.y,n,1),i.kwargs.splice(n,1);for(let e=0;e<o.terminalNodes.length;++e)o.terminalNodes[e]>t?--o.terminalNodes[e]:o.terminalNodes[e]===t&&(o.terminalNodes[e]=-1);for(let e=0;e<o.rNodes.length;++e)o.rNodes[e]>t?--o.rNodes[e]:o.rNodes[e]===t&&(o.rNodes[e]=-1);let s=0;for(;s<r.atomPairs.length;){const e=r.atomPairs[s][0],n=r.atomPairs[s][1];e===t||n===t?(r.atomPairs.splice(s,1),r.bondTypes=C(Uint32Array,r.bondTypes,s,1),r.bondConfiguration.has(s)&&r.bondConfiguration.delete(s),r.kwargs.has(s)&&r.kwargs.delete(s),--s):(r.atomPairs[s][0]=e>t?e-1:e,r.atomPairs[s][1]=n>t?n-1:n),++s}let a=Array.from(r.bondConfiguration.keys());a.forEach((e=>{if(r.bondConfiguration.has(e)&&e>n){const t=r.bondConfiguration.get(e);r.bondConfiguration.delete(e),r.bondConfiguration.set(e-1,t)}})),a=Array.from(r.kwargs.keys()),a.forEach((e=>{if(r.kwargs.has(e)&&e>n){const t=r.kwargs.get(e);r.kwargs.delete(e),r.kwargs.set(e-1,t)}}))}}function C(e,t,n,i){const r=new e(t.length-i);let o=0,s=0;for(;o<t.length;)o===n&&(o+=i),r[s]=t[o],++s,++o;return r}function A(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,r=Math.atan(i);n=e<0?Math.PI/2+r:-Math.PI/2+r}return n}function S(e,t){if(0!==t){const n=e.x,i=e.y,r=Math.cos(t),o=Math.sin(t);for(let e=0;e<n.length;++e){const t=n[e];n[e]=(0,l.YN)(t*r-i[e]*o),i[e]=(0,l.YN)(t*o+i[e]*r)}}}function x(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 _(e,t,n){const i=e.atoms.x,r=e.atoms.y;for(let e=0;e<i.length;++e)i[e]=(0,l.YN)(i[e]+t),void 0!==n&&(r[e]=(0,l.YN)(r[e]+n))}},294:(e,t,n)=>{"use strict";function i(e,t){return e[t.polymerType]?.[t.symbol]}function r(e,t){return!!e[t.polymerType]?.[t.symbol]}function o(e,t,n){let i=e[t.polymerType];i||(i=e[t.polymerType]={}),i[t.symbol]=n}n.d(t,{Cg:()=>s,LQ:()=>o,bq:()=>r,vF:()=>a,xb:()=>i});class s extends Map{constructor(e){super(e)}}class a{constructor(e,t){this.molfile=e,this.monomers=t}static createEmpty(){return new a("",new s(null))}}},330:(e,t,n)=>{"use strict";n.d(t,{kA:()=>r,pz:()=>s,qj:()=>o,vG:()=>a});var i=n(2003);function r(e,t){return e?e.columns.getUnusedName(t):t}function o(e,t){return r(e,`molfile(${t})`)}function s(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(7362);class i{}i.SemType="Nucleotides",i.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",i.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 r={};return e.forEach((e=>{const n=e[0],i=e[1];n.forEach(((e,n)=>{r[e]=this.colourPalette[i][t?0:n]}))})),new n(r)}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:()=>o,n:()=>r});var i=n(1858);class r{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 o{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";var i=n(6082),r=n(7362),o=n(6718);function s(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),r=i.Color.b(n),o=Math.sqrt(Math.pow(0-t,2)+Math.pow(0-e,2)+Math.pow(0-r,2));if(o>210)return`rgb(${t/o*210},${e/o*210},${r/o*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{static get palette(){return c._pallete||(c._pallete=c.buildPalette()),c._pallete}static buildPalette(){return(0,o.pj)().then((e=>{e.awaitLoaded(1/0).then((()=>{const t=e.getMonomerLib();t.onChanged.subscribe((()=>{c.customMonomerColors={},c.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]=s(n.meta.colors.default.background))}}}))}))})),[].concat(...Object.values(r.e.colourPalette))}get(e,t){const n=c.palette.length,i=c.customMonomerColors[e],r=t??"PEPTIDE";if(i&&i[r])return i[r];const o=a.hashCode(e)%n;return s(c.palette[o])}}c._pallete=null,c.customMonomerColors={},c.polymerTypes=[]},6642:(e,t,n)=>{"use strict";n.d(t,{BG:()=>s,sD:()=>l});var i=n(4328),r=n(1858),o=n(8070);function s(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 r.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,o.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,{Jy:()=>y,S$:()=>g,U0:()=>b});var i=n(7389),r=n(6082),o=n(1991),s=n.n(o),a=n(8312),l=n(2003),c=n(6642),h=n(6718),u=n(9192),d=n(3856),p=n(673),m=n(3599),f=n(5553);const g="rgb(100,100,100)";class y extends c.sD{get separatorWidth(){return this.props?.fontCharWidth?this.props?.fontCharWidth:5}constructor(e,t,n,i,o){super(e,t,n),this.monomerLengthLimit=i,this.propsProvider=o,this.colWidth=0,this._monomerLengthList=null,this._processedMaxVisibleSeqLength=0,this._monomerLengthMap={},this._monomerStructureMap={},this.sysMonomerLib=null,this.padding=5,this.props=this.propsProvider(),this._processedRows=r.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((()=>{const e=this.tableCol.dataFrame;this.gridCol.grid,-1===e.currentRowIdx&&(this.tableCol.temp["reference-sequence"]=null,this.tableCol.temp["current-word"]=null,this.invalidateGrid())})))}async init(){await Promise.all([(async()=>{this.seqHelper=await(0,a.Q)(),this.invalidateGrid()})(),(async()=>{const e=await(0,h.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=r.BitSet.create(this.tableCol.length),this._monomerLengthList=null,this._monomerLengthMap={},this._monomerStructureMap={},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,u.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]=5;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}getCellMonomerLengthsForSeq(e){this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(this.tableCol.length).fill(null));const t=this.seqHelper.getSeqHandler(this.tableCol),n=this.props.separatorWidth+1*this.props.fontCharWidth,i=Math.ceil(this.colWidth/n),r=t.getSplitted(e),o=Math.min(i,r.length);let s=this._monomerLengthList[e];if(null===s||s.length<o){s=this._monomerLengthList[e]=new Array(r.length);let n=0;for(let e=0;e<o;++e){const i=r.getOriginal(e),o=this.props.monomerToShort(i,this.monomerLengthLimit),a=(t.isSeparator()?this.separatorWidth:this.props.separatorWidth)+o.length*this.props.fontCharWidth;if(s[e]=a,n+=a,n>this.colWidth)break}}return s}getCellMonomerLengthsForSeqValue(e,t){const n=this.seqHelper.getSeqHandler(this.tableCol),i=this.props.separatorWidth+1*this.props.fontCharWidth,r=Math.ceil(t/i),o=n.splitter(e),s=Math.min(r,o.length),a=new Array(s);let l=0;for(let e=0;e<s;++e){const i=o.getOriginal(e),r=this.props.monomerToShort(i,this.monomerLengthLimit),s=(n.isSeparator()?this.separatorWidth:this.props.separatorWidth)+r.length*this.props.fontCharWidth;if(a[e]=s,l+=s,l>t)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)}}})(),r=this.props.separatorWidth+1*this.props.fontCharWidth,o=Math.ceil(this.colWidth/r);for(let e=n;e<i;e++){if(this._processedRows.get(e)&&o<=this._processedMaxVisibleSeqLength)continue;const n=this.seqHelper.getSeqHandler(this.tableCol).getSplitted(e,o),i=Math.min(o,n.length);i>t.length&&t.push(...new Array(i-t.length).fill(r));let s=0;for(let e=0;e<i;++e){const i=n.getOriginal(e),r=this.props.monomerToShort(i,this.monomerLengthLimit),o=this.props.separatorWidth+r.length*this.props.fontCharWidth;if(t[e]=Math.max(t[e]??0,o),s+=o,s>=this.colWidth)break}this._processedMaxVisibleSeqLength=Math.max(this._processedMaxVisibleSeqLength,o)}return t}getPosition(e,t,n){const[i,r]=this.getCellMonomerLengths(e,n);return 0===this.seqHelper.getSeqHandler(this.tableCol).getSplitted(e).length?null:function(e,t){let n,i=100,r=0,o=e.length-1;for(;r<=o;){if(n=Math.floor((o+r)/2),e[n]<=t&&t<e[n+1])return n;if(t<e[n]?o=n-1:r=n+1,--i<=0)throw new Error(`Get position for pointer x = ${t} searching has not converged on ${JSON.stringify(e)}. `)}return null}(r,t)}setMonomerLengthLimit(e){this.monomerLengthLimit!=e&&(this.monomerLengthLimit=e,this.dirty=!0)}setSeparatorWidth(e){this.separatorWidth!=e&&(this.props.separatorWidth=e,this.dirty=!0)}render(e,t,n,i,r,o,a){const c=o.grid?.canvas===e.canvas;if(!this.seqHelper)return;const h=this.gridCol,m=this.tableCol,f=window.devicePixelRatio,y=`${this.toLog()}.render()`;this.logger.debug(`${y}, start`);let v=this.monomerLengthLimit;if(d.gp.maxMonomerLength in m.tags){const e=parseInt(m.getTag(d.gp.maxMonomerLength));v=!isNaN(e)&&e?e:50}if(".mm.cellRenderer.maxMonomerLength"in m.temp){const e=m.temp[".mm.cellRenderer.maxMonomerLength"];v=!isNaN(e)&&e?e:50}e.save();try{const a=this.seqHelper.getSeqHandler(m);if(m.temp[".mm.cellRenderer.settingsChanged"]===p.s.true||this.monomerLengthLimit!=v){let e=0;const t=8;e=m.temp[".mm.cellRenderer.gapLength"]??e,this.setMonomerLengthLimit(v),this.setSeparatorWidth(a.isMsa()?t:e),m.temp[".mm.cellRenderer.settingsChanged"]=p.s.false}let[u,y]=this.getCellMonomerLengths(o.tableRowIndex,i);u.length;const w=o.cell.value,C=o.cell.rowIndex,A=(m.getTag(l.gp.alphabet),50);c&&(i=b(h?.grid,e,t,i,f)),e.beginPath(),e.rect(t+this.padding,n+this.padding,i-this.padding-1,r-2*this.padding),e.clip(),e.font=this.props?.font??"12px monospace",e.textBaseline="top";const S=m.meta.units,x=m.getTag(l.gp.aligned),E=m.getTag(l.gp.separator)??"",_=this.props.separatorWidth+1*this.props.fontCharWidth,M=Math.ceil(i/_),I=m.temp["reference-sequence"],T=this.tableCol.temp["current-word"];T&&-1===m?.dataFrame?.currentRowIdx&&(this.tableCol.temp["current-word"]=null);const L=(()=>{const e=a.getSplitter(M)(null!=I&&""!=I?I:T??"");return s().count(0).take(e.length).map((t=>e.getOriginal(t))).toArray()})(),N=c?a.getSplitted(C):a.splitter(w);c||(y=this.getSummedMonomerLengths(this.getCellMonomerLengthsForSeqValue(w,i)));let $=d.yg.classic;x&&x.includes("MSA")&&S==l.Hi.SEPARATOR&&($=d.yg.MSA);const P=Math.min(N.length,M);for(let s=0;s<P;++s){const l=N.getOriginal(s),c=N.getCanonical(s);let h=g;const u=this.getMonomerLib();if(u){const e=a.defaultBiotype;h=u.getMonomerTextColor(e,c)}e.fillStyle=g;const p={color:h,pivot:0,left:!0,transparencyRate:1,separator:E,last:s===N.length-1,drawStyle:$,maxWord:y,wordIdx:s,gridCell:o,referenceSequence:L,maxLengthOfMonomer:v,monomerTextSizeMap:this._monomerLengthMap,logger:this.logger};if((0,d.oZ)(e,l,t+this.padding,n,i,r,p),A>i)break}}catch(e){const[t,n]=(0,u.AP)(e);this.logger.error(t,void 0,n),this.errors.push(e)}finally{e.restore()}}onMouseMove(e,t){const n=`${this.toLog()}.onMouseMove()`;if(!this.seqHelper||null==e.tableRowIndex)return;const r=e.bounds,o=t.offsetX-e.gridColumn.left+(e.gridColumn.left-r.x),s=this.getPosition(e.tableRowIndex,o,r.width);this.logger.debug(`${n}, start, argsX: ${o}, left: ${s}`);const a=this.seqHelper.getSeqHandler(this.tableCol),c=a.getSplitted(e.tableRowIndex);if(null!==s&&s<c.length){const n=a.alphabet??l.YI.UN,r={position:s,biotype:n===l.YI.RNA||n===l.YI.DNA?m.o.NUCLEOTIDE:m.o.AA,symbol:c.getCanonical(s)},o=[];let h=this._monomerStructureMap[r.symbol];{const e=this.getMonomerLib();h=this._monomerStructureMap[r.symbol]=e?e.getTooltip(r.biotype,r.symbol):i.divText("Monomer library is not available")}o.push(h),i.tooltip.show(i.divV(o),t.x+16,t.y+16),(0,f.WN)(e,r)}else i.tooltip.hide(),(0,f.WN)(e,null)}}function b(e,t,n,i,r){return e?Math.max(Math.min(e.canvas.width/r-n,i)):Math.max(t.canvas.width/r-n,0)}},3856:(e,t,n)=>{"use strict";n.d(t,{Mn:()=>l,gp:()=>a,oZ:()=>u,yg:()=>c});var i=n(7278);const r="#808080",o="rgb(0,0,0)",s=i.zS;var a,l,c;!function(e){e.maxMonomerLength=".mm.cellRenderer.maxMonomerLength"}(a||(a={})),function(e){e.applyToBackground=".m.cellRenderer.applyToBackground"}(l||(l={})),function(e){e.MSA="MSA",e.classic="classic"}(c||(c={}));const h=new class{constructor(){this.color="rgb(100,100,100)",this.pivot=0,this.left=!1,this.transparencyRate=1,this.separator="",this.last=!1,this.drawStyle=c.classic,this.maxWord=[],this.wordIdx=0,this.gridCell=null,this.referenceSequence=null,this.maxLengthOfMonomer=null,this.monomerTextSizeMap={},this.logger=void 0}};function u(e,t,n,i,a,l,u){var d,p,m;const f=Object.assign(Object.assign({},h),u);u.logger?.debug("Bio: printLeftOrCentered(), start"),e.textAlign="start";let g=t.substring(0),y=f.last?"":f.separator;f.drawStyle===c.MSA&&(y="");let b=!0,v=!0,w="difference";if(null!=f.gridCell&&null!=f.gridCell.cell.column&&(b=f.gridCell.cell.column.temp["color-code"]??!0,v=f.gridCell.cell.column.temp["compare-with-current"]??!0,w=f.gridCell.cell.column.temp["highlight-difference"]??"difference"),f.referenceSequence){const e=f.referenceSequence[f.wordIdx];v&&f.referenceSequence.length>0&&"difference"===w&&(f.transparencyRate=g==e?.3:f.transparencyRate),v&&f.referenceSequence.length>0&&"equal"===w&&(f.transparencyRate=g!=e?.3:f.transparencyRate)}null!=f.maxLengthOfMonomer&&(g=s(g,f.maxLengthOfMonomer));const C=g+y;(d=f.monomerTextSizeMap)[C]??(d[C]=e.measureText(C));let A=f.monomerTextSizeMap[C];(p=f.monomerTextSizeMap)[g]??(p[g]=e.measureText(g));let S=f.monomerTextSizeMap[g].width;const x=l/2-(A.fontBoundingBoxAscent+A.fontBoundingBoxDescent)/2+1;(m=f.monomerTextSizeMap)[y]??(m[y]=e.measureText(y));const E=f.monomerTextSizeMap[y].width;function _(t,s){const a=b?f.color:o;e.fillStyle=a,e.globalAlpha=f.transparencyRate,f.drawStyle===c.classic&&(e.fillText(g,n+t,i+x),e.fillStyle=r,e.fillText(y,n+s,i+x)),f.drawStyle===c.MSA&&e.fillText(g,n+t,i+x)}A=A.width,f.drawStyle===c.MSA&&(S=f.maxWord[f.wordIdx],A=f.maxWord[f.wordIdx]);const M=(f.maxWord[f.wordIdx]??0)-(f.maxWord[0]??0);if(f.left||A>a)return _(M,M+S),n+M+S+E;{const e=(a-A)/2;return _(e,e+S),n+M+e+S}}},3151:(e,t,n)=>{"use strict";n.d(t,{EK:()=>l,Ec:()=>o,f6:()=>i,pe:()=>s,q7:()=>a,yw:()=>r});const i=["symbol","molfile","rgroups","name"],r="MonomerName",o={monomerType:null,smiles:null,name:"Name",author:null,molfile:"molecule",naturalAnalog:"MonomerNaturalAnalogCode",rgroups:"MonomerCaps",createDate:null,id:null,polymerType:"MonomerType",symbol:"MonomerName"},s={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 r(e){return e instanceof Error?e.stack:"StateError"===e.constructor.name&&"$thrownJsError"in e?r(e.$thrownJsError):void 0}function o(e){return[i(e),r(e)]}n.d(t,{AP:()=>o})},3516:(e,t,n)=>{"use strict";n.d(t,{m:()=>o});var i=n(6082),r=n(439);class o{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=r.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:()=>c});var i=n(6082),r=n(1991),o=n.n(r),s=n(2003),a=n(7278),l=n(439);function c(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=s.Hi.SEPARATOR,n.setTag(s.gp.separator,"/"),n.setTag(s.gp.alphabet,s.YI.UN),n.setTag(s.gp.alphabetIsMultichar,"true");const r=[];return r.push(n),r.push(i.Column.fromList(i.COLUMN_TYPE.FLOAT,"Activity",new Array(100).fill(7.30751))),r}function h(e,t=s.Hi.SEPARATOR,n=s.YI.PT,r=(t===s.Hi.SEPARATOR?"-":void 0),c=void 0,h="seq",u=100,d=10**6){const p=n===s.YI.UN?c?.getMonomerSymbolsByType("PEPTIDE")??[]:Array.from((0,s.Qf)(n)),m=p.length,f=i.Column.fromType(i.COLUMN_TYPE.STRING,h,u);f.semType=i.SEMTYPE.MACROMOLECULE,f.meta.units=t,f.setTag(s.gp.alphabet,n),t==s.Hi.SEPARATOR&&f.setTag(s.gp.separator,r);const g=e.getSeqHandler(f);for(let e=0;e<u;e++){const n=o().count(0).take(d).map((e=>p[Math.floor(Math.random()*m)])).toArray(),i=g.joiner(new a.Mu(n,l.b9[t]));f.set(e,i)}return f}},439:(e,t,n)=>{"use strict";n.d(t,{B5:()=>l,Hi:()=>i,Vl:()=>c,YI:()=>r,_S:()=>u,b9:()=>d,gp:()=>o,q7:()=>h,z1:()=>a});var i,r,o,s=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"}(r||(r={})),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"}(o||(o={}));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"])}}},h=[new s.a(r.PT,c.fasta.peptide,.5),new s.a(r.DNA,c.fasta.dna,.55),new s.a(r.RNA,c.fasta.rna,.55)],u="",d={[i.FASTA]:"-",[i.SEPARATOR]:"",[i.HELM]:"*"}},2003:(e,t,n)=>{"use strict";n.d(t,{Hi:()=>i.Hi,J9:()=>r.J9,Qf:()=>r.Qf,YI:()=>i.YI,dh:()=>r.dh,gp:()=>i.gp,mn:()=>r.mn,q7:()=>i.q7,qp:()=>r.qp,z1:()=>i.z1,zS:()=>r.zS});var i=n(439),r=n(7278)},2738:(e,t,n)=>{"use strict";n.d(t,{X:()=>r,a:()=>i});class i{constructor(e,t,n){this.name=e,this.alphabet=t,this.cutoff=n}}class r 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:()=>y,J9:()=>p,Mu:()=>u,Qf:()=>w,dh:()=>f,mn:()=>S,p0:()=>A,pc:()=>C,qp:()=>g,tm:()=>m,zS:()=>v});var i=n(6082),r=n(1991),o=n.n(r),s=n(3527),a=n(3629),l=n(2738),c=n(439),h=(n(8924),n(1093),n(4152),n(8438));class u{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]}constructor(e,t){this.mList=e,this.gapOriginalMonomer=t}}class d{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]}constructor(e){this.seqS=e}}const p=e=>{const t=o()(e.toString().matchAll(c.B5)).map((e=>e[2]??e[1])).toArray();return new u(t,c.b9[c.Hi.FASTA])},m=e=>e?new d(e):new u([],c.b9[c.Hi.FASTA]);function f(e,t=void 0){return n=>{if(n){let i;const r=new RegExp(`(?<=^|\\${e})("-"|'-'|[^\\${e}]*)(?=\\${e}|$)`,"g");return void 0!==t?(r.lastIndex=0,i=o()(n.matchAll(r)).take(t).map((e=>e[0])).toArray()):i=n.replaceAll('"-"',"").replaceAll("'-'","").split(e,t),new u(i,c.b9[c.Hi.SEPARATOR])}return new u([],c.b9[c.Hi.SEPARATOR])}}const g=e=>{const t=e.split("$")[0].split("|"),n=o()(t.map((e=>(e.match(/(?<=\{).+(?=})/)?.[0]?.split(".")??[]).map((e=>(0,h.D)(e)))))).flatten().toArray();return new u(n,c.b9[c.Hi.HELM])};function y(e,t,n=void 0){if(e.toLowerCase().startsWith(c.Hi.FASTA))return p;if(e.toLowerCase().startsWith(c.Hi.SEPARATOR))return f(t,n);if(e.toLowerCase().startsWith(c.Hi.HELM))return g;throw new Error(`Unexpected units ${e} .`)}const b=/([^\W_]+)/g;function v(e,t){if(e.length<=t)return e;const n=e.match(b),i=e.length>t||(n?.length??0)>1,r=n?.[0]??" ";return i?r.substring(0,t-1)+"…":r}function w(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 C(e,t,n="-"){const i=t.map((t=>{const i=function(e,t,n="-"){const i=new Set([...new Set(Object.keys(e)),...t]);i.delete(n);const r=[],o=[];for(const n of i)r.push(n in e?e[n]:0),o.push(t.has(n)?1:0);const l=new s.Mi(r),c=new s.Mi(o);return(0,a.KE)(l,c)/((0,a.wQ)(l)*(0,a.wQ)(c))}(e,t.alphabet,n);return new l.X(t,e,i)}));let r;const o=Math.max(...i.map((e=>e.similarity>e.cutoff?e.similarity:-1)));return r=o>0?i.find((e=>e.similarity===o)).name:c.YI.UN,r}function A(e,t,n="-"){const i=Object.keys(e),r=/\(|\)/;return C(i.filter((e=>3===e.split(r).filter((e=>!!e)).length)).length>.8*i.length?Object.entries(e).reduce(((e,[t,n])=>{const i=t.split(r)[1];return i&&(e[i]=n),e}),{}):e,t,n)}function S(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:()=>r});var i=n(6082);async function r(){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:()=>r});var i=n(6082);function r(e,t){const n=e=>{const t=s.columns.addNewString((e+1).toString());return r.push(t),t},r=[],o=e.length,s=i.DataFrame.create(o),a=t.getSeqHandler(e);for(let e=0;e<o;++e){const t=a.getSplitted(e);for(let i=0;i<t.length;++i){const o=t.getCanonical(i);((r[i]??null)||n(i)).set(e,o,!1)}}return s}},7602:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var i,r=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 o{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,o]=(0,r.AP)(t);this.logger.error(`${e}, SYNC syncId = ${n}, ERROR:\n${i}`,void 0,o),this.errors.push(t)}))}resetErrors(){const e=this.errors;return this.errors=[],e}}},4326:(e,t,n)=>{"use strict";n.d(t,{Fo:()=>h,Lp:()=>o,P4:()=>s,fH:()=>r,gp:()=>i,lT:()=>l,mH:()=>a});var i,r,o,s,a,l,c=n(6082);!function(e){e.tooltipWebLogo=".tooltipWebLogo"}(i||(i={})),function(e){e.Entropy="Entropy",e.full="100%"}(r||(r={})),function(e){e.TOP="top",e.MIDDLE="middle",e.BOTTOM="bottom"}(o||(o={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(s||(s={})),function(e){e.AUTO="auto",e.ON="on",e.OFF="off"}(a||(a={})),function(e){e.Filtered="Filtered",e.Selected="Selected"}(l||(l={}));const h=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=r.Entropy,this.positionWidth=16,this.verticalAlignment=o.MIDDLE,this.horizontalAlignment=s.CENTER,this.fixWidth=!1,this.fitArea=!0,this.minHeight=50,this.maxHeight=100,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,r=(i="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){var t,n,r=void 0!==e?e:{};r.ready=new Promise((function(e,i){t=e,n=i}));var o,s=Object.assign({},r),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&&(o=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)})),r.print||console.log.bind(console);var h,u,d=r.printErr||console.warn.bind(console);Object.assign(r,s),s=null,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.quit&&r.quit,r.wasmBinary&&(h=r.wasmBinary),r.noExitRuntime,"object"!=typeof WebAssembly&&_("no native wasm support detected");var p,m,f,g=!1;function y(){var e=u.buffer;r.HEAP8=p=new Int8Array(e),r.HEAP16=new Int16Array(e),r.HEAP32=new Int32Array(e),r.HEAPU8=m=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=f=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}var b,v,w=[],C=[],A=[],S=0,x=null,E=null;function _(e){r.onAbort&&r.onAbort(e),d(e="Aborted("+e+")"),g=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}function M(e){return e.startsWith("data:application/octet-stream;base64,")}function I(e){try{if(e==b&&h)return new Uint8Array(h);if(o)return o(e);throw"both async and sync fetching of the wasm failed"}catch(e){_(e)}}function T(e,t,n){return function(e){return h||!a&&!l||"function"!=typeof fetch?Promise.resolve().then((function(){return I(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 I(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),_(e)}))}function L(e){for(;e.length>0;)e.shift()(r)}function N(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){f[this.ptr+4>>2]=e},this.get_type=function(){return f[this.ptr+4>>2]},this.set_destructor=function(e){f[this.ptr+8>>2]=e},this.get_destructor=function(){return f[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,p[this.ptr+12|0]=e},this.get_caught=function(){return 0!=p[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,p[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=p[this.ptr+13|0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){f[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return f[this.ptr+16>>2]},this.get_exception_ptr=function(){if(D(this.get_type()))return f[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function $(e){var t=u.buffer;try{return u.grow(e-t.byteLength+65535>>>16),y(),1}catch(e){}}function P(e){return r["_"+e]}M(b="wasmDbscan.wasm")||(v=b,b=r.locateFile?r.locateFile(v,c):c+v);var R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(e,t,n,i,r){var o={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=B(t);return function(e,t,n){!function(e,t,n,i){if(!(i>0))return 0;for(var r=n+i-1,o=0;o<e.length;++o){var s=e.charCodeAt(o);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++o)),s<=127){if(n>=r)break;t[n++]=s}else if(s<=2047){if(n+1>=r)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=r)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=r)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}t[n]=0}(e,m,t,n)}(e,n,t),n}(e)),t},array:e=>{var t,n,i=B(e.length);return t=e,n=i,p.set(t,n),i}},s=P(e),a=[],l=0;if(i)for(var c=0;c<i.length;c++){var h=o[n[c]];h?(0===l&&(l=F()),a[c]=h(i[c])):a[c]=i[c]}var u=s.apply(null,a);return function(e){return 0!==l&&H(l),function(e){return"string"===t?(n=e)?function(e,t,n){for(var i=t+n,r=t;e[r]&&!(r>=i);)++r;if(r-t>16&&e.buffer&&R)return R.decode(e.subarray(t,r));for(var o="";t<r;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var l=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|l:(7&s)<<18|a<<12|l<<6|63&e[t++])<65536)o+=String.fromCharCode(s);else{var c=s-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&s)<<6|a)}else o+=String.fromCharCode(s)}return o}(m,n,i):"":"boolean"===t?Boolean(e):e;var n,i}(e)}(u)}var k,G={__cxa_throw:function(e,t,n){throw new N(e).init(t,n),e},abort:function(){_("")},emscripten_memcpy_big:function(e,t,n){m.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=m.length,i=2147483648;if((e>>>=0)>i)return!1;for(var r=1;r<=4;r*=2){var o=n*(1+.2/r);if(o=Math.min(o,e+100663296),$(Math.min(i,(t=Math.max(e,o))+(65536-t%65536)%65536)))return!0}return!1}},F=(function(){var e,t,i,o,s={env:G,wasi_snapshot_preview1:G};function a(e,t){var n,i=e.exports;return r.asm=i,u=r.asm.memory,y(),r.asm.__indirect_function_table,n=r.asm.__wasm_call_ctors,C.unshift(n),function(){if(S--,r.monitorRunDependencies&&r.monitorRunDependencies(S),0==S&&(null!==x&&(clearInterval(x),x=null),E)){var e=E;E=null,e()}}(),i}if(S++,r.monitorRunDependencies&&r.monitorRunDependencies(S),r.instantiateWasm)try{return r.instantiateWasm(s,a)}catch(e){d("Module.instantiateWasm callback failed with error: "+e),n(e)}(e=h,t=b,i=s,o=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||M(t)||"function"!=typeof fetch?T(t,i,o):fetch(t,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,i).then(o,(function(e){return d("wasm streaming compile failed: "+e),d("falling back to ArrayBuffer instantiation"),T(t,i,o)}))}))).catch(n)}(),r._dbscan=function(){return(r._dbscan=r.asm.dbscan).apply(null,arguments)},r._malloc=function(){return(r._malloc=r.asm.malloc).apply(null,arguments)},r._free=function(){return(r._free=r.asm.free).apply(null,arguments)},function(){return(F=r.asm.stackSave).apply(null,arguments)}),H=function(){return(H=r.asm.stackRestore).apply(null,arguments)},B=function(){return(B=r.asm.stackAlloc).apply(null,arguments)},D=function(){return(D=r.asm.__cxa_is_pointer_type).apply(null,arguments)};function V(){function e(){k||(k=!0,r.calledRun=!0,g||(L(C),t(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)e=r.postRun.shift(),A.unshift(e);var e;L(A)}()))}S>0||(function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)e=r.preRun.shift(),w.unshift(e);var e;L(w)}(),S>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),e()}),1)):e()))}if(r.ccall=O,r.cwrap=function(e,t,n,i){var r=!n||n.every((e=>"number"===e||"boolean"===e));return"string"!==t&&r&&!i?P(e):function(){return O(e,t,n,arguments)}},E=function e(){k||V(),k||(E=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return V(),e.ready});"object"==typeof exports?e.exports=r:"function"==typeof define&&n.amdO?define([],(function(){return r})):"object"==typeof exports&&(exports.exportCppDbscanLib=r)},6295:(e,t,n)=>{"use strict";n.d(t,{$1:()=>a,Hf:()=>u,Hr:()=>_,Ii:()=>y,Qj:()=>f,T6:()=>E,TK:()=>S,be:()=>g,gt:()=>w,iS:()=>s,ij:()=>C,jL:()=>h,lO:()=>m,lP:()=>v,rR:()=>b,tO:()=>l,v_:()=>c,w_:()=>d,yK:()=>A,zn:()=>p});var i=n(8774),r=n(8498),o=n(6863);r.aT.Tanimoto,r.aT.Dice,r.aT.Asymmetric,r.aT.BraunBlanquet,r.aT.Cosine,r.aT.Kulczynski,r.aT.McConnaughey,r.aT.RogotGoldberg,r.aT.Russel,r.aT.Sokal,r.aT.Hamming,r.aT.Euclidean,r.aT.Tanimoto,r.aT.Dice,r.aT.Asymmetric,r.aT.BraunBlanquet,r.aT.Cosine,r.aT.Kulczynski,r.aT.McConnaughey,r.aT.RogotGoldberg,r.aT.Russel,r.aT.Sokal,r.aT.Hamming,r.aT.Euclidean;const s=[r.aT.Tanimoto,r.aT.Dice,r.aT.Cosine];function a(e,t){const n=e.trueCount()+t.trueCount();if(0==n)return 1;const i=e.andWithCountBits(t,!0);return i/(n-i)}function l(e,t){return 1-a(e,t)}function c(e,t){return x(a(new i.A(e,32*e.length),new i.A(t,32*t.length)))}function h(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 d(e,t){let n=0,i=0,r=0;for(let o=0;o<e.length;o++)n+=e[o]*t[o],i+=e[o]*e[o],r+=t[o]*t[o];return(1-n/(Math.sqrt(i)*Math.sqrt(r)))/2}function p(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 m(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 f(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 y(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 b(e,t){return x(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 v(e,t){return x(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 C(e,t){return x(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 x(function(e,t){return 0==e.length?0:e.andWithCountBits(t,!0)/e.length}(e,t))}function S(e,t){return x(function(e,t){const n=e.andWithCountBits(t,!0),i=e.countBits(!0)+t.countBits(!0),r=e.length,o=r-i+n;return n==r||o==r?1:n/i+o/(2*r-i)}(e,t))}function x(e){return e<=0?3402823e32:1/e-1}function E(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){const t=function(e){const t=e?.mostCommon??new Set;return(e,n)=>{const i=e.length,r=n.length;let o=0,s=0,a=0;for(;s<i&&a<r;)e[s]===n[a]?(t?.has(e[s])||++o,++s,++a):e[s]<n[a]?++s:++a;return o}}(e);return(e,n)=>0===n.length||0===e.length?1e4:Math.min(e.length,n.length)/(t(e,n)+1e-4)}r.aT.Tanimoto,r.aT.Asymmetric,r.aT.Cosine,r.aT.Sokal,o.Z.HAMMING,o.Z.LEVENSHTEIN,o.Z.MONOMER_CHEMICAL_DISTANCE,o.Z.NEEDLEMANN_WUNSCH},684:(e,t,n)=>{"use strict";n.d(t,{C0:()=>o,GP:()=>i,Gi:()=>a,YP:()=>c,_X:()=>s,n3:()=>r,vb:()=>l});const i="dim-red-preprocessing-function",r="supportedSemTypes",o="supportedTypes",s="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,r=new Float32Array((n.length+i)*(n.length+i));return Object.entries(t).forEach((([e,i])=>{const o=n[i];Object.entries(t).forEach((([t,i])=>{r[e.charCodeAt(0)*n.length+t.charCodeAt(0)]=o[i]}))})),(e,t)=>1-r[e.charCodeAt(0)*n.length+t.charCodeAt(0)]}(),n=e?.threshold??0;return(e,i)=>{let r=0;const o=e.length,s=i.length,a=Math.ceil(Math.max(o,s)*(1-n));o!==s&&(r=Math.abs(o-s));let l=0;for(let n=0;n<Math.min(o,s);n++)if(e[n]!==i[n]&&(l+=t(e[n],i[n]),l>a))return 1;return l+=r,l/=Math.max(o,s),l}}n.d(t,{Z:()=>s,V:()=>a});var r=n(2787);const o={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 s;!function(e){e.HAMMING="Hamming",e.LEVENSHTEIN="Levenshtein",e.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",e.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(s||(s={}));const a={[s.HAMMING]:i,[s.LEVENSHTEIN]:function(){return(e,t)=>(0,r.I)(e,t)/Math.max(e.length,t.length)},[s.NEEDLEMANN_WUNSCH]:function(e){const t=new Uint16Array(65536),{gapOpen:n,gapExtend:i,scoringMatrix:r,alphabetIndexes:s}={...o,...e};Object.entries(s).forEach((([e,n])=>t[e.charCodeAt(0)]=n));const a=[new Float32Array(1e4),new Float32Array(1e4)];return(e,o)=>{const s=new Array(e.length+1).fill(!1),l=new Array(e.length+1).fill(!1);let c=0,h=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 u=1;u<o.length+1;u++){a[h][0]=-i-(u-1)*i;for(let d=1;d<e.length+1;d++){const p=a[c][d-1]+r[t[e.charCodeAt(d-1)]][t[o.charCodeAt(u-1)]],m=a[c][d]-(s[d]||1===u||u===o.length?i:n),f=a[h][d-1]-(l[d-1]||1===d||d===e.length?i:n);a[h][d]=Math.max(p,f,m),a[h][d]===p?(s[d]=!1,l[d]=!1):a[h][d]===f?(s[d]=!1,l[d]=!0):(s[d]=!0,l[d]=!1)}c=h,h=(h+1)%2}const u=Math.min(e.length,o.length);return(u-a[c][e.length])/u}},[s.MONOMER_CHEMICAL_DISTANCE]:i}},8060:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});const i="dimensionality-reducer-terminate-event"},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,r,o,s,a,l,c;n.d(t,{EG:()=>a,Pn:()=>r,RR:()=>l,Wn:()=>c,aT:()=>o,m6:()=>s,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"}(r||(r={})),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"}(o||(o={})),function(e){e.TanimotoIntArray="TanimotoIntArray"}(s||(s={})),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(8498),n(9336)},9336:(e,t,n)=>{"use strict";var i=n(2787),r=n(944),o=n(6295),s=n(6863),a=n(8498);const l={[a.Pn.Euclidean]:o.jL,[a.Pn.Manhattan]:o.Hf,[a.Pn.Cosine]:o.w_},c={[a.xL.Levenshtein]:i.I,[a.xL.JaroWinkler]:r.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}},h={[a.aT.Tanimoto]:o.tO,[a.aT.Dice]:o.zn,[a.aT.Asymmetric]:o.gt,[a.aT.BraunBlanquet]:o.ij,[a.aT.Cosine]:o.lO,[a.aT.Kulczynski]:o.rR,[a.aT.McConnaughey]:o.lP,[a.aT.RogotGoldberg]:o.TK,[a.aT.Russel]:o.yK,[a.aT.Sokal]:o.Ii,[a.aT.Hamming]:o.be,[a.aT.Euclidean]:o.Qj},u={[a.m6.TanimotoIntArray]:o.v_},d={[a.RR.Difference]:o.T6},p={[a.Wn.CommonItems]:o.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]:h[a.aT.Tanimoto],[a.aT.Dice]:h[a.aT.Dice],[a.aT.Asymmetric]:h[a.aT.Asymmetric],[a.aT.BraunBlanquet]:h[a.aT.BraunBlanquet],[a.aT.Cosine]:h[a.aT.Cosine],[a.aT.Kulczynski]:h[a.aT.Kulczynski],[a.aT.McConnaughey]:h[a.aT.McConnaughey],[a.aT.RogotGoldberg]:h[a.aT.RogotGoldberg],[a.aT.Russel]:h[a.aT.Russel],[a.aT.Sokal]:h[a.aT.Sokal]},[a.EG.MacroMolecule]:{[s.Z.HAMMING]:s.V[s.Z.HAMMING],[s.Z.LEVENSHTEIN]:s.V[s.Z.LEVENSHTEIN],[s.Z.NEEDLEMANN_WUNSCH]:s.V[s.Z.NEEDLEMANN_WUNSCH],[s.Z.MONOMER_CHEMICAL_DISTANCE]:s.V[s.Z.MONOMER_CHEMICAL_DISTANCE]},[a.EG.Number]:{[a.RR.Difference]:d[a.RR.Difference]},[a.EG.IntArray]:{[a.m6.TanimotoIntArray]:u[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,r=i._createBuffer(n);if(t)for(let e=0;e<r.length;e++)r[e]=-1;this._data=r,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 r=e.lengthInInts;for(let i=0;i<r;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 r=0,o=0;for(;t-o>=4;)n._data[r++]=255&e[o]|(255&e[o+1])<<8|(255&e[o+2])<<16|(255&e[o+3])<<24,o+=4;return t-o==3&&(n._data[r]=(255&e[o+2])<<16),t-o==2&&(n._data[r]|=(255&e[o+1])<<8),t-o==1&&(n._data[r]|=255&e[o]),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,r=!0){if(n&&r&&this.setAll(!t,!1),r)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 r=Math.min(e,t),o=Math.max(e,t);if(n)for(let e=r;e<=o;e++)this.setTrue(e);else for(let e=r;e<=o;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 r=31&this._length;for(0!=r&&(n&=~(4294967295<<r));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 r=this.lengthInInts;let o=0;for(;o<r-1;o++)for(let t=this._data[o]&e._data[o];0!=t;t>>>=8)n+=i._onBitCount[255&t];let s=this._data[o]&e._data[o];const a=31&this._length;for(0!=a&&(s&=~(4294967295<<a));0!=s;s>>>=8)n+=i._onBitCount[255&s];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 r=this.lengthInInts;for(let o=Math.floor(e/32);o<r;o++){let r=t?this._data[o]:~this._data[o];if(0!=n)r&=4294967295<<n&4294967295,n=0;else if(!t&&-4294967296==r)continue;for(let t=0;0!=r;t+=8,r>>>=8){const n=i._firstOnBit[255&r];if(n>=0)return(e=n+32*o+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 r=Math.floor(e/32);r>=0;r--){let e=t?this._data[r]:~this._data[r];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*r+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,{cb:()=>a,PE:()=>s}),n(4328);var i=n(6082);n(9982),i.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,,,,,,,,,,,,,,,,,,,,,').columns.add(i.Column.fromList(i.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var r,o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};function s(e,t,n,i=0,r="timeout"){return o(this,void 0,void 0,(function*(){return new Promise(((o,s)=>{const a=e.subscribe((e=>{try{t(e),o("OK")}catch(e){s(e)}finally{a.unsubscribe(),clearTimeout(l)}})),l=setTimeout((()=>{a.unsubscribe(),s(r)}),i);n()}))}))}function a(e){return o(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,e)))}))}console.log.bind(console),console.info.bind(console),console.warn.bind(console),console.error.bind(console),function(e){e.notNull=function(e,t){if(null==e)throw new Error(`${null==t?"Value":t} not defined`)}}(r||(r={})),i.DataFrame.fromColumns([i.Column.fromStrings("col",["val1","val2","val3"])])},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:()=>o,vA:()=>r,wQ:()=>s});var i=n(3527);function r(e=!1,t="Assertion error."){if(!e)throw new Error(t)}function o(e,t,n=1){const o=e.length;r(o==t.length,"Vector lengths do not match.");const s=new i.Mi(o);for(let i=0;i<e.length;++i)s[i]=e[i]+n*t[i];return s}function s(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 r=0;r<t;++r)n+=e[r],i+=Math.pow(e[r],2);const r=n/t,o=1/Math.sqrt(i/t-Math.pow(r,2));for(let n=0;n<t;++n)e[n]=(e[n]-r)*o;return e}},1913:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(3282),r=n(9029),o=n(1520),s=n(2586),a=n(8708),l=n(2023),c="errorMessage",h=new i.Name("emUsed"),u={required:"missingProperty",dependencies:"property",dependentRequired:"property"},d=/\$\{[^}]+\}/,p=/\$\{([^}]+)\}/g,m=/^""\s*\+\s*|\s*\+\s*""$/g;const f=(e,t={})=>{if(!e.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(e.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return e.addKeyword(function(e){return{keyword:c,schemaType:["string","object"],post:!0,code(t){const{gen:n,data:f,schema:g,schemaValue:y,it:b}=t;if(!1===b.createErrors)return;const v=g,w=r.strConcat(l.default.instancePath,b.errorPath);function C(e,t){return r.and(i._`${e}.keyword !== ${c}`,i._`!${e}.${h}`,i._`${e}.instancePath === ${w}`,i._`${e}.keyword in ${t}`,i._`${e}.schemaPath.indexOf(${b.errSchemaPath}) === 0`,i._`/^\\/[^\\/]*$/.test(${e}.schemaPath.slice(${b.errSchemaPath.length}))`)}function A(e,t){const i=[];for(const n in e){const e=t[n];d.test(e)&&i.push([n,x(e)])}return n.object(...i)}function S(e){return d.test(e)?new o._Code(o.safeStringify(e).replace(p,((e,t)=>`" + JSON.stringify(${s.getData(t,b)}) + "`)).replace(m,"")):i.stringify(e)}function x(e){return i._`function(){return ${S(e)}}`}n.if(i._`${l.default.errors} > 0`,(()=>{if("object"==typeof v){const[o,s]=function(e){let t,n;for(const i in e){if("properties"===i||"items"===i)continue;const r=e[i];if("object"==typeof r){t||(t={});const e=t[i]={};for(const t in r)e[t]=[]}else n||(n={}),n[i]=[]}return[t,n]}(v);s&&function(r){const o=n.const("emErrors",i.stringify(r)),s=n.const("templates",A(r,g));n.forOf("err",l.default.vErrors,(e=>n.if(C(e,o),(()=>n.code(i._`${o}[${e}.keyword].push(${e})`).assign(i._`${e}.${h}`,!0)))));const{singleError:c}=e;if(c){const e=n.let("message",i._`""`),r=n.let("paramsErrors",i._`[]`);u((t=>{n.if(e,(()=>n.code(i._`${e} += ${"string"==typeof c?c:";"}`))),n.code(i._`${e} += ${d(t)}`),n.assign(r,i._`${r}.concat(${o}[${t}])`)})),a.reportError(t,{message:e,params:i._`{errors: ${r}}`})}else u((e=>a.reportError(t,{message:d(e),params:i._`{errors: ${o}[${e}]}`})));function u(e){n.forIn("key",o,(t=>n.if(i._`${o}[${t}].length`,(()=>e(t)))))}function d(e){return i._`${e} in ${s} ? ${s}[${e}]() : ${y}[${e}]`}}(s),o&&function(e){const r=n.const("emErrors",i.stringify(e)),o=[];for(const t in e)o.push([t,A(e[t],g[t])]);const s=n.const("templates",n.object(...o)),c=n.scopeValue("obj",{ref:u,code:i.stringify(u)}),d=n.let("emPropParams"),p=n.let("emParamsErrors");n.forOf("err",l.default.vErrors,(e=>n.if(C(e,r),(()=>{n.assign(d,i._`${c}[${e}.keyword]`),n.assign(p,i._`${r}[${e}.keyword][${e}.params[${d}]]`),n.if(p,(()=>n.code(i._`${p}.push(${e})`).assign(i._`${e}.${h}`,!0)))})))),n.forIn("key",r,(e=>n.forIn("keyProp",i._`${r}[${e}]`,(o=>{n.assign(p,i._`${r}[${e}][${o}]`),n.if(i._`${p}.length`,(()=>{const r=n.const("tmpl",i._`${s}[${e}] && ${s}[${e}][${o}]`);a.reportError(t,{message:i._`${r} ? ${r}() : ${y}[${e}][${o}]`,params:i._`{errors: ${p}}`})}))}))))}(o),function(e){const{props:o,items:s}=e;if(!o&&!s)return;const u=i._`typeof ${f} == "object"`,d=i._`Array.isArray(${f})`,p=n.let("emErrors");let m,b;const v=n.let("templates");function C(e,t){n.assign(p,i.stringify(e)),n.assign(v,A(e,t))}o&&s?(m=n.let("emChildKwd"),n.if(u),n.if(d,(()=>{C(s,g.items),n.assign(m,i.str`items`)}),(()=>{C(o,g.properties),n.assign(m,i.str`properties`)})),b=i._`[${m}]`):s?(n.if(d),C(s,g.items),b=i._`.items`):o&&(n.if(r.and(u,r.not(d))),C(o,g.properties),b=i._`.properties`),n.forOf("err",l.default.vErrors,(e=>function(e,t,o){n.if(r.and(i._`${e}.keyword !== ${c}`,i._`!${e}.${h}`,i._`${e}.instancePath.indexOf(${w}) === 0`),(()=>{const r=n.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:i._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),s=n.const("emMatches",i._`${r}.exec(${e}.instancePath.slice(${w}.length))`),a=n.const("emChild",i._`${s} && ${s}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);n.if(i._`${a} !== undefined && ${a} in ${t}`,(()=>o(a)))}))}(e,p,(t=>n.code(i._`${p}[${t}].push(${e})`).assign(i._`${e}.${h}`,!0))))),n.forIn("key",p,(e=>n.if(i._`${p}[${e}].length`,(()=>{a.reportError(t,{message:i._`${e} in ${v} ? ${v}[${e}]() : ${y}${b}[${e}]`,params:i._`{errors: ${p}[${e}]}`}),n.assign(i._`${l.default.vErrors}[${l.default.errors}-1].instancePath`,i._`${w} + "/" + ${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}(v))}const o="string"==typeof v?v:v._;o&&function(e){const o=n.const("emErrs",i._`[]`);n.forOf("err",l.default.vErrors,(e=>n.if(function(e){return r.and(i._`${e}.keyword !== ${c}`,i._`!${e}.${h}`,r.or(i._`${e}.instancePath === ${w}`,r.and(i._`${e}.instancePath.indexOf(${w}) === 0`,i._`${e}.instancePath[${w}.length] === "/"`)),i._`${e}.schemaPath.indexOf(${b.errSchemaPath}) === 0`,i._`${e}.schemaPath[${b.errSchemaPath}.length] === "/"`)}(e),(()=>n.code(i._`${o}.push(${e})`).assign(i._`${e}.${h}`,!0))))),n.if(i._`${o}.length`,(()=>a.reportError(t,{message:S(e),params:i._`{errors: ${o}}`})))}(o),e.keepErrors||function(){const e=n.const("emErrs",i._`[]`);n.forOf("err",l.default.vErrors,(t=>n.if(i._`!${t}.${h}`,(()=>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=f,e.exports=f,e.exports.default=f},7433:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const i=n(4042),r=n(6105),o=n(6653),s=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(),r.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;t&&(s.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 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 u=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return u.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),r=n(6144),o=n(6653),s=n(2079),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends i.default{_addVocabularies(){super._addVocabularies(),r.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;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 h=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var u=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var 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 r 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 o(e,...t){const n=[e[0]];let i=0;for(;i<t.length;)l(n,t[i]),n.push(e[++i]);return new r(n)}t._Code=r,t.nil=new r(""),t._=o;const s=new r("+");function a(e,...t){const n=[h(e[0])];let i=0;for(;i<t.length;)n.push(s),l(n,t[i]),n.push(s,h(e[++i]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===s){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 r(n)}function l(e,t){var n;t instanceof r?e.push(...t._items):t instanceof i?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:h(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 h(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 r(h(e))},t.safeStringify=h,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new r(`.${e}`):o`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new r(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new r(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),r=n(7845);var o=n(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}});var s=n(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.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?r.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=N(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=N(this.rhs,e,t),this}get names(){return L(this.lhs instanceof i.Name?{}:{...this.lhs.names},this.rhs)}}class h 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 u 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=N(this.code,e,t),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class f extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let i=n.length;for(;i--;){const r=n[i];r.optimizeNames(e,t)||($(e,r.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>T(e,t.names)),{})}}class g extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends f{}class b extends g{}b.kind="else";class v extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new b(e):e}return t?!1===e?t instanceof v?t:t.nodes:this.nodes.length?this:new v(P(e),t instanceof v?[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=N(this.condition,e,t),this}get names(){const e=super.names;return L(e,this.condition),this.else&&T(e,this.else.names),e}}v.kind="if";class w extends g{}w.kind="for";class C extends w{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=N(this.iteration,e,t),this}get names(){return T(super.names,this.iteration.names)}}class A extends w{constructor(e,t,n,i){super(),this.varKind=e,this.name=t,this.from=n,this.to=i}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${t} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){const e=L(super.names,this.from);return L(e,this.to)}}class S extends w{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=N(this.iterable,e,t),this}get names(){return T(super.names,this.iterable.names)}}class x extends g{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}x.kind="func";class E extends f{render(e){return"return "+super.render(e)}}E.kind="return";class _ extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,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&&T(e,this.catch.names),this.finally&&T(e,this.finally.names),e}}class M extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}M.kind="catch";class I extends g{render(e){return"finally"+super.render(e)}}function T(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function L(e,t){return t instanceof i._CodeOrName?T(e,t.names):e}function N(e,t,n){return e instanceof i.Name?o(e):(r=e)instanceof i._Code&&r._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=o(t)),t instanceof i._Code?e.push(...t._items):e.push(t),e)),[])):e;var r;function o(e){const i=n[e.str];return void 0===i||1!==t[e.str]?e:(delete t[e.str],i)}}function $(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function P(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:i._`!${G(e)}`}I.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 r.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 r=this._scope.toName(t);return void 0!==n&&i&&(this._constants[r.str]=n),this._leafNode(new l(e,r,n)),r}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new c(e,t,n))}add(e,n){return this._leafNode(new h(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,r]of e)t.length>1&&t.push(","),t.push(n),(n!==r||this.opts.es5)&&(t.push(":"),(0,i.addCodeArg)(t,r));return t.push("}"),new i._Code(t)}if(e,t,n){if(this._blockNode(new v(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 v(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(v,b)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new C(e),t)}forRange(e,t,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const s=this._scope.toName(e);return this._for(new A(o,s,t,n),(()=>i(s)))}forOf(e,t,n,o=r.varKinds.const){const s=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(s,i._`${e}[${t}]`),n(s)}))}return this._for(new S("of",o,s,t),(()=>n(s)))}forIn(e,t,n,o=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,i._`Object.keys(${t})`,n);const s=this._scope.toName(e);return this._for(new S("in",o,s,t),(()=>n(s)))}endFor(){return this._endBlockNode(w)}label(e){return this._leafNode(new u(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 _;if(this._blockNode(i),this.code(e),t){const e=this.name("e");this._currNode=i.catch=new M(e),t(e)}return n&&(this._currNode=i.finally=new I,this.code(n)),this._endBlockNode(M,I)}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,r){return this._blockNode(new x(e,t,n)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(x)}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 v))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=P;const R=k(t.operators.AND);t.and=function(...e){return e.reduce(R)};const O=k(t.operators.OR);function k(e){return(t,n)=>t===i.nil?n:n===i.nil?t:i._`${G(t)} ${e} ${G(n)}`}function G(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 r extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o||(t.UsedValueState=o={})),t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class s{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=s;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 s{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:r}=i,o=null!==(n=t.key)&&void 0!==n?n:t.ref;let s=this._values[r];if(s){const e=s.get(o);if(e)return e}else s=this._values[r]=new Map;s.set(o,i);const a=this._scope[r]||(this._scope[r]=[]),l=a.length;return a[l]=t.ref,i.setValue(t,{property:r,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,s={},a){let l=i.nil;for(const c in e){const h=e[c];if(!h)continue;const u=s[c]=s[c]||new Map;h.forEach((e=>{if(u.has(e))return;u.set(e,o.Started);let s=n(e);if(s){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;l=i._`${l}${n} ${e} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(e)))throw new r(e);l=i._`${l}${s}${this.opts._n}`}u.set(e,o.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),r=n(4227),o=n(2023);function s(e,t){const n=e.const("err",t);e.if(i._`${o.default.vErrors} === null`,(()=>e.assign(o.default.vErrors,i._`[${n}]`)),i._`${o.default.vErrors}.push(${n})`),e.code(i._`${o.default.errors}++`)}function a(e,t){const{gen:n,validateName:r,schemaEnv:o}=e;o.$async?n.throw(i._`new ${e.ValidationError}(${t})`):(n.assign(i._`${r}.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,r,o){const{it:l}=e,{gen:h,compositeRule:u,allErrors:d}=l,p=c(e,n,r);(null!=o?o:u||d)?s(h,p):a(l,i._`[${p}]`)},t.reportExtraError=function(e,n=t.keywordError,i){const{it:r}=e,{gen:l,compositeRule:h,allErrors:u}=r;s(l,c(e,n,i)),h||u||a(r,o.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(o.default.errors,t),e.if(i._`${o.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(i._`${o.default.vErrors}.length`,t)),(()=>e.assign(o.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:r,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",s,o.default.errors,(s=>{e.const(l,i._`${o.default.vErrors}[${s}]`),e.if(i._`${l}.instancePath === undefined`,(()=>e.assign(i._`${l}.instancePath`,(0,i.strConcat)(o.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`,r))}))};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:r}=e.it;return!1===r?i._`{}`:function(e,t,n={}){const{gen:r,it:s}=e,a=[h(s,n),u(e,n)];return function(e,{params:t,message:n},r){const{keyword:s,data:a,schemaValue:c,it:h}=e,{opts:u,propertyName:d,topSchemaRef:p,schemaPath:m}=h;r.push([l.keyword,s],[l.params,"function"==typeof t?t(e):t||i._`{}`]),u.messages&&r.push([l.message,"function"==typeof n?n(e):n]),u.verbose&&r.push([l.schema,c],[l.parentSchema,i._`${p}${m}`],[o.default.data,a]),d&&r.push([l.propertyName,d])}(e,t,a),r.object(...a)}(e,t,n)}function h({errorPath:e},{instancePath:t}){const n=t?i.str`${e}${(0,r.getErrorPath)(t,r.Type.Str)}`:e;return[o.default.instancePath,(0,i.strConcat)(o.default.instancePath,n)]}function u({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:o}){let s=o?t:i.str`${t}/${e}`;return n&&(s=i.str`${s}${(0,r.getErrorPath)(n,r.Type.Str)}`),[l.schemaPath,s]}},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),r=n(3558),o=n(2023),s=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,s.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 h(e){const t=d.call(this,e);if(t)return t;const n=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:h}=this.opts,u=new i.CodeGen(this.scope,{es5:a,lines:c,ownProperties:h});let p;e.$async&&(p=u.scopeValue("Error",{ref:r.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const m=u.scopeName("validate");e.validateName=m;const f={gen:u,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:u.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 g;try{this._compilations.add(e),(0,l.validateFunctionCode)(f),u.optimize(this.opts.code.optimize);const t=u.toString();g=`${u.scopeRefs(o.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${o.default.self}`,`${o.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:m,validateCode:t,scopeValues:u._values}),this.opts.unevaluated){const{props:e,items:t}=f;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,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function u(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:h.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,s._getFullPath)(this.opts.uriResolver,n);let r=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===r)return g.call(this,n,e);const o=(0,s.normalizeId)(i),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||h.call(this,a),o===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,i=t[n];return i&&(r=(0,s.resolveUrl)(this.opts.uriResolver,r,i)),new c({schema:t,schemaId:n,root:e,baseId:r})}return g.call(this,n,a)}}t.SchemaEnv=c,t.compileSchema=h,t.resolveRef=function(e,t,n){var i;n=(0,s.resolveUrl)(this.opts.uriResolver,t,n);const r=e.refs[n];if(r)return r;let o=p.call(this,e,n);if(void 0===o){const r=null===(i=e.localRefs)||void 0===i?void 0:i[n],{schemaId:s}=this.opts;r&&(o=new c({schema:r,schemaId:s,root:e,baseId:t}))}return void 0!==o?e.refs[n]=u.call(this,o):void 0},t.getCompilingSchema=d,t.resolveSchema=m;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:n,root:i}){var r;if("/"!==(null===(r=e.fragment)||void 0===r?void 0:r[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 r="object"==typeof(n=e)&&n[this.opts.schemaId];!f.has(i)&&r&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,r))}let o;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,i,e)}const{schemaId:l}=this.opts;return o=o||new c({schema:n,schemaId:l,root:i,baseId:t}),o.schema!==o.root.schema?o:void 0}},2023:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(9029),r={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=r},4551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6939);class r extends Error{constructor(e,t,n,r){super(r||`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=r},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),r=n(2017),o=n(7106),s=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++,!s.has(n)&&("object"==typeof e[n]&&(0,i.eachItem)(e[n],(e=>t+=c(e))),t===1/0))return 1/0}return t}function h(e,t="",n){!1!==n&&(t=p(t));const i=e.parse(t);return u(e,i)}function u(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=h,t._getFullPath=u;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,s=p(e[n]||t),a={"":s},l=h(i,s,!1),c={},u=new Set;return o(e,{allKeys:!0},((e,t,i,r)=>{if(void 0===r)return;const o=l+t;let s=a[r];function h(t){const n=this.opts.uriResolver.resolve;if(t=p(s?n(s,t):t),u.has(t))throw f(t);u.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(o)&&("#"===t[0]?(d(e,c[t],t),c[t]=e):this.refs[t]=o),t}function g(e){if("string"==typeof e){if(!m.test(e))throw new Error(`invalid anchor "${e}"`);h.call(this,`#${e}`)}}"string"==typeof e[n]&&(s=h.call(this,e[n])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),a[t]=s})),c;function d(e,t,n){if(void 0!==t&&!r(e,t))throw f(n)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},396:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},4227:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const i=n(9029),r=n(1520);function o(e,t=e.schema){const{opts:n,self:i}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const r=i.RULES.keywords;for(const n in t)r[n]||m(e,`unknown keyword: "${n}"`)}function s(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:r}){return(o,s,a,l)=>{const c=void 0===a?s:a instanceof i.Name?(s instanceof i.Name?e(o,s,a):t(o,s,a),a):s instanceof i.Name?(t(o,a,s),s):n(s,a);return l!==i.Name||c instanceof i.Name?c:r(o,c)}}function h(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",i._`{}`);return void 0!==t&&u(e,n,t),n}function u(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||(o(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRules=s,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,r,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return i._`${n}`}return i._`${e}${t}${(0,i.getProperty)(r)}`},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} || {}`),u(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:h}),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=h,t.setEvaluated=u;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 r._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 r=t===p.Num;return n?r?i._`"[" + ${e} + "]"`:i._`"['" + ${e} + "']"`:r?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 r=t.RULES.types[i];return r&&!0!==r&&n(e,r)},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),r=n(9029),o=n(2023),s={message:"boolean schema is false"};function a(e,t){const{gen:n,data:r}=e,o={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,i.reportError)(o,s,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(o.default.data):(t.assign(r._`${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),r=n(7887),o=n(8708),s=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:o}=e,a=function(e,t){return t?e.filter((e=>h.has(e)||"array"===t&&"array"===e)):[]}(t,o.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,r.schemaHasRulesForType)(e,t[0]));if(c){const r=d(t,i,o.strictNumbers,l.Wrong);n.if(r,(()=>{a.length?function(e,t,n){const{gen:i,data:r,opts:o}=e,a=i.let("dataType",s._`typeof ${r}`),l=i.let("coerced",s._`undefined`);"array"===o.coerceTypes&&i.if(s._`${a} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,(()=>i.assign(r,s._`${r}[0]`).assign(a,s._`typeof ${r}`).if(d(t,r,o.strictNumbers),(()=>i.assign(l,r))))),i.if(s._`${l} !== undefined`);for(const e of n)(h.has(e)||"array"===e&&"array"===o.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void i.elseIf(s._`${a} == "number" || ${a} == "boolean"`).assign(l,s._`"" + ${r}`).elseIf(s._`${r} === null`).assign(l,s._`""`);case"number":return void i.elseIf(s._`${a} == "boolean" || ${r} === null
1
+ var bio;(()=>{var e={8924:(e,t,n)=>{"use strict";var i=n(7362);class r 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,r)),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,r)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new r({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 r.aaSynonyms?r.aaSynonyms[e]:e;return super.get(t)}}r.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class o{static getPalette(e="grok"){switch(e){case"grok":return r.GrokGroups;case"lesk":return r.Lesk;default:throw new Error(`ChemPalette: scheme \`${e}\` does not exist`)}}static getInnerOuter(e){let t=0,n="",i="";for(const r of e)"("==r?t++:")"==r?t--:t?n+=r:i+=r;return isNaN(parseInt(n))?[i,n]:[i,""]}static getColorAAPivot(e="",t="grok"){const n=this.getPalette(t);let[i,r]=this.getInnerOuter(e);if(i=i.length>6?`${i.slice(0,3)}...`:i,r=r.length>6?`${r.slice(0,3)}...`:r,1==e.length||"("==e[1]){const t=e[0]?.toUpperCase();return t in n?[n.get(t),t,r,1]:[this.undefinedColor,i,r,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,r,2]:[this.undefinedColor,i,r,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,r,3]:[this.undefinedColor,i,r,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,r,4]:[this.undefinedColor,i,r,4]}return[this.undefinedColor,i,r,0]}}o.SemType="Aminoacids",o.SemTypeMultipleAlignment="AminoacidsMultipleAlignment",o.undefinedColor="rgb(100,100,100)",o.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"},o.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"},o.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(*)*"},o.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:()=>r});var i=n(6082);async function r(){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:()=>o,fA:()=>s});var i=n(7389),r=n(6082);async function o(){const e="Helm",t=r.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 s(e,t){if(!e)throw new Error("Argument 'a' of type Atom or HelmType is mandatory.");let n,i;const r=e;return"ATOM"===r.T?(n=r.biotype(),i=r.elem):(n=e,i=t),[n,i]}r.JsInputBase,Error,i.input.helmAsync=async function(e,t){return(await o()).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:()=>s});var i=n(4328);const r="Libraries";let o=Promise.resolve();async function s(){let e;return o=o.then((async()=>{const t=i.userSettings.getValue(r,"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 o,e}async function a(e){o=o.then((async()=>{console.debug(`Bio: setUserLibSettings()\n${JSON.stringify(e,void 0,2)}`),i.userSettings.add(r,"Settings",JSON.stringify(e),!0)})),await o}},5553:(e,t,n)=>{"use strict";n.d(t,{Qc:()=>A,WN:()=>S});var i=n(1991),r=n.n(i);const o="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,s=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,h=globalThis.AbortSignal;if(void 0===c){h=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},c=class{constructor(){t()}signal=new h;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 u=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),d=e=>u(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 f{#t;#n;#i;#r;#o;#s;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#l;#c;#h;#u;#d;#p;#m;#f;#g;#y;#b;#v;#w;#C;#A;#S;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#w,sizes:e.#b,keyMap:e.#c,keyList:e.#h,valList:e.#u,next:e.#d,prev:e.#p,get head(){return e.#m},get tail(){return e.#f},free:e.#g,isBackgroundFetch:t=>e.#x(t),backgroundFetch:(t,n,i,r)=>e.#E(t,n,i,r),moveToTail:t=>e.#_(t),indexes:t=>e.#M(t),rindexes:t=>e.#I(t),isStale:t=>e.#T(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.#o}get memoMethod(){return this.#s}get dispose(){return this.#i}get disposeAfter(){return this.#r}constructor(e){const{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:h,disposeAfter:p,noDisposeOnSet:g,noUpdateTTL:y,maxSize:b=0,maxEntrySize:v=0,sizeCalculation:w,fetchMethod:C,memoMethod:A,noDeleteOnFetchRejection:S,noDeleteOnStaleGet:x,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:_,ignoreFetchAbort:M}=e;if(0!==t&&!u(t))throw new TypeError("max option must be a nonnegative integer");const I=t?d(t):Array;if(!I)throw new Error("invalid max value: "+t);if(this.#t=t,this.#n=b,this.maxEntrySize=v||this.#n,this.sizeCalculation=w,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!==A&&"function"!=typeof A)throw new TypeError("memoMethod must be a function if defined");if(this.#s=A,void 0!==C&&"function"!=typeof C)throw new TypeError("fetchMethod must be a function if specified");if(this.#o=C,this.#A=!!C,this.#c=new Map,this.#h=new Array(t).fill(void 0),this.#u=new Array(t).fill(void 0),this.#d=new I(t),this.#p=new I(t),this.#m=0,this.#f=0,this.#g=m.create(t),this.#a=0,this.#l=0,"function"==typeof h&&(this.#i=h),"function"==typeof p?(this.#r=p,this.#y=[]):(this.#r=void 0,this.#y=void 0),this.#C=!!this.#i,this.#S=!!this.#r,this.noDisposeOnSet=!!g,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!S,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!M,0!==this.maxEntrySize){if(0!==this.#n&&!u(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!u(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#L()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!x,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=u(i)||0===i?i:1,this.ttlAutopurge=!!r,this.ttl=n||0,this.ttl){if(!u(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#N()}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=>!s.has(e))(e)&&(s.add(e),l("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,f))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#N(){const e=new p(this.#t),t=new p(this.#t);this.#w=e,this.#v=t,this.#$=(n,i,r=o.now())=>{if(t[n]=0!==i?r:0,e[n]=i,0!==i&&this.ttlAutopurge){const e=setTimeout((()=>{this.#T(n)&&this.#P(this.#h[n],"expire")}),i+1);e.unref&&e.unref()}},this.#R=n=>{t[n]=0!==e[n]?o.now():0},this.#O=(r,o)=>{if(e[o]){const s=e[o],a=t[o];if(!s||!a)return;r.ttl=s,r.start=a,r.now=n||i();const l=r.now-a;r.remainingTTL=s-l}};let n=0;const i=()=>{const e=o.now();if(this.ttlResolution>0){n=e;const t=setTimeout((()=>n=0),this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=r=>{const o=this.#c.get(r);if(void 0===o)return 0;const s=e[o],a=t[o];return s&&a?s-((n||i())-a):1/0},this.#T=r=>{const o=t[r],s=e[r];return!!s&&!!o&&(n||i())-o>s}}#R=()=>{};#O=()=>{};#$=()=>{};#T=()=>!1;#L(){const e=new p(this.#t);this.#l=0,this.#b=e,this.#k=t=>{this.#l-=e[t],e[t]=0},this.#G=(e,t,n,i)=>{if(this.#x(t))return 0;if(!u(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),!u(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.#H(!0)}this.#l+=e[t],i&&(i.entrySize=n,i.totalCalculatedSize=this.#l)}}#k=e=>{};#F=(e,t,n)=>{};#G=(e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#M({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#f;this.#B(t)&&(!e&&this.#T(t)||(yield t),t!==this.#m);)t=this.#p[t]}*#I({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#m;this.#B(t)&&(!e&&this.#T(t)||(yield t),t!==this.#f);)t=this.#d[t]}#B(e){return void 0!==e&&this.#c.get(this.#h[e])===e}*entries(){for(const e of this.#M())void 0===this.#u[e]||void 0===this.#h[e]||this.#x(this.#u[e])||(yield[this.#h[e],this.#u[e]])}*rentries(){for(const e of this.#I())void 0===this.#u[e]||void 0===this.#h[e]||this.#x(this.#u[e])||(yield[this.#h[e],this.#u[e]])}*keys(){for(const e of this.#M()){const t=this.#h[e];void 0===t||this.#x(this.#u[e])||(yield t)}}*rkeys(){for(const e of this.#I()){const t=this.#h[e];void 0===t||this.#x(this.#u[e])||(yield t)}}*values(){for(const e of this.#M())void 0===this.#u[e]||this.#x(this.#u[e])||(yield this.#u[e])}*rvalues(){for(const e of this.#I())void 0===this.#u[e]||this.#x(this.#u[e])||(yield this.#u[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const n of this.#M()){const i=this.#u[n],r=this.#x(i)?i.__staleWhileFetching:i;if(void 0!==r&&e(r,this.#h[n],this))return this.get(this.#h[n],t)}}forEach(e,t=this){for(const n of this.#M()){const i=this.#u[n],r=this.#x(i)?i.__staleWhileFetching:i;void 0!==r&&e.call(t,r,this.#h[n],this)}}rforEach(e,t=this){for(const n of this.#I()){const i=this.#u[n],r=this.#x(i)?i.__staleWhileFetching:i;void 0!==r&&e.call(t,r,this.#h[n],this)}}purgeStale(){let e=!1;for(const t of this.#I({allowStale:!0}))this.#T(t)&&(this.#P(this.#h[t],"expire"),e=!0);return e}info(e){const t=this.#c.get(e);if(void 0===t)return;const n=this.#u[t],i=this.#x(n)?n.__staleWhileFetching:n;if(void 0===i)return;const r={value:i};if(this.#w&&this.#v){const e=this.#w[t],n=this.#v[t];if(e&&n){const t=e-(o.now()-n);r.ttl=t,r.start=Date.now()}}return this.#b&&(r.size=this.#b[t]),r}dump(){const e=[];for(const t of this.#M({allowStale:!0})){const n=this.#h[t],i=this.#u[t],r=this.#x(i)?i.__staleWhileFetching:i;if(void 0===r||void 0===n)continue;const s={value:r};if(this.#w&&this.#v){s.ttl=this.#w[t];const e=o.now()-this.#v[t];s.start=Math.floor(Date.now()-e)}this.#b&&(s.size=this.#b[t]),e.unshift([n,s])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const e=Date.now()-n.start;n.start=o.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:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=n;let{noUpdateTTL:l=this.noUpdateTTL}=n;const c=this.#G(e,t,n.size||0,s);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let h=0===this.#a?void 0:this.#c.get(e);if(void 0===h)h=0===this.#a?this.#f:0!==this.#g.length?this.#g.pop():this.#a===this.#t?this.#H(!1):this.#a,this.#h[h]=e,this.#u[h]=t,this.#c.set(e,h),this.#d[this.#f]=h,this.#p[h]=this.#f,this.#f=h,this.#a++,this.#F(h,c,a),a&&(a.set="add"),l=!1;else{this.#_(h);const n=this.#u[h];if(t!==n){if(this.#A&&this.#x(n)){n.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=n;void 0===t||o||(this.#C&&this.#i?.(t,e,"set"),this.#S&&this.#y?.push([t,e,"set"]))}else o||(this.#C&&this.#i?.(n,e,"set"),this.#S&&this.#y?.push([n,e,"set"]));if(this.#k(h),this.#F(h,c,a),this.#u[h]=t,a){a.set="replace";const e=n&&this.#x(n)?n.__staleWhileFetching:n;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0===i||this.#w||this.#N(),this.#w&&(l||this.#$(h,i,r),a&&this.#O(a,h)),!o&&this.#S&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#r?.(...t)}return this}pop(){try{for(;this.#a;){const e=this.#u[this.#m];if(this.#H(!0),this.#x(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#S&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#r?.(...t)}}}#H(e){const t=this.#m,n=this.#h[t],i=this.#u[t];return this.#A&&this.#x(i)?i.__abortController.abort(new Error("evicted")):(this.#C||this.#S)&&(this.#C&&this.#i?.(i,n,"evict"),this.#S&&this.#y?.push([i,n,"evict"])),this.#k(t),e&&(this.#h[t]=void 0,this.#u[t]=void 0,this.#g.push(t)),1===this.#a?(this.#m=this.#f=0,this.#g.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,r=this.#c.get(e);if(void 0!==r){const e=this.#u[r];if(this.#x(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#T(r))return n&&this.#R(r),i&&(i.has="hit",this.#O(i,r)),!0;i&&(i.has="stale",this.#O(i,r))}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.#T(i))return;const r=this.#u[i];return this.#x(r)?r.__staleWhileFetching:r}#E(e,t,n,i){const r=void 0===t?void 0:this.#u[t];if(this.#x(r))return r;const o=new c,{signal:s}=n;s?.addEventListener("abort",(()=>o.abort(s.reason)),{signal:o.signal});const a={signal:o.signal,options:n,context:i},l=(i,r=!1)=>{const{aborted:s}=o.signal,l=n.ignoreFetchAbort&&void 0!==i;if(n.status&&(s&&!r?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,l&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),s&&!l&&!r)return h(o.signal.reason);const c=u;return this.#u[t]===u&&(void 0===i?c.__staleWhileFetching?this.#u[t]=c.__staleWhileFetching:this.#P(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,i,a.options))),i},h=i=>{const{aborted:r}=o.signal,s=r&&n.allowStaleOnFetchAbort,a=s||n.allowStaleOnFetchRejection,l=a||n.noDeleteOnFetchRejection,c=u;if(this.#u[t]===u&&(l&&void 0!==c.__staleWhileFetching?s||(this.#u[t]=c.__staleWhileFetching):this.#P(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 u=new Promise(((t,i)=>{const s=this.#o?.(e,r,a);s&&s instanceof Promise&&s.then((e=>t(void 0===e?void 0:e)),i),o.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),h(e)))),d=Object.assign(u,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return void 0===t?(this.set(e,d,{...a.options,status:void 0}),t=this.#c.get(e)):this.#u[t]=d,d}#x(e){if(!this.#A)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:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:f=!1,status:g,signal:y}=t;if(!this.#A)return g&&(g.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:g});const b={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:p,ignoreFetchAbort:d,status:g,signal:y};let v=this.#c.get(e);if(void 0===v){g&&(g.fetch="miss");const t=this.#E(e,v,b,m);return t.__returned=t}{const t=this.#u[v];if(this.#x(t)){const e=n&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const r=this.#T(v);if(!f&&!r)return g&&(g.fetch="hit"),this.#_(v),i&&this.#R(v),g&&this.#O(g,v),t;const o=this.#E(e,v,b,m),s=void 0!==o.__staleWhileFetching&&n;return g&&(g.fetch=r?"stale":"refresh",s&&r&&(g.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}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.#s;if(!n)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:r,...o}=t,s=this.get(e,o);if(!r&&void 0!==s)return s;const a=n(e,s,{options:o,context:i});return this.set(e,a,o),a}get(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=t,s=this.#c.get(e);if(void 0!==s){const t=this.#u[s],a=this.#x(t);return o&&this.#O(o,s),this.#T(s)?(o&&(o.get="stale"),a?(o&&n&&void 0!==t.__staleWhileFetching&&(o.returnedStale=!0),n?t.__staleWhileFetching:void 0):(r||this.#P(e,"expire"),o&&n&&(o.returnedStale=!0),n?t:void 0)):(o&&(o.get="hit"),a?t.__staleWhileFetching:(this.#_(s),i&&this.#R(s),t))}o&&(o.get="miss")}#D(e,t){this.#p[t]=e,this.#d[e]=t}#_(e){e!==this.#f&&(e===this.#m?this.#m=this.#d[e]:this.#D(this.#p[e],this.#d[e]),this.#D(this.#f,e),this.#f=e)}delete(e){return this.#P(e,"delete")}#P(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.#k(i);const n=this.#u[i];if(this.#x(n)?n.__abortController.abort(new Error("deleted")):(this.#C||this.#S)&&(this.#C&&this.#i?.(n,e,t),this.#S&&this.#y?.push([n,e,t])),this.#c.delete(e),this.#h[i]=void 0,this.#u[i]=void 0,i===this.#f)this.#f=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.#g.push(i)}}if(this.#S&&this.#y?.length){const e=this.#y;let t;for(;t=e?.shift();)this.#r?.(...t)}return n}clear(){return this.#V("delete")}#V(e){for(const t of this.#I({allowStale:!0})){const n=this.#u[t];if(this.#x(n))n.__abortController.abort(new Error("deleted"));else{const i=this.#h[t];this.#C&&this.#i?.(n,i,e),this.#S&&this.#y?.push([n,i,e])}}if(this.#c.clear(),this.#u.fill(void 0),this.#h.fill(void 0),this.#w&&this.#v&&(this.#w.fill(0),this.#v.fill(0)),this.#b&&this.#b.fill(0),this.#m=0,this.#f=0,this.#g.length=0,this.#l=0,this.#a=0,this.#S&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#r?.(...t)}}}function g(e){window.$monomerHover=e}var y=n(2003),b=n(6077),v=n(3561),w=n(9235);const C="MonomerHoverLinks";async function A(e,t,n,i,o,s=!1){const a=i.getSeqHandler(e),l=a.alphabet==y.YI.RNA||a.alphabet==y.YI.DNA,c=a.isHelm()&&l,h=!a.isHelm()&&l,u=e=>null==e?null:c?s?e:Math.floor(e/3):h&&s?3*e+1:e,d=s?await i.getHelmToMolfileConverter(n):null,p=new f({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(s){const e=a.getHelm(t);return i.helmToAtomicLevelSingle(e,d,!1,!1).monomers}{const e=a.getSplitted(t),i=a.defaultBiotype,s=r().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",h=(0,b.eM)([s],c,l,n,o);return(0,v.gU)(s,h,l,c).monomers}}(e,t)),l}const A={targetCol:t,handler:(t,i,r)=>{const o=r.grid,s=t.tableRowIndex,a=t.gridRow,l=o.cell(r.name,a),c=null!==(h=window.$monomerHover)&&void 0!==h?h:null;var h;if(!c||c&&(c.dataFrameId!=e.dataFrame.id||c.gridRowIdx!=a||c.seqColName!=e.name||c.seqPosition!=i?.position)){if(c&&(g(null),c.gridCell.render()),!i)return g(null),!0;g({gridCell:l,dataFrameId:e.dataFrame.id,gridRowIdx:a,seqColName:e.name,seqPosition:u(i?.position)??-1,getSubstruct:()=>{if(!i||"*"===i.symbol)return;const t=m(e,s);if(!t)return;const r=t.get(u(i?.position));return r?(0,w.H)([r],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 r=m(e,i);return r?(0,w.H)(r.values(),n):void 0}};return function(e,t){let n=e[C];n||(n=e[C]=[]),n.push(t),e[C]=n}(e.temp,A),function(e,t){let n=e["substruct-providers"];n||(n=e["substruct-providers"]=[]),n.push(t),e["substruct-providers"]=n}(t.temp,A),A}function S(e,t){try{const n=e.tableColumn;if(!n)return;const i=function(e){return e.temp[C]??[]}(n);for(let n=i.length-1;n>=0;--n){const r=i[n],o=e.grid.col(r.targetCol.name);if(o&&!r.handler(e,t,o))break}}catch(e){console.error(e)}}},6718:(e,t,n)=>{"use strict";n.d(t,{A7:()=>p,pj:()=>h,uL:()=>u,uX:()=>c});var i=n(6082),r=n(4328),o=n(6295),s=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(s.Ec).forEach((t=>{if("symbol"===t){const r=e.get(s.Ec[t],n);i[t]="."===r?e.get(s.yw,n):r}else if("rgroups"===t){const r=e.get(s.Ec[t],n).split("\n"),o=[];r.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}`,o.push(t)})),i[t]=o}else s.Ec[t]&&(i[t]=e.get(s.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 h(){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 u(e,t,n){e instanceof i.Column&&(e=(0,a.R)(e,n).columns.toList());const o=(await h()).getMonomerLib(),s=new Array(e.length),c=e[0].length,u=new Float32Array(c);for(let n=0;n<e.length;++n){const a=n<t.length?t.getCanonical(n):l._S,h=o.getMonomer("PEPTIDE",a)?.smiles??"",d=e[n],p=d.getRawData(),m=d.categories,f=m.indexOf("");if(s[n]={categories:m,data:p,emptyIndex:f},void 0===a)continue;const g=i.Column.fromStrings("smiles",m.map((e=>o.getMonomer("PEPTIDE",e)?.smiles??""))),y=(i.DataFrame.fromColumns([g]),await r.chem.getSimilarities(g,h)),b=y?y.getRawData():null;for(let e=0;e<c;++e){const t=p[e];a!==l._S&&t!==f?u[e]+=b[t]:a===l._S&&t===f&&(u[e]+=1)}}for(let n=0;n<u.length;++n){let r=u[n]/t.length;for(let o=0;o<e.length;++o){const e=s[o];if(o>=t.length&&e.data[n]!==e.emptyIndex||e.data[n]===e.emptyIndex&&o<t.length){r=i.FLOAT_NULL;break}}u[n]=r}return i.Column.fromFloat32Array("Similarity",u)}async function d(e){const t=(await h()).getMonomerLib(),n=[],o={},s=e.map((e=>t.getMonomer("PEPTIDE",e)?.smiles??"")),a=i.Column.fromStrings("smiles",s);for(let t=0;t<s.length;++t){o[e[t]]=t;const i=s[t],l=""===i?new Array(s.length).fill(0):(await r.chem.getSimilarities(a,i)).getRawData();l[t]=1,n[t]=Array.from(l)}return{scoringMatrix:n,alphabetIndexes:o}}async function p(e,t="Morgan"){const n=(await h()).getMonomerLib(),r=new Array(e.length).fill(0).map((()=>new Array(e.length).fill(0))),s={},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),u=(i.DataFrame.fromColumns([c]),(await l.apply({col:c,fingerprintType:t}))?.entries);if(!u)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<u.length;++t)if(r[t][t]=1,s[e[t]]=t,u[t])for(let e=t+1;e<u.length;++e)u[e]&&(r[t][e]=r[e][t]=(0,o.$1)(u[t],u[e]));return{scoringMatrix:r,alphabetIndexes:s}}},6197:(e,t,n)=>{"use strict";n.d(t,{Y:()=>r});var i=n(3599);function r(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),r=n(1991),o=n.n(r),s=n(330),a=n(3599);async function l(e,t,r,l,c,h,u){const d=e.length,p=e.dataFrame,m=Math.max(navigator.hardwareConcurrency-2,1),f=new Array(m).fill(null).map((()=>new Worker(new URL(n.p+n.u(455),n.b)))),g=d/m,y=new Array(m),b=h.getSeqHandler(e),v="RNA"==l?a.o.NUCLEOTIDE:a.o.AA,w=o().count(0).take(e.length).map((e=>{const t=b.getSplitted(e);return o().count(0).take(t.length).map((e=>({position:e,symbol:t.getCanonical(e),biotype:v}))).toArray()})).toArray();for(let e=0;e<m;e++){const n=f[e],i=Math.floor(e*g),o=e===m-1?d:Math.floor((e+1)*g);y[e]=new Promise((e=>{n.onmessage=t=>{e(t.data)}})),n.postMessage({seqList:w,monomersDict:t,alphabet:r,polymerType:l,start:i,end:o})}const C=[],A=[];await Promise.all(y).then((e=>{for(const t of e)C.push(...t.molfiles),A.push(...t.warnings)})),setTimeout((()=>{f.forEach((e=>{e.terminate()}))}),0);const S=(0,s.qj)(p,e.name),x=i.Column.fromType(i.COLUMN_TYPE.STRING,S,e.length).init((e=>C[e]?.molfile));return x.semType=i.SEMTYPE.MOLECULE,x.meta.units=i.UNITS.Molecule.MOLBLOCK,x.setTag(".sequence-src-col",e.name),{molCol:x,warnings:A}}function c(e,t){const n={},r={};for(const o of e){const e=t.getWebEditorMonomer(o.biotype,o.symbol).backgroundcolor,a=(0,s.vG)(e??i.Color.toRgb(i.Color.mouseOverRows))??[1,0,0,.7];for(const e of o.atoms)n[e]=a;for(const e of o.bonds)r[e]=a}return{atoms:Object.keys(n).map((e=>parseInt(e))),bonds:Object.keys(r).map((e=>parseInt(e))),highlightAtomColors:n,highlightBondColors:r}}},3561:(e,t,n)=>{"use strict";n.d(t,{Hb:()=>l,YN:()=>f,gU:()=>c});var i=n(8123),r=n(294),o=n(3151),s=n(439),a=n(6197);function l(e,t,n){const r=new Map;for(const a of e.getMonomerSymbolsByType(t)){const l=e.getMonomer(t,a);if("RNA"===t&&("Branch"===l.monomerType||n===s.YI.DNA&&l.symbol===i.u.DEOXYRIBOSE.symbol||n===s.YI.RNA&&l.symbol===i.u.RIBOSE.symbol||l.symbol===i.u.PHOSPHATE.symbol)||"PEPTIDE"===t&&"Branch"!==l.monomerType){const e={};o.f6.forEach((t=>{e[t]=l[t]})),r.set(l.symbol,e)}}return r}function c(e,t,n,o){if(0===e.length)return r.vF.createEmpty();const l=m,{atomCount:c,bondCount:u,needsCapping:p}=l(e,t,n,o),g=new Array(c),y=new Array(u);let b,v=null,w=null;"PEPTIDE"===o?b=h:(b=d,v=n===s.YI.DNA?(0,r.xb)(t,i.u.DEOXYRIBOSE):(0,r.xb)(t,i.u.RIBOSE),w=(0,r.xb)(t,i.u.PHOSPHATE));const C={i:0,nodeShift:0,bondShift:0,backbonePositionShift:new Array(2).fill(0),branchPositionShift:new Array(2).fill(0),backboneAttachNode:0,branchAttachNode:0,flipFactor:1},A={sugar:v,phosphate:w,seqLength:e.length,atomCount:c,bondCount:u},S=new r.Cg,x=[];let E=0;for(C.i=0;C.i<A.seqLength;++C.i){const n=e[C.i];if(n.symbol===s._S)continue;const i=(0,r.xb)(t,{symbol:n.symbol,polymerType:(0,a.Y)(n.biotype)}),o=C.nodeShift,l=C.bondShift;b(i,g,y,C,A),i.stereoAtoms?.forEach((e=>x.push(e+E))),E+=i.atoms.x.length;const c=C.nodeShift-o,h=new Array(c);for(let e=0;e<c;++e)h[e]=o+e;const u=C.bondShift-l,d=new Array(u);for(let e=0;e<u;++e)d[e]=l+e;S.set(C.i,{biotype:n.biotype,symbol:n.symbol,atoms:h,bonds:d})}p&&function(e,t,n,r){const o=n.nodeShift+1;e[r.atomCount]=i.u.V3K_BEGIN_DATA_LINE+o+" "+i.u.OXYGEN+" "+f(n.backbonePositionShift[0])+" "+n.flipFactor*f(n.backbonePositionShift[1])+" 0.000000 0\n";const s=n.backboneAttachNode,a=o;t[r.bondCount]=i.u.V3K_BEGIN_DATA_LINE+n.bondShift+" 1 "+s+" "+a+"\n"}(g,y,C,A);const _=i.u.V3K_BEGIN_COUNTS_LINE+c+" "+u+i.u.V3K_COUNTS_LINE_ENDING;let M="";return M+=i.u.V3K_HEADER_FIRST_LINE,M+=i.u.V3K_HEADER_SECOND_LINE,M+=i.u.V3K_BEGIN_CTAB_BLOCK,M+=_,M+=i.u.V3K_BEGIN_ATOM_BLOCK,M+=g.join(""),M+=i.u.V3K_END_ATOM_BLOCK,M+=i.u.V3K_BEGIN_BOND_BLOCK,M+=y.join(""),M+=i.u.V3K_END_BOND_BLOCK,x.length>0&&(M+=function(e){const t=[];let n=`M V30 MDLV30/STEABS ATOMS=(${e.length}`;for(let i=0;i<e.length;i++){const r=`${n} ${e[i]}`;r.length>76?(t.push(`${n} -\n`),n=`M V30 ${e[i]}`):n=r,i===e.length-1&&t.push(`${n})\n`)}return`M V30 BEGIN COLLECTION\n${t.join("")}M V30 END COLLECTION\n`}(x)),M+=i.u.V3K_END_CTAB_BLOCK,M+=i.u.V3K_END,{molfile:M,monomers:S}}function h(e,t,n,i){i.flipFactor=(-1)**(i.i%2),u(e,t,n,i)}function u(e,t,n,r){!function(e,t,n){for(let r=0;r<e.atoms.atomTypes.length;++r){const o=n.nodeShift+r+1;t[n.nodeShift+r]=i.u.V3K_BEGIN_DATA_LINE+o+" "+e.atoms.atomTypes[r]+" "+f(n.backbonePositionShift[0]+e.atoms.x[r])+" "+f(n.backbonePositionShift[1]+n.flipFactor*e.atoms.y[r])+" "+e.atoms.kwargs[r]}}(e,t,r),p(e,n,r),function(e,t,n){if(0!==n.backboneAttachNode){const r=n.bondShift,o=n.backboneAttachNode,s=e.meta.terminalNodes[0]+n.nodeShift;t[n.bondShift-1]=i.u.V3K_BEGIN_DATA_LINE+r+" 1 "+o+" "+s+"\n"}}(e,n,r),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,r),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,r)}function d(e,t,n,r,o){if(0===r.i)u(o.sugar,t,n,r);else for(const e of[o.phosphate,o.sugar])u(e,t,n,r);!function(e,t,n,r){(function(e,t,n){for(let r=0;r<e.atoms.atomTypes.length;++r){const o=n.nodeShift+r+1;t[n.nodeShift+r]=i.u.V3K_BEGIN_DATA_LINE+o+" "+e.atoms.atomTypes[r]+" "+f(n.branchPositionShift[0]+e.atoms.x[r])+" "+f(n.branchPositionShift[1]+n.flipFactor*e.atoms.y[r])+" "+e.atoms.kwargs[r]}})(e,t,r),p(e,n,r),function(e,t,n){const r=n.bondShift,o=n.branchAttachNode,s=e.meta.terminalNodes[0]+n.nodeShift;t[r-1]=i.u.V3K_BEGIN_DATA_LINE+r+" 1 "+o+" "+s+"\n"}(e,n,r);const o=r.bondShift,s=r.branchAttachNode,a=e.meta.terminalNodes[0]+r.nodeShift;n[o-1]=i.u.V3K_BEGIN_DATA_LINE+o+" 1 "+s+" "+a+"\n",r.bondShift+=e.bonds.atomPairs.length+1,r.nodeShift+=e.atoms.atomTypes.length}(e,t,n,r)}function p(e,t,n){for(let r=0;r<e.bonds.atomPairs.length;++r){const o=n.bondShift+r+1,s=e.bonds.atomPairs[r][0]+n.nodeShift,a=e.bonds.atomPairs[r][1]+n.nodeShift;let l="";if(e.bonds.bondConfiguration.has(r)){let t=e.bonds.bondConfiguration.get(r);n.flipFactor<0&&(t=1===t?3:1),l=" CFG="+t}const c=e.bonds.kwargs.has(r)?" "+e.bonds.kwargs.get(r):"";t[n.bondShift+r]=i.u.V3K_BEGIN_DATA_LINE+o+" "+e.bonds.bondTypes[r]+" "+s+" "+a+l+c+"\n"}}function m(e,t,n,o){let l=0,c=0,h=0,u=!0,d=null;for(const n of e)if(n.symbol!==s._S){if("*"==n.symbol)throw new Error("Gap canonical symbol is '', not '*");d=(0,r.xb)(t,{symbol:n.symbol,polymerType:(0,a.Y)(n.biotype)}),l+=d.atoms.x.length,c+=d.bonds.bondTypes.length,h++}if("PEPTIDE"===o)l+=1,c+=h,h>0&&(d?.meta?.rNodes?.length??0)<2&&(u=!1,l-=1,c-=1);else{const o=n===s.YI.DNA?(0,r.xb)(t,i.u.DEOXYRIBOSE):(0,r.xb)(t,i.u.RIBOSE),a=(0,r.xb)(t,i.u.PHOSPHATE);l+=(e.length-1)*a.atoms.x.length,l+=e.length*o.atoms.x.length,l+=1,c+=(e.length-1)*a.bonds.bondTypes.length,c+=e.length*o.bonds.bondTypes.length,c-=1,c+=3*e.length}return{atomCount:l,bondCount:c,needsCapping:u}}function f(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:()=>f});var i=n(4328),r=n(6082),o=n(1991),s=n.n(o),a=n(439),l=n(3561),c=n(9235),h=n(294),u=n(9192),d=n(330),p=n(8123);async function m(e,t,n,o,l){if(t.semType!==r.SEMTYPE.MACROMOLECULE)return{molCol:null,warnings:[`Only the ${r.SEMTYPE.MACROMOLECULE} columns can be converted to atomic level, the chosen column has semType '${t.semType}'`]};let h=t;const p=o.getSeqHandler(t);let m,g;p.notation!==a.Hi.SEPARATOR&&(h=p.convert(a.Hi.SEPARATOR,"."),h.name=t.name);try{g=o.getSeqHandler(h).alphabet,m=(0,d.pz)(g)}catch(e){const[t,n]=(0,u.AP)(e);return{molCol:null,warnings:[t]}}const y=function(e,t){const n=e.length,r=new Array(n),o=t.getSeqHandler(e);let a=!1;const l=o.defaultBiotype;for(let e=0;e<n;++e){const t=o.getSplitted(e);a||(a=0===t.length),r[e]=s().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`),r}(h,o),b=f(y,m,g,n,l),v=h.length,w=await(0,c.R)(h,b,g,m,n,o,l);return w.warnings.length>.05*v&&i.shell.warning(`Molfile conversion resulted in ${w.warnings.length} errors`),w}function f(e,t,n,i,r){const o=(0,l.Hb)(i,t,n),s={},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)g(s,n.symbol,o,r,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];g(s,e,o,r,t,c),s[t]?.[e]&&(s[t][n]=s[t][e])}else g(s,n,o,r,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 s}function g(e,t,n,i,r,o){const s={polymerType:r,symbol:t};if(!(0,h.bq)(e,s)){const a=function(e,t,n,i,r){if(t.has(e)){const s=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}(s.rgroups),c=(o=s.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}(o):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 r=parseInt(e.substring(n,i).replace(/^A\s+/,""));n=e.indexOf("R",i),i=e.indexOf("\n",n);const o=parseInt(e.substring(n,i).replace(/^R/,""));t.set(r,o),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 r=e.substring(n,i).replaceAll(/\s+/g," ").split(" ").map((e=>parseInt(e))).slice(1);for(let e=0;e<r.length;e+=2){if(t.has(r[e])&&t.get(r[e])!==r[e+1])throw new Error(`r-group index ${r[e]} has already been added with a different value`);t.set(r[e],r[e+1])}n=e.indexOf(p.u.V2K_RGP_LINE,i)}return t}(o),h=s.molfile.includes("V3000")?s.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,r=e.split("");for(let e=i+5;e<r.length;e++)" "!==r[e]&&(r[e]="0");return r.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)}(s.molfile),n),u=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))}}(h),d=function(e,t){const n=new Array(t),i=new Float32Array(t),r=new Float32Array(t),o=new Array(t);let s=e.indexOf(p.u.V3K_BEGIN_ATOM_BLOCK);s=e.indexOf("\n",s);let a=s;for(let l=0;l<t;l++){s=e.indexOf(p.u.V3K_BEGIN_DATA_LINE,s)+p.u.V3K_IDX_SHIFT,a=e.indexOf(" ",s),s=a+1,a=e.indexOf(" ",s),n[l]=e.substring(s,a);const t=new Array(2);for(let n=0;n<2;++n)s=a+1,a=e.indexOf(" ",s),t[n]=parseFloat(e.substring(s,a));i[l]=t[0],r[l]=t[1],s=a,a=e.indexOf("\n",s)+1,o[l]=e.slice(s,a),s=a}return{atomTypes:n,x:i,y:r,kwargs:o}}(h,u.atomCount),m=function(e,t){const n=new Uint32Array(t),i=new Array(t),r=new Map,o=new Map;let s=e.indexOf(p.u.V3K_BEGIN_BOND_BLOCK);s=e.indexOf("\n",s);let a=s;for(let l=0;l<t;++l){const t=new Array(3);s=e.indexOf(p.u.V3K_BEGIN_DATA_LINE,a)+p.u.V3K_IDX_SHIFT,a=e.indexOf(" ",s);for(let n=0;n<3;++n)s=a+1,a=Math.min(e.indexOf("\n",s),e.indexOf(" ",s)),t[n]=parseInt(e.slice(s,a));n[l]=t[0],i[l]=t.slice(1);const c=e.indexOf("\n",s);let h=e.slice(a,c),u=h.indexOf(p.u.V3K_BOND_CONFIG);if(-1!==u){u=h.indexOf("=",u)+1;let e=h.indexOf(" ",u);-1===e&&(e=h.length);const t=parseInt(h.slice(u,e));r.set(l,t);const n=p.u.V3K_BOND_CONFIG+t.toString();h=h.replace(n,"")}h||o.set(l,h)}return{bondTypes:n,atomPairs:i,bondConfiguration:r,kwargs:o}}(h,u.bondCount),f=function(e,t,n,i){const r={backboneShift:null,branchShift:null,terminalNodes:[],rNodes:[]};return function(e,t,n){for(const[i,r]of n)e.atomTypes[i-1]=t[r-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,r),y(t,r),r}(d,m,a,c),g=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}(h),v={atoms:d,bonds:m,meta:f,stereoAtoms:g};return"PEPTIDE"===i?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,i=e.atoms.x,r=e.atoms.y;_(e,-i[t],-r[t]);const o=A(i[n],r[n]);S(e.atoms,-o),i[e.meta.rNodes[1]-1]<0&&x(e);const s=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],r=n[(e+1)%2];t.has(i)?t.get(i)?.push(r):t.set(i,new Array(1).fill(r))}return t}(e);let n=0;const i=e.atoms.atomTypes.length;let r=0;if(e.meta.terminalNodes.length<2)return null;for(;0===n;){const o=t.get(e.meta.terminalNodes[1])[r];if(e.atoms.atomTypes[o-1]===p.u.OXYGEN&&o!==e.meta.rNodes[1]&&(n=o),r++,r>i)return null}return n}(e);null!=s&&(function(e,t){e.atoms.y[e.meta.rNodes[1]-1]<0&&e.atoms.y[t-1]<0&&(function(e){E(e,!0)}(e),S(e.atoms,-function(e,t){return A(e,t)+Math.PI/2}(e.atoms.x[e.meta.terminalNodes[1]-1],e.atoms.y[e.meta.terminalNodes[1]-1])))}(e,s),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,r=n-1,o=e.atoms.x,s=e.atoms.y,a=o[i],l=s[i];o[i]=o[r],s[i]=s[r],o[r]=a,s[r]=l}(e,t,e.meta.rNodes[1])}(e,s))}(v):e===p.u.RIBOSE.symbol||e===p.u.DEOXYRIBOSE.symbol?function(e,t){const n=e.atoms.x,i=e.atoms.y;let r=e.meta.terminalNodes[0]-1;const o=e.meta.rNodes[1]-1;_(e,-n[r],-i[r]);const s=A(n[e.meta.rNodes[2]-1],i[e.meta.rNodes[2]-1]);S(e.atoms,-s),n[e.meta.rNodes[0]-1]>n[e.meta.rNodes[1]-1]&&x(e);const a=A(n[o],i[o]);S(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,r=e.meta.terminalNodes[2]-1,o=t[i]-t[r],s=n[i]-n[r];return Math.atan2(o,s)}(e),r=e.meta.terminalNodes[0]-1,_(e,-n[r],-i[r])}(v,r):e===p.u.PHOSPHATE.symbol?function(e){const t=e.meta.rNodes[1]-1,n=e.meta.rNodes[0]-1,i=e.atoms.x,r=e.atoms.y;_(e,-i[t],-r[t]);const o=A(i[n],r[n]);S(e.atoms,Math.PI/2-o)}(v):function(e,t){const n=e.atoms.x,i=e.atoms.y,r=e.meta.terminalNodes[0]-1,o=e.meta.rNodes[0]-1;_(e,-n[r],-i[r]);const s=A(n[o],i[o]),a=t.value;if(!a)throw new Error("The value of sugarBranchToOYAngle is null");S(e.atoms,Math.PI-s+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)}(v,r),function(e,t,n){"PEPTIDE"===e?(b(t,e),w(t,t.meta.rNodes[1])):n===p.u.RIBOSE.symbol||n===p.u.DEOXYRIBOSE.symbol?(w(t,t.meta.rNodes[1]),t.meta.rNodes[1]=t.meta.terminalNodes[1],y(t.bonds,t.meta),b(t,e),w(t,t.meta.rNodes[1]),w(t,t.meta.rNodes[0]),w(t,t.meta.rNodes[2])):n===p.u.PHOSPHATE.symbol&&(t.meta.terminalNodes[0]=t.meta.rNodes[0],_(t,-t.atoms.x[t.meta.terminalNodes[0]-1],-t.atoms.y[t.meta.terminalNodes[0]-1]),b(t,e),w(t,t.meta.rNodes[1]))}(i,v,e),function(e){let t=0;for(;t<e.atoms.atomTypes.length;)e.atoms.atomTypes[t]===p.u.HYDROGEN&&(w(e,t+1),--t),++t}(v),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}(v),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,""))}}(v),v}var o;return null}(t,n,i,r,o);if(!a)throw new Error(`Monomer with symbol '${t}' is absent the monomer library`);(0,h.LQ)(e,s,a)}}function y(e,t){const n=t.rNodes;t.terminalNodes=new Array(n.length).fill(0);const i=t.terminalNodes,r=e.atomPairs;let o=0,s=0;for(;o<r.length&&s<i.length;){for(let e=0;e<i.length;++e)for(let t=0;t<2;++t)r[o][t]===n[e]&&(i[e]=r[o][(t+1)%2],n.length,++s);++o}}function b(e,t){e.meta.rNodes.length>1&&(e.meta.backboneShift=v(e,e.meta.rNodes[1]-1,e.meta.terminalNodes[0]-1)),"RNA"===t&&e.meta.rNodes.length>2&&(e.meta.branchShift=v(e,e.meta.rNodes[2]-1,e.meta.terminalNodes[0]-1))}function v(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 w(e,t){if(void 0!==t){const n=t-1,i=e.atoms,r=e.bonds,o=e.meta;i.atomTypes.splice(n,1),i.x=C(Float32Array,i.x,n,1),i.y=C(Float32Array,i.y,n,1),i.kwargs.splice(n,1);for(let e=0;e<o.terminalNodes.length;++e)o.terminalNodes[e]>t?--o.terminalNodes[e]:o.terminalNodes[e]===t&&(o.terminalNodes[e]=-1);for(let e=0;e<o.rNodes.length;++e)o.rNodes[e]>t?--o.rNodes[e]:o.rNodes[e]===t&&(o.rNodes[e]=-1);let s=0;for(;s<r.atomPairs.length;){const e=r.atomPairs[s][0],n=r.atomPairs[s][1];e===t||n===t?(r.atomPairs.splice(s,1),r.bondTypes=C(Uint32Array,r.bondTypes,s,1),r.bondConfiguration.has(s)&&r.bondConfiguration.delete(s),r.kwargs.has(s)&&r.kwargs.delete(s),--s):(r.atomPairs[s][0]=e>t?e-1:e,r.atomPairs[s][1]=n>t?n-1:n),++s}let a=Array.from(r.bondConfiguration.keys());a.forEach((e=>{if(r.bondConfiguration.has(e)&&e>n){const t=r.bondConfiguration.get(e);r.bondConfiguration.delete(e),r.bondConfiguration.set(e-1,t)}})),a=Array.from(r.kwargs.keys()),a.forEach((e=>{if(r.kwargs.has(e)&&e>n){const t=r.kwargs.get(e);r.kwargs.delete(e),r.kwargs.set(e-1,t)}}))}}function C(e,t,n,i){const r=new e(t.length-i);let o=0,s=0;for(;o<t.length;)o===n&&(o+=i),r[s]=t[o],++s,++o;return r}function A(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,r=Math.atan(i);n=e<0?Math.PI/2+r:-Math.PI/2+r}return n}function S(e,t){if(0!==t){const n=e.x,i=e.y,r=Math.cos(t),o=Math.sin(t);for(let e=0;e<n.length;++e){const t=n[e];n[e]=(0,l.YN)(t*r-i[e]*o),i[e]=(0,l.YN)(t*o+i[e]*r)}}}function x(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 _(e,t,n){const i=e.atoms.x,r=e.atoms.y;for(let e=0;e<i.length;++e)i[e]=(0,l.YN)(i[e]+t),void 0!==n&&(r[e]=(0,l.YN)(r[e]+n))}},294:(e,t,n)=>{"use strict";function i(e,t){return e[t.polymerType]?.[t.symbol]}function r(e,t){return!!e[t.polymerType]?.[t.symbol]}function o(e,t,n){let i=e[t.polymerType];i||(i=e[t.polymerType]={}),i[t.symbol]=n}n.d(t,{Cg:()=>s,LQ:()=>o,bq:()=>r,vF:()=>a,xb:()=>i});class s extends Map{constructor(e){super(e)}}class a{constructor(e,t){this.molfile=e,this.monomers=t}static createEmpty(){return new a("",new s(null))}}},330:(e,t,n)=>{"use strict";n.d(t,{kA:()=>r,pz:()=>s,qj:()=>o,vG:()=>a});var i=n(2003);function r(e,t){return e?e.columns.getUnusedName(t):t}function o(e,t){return r(e,`molfile(${t})`)}function s(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(7362);class i{}i.SemType="Nucleotides",i.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",i.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 r={};return e.forEach((e=>{const n=e[0],i=e[1];n.forEach(((e,n)=>{r[e]=this.colourPalette[i][t?0:n]}))})),new n(r)}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:()=>o,n:()=>r});var i=n(1858);class r{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 o{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";var i=n(6082),r=n(7362),o=n(6718);function s(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),r=i.Color.b(n),o=Math.sqrt(Math.pow(0-t,2)+Math.pow(0-e,2)+Math.pow(0-r,2));if(o>210)return`rgb(${t/o*210},${e/o*210},${r/o*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{static get palette(){return c._pallete||(c._pallete=c.buildPalette()),c._pallete}static buildPalette(){return(0,o.pj)().then((e=>{e.awaitLoaded(1/0).then((()=>{const t=e.getMonomerLib();t.onChanged.subscribe((()=>{c.customMonomerColors={},c.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]=s(n.meta.colors.default.background))}}}))}))})),[].concat(...Object.values(r.e.colourPalette))}get(e,t){const n=c.palette.length,i=c.customMonomerColors[e],r=t??"PEPTIDE";if(i&&i[r])return i[r];const o=a.hashCode(e)%n;return s(c.palette[o])}}c._pallete=null,c.customMonomerColors={},c.polymerTypes=[]},6642:(e,t,n)=>{"use strict";n.d(t,{BG:()=>s,sD:()=>l});var i=n(4328),r=n(1858),o=n(8070);function s(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 r.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,o.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,{Jy:()=>y,S$:()=>g,U0:()=>b});var i=n(7389),r=n(6082),o=n(1991),s=n.n(o),a=n(8312),l=n(2003),c=n(6642),h=n(6718),u=n(9192),d=n(3856),p=n(673),m=n(3599),f=n(5553);const g="rgb(100,100,100)";class y extends c.sD{get separatorWidth(){return this.props?.fontCharWidth?this.props?.fontCharWidth:5}constructor(e,t,n,i,o){super(e,t,n),this.monomerLengthLimit=i,this.propsProvider=o,this.colWidth=0,this._monomerLengthList=null,this._processedMaxVisibleSeqLength=0,this._monomerLengthMap={},this._monomerStructureMap={},this.sysMonomerLib=null,this.padding=5,this.props=this.propsProvider(),this._processedRows=r.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((()=>{const e=this.tableCol.dataFrame;this.gridCol.grid,-1===e.currentRowIdx&&(this.tableCol.temp["reference-sequence"]=null,this.tableCol.temp["current-word"]=null,this.invalidateGrid())})))}async init(){await Promise.all([(async()=>{this.seqHelper=await(0,a.Q)(),this.invalidateGrid()})(),(async()=>{const e=await(0,h.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=r.BitSet.create(this.tableCol.length),this._monomerLengthList=null,this._monomerLengthMap={},this._monomerStructureMap={},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,u.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]=5;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}getCellMonomerLengthsForSeq(e){this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(this.tableCol.length).fill(null));const t=this.seqHelper.getSeqHandler(this.tableCol),n=this.props.separatorWidth+1*this.props.fontCharWidth,i=Math.ceil(this.colWidth/n),r=t.getSplitted(e),o=Math.min(i,r.length);let s=this._monomerLengthList[e];if(null===s||s.length<o){s=this._monomerLengthList[e]=new Array(r.length);let n=0;for(let e=0;e<o;++e){const i=r.getOriginal(e),o=this.props.monomerToShort(i,this.monomerLengthLimit),a=(t.isSeparator()?this.separatorWidth:this.props.separatorWidth)+o.length*this.props.fontCharWidth;if(s[e]=a,n+=a,n>this.colWidth)break}}return s}getCellMonomerLengthsForSeqValue(e,t){const n=this.seqHelper.getSeqHandler(this.tableCol),i=this.props.separatorWidth+1*this.props.fontCharWidth,r=Math.ceil(t/i),o=n.splitter(e),s=Math.min(r,o.length),a=new Array(s);let l=0;for(let e=0;e<s;++e){const i=o.getOriginal(e),r=this.props.monomerToShort(i,this.monomerLengthLimit),s=(n.isSeparator()?this.separatorWidth:this.props.separatorWidth)+r.length*this.props.fontCharWidth;if(a[e]=s,l+=s,l>t)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)}}})(),r=this.props.separatorWidth+1*this.props.fontCharWidth,o=Math.ceil(this.colWidth/r);for(let e=n;e<i;e++){if(this._processedRows.get(e)&&o<=this._processedMaxVisibleSeqLength)continue;const n=this.seqHelper.getSeqHandler(this.tableCol).getSplitted(e,o),i=Math.min(o,n.length);i>t.length&&t.push(...new Array(i-t.length).fill(r));let s=0;for(let e=0;e<i;++e){const i=n.getOriginal(e),r=this.props.monomerToShort(i,this.monomerLengthLimit),o=this.props.separatorWidth+r.length*this.props.fontCharWidth;if(t[e]=Math.max(t[e]??0,o),s+=o,s>=this.colWidth)break}this._processedMaxVisibleSeqLength=Math.max(this._processedMaxVisibleSeqLength,o)}return t}getPosition(e,t,n){const[i,r]=this.getCellMonomerLengths(e,n);return 0===this.seqHelper.getSeqHandler(this.tableCol).getSplitted(e).length?null:function(e,t){let n,i=100,r=0,o=e.length-1;for(;r<=o;){if(n=Math.floor((o+r)/2),e[n]<=t&&t<e[n+1])return n;if(t<e[n]?o=n-1:r=n+1,--i<=0)throw new Error(`Get position for pointer x = ${t} searching has not converged on ${JSON.stringify(e)}. `)}return null}(r,t)}setMonomerLengthLimit(e){this.monomerLengthLimit!=e&&(this.monomerLengthLimit=e,this.dirty=!0)}setSeparatorWidth(e){this.separatorWidth!=e&&(this.props.separatorWidth=e,this.dirty=!0)}render(e,t,n,i,r,o,a){const c=o.grid?.canvas===e.canvas;if(!this.seqHelper)return;const h=this.gridCol,m=this.tableCol,f=window.devicePixelRatio,y=`${this.toLog()}.render()`;this.logger.debug(`${y}, start`);let v=this.monomerLengthLimit;if(d.gp.maxMonomerLength in m.tags){const e=parseInt(m.getTag(d.gp.maxMonomerLength));v=!isNaN(e)&&e?e:50}if(".mm.cellRenderer.maxMonomerLength"in m.temp){const e=m.temp[".mm.cellRenderer.maxMonomerLength"];v=!isNaN(e)&&e?e:50}e.save();try{const a=this.seqHelper.getSeqHandler(m);if(m.temp[".mm.cellRenderer.settingsChanged"]===p.s.true||this.monomerLengthLimit!=v){let e=0;const t=8;e=m.temp[".mm.cellRenderer.gapLength"]??e,this.setMonomerLengthLimit(v),this.setSeparatorWidth(a.isMsa()?t:e),m.temp[".mm.cellRenderer.settingsChanged"]=p.s.false}let[u,y]=this.getCellMonomerLengths(o.tableRowIndex,i);u.length;const w=o.cell.value,C=o.cell.rowIndex,A=(m.getTag(l.gp.alphabet),50);c&&(i=b(h?.grid,e,t,i,f)),e.beginPath(),e.rect(t+this.padding,n+this.padding,i-this.padding-1,r-2*this.padding),e.clip(),e.font=this.props?.font??"12px monospace",e.textBaseline="top";const S=m.meta.units,x=m.getTag(l.gp.aligned),E=m.getTag(l.gp.separator)??"",_=this.props.separatorWidth+1*this.props.fontCharWidth,M=Math.ceil(i/_),I=m.temp["reference-sequence"],T=this.tableCol.temp["current-word"];T&&-1===m?.dataFrame?.currentRowIdx&&(this.tableCol.temp["current-word"]=null);const L=(()=>{const e=a.getSplitter(M)(null!=I&&""!=I?I:T??"");return s().count(0).take(e.length).map((t=>e.getOriginal(t))).toArray()})(),N=c?a.getSplitted(C):a.splitter(w);c||(y=this.getSummedMonomerLengths(this.getCellMonomerLengthsForSeqValue(w,i)));let $=d.yg.classic;x&&x.includes("MSA")&&S==l.Hi.SEPARATOR&&($=d.yg.MSA);const P=Math.min(N.length,M);for(let s=0;s<P;++s){const l=N.getOriginal(s),c=N.getCanonical(s);let h=g;const u=this.getMonomerLib();if(u){const e=a.defaultBiotype;h=u.getMonomerTextColor(e,c)}e.fillStyle=g;const p={color:h,pivot:0,left:!0,transparencyRate:1,separator:E,last:s===N.length-1,drawStyle:$,maxWord:y,wordIdx:s,gridCell:o,referenceSequence:L,maxLengthOfMonomer:v,monomerTextSizeMap:this._monomerLengthMap,logger:this.logger};if((0,d.oZ)(e,l,t+this.padding,n,i,r,p),A>i)break}}catch(e){const[t,n]=(0,u.AP)(e);this.logger.error(t,void 0,n),this.errors.push(e)}finally{e.restore()}}onMouseMove(e,t){const n=`${this.toLog()}.onMouseMove()`;if(!this.seqHelper||null==e.tableRowIndex)return;const r=e.bounds,o=t.offsetX-e.gridColumn.left+(e.gridColumn.left-r.x),s=this.getPosition(e.tableRowIndex,o,r.width);this.logger.debug(`${n}, start, argsX: ${o}, left: ${s}`);const a=this.seqHelper.getSeqHandler(this.tableCol),c=a.getSplitted(e.tableRowIndex);if(null!==s&&s<c.length){const n=a.alphabet??l.YI.UN,r={position:s,biotype:n===l.YI.RNA||n===l.YI.DNA?m.o.NUCLEOTIDE:m.o.AA,symbol:c.getCanonical(s)},o=[];let h=this._monomerStructureMap[r.symbol];{const e=this.getMonomerLib();h=this._monomerStructureMap[r.symbol]=e?e.getTooltip(r.biotype,r.symbol):i.divText("Monomer library is not available")}o.push(h),i.tooltip.show(i.divV(o),t.x+16,t.y+16),(0,f.WN)(e,r)}else i.tooltip.hide(),(0,f.WN)(e,null)}}function b(e,t,n,i,r){return e?Math.max(Math.min(e.canvas.width/r-n,i)):Math.max(t.canvas.width/r-n,0)}},3856:(e,t,n)=>{"use strict";n.d(t,{Mn:()=>l,gp:()=>a,oZ:()=>u,yg:()=>c});var i=n(7278);const r="#808080",o="rgb(0,0,0)",s=i.zS;var a,l,c;!function(e){e.maxMonomerLength=".mm.cellRenderer.maxMonomerLength"}(a||(a={})),function(e){e.applyToBackground=".m.cellRenderer.applyToBackground"}(l||(l={})),function(e){e.MSA="MSA",e.classic="classic"}(c||(c={}));const h=new class{constructor(){this.color="rgb(100,100,100)",this.pivot=0,this.left=!1,this.transparencyRate=1,this.separator="",this.last=!1,this.drawStyle=c.classic,this.maxWord=[],this.wordIdx=0,this.gridCell=null,this.referenceSequence=null,this.maxLengthOfMonomer=null,this.monomerTextSizeMap={},this.logger=void 0}};function u(e,t,n,i,a,l,u){var d,p,m;const f=Object.assign(Object.assign({},h),u);u.logger?.debug("Bio: printLeftOrCentered(), start"),e.textAlign="start";let g=t.substring(0),y=f.last?"":f.separator;f.drawStyle===c.MSA&&(y="");let b=!0,v=!0,w="difference";if(null!=f.gridCell&&null!=f.gridCell.cell.column&&(b=f.gridCell.cell.column.temp["color-code"]??!0,v=f.gridCell.cell.column.temp["compare-with-current"]??!0,w=f.gridCell.cell.column.temp["highlight-difference"]??"difference"),f.referenceSequence){const e=f.referenceSequence[f.wordIdx];v&&f.referenceSequence.length>0&&"difference"===w&&(f.transparencyRate=g==e?.3:f.transparencyRate),v&&f.referenceSequence.length>0&&"equal"===w&&(f.transparencyRate=g!=e?.3:f.transparencyRate)}null!=f.maxLengthOfMonomer&&(g=s(g,f.maxLengthOfMonomer));const C=g+y;(d=f.monomerTextSizeMap)[C]??(d[C]=e.measureText(C));let A=f.monomerTextSizeMap[C];(p=f.monomerTextSizeMap)[g]??(p[g]=e.measureText(g));let S=f.monomerTextSizeMap[g].width;const x=l/2-(A.fontBoundingBoxAscent+A.fontBoundingBoxDescent)/2+1;(m=f.monomerTextSizeMap)[y]??(m[y]=e.measureText(y));const E=f.monomerTextSizeMap[y].width;function _(t,s){const a=b?f.color:o;e.fillStyle=a,e.globalAlpha=f.transparencyRate,f.drawStyle===c.classic&&(e.fillText(g,n+t,i+x),e.fillStyle=r,e.fillText(y,n+s,i+x)),f.drawStyle===c.MSA&&e.fillText(g,n+t,i+x)}A=A.width,f.drawStyle===c.MSA&&(S=f.maxWord[f.wordIdx],A=f.maxWord[f.wordIdx]);const M=(f.maxWord[f.wordIdx]??0)-(f.maxWord[0]??0);if(f.left||A>a)return _(M,M+S),n+M+S+E;{const e=(a-A)/2;return _(e,e+S),n+M+e+S}}},3151:(e,t,n)=>{"use strict";n.d(t,{EK:()=>l,Ec:()=>o,f6:()=>i,pe:()=>s,q7:()=>a,yw:()=>r});const i=["symbol","molfile","rgroups","name"],r="MonomerName",o={monomerType:null,smiles:null,name:"Name",author:null,molfile:"molecule",naturalAnalog:"MonomerNaturalAnalogCode",rgroups:"MonomerCaps",createDate:null,id:null,polymerType:"MonomerType",symbol:"MonomerName"},s={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 r(e){return e instanceof Error?e.stack:"StateError"===e.constructor.name&&"$thrownJsError"in e?r(e.$thrownJsError):void 0}function o(e){return[i(e),r(e)]}n.d(t,{AP:()=>o})},3516:(e,t,n)=>{"use strict";n.d(t,{m:()=>o});var i=n(6082),r=n(439);class o{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=r.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:()=>c});var i=n(6082),r=n(1991),o=n.n(r),s=n(2003),a=n(7278),l=n(439);function c(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=s.Hi.SEPARATOR,n.setTag(s.gp.separator,"/"),n.setTag(s.gp.alphabet,s.YI.UN),n.setTag(s.gp.alphabetIsMultichar,"true");const r=[];return r.push(n),r.push(i.Column.fromList(i.COLUMN_TYPE.FLOAT,"Activity",new Array(100).fill(7.30751))),r}function h(e,t=s.Hi.SEPARATOR,n=s.YI.PT,r=(t===s.Hi.SEPARATOR?"-":void 0),c=void 0,h="seq",u=100,d=10**6){const p=n===s.YI.UN?c?.getMonomerSymbolsByType("PEPTIDE")??[]:Array.from((0,s.Qf)(n)),m=p.length,f=i.Column.fromType(i.COLUMN_TYPE.STRING,h,u);f.semType=i.SEMTYPE.MACROMOLECULE,f.meta.units=t,f.setTag(s.gp.alphabet,n),t==s.Hi.SEPARATOR&&f.setTag(s.gp.separator,r);const g=e.getSeqHandler(f);for(let e=0;e<u;e++){const n=o().count(0).take(d).map((e=>p[Math.floor(Math.random()*m)])).toArray(),i=g.joiner(new a.Mu(n,l.b9[t]));f.set(e,i)}return f}},439:(e,t,n)=>{"use strict";n.d(t,{B5:()=>l,Hi:()=>i,Vl:()=>c,YI:()=>r,_S:()=>u,b9:()=>d,gp:()=>o,q7:()=>h,z1:()=>a});var i,r,o,s=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"}(r||(r={})),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"}(o||(o={}));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"])}}},h=[new s.a(r.PT,c.fasta.peptide,.5),new s.a(r.DNA,c.fasta.dna,.55),new s.a(r.RNA,c.fasta.rna,.55)],u="",d={[i.FASTA]:"-",[i.SEPARATOR]:"",[i.HELM]:"*"}},2003:(e,t,n)=>{"use strict";n.d(t,{Hi:()=>i.Hi,J9:()=>r.J9,Qf:()=>r.Qf,YI:()=>i.YI,dh:()=>r.dh,gp:()=>i.gp,mn:()=>r.mn,q7:()=>i.q7,qp:()=>r.qp,z1:()=>i.z1,zS:()=>r.zS});var i=n(439),r=n(7278)},2738:(e,t,n)=>{"use strict";n.d(t,{X:()=>r,a:()=>i});class i{constructor(e,t,n){this.name=e,this.alphabet=t,this.cutoff=n}}class r 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:()=>y,J9:()=>p,Mu:()=>u,Qf:()=>w,dh:()=>f,mn:()=>S,p0:()=>A,pc:()=>C,qp:()=>g,tm:()=>m,zS:()=>v});var i=n(6082),r=n(1991),o=n.n(r),s=n(3527),a=n(3629),l=n(2738),c=n(439),h=(n(8924),n(1093),n(4152),n(8438));class u{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]}constructor(e,t){this.mList=e,this.gapOriginalMonomer=t}}class d{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]}constructor(e){this.seqS=e}}const p=e=>{const t=o()(e.toString().matchAll(c.B5)).map((e=>e[2]??e[1])).toArray();return new u(t,c.b9[c.Hi.FASTA])},m=e=>e?new d(e):new u([],c.b9[c.Hi.FASTA]);function f(e,t=void 0){return n=>{if(n){let i;const r=new RegExp(`(?<=^|\\${e})("-"|'-'|[^\\${e}]*)(?=\\${e}|$)`,"g");return void 0!==t?(r.lastIndex=0,i=o()(n.matchAll(r)).take(t).map((e=>e[0])).toArray()):i=n.replaceAll('"-"',"").replaceAll("'-'","").split(e,t),new u(i,c.b9[c.Hi.SEPARATOR])}return new u([],c.b9[c.Hi.SEPARATOR])}}const g=e=>{const t=e.split("$")[0].split("|"),n=o()(t.map((e=>(e.match(/(?<=\{).+(?=})/)?.[0]?.split(".")??[]).map((e=>(0,h.D)(e)))))).flatten().toArray();return new u(n,c.b9[c.Hi.HELM])};function y(e,t,n=void 0){if(e.toLowerCase().startsWith(c.Hi.FASTA))return p;if(e.toLowerCase().startsWith(c.Hi.SEPARATOR))return f(t,n);if(e.toLowerCase().startsWith(c.Hi.HELM))return g;throw new Error(`Unexpected units ${e} .`)}const b=/([^\W_]+)/g;function v(e,t){if(e.length<=t)return e;const n=e.match(b),i=e.length>t||(n?.length??0)>1,r=n?.[0]??" ";return i?r.substring(0,t-1)+"…":r}function w(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 C(e,t,n="-"){const i=t.map((t=>{const i=function(e,t,n="-"){const i=new Set([...new Set(Object.keys(e)),...t]);i.delete(n);const r=[],o=[];for(const n of i)r.push(n in e?e[n]:0),o.push(t.has(n)?1:0);const l=new s.Mi(r),c=new s.Mi(o);return(0,a.KE)(l,c)/((0,a.wQ)(l)*(0,a.wQ)(c))}(e,t.alphabet,n);return new l.X(t,e,i)}));let r;const o=Math.max(...i.map((e=>e.similarity>e.cutoff?e.similarity:-1)));return r=o>0?i.find((e=>e.similarity===o)).name:c.YI.UN,r}function A(e,t,n="-"){const i=Object.keys(e),r=/\(|\)/;return C(i.filter((e=>3===e.split(r).filter((e=>!!e)).length)).length>.8*i.length?Object.entries(e).reduce(((e,[t,n])=>{const i=t.split(r)[1];return i&&(e[i]=n),e}),{}):e,t,n)}function S(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:()=>r});var i=n(6082);async function r(){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:()=>r});var i=n(6082);function r(e,t){const n=e=>{const t=s.columns.addNewString((e+1).toString());return r.push(t),t},r=[],o=e.length,s=i.DataFrame.create(o),a=t.getSeqHandler(e);for(let e=0;e<o;++e){const t=a.getSplitted(e);for(let i=0;i<t.length;++i){const o=t.getCanonical(i);((r[i]??null)||n(i)).set(e,o,!1)}}return s}},7602:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var i,r=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 o{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,o]=(0,r.AP)(t);this.logger.error(`${e}, SYNC syncId = ${n}, ERROR:\n${i}`,void 0,o),this.errors.push(t)}))}resetErrors(){const e=this.errors;return this.errors=[],e}}},4326:(e,t,n)=>{"use strict";n.d(t,{Fo:()=>h,Lp:()=>o,P4:()=>s,fH:()=>r,gp:()=>i,lT:()=>l,mH:()=>a});var i,r,o,s,a,l,c=n(6082);!function(e){e.tooltipWebLogo=".tooltipWebLogo"}(i||(i={})),function(e){e.Entropy="Entropy",e.full="100%"}(r||(r={})),function(e){e.TOP="top",e.MIDDLE="middle",e.BOTTOM="bottom"}(o||(o={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(s||(s={})),function(e){e.AUTO="auto",e.ON="on",e.OFF="off"}(a||(a={})),function(e){e.Filtered="Filtered",e.Selected="Selected"}(l||(l={}));const h=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=r.Entropy,this.positionWidth=16,this.verticalAlignment=o.MIDDLE,this.horizontalAlignment=s.CENTER,this.fixWidth=!1,this.fitArea=!0,this.minHeight=50,this.maxHeight=100,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,r=(i="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){var t,n,r=void 0!==e?e:{};r.ready=new Promise((function(e,i){t=e,n=i}));var o,s=Object.assign({},r),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&&(o=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)})),r.print||console.log.bind(console);var h,u,d=r.printErr||console.warn.bind(console);Object.assign(r,s),s=null,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.quit&&r.quit,r.wasmBinary&&(h=r.wasmBinary),r.noExitRuntime,"object"!=typeof WebAssembly&&_("no native wasm support detected");var p,m,f,g=!1;function y(){var e=u.buffer;r.HEAP8=p=new Int8Array(e),r.HEAP16=new Int16Array(e),r.HEAP32=new Int32Array(e),r.HEAPU8=m=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=f=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}var b,v,w=[],C=[],A=[],S=0,x=null,E=null;function _(e){r.onAbort&&r.onAbort(e),d(e="Aborted("+e+")"),g=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}function M(e){return e.startsWith("data:application/octet-stream;base64,")}function I(e){try{if(e==b&&h)return new Uint8Array(h);if(o)return o(e);throw"both async and sync fetching of the wasm failed"}catch(e){_(e)}}function T(e,t,n){return function(e){return h||!a&&!l||"function"!=typeof fetch?Promise.resolve().then((function(){return I(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 I(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),_(e)}))}function L(e){for(;e.length>0;)e.shift()(r)}function N(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){f[this.ptr+4>>2]=e},this.get_type=function(){return f[this.ptr+4>>2]},this.set_destructor=function(e){f[this.ptr+8>>2]=e},this.get_destructor=function(){return f[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,p[this.ptr+12|0]=e},this.get_caught=function(){return 0!=p[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,p[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=p[this.ptr+13|0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){f[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return f[this.ptr+16>>2]},this.get_exception_ptr=function(){if(D(this.get_type()))return f[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function $(e){var t=u.buffer;try{return u.grow(e-t.byteLength+65535>>>16),y(),1}catch(e){}}function P(e){return r["_"+e]}M(b="wasmDbscan.wasm")||(v=b,b=r.locateFile?r.locateFile(v,c):c+v);var R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(e,t,n,i,r){var o={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=B(t);return function(e,t,n){!function(e,t,n,i){if(!(i>0))return 0;for(var r=n+i-1,o=0;o<e.length;++o){var s=e.charCodeAt(o);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++o)),s<=127){if(n>=r)break;t[n++]=s}else if(s<=2047){if(n+1>=r)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=r)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=r)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}t[n]=0}(e,m,t,n)}(e,n,t),n}(e)),t},array:e=>{var t,n,i=B(e.length);return t=e,n=i,p.set(t,n),i}},s=P(e),a=[],l=0;if(i)for(var c=0;c<i.length;c++){var h=o[n[c]];h?(0===l&&(l=F()),a[c]=h(i[c])):a[c]=i[c]}var u=s.apply(null,a);return function(e){return 0!==l&&H(l),function(e){return"string"===t?(n=e)?function(e,t,n){for(var i=t+n,r=t;e[r]&&!(r>=i);)++r;if(r-t>16&&e.buffer&&R)return R.decode(e.subarray(t,r));for(var o="";t<r;){var s=e[t++];if(128&s){var a=63&e[t++];if(192!=(224&s)){var l=63&e[t++];if((s=224==(240&s)?(15&s)<<12|a<<6|l:(7&s)<<18|a<<12|l<<6|63&e[t++])<65536)o+=String.fromCharCode(s);else{var c=s-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&s)<<6|a)}else o+=String.fromCharCode(s)}return o}(m,n,i):"":"boolean"===t?Boolean(e):e;var n,i}(e)}(u)}var k,G={__cxa_throw:function(e,t,n){throw new N(e).init(t,n),e},abort:function(){_("")},emscripten_memcpy_big:function(e,t,n){m.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=m.length,i=2147483648;if((e>>>=0)>i)return!1;for(var r=1;r<=4;r*=2){var o=n*(1+.2/r);if(o=Math.min(o,e+100663296),$(Math.min(i,(t=Math.max(e,o))+(65536-t%65536)%65536)))return!0}return!1}},F=(function(){var e,t,i,o,s={env:G,wasi_snapshot_preview1:G};function a(e,t){var n,i=e.exports;return r.asm=i,u=r.asm.memory,y(),r.asm.__indirect_function_table,n=r.asm.__wasm_call_ctors,C.unshift(n),function(){if(S--,r.monitorRunDependencies&&r.monitorRunDependencies(S),0==S&&(null!==x&&(clearInterval(x),x=null),E)){var e=E;E=null,e()}}(),i}if(S++,r.monitorRunDependencies&&r.monitorRunDependencies(S),r.instantiateWasm)try{return r.instantiateWasm(s,a)}catch(e){d("Module.instantiateWasm callback failed with error: "+e),n(e)}(e=h,t=b,i=s,o=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||M(t)||"function"!=typeof fetch?T(t,i,o):fetch(t,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,i).then(o,(function(e){return d("wasm streaming compile failed: "+e),d("falling back to ArrayBuffer instantiation"),T(t,i,o)}))}))).catch(n)}(),r._dbscan=function(){return(r._dbscan=r.asm.dbscan).apply(null,arguments)},r._malloc=function(){return(r._malloc=r.asm.malloc).apply(null,arguments)},r._free=function(){return(r._free=r.asm.free).apply(null,arguments)},function(){return(F=r.asm.stackSave).apply(null,arguments)}),H=function(){return(H=r.asm.stackRestore).apply(null,arguments)},B=function(){return(B=r.asm.stackAlloc).apply(null,arguments)},D=function(){return(D=r.asm.__cxa_is_pointer_type).apply(null,arguments)};function V(){function e(){k||(k=!0,r.calledRun=!0,g||(L(C),t(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)e=r.postRun.shift(),A.unshift(e);var e;L(A)}()))}S>0||(function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)e=r.preRun.shift(),w.unshift(e);var e;L(w)}(),S>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),e()}),1)):e()))}if(r.ccall=O,r.cwrap=function(e,t,n,i){var r=!n||n.every((e=>"number"===e||"boolean"===e));return"string"!==t&&r&&!i?P(e):function(){return O(e,t,n,arguments)}},E=function e(){k||V(),k||(E=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return V(),e.ready});"object"==typeof exports?e.exports=r:"function"==typeof define&&n.amdO?define([],(function(){return r})):"object"==typeof exports&&(exports.exportCppDbscanLib=r)},6295:(e,t,n)=>{"use strict";n.d(t,{$1:()=>a,Hf:()=>u,Hr:()=>_,Ii:()=>y,Qj:()=>f,T6:()=>E,TK:()=>S,be:()=>g,gt:()=>w,iS:()=>s,ij:()=>C,jL:()=>h,lO:()=>m,lP:()=>v,rR:()=>b,tO:()=>l,v_:()=>c,w_:()=>d,yK:()=>A,zn:()=>p});var i=n(8774),r=n(8498),o=n(6863);r.aT.Tanimoto,r.aT.Dice,r.aT.Asymmetric,r.aT.BraunBlanquet,r.aT.Cosine,r.aT.Kulczynski,r.aT.McConnaughey,r.aT.RogotGoldberg,r.aT.Russel,r.aT.Sokal,r.aT.Hamming,r.aT.Euclidean,r.aT.Tanimoto,r.aT.Dice,r.aT.Asymmetric,r.aT.BraunBlanquet,r.aT.Cosine,r.aT.Kulczynski,r.aT.McConnaughey,r.aT.RogotGoldberg,r.aT.Russel,r.aT.Sokal,r.aT.Hamming,r.aT.Euclidean;const s=[r.aT.Tanimoto,r.aT.Dice,r.aT.Cosine];function a(e,t){const n=e.trueCount()+t.trueCount();if(0==n)return 1;const i=e.andWithCountBits(t,!0);return i/(n-i)}function l(e,t){return 1-a(e,t)}function c(e,t){return x(a(new i.A(e,32*e.length),new i.A(t,32*t.length)))}function h(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 d(e,t){let n=0,i=0,r=0;for(let o=0;o<e.length;o++)n+=e[o]*t[o],i+=e[o]*e[o],r+=t[o]*t[o];return(1-n/(Math.sqrt(i)*Math.sqrt(r)))/2}function p(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 m(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 f(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 y(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 b(e,t){return x(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 v(e,t){return x(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 C(e,t){return x(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 x(function(e,t){return 0==e.length?0:e.andWithCountBits(t,!0)/e.length}(e,t))}function S(e,t){return x(function(e,t){const n=e.andWithCountBits(t,!0),i=e.countBits(!0)+t.countBits(!0),r=e.length,o=r-i+n;return n==r||o==r?1:n/i+o/(2*r-i)}(e,t))}function x(e){return e<=0?3402823e32:1/e-1}function E(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){const t=function(e){const t=e?.mostCommon??new Set;return(e,n)=>{const i=e.length,r=n.length;let o=0,s=0,a=0;for(;s<i&&a<r;)e[s]===n[a]?(t?.has(e[s])||++o,++s,++a):e[s]<n[a]?++s:++a;return o}}(e);return(e,n)=>0===n.length||0===e.length?1e4:Math.min(e.length,n.length)/(t(e,n)+1e-4)}r.aT.Tanimoto,r.aT.Asymmetric,r.aT.Cosine,r.aT.Sokal,o.Z.HAMMING,o.Z.LEVENSHTEIN,o.Z.MONOMER_CHEMICAL_DISTANCE,o.Z.NEEDLEMANN_WUNSCH},684:(e,t,n)=>{"use strict";n.d(t,{C0:()=>o,GP:()=>i,Gi:()=>a,YP:()=>c,_X:()=>s,n3:()=>r,vb:()=>l});const i="dim-red-preprocessing-function",r="supportedSemTypes",o="supportedTypes",s="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,r=new Float32Array((n.length+i)*(n.length+i));return Object.entries(t).forEach((([e,i])=>{const o=n[i];Object.entries(t).forEach((([t,i])=>{r[e.charCodeAt(0)*n.length+t.charCodeAt(0)]=o[i]}))})),(e,t)=>1-r[e.charCodeAt(0)*n.length+t.charCodeAt(0)]}(),n=e?.threshold??0;return(e,i)=>{let r=0;const o=e.length,s=i.length,a=Math.ceil(Math.max(o,s)*(1-n));o!==s&&(r=Math.abs(o-s));let l=0;for(let n=0;n<Math.min(o,s);n++)if(e[n]!==i[n]&&(l+=t(e[n],i[n]),l>a))return 1;return l+=r,l/=Math.max(o,s),l}}n.d(t,{Z:()=>s,V:()=>a});var r=n(2787);const o={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 s;!function(e){e.HAMMING="Hamming",e.LEVENSHTEIN="Levenshtein",e.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",e.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(s||(s={}));const a={[s.HAMMING]:i,[s.LEVENSHTEIN]:function(){return(e,t)=>(0,r.I)(e,t)/Math.max(e.length,t.length)},[s.NEEDLEMANN_WUNSCH]:function(e){const t=new Uint16Array(65536),{gapOpen:n,gapExtend:i,scoringMatrix:r,alphabetIndexes:s}={...o,...e};Object.entries(s).forEach((([e,n])=>t[e.charCodeAt(0)]=n));const a=[new Float32Array(1e4),new Float32Array(1e4)];return(e,o)=>{const s=new Array(e.length+1).fill(!1),l=new Array(e.length+1).fill(!1);let c=0,h=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 u=1;u<o.length+1;u++){a[h][0]=-i-(u-1)*i;for(let d=1;d<e.length+1;d++){const p=a[c][d-1]+r[t[e.charCodeAt(d-1)]][t[o.charCodeAt(u-1)]],m=a[c][d]-(s[d]||1===u||u===o.length?i:n),f=a[h][d-1]-(l[d-1]||1===d||d===e.length?i:n);a[h][d]=Math.max(p,f,m),a[h][d]===p?(s[d]=!1,l[d]=!1):a[h][d]===f?(s[d]=!1,l[d]=!0):(s[d]=!0,l[d]=!1)}c=h,h=(h+1)%2}const u=Math.min(e.length,o.length);return(u-a[c][e.length])/u}},[s.MONOMER_CHEMICAL_DISTANCE]:i}},8060:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});const i="dimensionality-reducer-terminate-event"},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,r,o,s,a,l,c;n.d(t,{EG:()=>a,Pn:()=>r,RR:()=>l,Wn:()=>c,aT:()=>o,m6:()=>s,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"}(r||(r={})),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"}(o||(o={})),function(e){e.TanimotoIntArray="TanimotoIntArray"}(s||(s={})),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(8498),n(9336)},9336:(e,t,n)=>{"use strict";var i=n(2787),r=n(944),o=n(6295),s=n(6863),a=n(8498);const l={[a.Pn.Euclidean]:o.jL,[a.Pn.Manhattan]:o.Hf,[a.Pn.Cosine]:o.w_},c={[a.xL.Levenshtein]:i.I,[a.xL.JaroWinkler]:r.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}},h={[a.aT.Tanimoto]:o.tO,[a.aT.Dice]:o.zn,[a.aT.Asymmetric]:o.gt,[a.aT.BraunBlanquet]:o.ij,[a.aT.Cosine]:o.lO,[a.aT.Kulczynski]:o.rR,[a.aT.McConnaughey]:o.lP,[a.aT.RogotGoldberg]:o.TK,[a.aT.Russel]:o.yK,[a.aT.Sokal]:o.Ii,[a.aT.Hamming]:o.be,[a.aT.Euclidean]:o.Qj},u={[a.m6.TanimotoIntArray]:o.v_},d={[a.RR.Difference]:o.T6},p={[a.Wn.CommonItems]:o.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]:h[a.aT.Tanimoto],[a.aT.Dice]:h[a.aT.Dice],[a.aT.Asymmetric]:h[a.aT.Asymmetric],[a.aT.BraunBlanquet]:h[a.aT.BraunBlanquet],[a.aT.Cosine]:h[a.aT.Cosine],[a.aT.Kulczynski]:h[a.aT.Kulczynski],[a.aT.McConnaughey]:h[a.aT.McConnaughey],[a.aT.RogotGoldberg]:h[a.aT.RogotGoldberg],[a.aT.Russel]:h[a.aT.Russel],[a.aT.Sokal]:h[a.aT.Sokal]},[a.EG.MacroMolecule]:{[s.Z.HAMMING]:s.V[s.Z.HAMMING],[s.Z.LEVENSHTEIN]:s.V[s.Z.LEVENSHTEIN],[s.Z.NEEDLEMANN_WUNSCH]:s.V[s.Z.NEEDLEMANN_WUNSCH],[s.Z.MONOMER_CHEMICAL_DISTANCE]:s.V[s.Z.MONOMER_CHEMICAL_DISTANCE]},[a.EG.Number]:{[a.RR.Difference]:d[a.RR.Difference]},[a.EG.IntArray]:{[a.m6.TanimotoIntArray]:u[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,r=i._createBuffer(n);if(t)for(let e=0;e<r.length;e++)r[e]=-1;this._data=r,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 r=e.lengthInInts;for(let i=0;i<r;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 r=0,o=0;for(;t-o>=4;)n._data[r++]=255&e[o]|(255&e[o+1])<<8|(255&e[o+2])<<16|(255&e[o+3])<<24,o+=4;return t-o==3&&(n._data[r]=(255&e[o+2])<<16),t-o==2&&(n._data[r]|=(255&e[o+1])<<8),t-o==1&&(n._data[r]|=255&e[o]),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,r=!0){if(n&&r&&this.setAll(!t,!1),r)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 r=Math.min(e,t),o=Math.max(e,t);if(n)for(let e=r;e<=o;e++)this.setTrue(e);else for(let e=r;e<=o;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 r=31&this._length;for(0!=r&&(n&=~(4294967295<<r));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 r=this.lengthInInts;let o=0;for(;o<r-1;o++)for(let t=this._data[o]&e._data[o];0!=t;t>>>=8)n+=i._onBitCount[255&t];let s=this._data[o]&e._data[o];const a=31&this._length;for(0!=a&&(s&=~(4294967295<<a));0!=s;s>>>=8)n+=i._onBitCount[255&s];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 r=this.lengthInInts;for(let o=Math.floor(e/32);o<r;o++){let r=t?this._data[o]:~this._data[o];if(0!=n)r&=4294967295<<n&4294967295,n=0;else if(!t&&-4294967296==r)continue;for(let t=0;0!=r;t+=8,r>>>=8){const n=i._firstOnBit[255&r];if(n>=0)return(e=n+32*o+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 r=Math.floor(e/32);r>=0;r--){let e=t?this._data[r]:~this._data[r];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*r+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,{cb:()=>a,PE:()=>s}),n(4328);var i=n(6082);n(9982),i.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,,,,,,,,,,,,,,,,,,,,,').columns.add(i.Column.fromList(i.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var r,o=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((i=i.apply(e,t||[])).next())}))};function s(e,t,n,i=0,r="timeout"){return o(this,void 0,void 0,(function*(){return new Promise(((o,s)=>{const a=e.subscribe((e=>{try{t(e),o("OK")}catch(e){s(e)}finally{a.unsubscribe(),clearTimeout(l)}})),l=setTimeout((()=>{a.unsubscribe(),s(r)}),i);n()}))}))}function a(e){return o(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,e)))}))}console.log.bind(console),console.info.bind(console),console.warn.bind(console),console.error.bind(console),function(e){e.notNull=function(e,t){if(null==e)throw new Error(`${null==t?"Value":t} not defined`)}}(r||(r={})),i.DataFrame.fromColumns([i.Column.fromStrings("col",["val1","val2","val3"])])},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:()=>o,vA:()=>r,wQ:()=>s});var i=n(3527);function r(e=!1,t="Assertion error."){if(!e)throw new Error(t)}function o(e,t,n=1){const o=e.length;r(o==t.length,"Vector lengths do not match.");const s=new i.Mi(o);for(let i=0;i<e.length;++i)s[i]=e[i]+n*t[i];return s}function s(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 r=0;r<t;++r)n+=e[r],i+=Math.pow(e[r],2);const r=n/t,o=1/Math.sqrt(i/t-Math.pow(r,2));for(let n=0;n<t;++n)e[n]=(e[n]-r)*o;return e}},1913:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(3282),r=n(9029),o=n(1520),s=n(2586),a=n(8708),l=n(2023),c="errorMessage",h=new i.Name("emUsed"),u={required:"missingProperty",dependencies:"property",dependentRequired:"property"},d=/\$\{[^}]+\}/,p=/\$\{([^}]+)\}/g,m=/^""\s*\+\s*|\s*\+\s*""$/g;const f=(e,t={})=>{if(!e.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(e.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return e.addKeyword(function(e){return{keyword:c,schemaType:["string","object"],post:!0,code(t){const{gen:n,data:f,schema:g,schemaValue:y,it:b}=t;if(!1===b.createErrors)return;const v=g,w=r.strConcat(l.default.instancePath,b.errorPath);function C(e,t){return r.and(i._`${e}.keyword !== ${c}`,i._`!${e}.${h}`,i._`${e}.instancePath === ${w}`,i._`${e}.keyword in ${t}`,i._`${e}.schemaPath.indexOf(${b.errSchemaPath}) === 0`,i._`/^\\/[^\\/]*$/.test(${e}.schemaPath.slice(${b.errSchemaPath.length}))`)}function A(e,t){const i=[];for(const n in e){const e=t[n];d.test(e)&&i.push([n,x(e)])}return n.object(...i)}function S(e){return d.test(e)?new o._Code(o.safeStringify(e).replace(p,((e,t)=>`" + JSON.stringify(${s.getData(t,b)}) + "`)).replace(m,"")):i.stringify(e)}function x(e){return i._`function(){return ${S(e)}}`}n.if(i._`${l.default.errors} > 0`,(()=>{if("object"==typeof v){const[o,s]=function(e){let t,n;for(const i in e){if("properties"===i||"items"===i)continue;const r=e[i];if("object"==typeof r){t||(t={});const e=t[i]={};for(const t in r)e[t]=[]}else n||(n={}),n[i]=[]}return[t,n]}(v);s&&function(r){const o=n.const("emErrors",i.stringify(r)),s=n.const("templates",A(r,g));n.forOf("err",l.default.vErrors,(e=>n.if(C(e,o),(()=>n.code(i._`${o}[${e}.keyword].push(${e})`).assign(i._`${e}.${h}`,!0)))));const{singleError:c}=e;if(c){const e=n.let("message",i._`""`),r=n.let("paramsErrors",i._`[]`);u((t=>{n.if(e,(()=>n.code(i._`${e} += ${"string"==typeof c?c:";"}`))),n.code(i._`${e} += ${d(t)}`),n.assign(r,i._`${r}.concat(${o}[${t}])`)})),a.reportError(t,{message:e,params:i._`{errors: ${r}}`})}else u((e=>a.reportError(t,{message:d(e),params:i._`{errors: ${o}[${e}]}`})));function u(e){n.forIn("key",o,(t=>n.if(i._`${o}[${t}].length`,(()=>e(t)))))}function d(e){return i._`${e} in ${s} ? ${s}[${e}]() : ${y}[${e}]`}}(s),o&&function(e){const r=n.const("emErrors",i.stringify(e)),o=[];for(const t in e)o.push([t,A(e[t],g[t])]);const s=n.const("templates",n.object(...o)),c=n.scopeValue("obj",{ref:u,code:i.stringify(u)}),d=n.let("emPropParams"),p=n.let("emParamsErrors");n.forOf("err",l.default.vErrors,(e=>n.if(C(e,r),(()=>{n.assign(d,i._`${c}[${e}.keyword]`),n.assign(p,i._`${r}[${e}.keyword][${e}.params[${d}]]`),n.if(p,(()=>n.code(i._`${p}.push(${e})`).assign(i._`${e}.${h}`,!0)))})))),n.forIn("key",r,(e=>n.forIn("keyProp",i._`${r}[${e}]`,(o=>{n.assign(p,i._`${r}[${e}][${o}]`),n.if(i._`${p}.length`,(()=>{const r=n.const("tmpl",i._`${s}[${e}] && ${s}[${e}][${o}]`);a.reportError(t,{message:i._`${r} ? ${r}() : ${y}[${e}][${o}]`,params:i._`{errors: ${p}}`})}))}))))}(o),function(e){const{props:o,items:s}=e;if(!o&&!s)return;const u=i._`typeof ${f} == "object"`,d=i._`Array.isArray(${f})`,p=n.let("emErrors");let m,b;const v=n.let("templates");function C(e,t){n.assign(p,i.stringify(e)),n.assign(v,A(e,t))}o&&s?(m=n.let("emChildKwd"),n.if(u),n.if(d,(()=>{C(s,g.items),n.assign(m,i.str`items`)}),(()=>{C(o,g.properties),n.assign(m,i.str`properties`)})),b=i._`[${m}]`):s?(n.if(d),C(s,g.items),b=i._`.items`):o&&(n.if(r.and(u,r.not(d))),C(o,g.properties),b=i._`.properties`),n.forOf("err",l.default.vErrors,(e=>function(e,t,o){n.if(r.and(i._`${e}.keyword !== ${c}`,i._`!${e}.${h}`,i._`${e}.instancePath.indexOf(${w}) === 0`),(()=>{const r=n.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:i._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),s=n.const("emMatches",i._`${r}.exec(${e}.instancePath.slice(${w}.length))`),a=n.const("emChild",i._`${s} && ${s}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);n.if(i._`${a} !== undefined && ${a} in ${t}`,(()=>o(a)))}))}(e,p,(t=>n.code(i._`${p}[${t}].push(${e})`).assign(i._`${e}.${h}`,!0))))),n.forIn("key",p,(e=>n.if(i._`${p}[${e}].length`,(()=>{a.reportError(t,{message:i._`${e} in ${v} ? ${v}[${e}]() : ${y}${b}[${e}]`,params:i._`{errors: ${p}[${e}]}`}),n.assign(i._`${l.default.vErrors}[${l.default.errors}-1].instancePath`,i._`${w} + "/" + ${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}(v))}const o="string"==typeof v?v:v._;o&&function(e){const o=n.const("emErrs",i._`[]`);n.forOf("err",l.default.vErrors,(e=>n.if(function(e){return r.and(i._`${e}.keyword !== ${c}`,i._`!${e}.${h}`,r.or(i._`${e}.instancePath === ${w}`,r.and(i._`${e}.instancePath.indexOf(${w}) === 0`,i._`${e}.instancePath[${w}.length] === "/"`)),i._`${e}.schemaPath.indexOf(${b.errSchemaPath}) === 0`,i._`${e}.schemaPath[${b.errSchemaPath}.length] === "/"`)}(e),(()=>n.code(i._`${o}.push(${e})`).assign(i._`${e}.${h}`,!0))))),n.if(i._`${o}.length`,(()=>a.reportError(t,{message:S(e),params:i._`{errors: ${o}}`})))}(o),e.keepErrors||function(){const e=n.const("emErrs",i._`[]`);n.forOf("err",l.default.vErrors,(t=>n.if(i._`!${t}.${h}`,(()=>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=f,e.exports=f,e.exports.default=f},7433:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const i=n(4042),r=n(6105),o=n(6653),s=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(),r.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;t&&(s.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 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 u=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return u.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),r=n(6144),o=n(6653),s=n(2079),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends i.default{_addVocabularies(){super._addVocabularies(),r.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;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 h=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var u=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var 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 r 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 o(e,...t){const n=[e[0]];let i=0;for(;i<t.length;)l(n,t[i]),n.push(e[++i]);return new r(n)}t._Code=r,t.nil=new r(""),t._=o;const s=new r("+");function a(e,...t){const n=[h(e[0])];let i=0;for(;i<t.length;)n.push(s),l(n,t[i]),n.push(s,h(e[++i]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===s){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 r(n)}function l(e,t){var n;t instanceof r?e.push(...t._items):t instanceof i?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:h(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 h(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 r(h(e))},t.safeStringify=h,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new r(`.${e}`):o`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new r(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new r(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),r=n(7845);var o=n(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}});var s=n(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.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?r.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=N(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=N(this.rhs,e,t),this}get names(){return L(this.lhs instanceof i.Name?{}:{...this.lhs.names},this.rhs)}}class h 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 u 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=N(this.code,e,t),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class f extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let i=n.length;for(;i--;){const r=n[i];r.optimizeNames(e,t)||($(e,r.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>T(e,t.names)),{})}}class g extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends f{}class b extends g{}b.kind="else";class v extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new b(e):e}return t?!1===e?t instanceof v?t:t.nodes:this.nodes.length?this:new v(P(e),t instanceof v?[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=N(this.condition,e,t),this}get names(){const e=super.names;return L(e,this.condition),this.else&&T(e,this.else.names),e}}v.kind="if";class w extends g{}w.kind="for";class C extends w{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=N(this.iteration,e,t),this}get names(){return T(super.names,this.iteration.names)}}class A extends w{constructor(e,t,n,i){super(),this.varKind=e,this.name=t,this.from=n,this.to=i}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${t} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){const e=L(super.names,this.from);return L(e,this.to)}}class S extends w{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=N(this.iterable,e,t),this}get names(){return T(super.names,this.iterable.names)}}class x extends g{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}x.kind="func";class E extends f{render(e){return"return "+super.render(e)}}E.kind="return";class _ extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,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&&T(e,this.catch.names),this.finally&&T(e,this.finally.names),e}}class M extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}M.kind="catch";class I extends g{render(e){return"finally"+super.render(e)}}function T(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function L(e,t){return t instanceof i._CodeOrName?T(e,t.names):e}function N(e,t,n){return e instanceof i.Name?o(e):(r=e)instanceof i._Code&&r._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=o(t)),t instanceof i._Code?e.push(...t._items):e.push(t),e)),[])):e;var r;function o(e){const i=n[e.str];return void 0===i||1!==t[e.str]?e:(delete t[e.str],i)}}function $(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function P(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:i._`!${G(e)}`}I.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 r.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 r=this._scope.toName(t);return void 0!==n&&i&&(this._constants[r.str]=n),this._leafNode(new l(e,r,n)),r}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new c(e,t,n))}add(e,n){return this._leafNode(new h(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,r]of e)t.length>1&&t.push(","),t.push(n),(n!==r||this.opts.es5)&&(t.push(":"),(0,i.addCodeArg)(t,r));return t.push("}"),new i._Code(t)}if(e,t,n){if(this._blockNode(new v(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 v(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(v,b)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new C(e),t)}forRange(e,t,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const s=this._scope.toName(e);return this._for(new A(o,s,t,n),(()=>i(s)))}forOf(e,t,n,o=r.varKinds.const){const s=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(s,i._`${e}[${t}]`),n(s)}))}return this._for(new S("of",o,s,t),(()=>n(s)))}forIn(e,t,n,o=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,i._`Object.keys(${t})`,n);const s=this._scope.toName(e);return this._for(new S("in",o,s,t),(()=>n(s)))}endFor(){return this._endBlockNode(w)}label(e){return this._leafNode(new u(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 _;if(this._blockNode(i),this.code(e),t){const e=this.name("e");this._currNode=i.catch=new M(e),t(e)}return n&&(this._currNode=i.finally=new I,this.code(n)),this._endBlockNode(M,I)}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,r){return this._blockNode(new x(e,t,n)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(x)}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 v))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=P;const R=k(t.operators.AND);t.and=function(...e){return e.reduce(R)};const O=k(t.operators.OR);function k(e){return(t,n)=>t===i.nil?n:n===i.nil?t:i._`${G(t)} ${e} ${G(n)}`}function G(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 r extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o||(t.UsedValueState=o={})),t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class s{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=s;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 s{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:r}=i,o=null!==(n=t.key)&&void 0!==n?n:t.ref;let s=this._values[r];if(s){const e=s.get(o);if(e)return e}else s=this._values[r]=new Map;s.set(o,i);const a=this._scope[r]||(this._scope[r]=[]),l=a.length;return a[l]=t.ref,i.setValue(t,{property:r,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,s={},a){let l=i.nil;for(const c in e){const h=e[c];if(!h)continue;const u=s[c]=s[c]||new Map;h.forEach((e=>{if(u.has(e))return;u.set(e,o.Started);let s=n(e);if(s){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;l=i._`${l}${n} ${e} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(e)))throw new r(e);l=i._`${l}${s}${this.opts._n}`}u.set(e,o.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),r=n(4227),o=n(2023);function s(e,t){const n=e.const("err",t);e.if(i._`${o.default.vErrors} === null`,(()=>e.assign(o.default.vErrors,i._`[${n}]`)),i._`${o.default.vErrors}.push(${n})`),e.code(i._`${o.default.errors}++`)}function a(e,t){const{gen:n,validateName:r,schemaEnv:o}=e;o.$async?n.throw(i._`new ${e.ValidationError}(${t})`):(n.assign(i._`${r}.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,r,o){const{it:l}=e,{gen:h,compositeRule:u,allErrors:d}=l,p=c(e,n,r);(null!=o?o:u||d)?s(h,p):a(l,i._`[${p}]`)},t.reportExtraError=function(e,n=t.keywordError,i){const{it:r}=e,{gen:l,compositeRule:h,allErrors:u}=r;s(l,c(e,n,i)),h||u||a(r,o.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(o.default.errors,t),e.if(i._`${o.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(i._`${o.default.vErrors}.length`,t)),(()=>e.assign(o.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:r,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",s,o.default.errors,(s=>{e.const(l,i._`${o.default.vErrors}[${s}]`),e.if(i._`${l}.instancePath === undefined`,(()=>e.assign(i._`${l}.instancePath`,(0,i.strConcat)(o.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`,r))}))};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:r}=e.it;return!1===r?i._`{}`:function(e,t,n={}){const{gen:r,it:s}=e,a=[h(s,n),u(e,n)];return function(e,{params:t,message:n},r){const{keyword:s,data:a,schemaValue:c,it:h}=e,{opts:u,propertyName:d,topSchemaRef:p,schemaPath:m}=h;r.push([l.keyword,s],[l.params,"function"==typeof t?t(e):t||i._`{}`]),u.messages&&r.push([l.message,"function"==typeof n?n(e):n]),u.verbose&&r.push([l.schema,c],[l.parentSchema,i._`${p}${m}`],[o.default.data,a]),d&&r.push([l.propertyName,d])}(e,t,a),r.object(...a)}(e,t,n)}function h({errorPath:e},{instancePath:t}){const n=t?i.str`${e}${(0,r.getErrorPath)(t,r.Type.Str)}`:e;return[o.default.instancePath,(0,i.strConcat)(o.default.instancePath,n)]}function u({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:o}){let s=o?t:i.str`${t}/${e}`;return n&&(s=i.str`${s}${(0,r.getErrorPath)(n,r.Type.Str)}`),[l.schemaPath,s]}},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),r=n(3558),o=n(2023),s=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,s.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 h(e){const t=d.call(this,e);if(t)return t;const n=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:h}=this.opts,u=new i.CodeGen(this.scope,{es5:a,lines:c,ownProperties:h});let p;e.$async&&(p=u.scopeValue("Error",{ref:r.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const m=u.scopeName("validate");e.validateName=m;const f={gen:u,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:u.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 g;try{this._compilations.add(e),(0,l.validateFunctionCode)(f),u.optimize(this.opts.code.optimize);const t=u.toString();g=`${u.scopeRefs(o.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${o.default.self}`,`${o.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:m,validateCode:t,scopeValues:u._values}),this.opts.unevaluated){const{props:e,items:t}=f;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,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function u(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:h.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,s._getFullPath)(this.opts.uriResolver,n);let r=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&i===r)return g.call(this,n,e);const o=(0,s.normalizeId)(i),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||h.call(this,a),o===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,i=t[n];return i&&(r=(0,s.resolveUrl)(this.opts.uriResolver,r,i)),new c({schema:t,schemaId:n,root:e,baseId:r})}return g.call(this,n,a)}}t.SchemaEnv=c,t.compileSchema=h,t.resolveRef=function(e,t,n){var i;n=(0,s.resolveUrl)(this.opts.uriResolver,t,n);const r=e.refs[n];if(r)return r;let o=p.call(this,e,n);if(void 0===o){const r=null===(i=e.localRefs)||void 0===i?void 0:i[n],{schemaId:s}=this.opts;r&&(o=new c({schema:r,schemaId:s,root:e,baseId:t}))}return void 0!==o?e.refs[n]=u.call(this,o):void 0},t.getCompilingSchema=d,t.resolveSchema=m;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:n,root:i}){var r;if("/"!==(null===(r=e.fragment)||void 0===r?void 0:r[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 r="object"==typeof(n=e)&&n[this.opts.schemaId];!f.has(i)&&r&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,r))}let o;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,i,e)}const{schemaId:l}=this.opts;return o=o||new c({schema:n,schemaId:l,root:i,baseId:t}),o.schema!==o.root.schema?o:void 0}},2023:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(9029),r={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=r},4551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6939);class r extends Error{constructor(e,t,n,r){super(r||`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=r},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),r=n(2017),o=n(7106),s=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++,!s.has(n)&&("object"==typeof e[n]&&(0,i.eachItem)(e[n],(e=>t+=c(e))),t===1/0))return 1/0}return t}function h(e,t="",n){!1!==n&&(t=p(t));const i=e.parse(t);return u(e,i)}function u(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=h,t._getFullPath=u;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,s=p(e[n]||t),a={"":s},l=h(i,s,!1),c={},u=new Set;return o(e,{allKeys:!0},((e,t,i,r)=>{if(void 0===r)return;const o=l+t;let s=a[r];function h(t){const n=this.opts.uriResolver.resolve;if(t=p(s?n(s,t):t),u.has(t))throw f(t);u.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(o)&&("#"===t[0]?(d(e,c[t],t),c[t]=e):this.refs[t]=o),t}function g(e){if("string"==typeof e){if(!m.test(e))throw new Error(`invalid anchor "${e}"`);h.call(this,`#${e}`)}}"string"==typeof e[n]&&(s=h.call(this,e[n])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),a[t]=s})),c;function d(e,t,n){if(void 0!==t&&!r(e,t))throw f(n)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},396:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},4227:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const i=n(9029),r=n(1520);function o(e,t=e.schema){const{opts:n,self:i}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const r=i.RULES.keywords;for(const n in t)r[n]||m(e,`unknown keyword: "${n}"`)}function s(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:r}){return(o,s,a,l)=>{const c=void 0===a?s:a instanceof i.Name?(s instanceof i.Name?e(o,s,a):t(o,s,a),a):s instanceof i.Name?(t(o,a,s),s):n(s,a);return l!==i.Name||c instanceof i.Name?c:r(o,c)}}function h(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",i._`{}`);return void 0!==t&&u(e,n,t),n}function u(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||(o(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRules=s,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,r,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return i._`${n}`}return i._`${e}${t}${(0,i.getProperty)(r)}`},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} || {}`),u(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:h}),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=h,t.setEvaluated=u;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 r._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 r=t===p.Num;return n?r?i._`"[" + ${e} + "]"`:i._`"['" + ${e} + "']"`:r?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 r=t.RULES.types[i];return r&&!0!==r&&n(e,r)},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),r=n(9029),o=n(2023),s={message:"boolean schema is false"};function a(e,t){const{gen:n,data:r}=e,o={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,i.reportError)(o,s,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(o.default.data):(t.assign(r._`${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),r=n(7887),o=n(8708),s=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:o}=e,a=function(e,t){return t?e.filter((e=>h.has(e)||"array"===t&&"array"===e)):[]}(t,o.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,r.schemaHasRulesForType)(e,t[0]));if(c){const r=d(t,i,o.strictNumbers,l.Wrong);n.if(r,(()=>{a.length?function(e,t,n){const{gen:i,data:r,opts:o}=e,a=i.let("dataType",s._`typeof ${r}`),l=i.let("coerced",s._`undefined`);"array"===o.coerceTypes&&i.if(s._`${a} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,(()=>i.assign(r,s._`${r}[0]`).assign(a,s._`typeof ${r}`).if(d(t,r,o.strictNumbers),(()=>i.assign(l,r))))),i.if(s._`${l} !== undefined`);for(const e of n)(h.has(e)||"array"===e&&"array"===o.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void i.elseIf(s._`${a} == "number" || ${a} == "boolean"`).assign(l,s._`"" + ${r}`).elseIf(s._`${r} === null`).assign(l,s._`""`);case"number":return void i.elseIf(s._`${a} == "boolean" || ${r} === null
2
2
  || (${a} == "string" && ${r} && ${r} == +${r})`).assign(l,s._`+${r}`);case"integer":return void i.elseIf(s._`${a} === "boolean" || ${r} === null
3
3
  || (${a} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(l,s._`+${r}`);case"boolean":return void i.elseIf(s._`${r} === "false" || ${r} === 0 || ${r} === null`).assign(l,!1).elseIf(s._`${r} === "true" || ${r} === 1`).assign(l,!0);case"null":return i.elseIf(s._`${r} === "" || ${r} === 0 || ${r} === false`),void i.assign(l,null);case"array":i.elseIf(s._`${a} === "string" || ${a} === "number"
4
4
  || ${a} === "boolean" || ${r} === null`).assign(l,s._`[${r}]`)}}i.else(),m(e),i.endIf(),i.if(s._`${l} !== undefined`,(()=>{i.assign(r,l),function({gen:e,parentData:t,parentDataProperty:n},i){e.if(s._`${t} !== undefined`,(()=>e.assign(s._`${t}[${n}]`,i)))}(e,l)}))}(e,t,a):m(e)}))}return c};const h=new Set(["string","number","integer","boolean","null"]);function u(e,t,n,i=l.Correct){const r=i===l.Correct?s.operators.EQ:s.operators.NEQ;let o;switch(e){case"null":return s._`${t} ${r} null`;case"array":o=s._`Array.isArray(${t})`;break;case"object":o=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return s._`typeof ${t} ${r} ${e}`}return i===l.Correct?o:(0,s.not)(o);function a(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,n?s._`isFinite(${t})`:s.nil)}}function d(e,t,n,i){if(1===e.length)return u(e[0],t,n,i);let r;const o=(0,a.toHash)(e);if(o.array&&o.object){const e=s._`typeof ${t} != "object"`;r=o.null?e:s._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else r=s.nil;o.number&&delete o.integer;for(const e in o)r=(0,s.and)(r,u(e,t,n,i));return r}t.checkDataType=u,t.checkDataTypes=d;const p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function m(e){const t=function(e){const{gen:t,data:n,schema:i}=e,r=(0,a.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:n,schema:i.type,schemaCode:r,schemaValue:r,parentSchema:i,params:{},it:e}}(e);(0,o.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),r=n(4227);function o(e,t,n){const{gen:o,compositeRule:s,data:a,opts:l}=e;if(void 0===n)return;const c=i._`${a}${(0,i.getProperty)(t)}`;if(s)return void(0,r.checkStrictMode)(e,`default is ignored for: ${c}`);let h=i._`${c} === undefined`;"empty"===l.useDefaults&&(h=i._`${h} || ${c} === null || ${c} === ""`),o.if(h,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)o(e,t,n[t].default);else"array"===t&&Array.isArray(i)&&i.forEach(((t,n)=>o(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),r=n(208),o=n(7887),s=n(208),a=n(7870),l=n(3673),c=n(4495),h=n(9029),u=n(2023),d=n(6939),p=n(4227),m=n(8708);function f({gen:e,validateName:t,schema:n,schemaEnv:i,opts:r},o){r.code.es5?e.func(t,h._`${u.default.data}, ${u.default.valCxt}`,i.$async,(()=>{e.code(h._`"use strict"; ${g(n,r)}`),function(e,t){e.if(u.default.valCxt,(()=>{e.var(u.default.instancePath,h._`${u.default.valCxt}.${u.default.instancePath}`),e.var(u.default.parentData,h._`${u.default.valCxt}.${u.default.parentData}`),e.var(u.default.parentDataProperty,h._`${u.default.valCxt}.${u.default.parentDataProperty}`),e.var(u.default.rootData,h._`${u.default.valCxt}.${u.default.rootData}`),t.dynamicRef&&e.var(u.default.dynamicAnchors,h._`${u.default.valCxt}.${u.default.dynamicAnchors}`)}),(()=>{e.var(u.default.instancePath,h._`""`),e.var(u.default.parentData,h._`undefined`),e.var(u.default.parentDataProperty,h._`undefined`),e.var(u.default.rootData,u.default.data),t.dynamicRef&&e.var(u.default.dynamicAnchors,h._`{}`)}))}(e,r),e.code(o)})):e.func(t,h._`${u.default.data}, ${function(e){return h._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${e.dynamicRef?h._`, ${u.default.dynamicAnchors}={}`:h.nil}}={}`}(r)}`,i.$async,(()=>e.code(g(n,r)).code(o)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?h._`/*# sourceURL=${n} */`:h.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 v(e){(0,p.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:i,self:r}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function w(e,t){if(e.opts.jtd)return A(e,[],!1,t);const n=(0,r.getSchemaTypes)(e.schema);A(e,n,!(0,r.coerceAndCheckDataType)(e,n),t)}function C({gen:e,schemaEnv:t,schema:n,errSchemaPath:i,opts:r}){const o=n.$comment;if(!0===r.$comment)e.code(h._`${u.default.self}.logger.log(${o})`);else if("function"==typeof r.$comment){const n=h.str`${i}/$comment`,r=e.scopeValue("root",{ref:t.root});e.code(h._`${u.default.self}.opts.$comment(${o}, ${n}, ${r}.schema)`)}}function A(e,t,n,i){const{gen:r,schema:a,data:l,allErrors:c,opts:d,self:m}=e,{RULES:f}=m;function g(p){(0,o.shouldUseGroup)(a,p)&&(p.type?(r.if((0,s.checkDataType)(p.type,l,d.strictNumbers)),S(e,p),1===t.length&&t[0]===p.type&&n&&(r.else(),(0,s.reportTypeError)(e)),r.endIf()):S(e,p),c||r.if(h._`${u.default.errors} === ${i||0}`))}!a.$ref||!d.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(a,f)?(d.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{x(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)x(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 r=n[i];if("object"==typeof r&&(0,o.shouldUseRule)(e.schema,r)){const{type:n}=r.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),r.block((()=>{for(const e of f.rules)g(e);g(f.post)}))):r.block((()=>M(e,"$ref",f.all.$ref.definition)))}function S(e,t){const{gen:n,schema:i,opts:{useDefaults:r}}=e;r&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,o.shouldUseRule)(i,n)&&M(e,n.keyword,n.definition,t.type)}))}function x(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)&&(v(e),y(e))?function(e){const{schema:t,opts:n,gen:i}=e;f(e,(()=>{n.$comment&&t.$comment&&C(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(u.default.vErrors,null),i.let(u.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",h._`${n}.evaluated`),t.if(h._`${e.evaluated}.dynamicProps`,(()=>t.assign(h._`${e.evaluated}.props`,h._`undefined`))),t.if(h._`${e.evaluated}.dynamicItems`,(()=>t.assign(h._`${e.evaluated}.items`,h._`undefined`)))}(e),w(e),function(e){const{gen:t,schemaEnv:n,validateName:i,ValidationError:r,opts:o}=e;n.$async?t.if(h._`${u.default.errors} === 0`,(()=>t.return(u.default.data)),(()=>t.throw(h._`new ${r}(${u.default.vErrors})`))):(t.assign(h._`${i}.errors`,u.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:n,items:i}){n instanceof h.Name&&e.assign(h._`${t}.props`,n),i instanceof h.Name&&e.assign(h._`${t}.items`,i)}(e),t.return(h._`${u.default.errors} === 0`))}(e)}))}(e):f(e,(()=>(0,i.topBoolOrEmptySchema)(e)))};class _{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",L(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",u.default.errors))}result(e,t,n){this.failResult((0,h.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,h.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(h._`${t} !== undefined && (${(0,h.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=h.nil){this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(e=h.nil,t=h.nil){if(!this.$data)return;const{gen:n,schemaCode:i,schemaType:r,def:o}=this;n.if((0,h.or)(h._`${i} === undefined`,t)),e!==h.nil&&n.assign(e,!0),(r.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==h.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:i,it:r}=this;return(0,h.or)(function(){if(n.length){if(!(t instanceof h.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return h._`${(0,s.checkDataTypes)(e,t,r.opts.strictNumbers,s.DataType.Wrong)}`}return h.nil}(),function(){if(i.validateSchema){const n=e.scopeValue("validate$data",{ref:i.validateSchema});return h._`!${n}(${t})`}return h.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 r={...this.it,...n,items:void 0,props:void 0};return function(e,t){b(e)&&(v(e),y(e))?function(e,t){const{schema:n,gen:i,opts:r}=e;r.$comment&&n.$comment&&C(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 o=i.const("_errs",u.default.errors);w(e,o),i.var(t,h._`${o} === ${u.default.errors}`)}(e,t):(0,i.boolOrEmptySchema)(e,t)}(r,t),r}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,h.Name))),!0}}function M(e,t,n,i){const r=new _(e,n,t);"code"in n?n.code(r,i):r.$data&&n.validate?(0,l.funcKeywordCode)(r,n):"macro"in n?(0,l.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,l.funcKeywordCode)(r,n)}t.KeywordCxt=_;const I=/^\/(?:[^~]|~0|~1)*$/,T=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function L(e,{dataLevel:t,dataNames:n,dataPathArr:i}){let r,o;if(""===e)return u.default.rootData;if("/"===e[0]){if(!I.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);r=e,o=u.default.rootData}else{const s=T.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(r=s[2],"#"===r){if(a>=t)throw new Error(l("property/index",a));return i[t-a]}if(a>t)throw new Error(l("data",a));if(o=n[t-a],!r)return o}let s=o;const a=r.split("/");for(const e of a)e&&(o=h._`${o}${(0,h.getProperty)((0,p.unescapeJsonPointer)(e))}`,s=h._`${s} && ${o}`);return s;function l(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=L},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),r=n(2023),o=n(5765),s=n(8708);function a(e){const{gen:t,data:n,it:r}=e;t.if(r.parentData,(()=>t.assign(n,i._`${r.parentData}[${r.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:r,schema:o,parentSchema:s,it:a}=e,c=t.macro.call(a.self,o,s,a),h=l(n,r,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);const u=n.name("valid");e.subschema({schema:c,schemaPath:i.nil,errSchemaPath:`${a.errSchemaPath}/${r}`,topSchemaRef:h,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:c,keyword:h,schema:u,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 f=!p&&t.compile?t.compile.call(m.self,u,d,m):t.validate,g=l(c,h,f),y=c.let("valid");function b(n=(t.async?i._`await `:i.nil)){const s=m.opts.passContext?r.default.this:r.default.self,a=!("compile"in t&&!p||!1===t.schema);c.assign(y,i._`${n}${(0,o.callValidateCode)(e,g,s,a)}`,t.modifying)}function v(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),v((()=>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._`${g}.errors`;return c.assign(e,null),b(i.nil),e}();t.modifying&&a(e),v((()=>function(e,t){const{gen:n}=e;n.if(i._`Array.isArray(${t})`,(()=>{n.assign(r.default.vErrors,i._`${r.default.vErrors} === null ? ${t} : ${r.default.vErrors}.concat(${t})`).assign(r.default.errors,i._`${r.default.vErrors}.length`),(0,s.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},r,o){if(Array.isArray(r.keyword)?!r.keyword.includes(o):r.keyword!==o)throw new Error("ajv implementation error");const s=r.dependencies;if(null==s?void 0:s.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(r.validateSchema&&!r.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${i}": `+n.errorsText(r.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),r=n(4227);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:o,schemaPath:s,errSchemaPath:a,topSchemaRef:l}){if(void 0!==t&&void 0!==o)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const o=e.schema[t];return void 0===n?{schema:o,schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[n],schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}${(0,i.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,r.escapeFragment)(n)}`}}if(void 0!==o){if(void 0===s||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:s,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:o,data:s,dataTypes:a,propertyName:l}){if(void 0!==s&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=t;if(void 0!==n){const{errorPath:s,dataPathArr:a,opts:l}=t;h(c.let("data",i._`${t.data}${(0,i.getProperty)(n)}`,!0)),e.errorPath=i.str`${s}${(0,r.getErrorPath)(n,o,l.jsPropertySyntax)}`,e.parentDataProperty=i._`${n}`,e.dataPathArr=[...a,e.parentDataProperty]}function h(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!==s&&(h(s instanceof i.Name?s:c.let("data",s,!0)),void 0!==l&&(e.propertyName=l)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:i,createErrors:r,allErrors:o}){void 0!==i&&(e.compositeRule=i),void 0!==r&&(e.createErrors=r),void 0!==o&&(e.allErrors=o),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 r=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const o=n(3558),s=n(4551),a=n(396),l=n(3835),c=n(9029),h=n(6939),u=n(208),d=n(4227),p=n(3837),m=n(5944),f=(e,t)=>new RegExp(e,t);f.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},v={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function w(e){var t,n,i,r,o,s,a,l,c,h,u,d,p,g,y,b,v,w,C,A,S,x,E,_,M;const I=e.strict,T=null===(t=e.code)||void 0===t?void 0:t.optimize,L=!0===T||void 0===T?1:T||0,N=null!==(i=null===(n=e.code)||void 0===n?void 0:n.regExp)&&void 0!==i?i:f,$=null!==(r=e.uriResolver)&&void 0!==r?r:m.default;return{strictSchema:null===(s=null!==(o=e.strictSchema)&&void 0!==o?o:I)||void 0===s||s,strictNumbers:null===(l=null!==(a=e.strictNumbers)&&void 0!==a?a:I)||void 0===l||l,strictTypes:null!==(h=null!==(c=e.strictTypes)&&void 0!==c?c:I)&&void 0!==h?h:"log",strictTuples:null!==(d=null!==(u=e.strictTuples)&&void 0!==u?u:I)&&void 0!==d?d:"log",strictRequired:null!==(g=null!==(p=e.strictRequired)&&void 0!==p?p:I)&&void 0!==g&&g,code:e.code?{...e.code,optimize:L,regExp:N}:{optimize:L,regExp:N},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(v=e.meta)||void 0===v||v,messages:null===(w=e.messages)||void 0===w||w,inlineRefs:null===(C=e.inlineRefs)||void 0===C||C,schemaId:null!==(A=e.schemaId)&&void 0!==A?A:"$id",addUsedSchema:null===(S=e.addUsedSchema)||void 0===S||S,validateSchema:null===(x=e.validateSchema)||void 0===x||x,validateFormats:null===(E=e.validateFormats)||void 0===E||E,unicodeRegExp:null===(_=e.unicodeRegExp)||void 0===_||_,int32range:null===(M=e.int32range)||void 0===M||M,uriResolver:$}}class C{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...w(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 I;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)(),A.call(this,b,e,"NOT SUPPORTED"),A.call(this,v,e,"DEPRECATED","warn"),this._metaOpts=M.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&_.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),x.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 r.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function r(e){e&&!this.getSchema(e)&&await i.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await l.call(this,t.missingSchema),o.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 r.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 r;if("object"==typeof e){const{schemaId:t}=this.opts;if(r=e[t],void 0!==r&&"string"!=typeof r)throw new Error(`schema ${t} must be string`)}return t=(0,h.normalizeId)(t||r),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=S.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=S.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,h.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(L.call(this,n,t),!t)return(0,d.eachItem)(n,(e=>N.call(this,e))),this;P.call(this,t);const i={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(n,0===i.type.length?e=>N.call(this,e,i):e=>i.type.forEach((t=>N.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 r=e;for(const e of t)r=r[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:i}=t.definition,o=r[e];i&&o&&(r[e]=O(o))}}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,r=this.opts.addUsedSchema){let o;const{schemaId:s}=this.opts;if("object"==typeof e)o=e[s];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,h.normalizeId)(o||n);const c=h.getSchemaRefs.call(this,e,n);return a=new l.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:n,localRefs:c}),this._cache.set(a.schema,a),r&&!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 A(e,t,n,i="error"){for(const r in e){const o=r;o in t&&this.logger[i](`${n}: option ${r}. ${e[o]}`)}}function S(e){return e=(0,h.normalizeId)(e),this.schemas[e]||this.refs[e]}function x(){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 _(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 M(){const e={...this.opts};for(const t of g)delete e[t];return e}C.ValidationError=o.default,C.MissingRefError=s.default,t.default=C;const I={log(){},warn(){},error(){}},T=/^[a-z_$][a-z0-9_$:-]*$/i;function L(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(!T.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 N(e,t,n){var i;const r=null==t?void 0:t.post;if(n&&r)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let s=r?o.post:o.rules.find((({type:e})=>e===n));if(s||(s={type:n,rules:[]},o.rules.push(s)),o.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?$.call(this,s,a,t.before):s.rules.push(a),o.all[e]=a,null===(i=t.implements)||void 0===i||i.forEach((e=>this.addKeyword(e)))}function $(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 P(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=O(t)),e.validateSchema=this.compile(t,!0))}const R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,R]}}},9572:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(1678),r=n(7216),o=n(9547),s=n(8226),a=n(518),l=n(4588),c=n(5707),h=n(7082),u=["/properties"];t.default=function(e){return[i,r,o,s,a,t(this,l),c,t(this,h)].forEach((e=>this.addMetaSchema(e,void 0,!1))),this;function t(t,n){return e?t.$dataMetaSchema(n,u):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,r=0;for(;r<t;)i++,n=e.charCodeAt(r++),n>=55296&&n<=56319&&r<t&&(n=e.charCodeAt(r),56320==(64512&n)&&r++);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),r=n(4227),o={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)?s(e,i):(0,r.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:n,schema:o,data:s,keyword:a,it:l}=e;l.items=!0;const c=n.const("len",i._`${s}.length`);if(!1===o)e.setParams({len:t.length}),e.pass(i._`${c} <= ${t.length}`);else if("object"==typeof o&&!(0,r.alwaysValidSchema)(l,o)){const o=n.var("valid",i._`${c} <= ${t.length}`);n.if((0,i.not)(o),(()=>function(o){n.forRange("i",t.length,c,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:r.Type.Num},o),l.allErrors||n.if((0,i.not)(o),(()=>n.break()))}))}(o))),e.ok(o)}}t.validateAdditionalItems=s,t.default=o},8660:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(5765),r=n(9029),o=n(2023),s=n(4227),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>r._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:a,data:l,errsCount:c,it:h}=e;if(!c)throw new Error("ajv implementation error");const{allErrors:u,opts:d}=h;if(h.props=!0,"all"!==d.removeAdditional&&(0,s.alwaysValidSchema)(h,n))return;const p=(0,i.allSchemaProperties)(a.properties),m=(0,i.allSchemaProperties)(a.patternProperties);function f(e){t.code(r._`delete ${l}[${e}]`)}function g(i){if("all"===d.removeAdditional||d.removeAdditional&&!1===n)f(i);else{if(!1===n)return e.setParams({additionalProperty:i}),e.error(),void(u||t.break());if("object"==typeof n&&!(0,s.alwaysValidSchema)(h,n)){const n=t.name("valid");"failing"===d.removeAdditional?(y(i,n,!1),t.if((0,r.not)(n),(()=>{e.reset(),f(i)}))):(y(i,n),u||t.if((0,r.not)(n),(()=>t.break())))}}}function y(t,n,i){const r={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===i&&Object.assign(r,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(r,n)}t.forIn("key",l,(n=>{p.length||m.length?t.if(function(n){let o;if(p.length>8){const e=(0,s.schemaRefOrVal)(h,a.properties,"properties");o=(0,i.isOwnProperty)(t,e,n)}else o=p.length?(0,r.or)(...p.map((e=>r._`${n} === ${e}`))):r.nil;return m.length&&(o=(0,r.or)(o,...m.map((t=>r._`${(0,i.usePattern)(e,t)}.test(${n})`)))),(0,r.not)(o)}(n),(()=>g(n))):g(n)})),e.ok(r._`${c} === ${o.default.errors}`)}};t.default=a},5844:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(4227),r={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const o=t.name("valid");n.forEach(((t,n)=>{if((0,i.alwaysValidSchema)(r,t))return;const s=e.subschema({keyword:"allOf",schemaProp:n},o);e.ok(o),e.mergeEvaluated(s)}))}};t.default=r},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),r=n(4227),o={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:o,data:s,it:a}=e;let l,c;const{minContains:h,maxContains:u}=o;a.opts.next?(l=void 0===h?1:h,c=u):l=1;const d=t.const("len",i._`${s}.length`);if(e.setParams({min:l,max:c}),void 0===c&&0===l)return void(0,r.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==c&&l>c)return(0,r.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,r.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);f(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 f(n,i){t.forRange("i",0,d,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:r.Type.Num,compositeRule:!0},n),i()}))}void 0===c&&1===l?f(p,(()=>t.if(p,(()=>t.break())))):0===l?(t.let(p,!0),void 0!==c&&t.if(i._`${s}.length > 0`,m)):(t.let(p,!1),m()),e.result(p,(()=>e.reset()))}};t.default=o},3025:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const i=n(9029),r=n(4227),o=n(5765);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const r=1===t?"property":"properties";return i.str`must have ${r} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:r}})=>i._`{property: ${e},