@datagrok/bio 2.13.5 → 2.13.6
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/CHANGELOG.md +4 -0
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/package.json +2 -2
package/dist/package-test.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var bio_test;(()=>{var e={8924:(e,t,n)=>{"use strict";n.d(t,{X:()=>s});var r=n(7362);class s extends r.e{static get Lesk(){return void 0===this.lesk&&(this.lesk=this.makePalette([[["G","A","S","T"],"orange"],[["C","V","I","L","P","F","Y","M","W"],"all_green"],[["N","Q","H"],"magenta"],[["D","E"],"red"],[["K","R"],"all_blue"]],!1,s)),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,s)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new s({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 s.aaSynonyms?s.aaSynonyms[e]:e;return super.get(t)}}s.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class o{static getPalette(e="grok"){switch(e){case"grok":return s.GrokGroups;case"lesk":return s.Lesk;default:throw new Error(`ChemPalette: scheme \`${e}\` does not exist`)}}static getInnerOuter(e){let t=0,n="",r="";for(const s of e)"("==s?t++:")"==s?t--:t?n+=s:r+=s;return isNaN(parseInt(n))?[r,n]:[r,""]}static getColorAAPivot(e="",t="grok"){const n=this.getPalette(t);let[r,s]=this.getInnerOuter(e);if(r=r.length>6?`${r.slice(0,3)}...`:r,s=s.length>6?`${s.slice(0,3)}...`:s,1==e.length||"("==e[1]){const t=e[0]?.toUpperCase();return t in n?[n.get(t),t,s,1]:[this.undefinedColor,r,s,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,s,2]:[this.undefinedColor,r,s,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,s,3]:[this.undefinedColor,r,s,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,s,4]:[this.undefinedColor,r,s,4]}return[this.undefinedColor,r,s,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"}},9124:(e,t,n)=>{"use strict";n.d(t,{b:()=>o});var r=n(7389),s=n(6082);async function o(){const e="Helm",t=s.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()}r.input.helmAsync=async function(e,t){return(await o()).createHelmInput(e,t)}},4356:(e,t,n)=>{"use strict";n.d(t,{Eu:()=>l,so:()=>o,ub:()=>c,yZ:()=>u});var r=n(4328);const s="Libraries",o="System:AppData/Bio/monomer-libraries/",a={explicit:["HELMCoreLibrary.json"],exclude:[]};let i=Promise.resolve();async function c(){let e;return i=i.then((async()=>{const t=await r.dapi.userDataStorage.getValue(s,"Settings",!0);e=t?JSON.parse(t):{exclude:[],explicit:[]},e.exclude=e.exclude instanceof Array?e.exclude:[],e.explicit=e.explicit instanceof Array?e.explicit:[],console.debug(`Bio: getUserLibSettings()\n${JSON.stringify(e,void 0,2)}`)})),await i,e}async function l(e){i=i.then((async()=>{console.debug(`Bio: setUserLibSettings()\n${JSON.stringify(e,void 0,2)}`),await r.dapi.userDataStorage.postValue(s,"Settings",JSON.stringify(e),!0)})),await i}async function u(){await l(a)}},6718:(e,t,n)=>{"use strict";n.d(t,{A7:()=>d,pj:()=>c,uL:()=>l});var r=n(6082),s=n(4328),o=n(6295),a=(n(3151),n(2738)),i=(n(826),n(3077));async function c(){const e=r.Func.find({package:"Bio",name:"getMonomerLibHelper"});if(0===e.length)throw new Error('Package "Bio" must be installed for MonomerLibHelper.');return(await e[0].prepare().call()).getOutputParamValue()}async function l(e,t){e instanceof r.Column&&(e=(0,i.R)(e).columns.toList());const n=(await c()).getBioLib(),o=new Array(e.length),l=e[0].length,u=new Float32Array(l);for(let i=0;i<e.length;++i){const c=i<t.length?t.getCanonical(i):a._S,d=n.getMonomer("PEPTIDE",c)?.smiles??"",h=e[i],m=h.getRawData(),p=h.categories,f=p.indexOf("");if(o[i]={categories:p,data:m,emptyIndex:f},void 0===c)continue;const g=r.Column.fromStrings("smiles",p.map((e=>n.getMonomer("PEPTIDE",e)?.smiles??""))),y=(r.DataFrame.fromColumns([g]),await s.chem.getSimilarities(g,d)),w=y?y.getRawData():null;for(let e=0;e<l;++e){const t=m[e];c!==a._S&&t!==f?u[e]+=w[t]:c===a._S&&t===f&&(u[e]+=1)}}for(let n=0;n<u.length;++n){let s=u[n]/t.length;for(let a=0;a<e.length;++a){const e=o[a];if(a>=t.length&&e.data[n]!==e.emptyIndex||e.data[n]===e.emptyIndex&&a<t.length){s=r.FLOAT_NULL;break}}u[n]=s}return r.Column.fromFloat32Array("Similarity",u)}async function u(e){const t=(await c()).getBioLib(),n=[],o={},a=e.map((e=>t.getMonomer("PEPTIDE",e)?.smiles??"")),i=r.Column.fromStrings("smiles",a);for(let t=0;t<a.length;++t){o[e[t]]=t;const r=a[t],c=""===r?new Array(a.length).fill(0):(await s.chem.getSimilarities(i,r)).getRawData();c[t]=1,n[t]=Array.from(c)}return{scoringMatrix:n,alphabetIndexes:o}}async function d(e,t="Morgan"){const n=(await c()).getBioLib(),s=new Array(e.length).fill(0).map((()=>new Array(e.length).fill(0))),a={},i=e.map((e=>n.getMonomer("PEPTIDE",e)?.smiles??"")),l=r.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 u(e);const d=r.Column.fromStrings("smiles",i),h=(r.DataFrame.fromColumns([d]),(await l.apply({col:d,fingerprintType:t}))?.entries);if(!h)return console.warn(`${t} Fingerprints could not be calculated for monomers from chem package.\n falling back to Morgan fingerprints`),await u(e);for(let t=0;t<h.length;++t)if(s[t][t]=1,a[e[t]]=t,h[t])for(let e=t+1;e<h.length;++e)h[e]&&(s[t][e]=s[e][t]=(0,o.$1)(h[t],h[e]));return{scoringMatrix:s,alphabetIndexes:a}}},7384:(e,t,n)=>{"use strict";n.d(t,{C4:()=>h});var r=n(4328),s=n(6082),o=n(1991),a=n.n(o),i=n(439),c=n(826);const l={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:"d",RIBOSE:"r",PHOSPHATE:"p",OXYGEN:"O",HYDROGEN:"H"};var u=n(3151);function d(e){return Math.round(l.PRECISION_FACTOR*e)/l.PRECISION_FACTOR}async function h(e,t,o){if(0===s.Func.find({package:"Chem",name:"getRdKitModule"}).length)return{col:null,warnings:['Transformation to atomic level requires the package "Chem" installed.']};if(t.semType!==s.SEMTYPE.MACROMOLECULE)return{col:null,warnings:[`Only the ${s.SEMTYPE.MACROMOLECULE} columns can be converted to atomic level, the chosen column has semType '${t.semType}'`]};let d=t;const h=c.GO.forColumn(t);h.isHelm()&&(d=h.convert(i.Hi.SEPARATOR,"."),d.name=t.name);const p=c.GO.forColumn(d).alphabet;let f;if(p===i.YI.PT||p===i.YI.UN)f="PEPTIDE";else{if(p!==i.YI.RNA&&p!==i.YI.DNA)return{col:null,warnings:[`Unexpected column's '${d.name}' alphabet '${p}'.`]};f="RNA"}const g=function(e){const t=e.length,n=new Array(t),s=c.GO.forColumn(e);let o=!1;for(let e=0;e<t;++e){const t=s.getSplitted(e);o||(o=0===t.length),n[e]=a()(t.canonicals).filter((e=>!s.isGap(e))).map((e=>e)).toArray()}return o&&r.shell.warning(`Some values in the "${e.name}" column are empty`),n}(d),y=await async function(e,t,n,s){const o=function(e,t,n){const r=new Map;for(const s of e.getMonomerSymbolsByType(t)){const o=e.getMonomer(t,s);if("RNA"===t&&("Branch"===o.monomerType||n===i.YI.DNA&&o.symbol===l.DEOXYRIBOSE||n===i.YI.RNA&&o.symbol===l.RIBOSE||o.symbol===l.PHOSPHATE)||"PEPTIDE"===t&&"Branch"!==o.monomerType){const e={};u.f6.forEach((t=>{e[t]=o[t]})),r.set(o.symbol,e)}}return r}(t,n,s),a=new Map,c=await r.functions.call("Chem:getRdKitModule"),d={value:null};if("RNA"===n){const e=s===i.YI.RNA?[l.RIBOSE,l.PHOSPHATE]:[l.DEOXYRIBOSE,l.PHOSPHATE];for(const t of e)m(a,t,o,c,n,d)}for(let t=0;t<e.length;++t){const r=e[t];for(const e of r)if(""!==e)try{m(a,e,o,c,n,d)}catch(t){const n=t instanceof Error?t.message:t.toString(),r=t instanceof Error?t.stack:void 0;throw console.error(`bio lib: getMonomersDictFromLib() sym='${e}', error:\n${n}\n${r}`),new Error(`Can't get monomer '${e}' from library: ${n}`)}}return a}(g,o,f,p),w=d.length,{molfileList:b,molfileWarningList:A}=await async function(e,t,r,s,o){const a=Math.max(navigator.hardwareConcurrency-2,1),i=new Array(a).fill(null).map((()=>new Worker(new URL(n.p+n.u(248),n.b)))),c=o/a;let l=[],u=[];const d=new Array(a);for(let n=0;n<a;n++){const l=Math.floor(n*c),u=n===a-1?o:Math.floor((n+1)*c);i[n].postMessage({monomerSequencesArray:e,monomersDict:t,alphabet:r,polymerType:s,start:l,end:u}),d[n]=new Promise((e=>{i[n].onmessage=({data:{molfileList:t,molfileWarningList:n}})=>{e({molfileList:t,molfileWarningList:n})}}))}return(await Promise.all(d)).forEach((e=>{l=l.concat(...e.molfileList),u=u.concat(...e.molfileWarningList)})),setTimeout((()=>{i.forEach((e=>{e.terminate()}))}),0),{molfileList:l,molfileWarningList:u}}(g,y,p,f,w);if(A.length>.05*w)throw new Error("Too many errors getting molfiles.");const C=`molfile(${d.name})`,T=e.columns.getUnusedName(C),v=s.Column.fromStrings(T,b);return v.semType=s.SEMTYPE.MOLECULE,v.meta.units=s.UNITS.Molecule.MOLBLOCK,{col:v,warnings:A}}function m(e,t,n,r,s,o){if(!e.has(t)){const a=function(e,t,n,r,s){if(t.has(e)){const a=t.get(e),i=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}(a.rgroups),c=(o=a.molfile).includes("V3000")?function(e){const t=new Map,n=/M V30 (\d+) R#.+RGROUPS=\((\d+) (\d+)\).*/gm;let r;for(;null!==(r=n.exec(e));)r.index===n.lastIndex&&n.lastIndex++,t.set(parseInt(r[1]),parseInt(r[3]));return t}(o):function(e){const t=new Map;let n=e.indexOf(l.V2K_A_LINE,0),r=n;for(;-1!==n;){r=e.indexOf("\n",n);const s=parseInt(e.substring(n,r).replace(/^A\s+/,""));n=e.indexOf("R",r),r=e.indexOf("\n",n);const o=parseInt(e.substring(n,r).replace(/^R/,""));t.set(s,o),n=e.indexOf(l.V2K_A_LINE,r)}for(n=e.indexOf(l.V2K_RGP_LINE,0),r=e.indexOf("\n",n);-1!==n;){n+=l.V2K_RGP_SHIFT,r=e.indexOf("\n",n);const s=e.substring(n,r).replaceAll(/\s+/g," ").split(" ").map((e=>parseInt(e))).slice(1);for(let e=0;e<s.length;e+=2){if(t.has(s[e])&&t.get(s[e])!==s[e+1])throw new Error(`r-group index ${s[e]} has already been added with a different value`);t.set(s[e],s[e+1])}n=e.indexOf(l.V2K_RGP_LINE,r)}return t}(o),u=a.molfile.includes("V3000")?a.molfile:function(e,t){const n=t.get_mol(e),r=n.get_v3Kmolblock();return n.delete(),r}(function(e){let t=e.indexOf(l.V2K_A_LINE,0);-1===t&&(t=e.indexOf(l.V2K_RGP_LINE));const n=e.indexOf(l.V3K_END,t);return e.substring(0,t)+e.substring(n)}(a.molfile),n),h=function(e){let t=(e=e.replaceAll("\r","")).indexOf(l.V3K_BEGIN_COUNTS_LINE)+l.V3K_COUNTS_SHIFT,n=e.indexOf(" ",t+1);const r=parseInt(e.substring(t,n));return t=n+1,n=e.indexOf(" ",t+1),{atomCount:r,bondCount:parseInt(e.substring(t,n))}}(u),m=function(e,t){const n=new Array(t),r=new Float32Array(t),s=new Float32Array(t),o=new Array(t);let a=e.indexOf(l.V3K_BEGIN_ATOM_BLOCK);a=e.indexOf("\n",a);let i=a;for(let c=0;c<t;c++){a=e.indexOf(l.V3K_BEGIN_DATA_LINE,a)+l.V3K_IDX_SHIFT,i=e.indexOf(" ",a),a=i+1,i=e.indexOf(" ",a),n[c]=e.substring(a,i);const t=new Array(2);for(let n=0;n<2;++n)a=i+1,i=e.indexOf(" ",a),t[n]=parseFloat(e.substring(a,i));r[c]=t[0],s[c]=t[1],a=i,i=e.indexOf("\n",a)+1,o[c]=e.slice(a,i),a=i}return{atomTypes:n,x:r,y:s,kwargs:o}}(u,h.atomCount),g=function(e,t){const n=new Uint32Array(t),r=new Array(t),s=new Map,o=new Map;let a=e.indexOf(l.V3K_BEGIN_BOND_BLOCK);a=e.indexOf("\n",a);let i=a;for(let c=0;c<t;++c){const t=new Array(3);a=e.indexOf(l.V3K_BEGIN_DATA_LINE,i)+l.V3K_IDX_SHIFT,i=e.indexOf(" ",a);for(let n=0;n<3;++n)a=i+1,i=Math.min(e.indexOf("\n",a),e.indexOf(" ",a)),t[n]=parseInt(e.slice(a,i));n[c]=t[0],r[c]=t.slice(1);const u=e.indexOf("\n",a);let d=e.slice(i,u),h=d.indexOf(l.V3K_BOND_CONFIG);if(-1!==h){h=d.indexOf("=",h)+1;let e=d.indexOf(" ",h);-1===e&&(e=d.length);const t=parseInt(d.slice(h,e));s.set(c,t);const n=l.V3K_BOND_CONFIG+t.toString();d=d.replace(n,"")}d||o.set(c,d)}return{bondTypes:n,atomPairs:r,bondConfiguration:s,kwargs:o}}(u,h.bondCount),w=function(e,t,n,r){const s={backboneShift:null,branchShift:null,terminalNodes:[],rNodes:[]};return function(e,t,n){for(const[r,s]of n)e.atomTypes[r-1]=t[s-1]}(e,n,r),function(e,t){t.rNodes=Array.from(e.keys());for(let n=0;n<t.rNodes.length;n++)for(const r of[1,2])if(e.get(t.rNodes[n])===r){const e=t.rNodes[r-1];t.rNodes[r-1]=t.rNodes[n],t.rNodes[n]=e}}(r,s),p(t,s),s}(m,g,i,c),v=function(e){let t=[],n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(");for(;-1!==n;){n+=28;const r=e.indexOf(")",n);t=t.concat(e.substring(n,r).split(" ").slice(1).map((e=>parseInt(e)))),n=r,n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(",n)}return t}(u),E={atoms:m,bonds:g,meta:w,stereoAtoms:v};return"PEPTIDE"===r?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,r=e.atoms.x,s=e.atoms.y;T(e,-r[t],-s[t]);const o=b(r[n],s[n]);A(e.atoms,-o),r[e.meta.rNodes[1]-1]<0&&function(e){C(e,!1)}(e);const a=function(e){const t=function(e){const t=new Map;for(const n of e.bonds.atomPairs)for(let e=0;e<2;e++){const r=n[e],s=n[(e+1)%2];t.has(r)?t.get(r)?.push(s):t.set(r,new Array(1).fill(s))}return t}(e);let n=0;const r=e.atoms.atomTypes.length;let s=0;for(;0===n;){const o=t.get(e.meta.terminalNodes[1])[s];if(e.atoms.atomTypes[o-1]===l.OXYGEN&&o!==e.meta.rNodes[1]&&(n=o),s++,s>r)throw new Error(`Search for double-bonded Oxygen in ${e} has exceeded the limit of ${r}`)}return n}(e);!function(e,t){e.atoms.y[e.meta.rNodes[1]-1]<0&&e.atoms.y[t-1]<0&&(function(e){C(e,!0)}(e),A(e.atoms,-function(e,t){return b(e,t)+Math.PI/2}(e.atoms.x[e.meta.terminalNodes[1]-1],e.atoms.y[e.meta.terminalNodes[1]-1])))}(e,a),function(e,t){const n=e.atoms.x;n[e.meta.rNodes[1]-1]>n[t-1]&&function(e,t,n){const r=t-1,s=n-1,o=e.atoms.x,a=e.atoms.y,i=o[r],c=a[r];o[r]=o[s],a[r]=a[s],o[s]=i,a[s]=c}(e,t,e.meta.rNodes[1])}(e,a)}(E):e===l.RIBOSE||e===l.DEOXYRIBOSE?function(e,t){const n=e.atoms.x,r=e.atoms.y;let s=e.meta.terminalNodes[0]-1;const o=e.meta.rNodes[1]-1;T(e,-n[s],-r[s]);const a=b(n[o],r[o]);A(e.atoms,3*Math.PI/2-a),t.value=function(e){const t=e.atoms.x,n=e.atoms.y,r=e.meta.rNodes[2]-1,s=e.meta.terminalNodes[2]-1,o=t[r]-t[s],a=n[r]-n[s];return Math.atan(a/o)+Math.PI/2}(e),s=e.meta.terminalNodes[0]-1,T(e,-n[s],-r[s])}(E,s):e===l.PHOSPHATE?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,r=e.atoms.x,s=e.atoms.y;T(e,-r[t],-s[t]);const o=b(r[n],s[n]);A(e.atoms,Math.PI/2-o)}(E):function(e,t){const n=e.atoms.x,r=e.atoms.y,s=e.meta.terminalNodes[0]-1,o=e.meta.rNodes[0]-1;T(e,-n[s],-r[s]);const a=b(n[o],r[o]),i=t.value;if(!i)throw new Error("The value of sugarBranchToOYAngle is null");A(e.atoms,Math.PI-a+i);const c=function(e,t){return d(Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2))}({x:n[e.meta.rNodes[0]-1],y:r[e.meta.rNodes[0]-1]},{x:n[e.meta.terminalNodes[0]-1],y:r[e.meta.terminalNodes[0]-1]});if(1!=c)for(let e=0;e<n.length;++e)n[e]=d(n[e]/c),r[e]=d(r[e]/c)}(E,s),function(e,t,n){"PEPTIDE"===e?(f(t,e),y(t,t.meta.rNodes[1])):n===l.RIBOSE||n===l.DEOXYRIBOSE?(y(t,t.meta.rNodes[1]),t.meta.rNodes[1]=t.meta.terminalNodes[1],p(t.bonds,t.meta),f(t,e),y(t,t.meta.rNodes[1]),y(t,t.meta.rNodes[0]),y(t,t.meta.rNodes[2])):n===l.PHOSPHATE&&(t.meta.terminalNodes[0]=t.meta.rNodes[0],T(t,-t.atoms.x[t.meta.terminalNodes[0]-1],-t.atoms.y[t.meta.terminalNodes[0]-1]),f(t,e),y(t,t.meta.rNodes[1]))}(r,E,e),function(e){let t=0;for(;t<e.atoms.atomTypes.length;)e.atoms.atomTypes[t]===l.HYDROGEN&&(y(e,t+1),--t),++t}(E),E}var o;return null}(t,n,r,s,o);if(!a)throw new Error(`Monomer with symbol '${t}' is absent the monomer library`);e.set(t,a)}}function p(e,t){const n=t.rNodes;t.terminalNodes=new Array(n.length).fill(0);const r=t.terminalNodes,s=e.atomPairs;let o=0,a=0;for(;o<s.length&&a<r.length;){for(let e=0;e<r.length;++e)for(let t=0;t<2;++t)s[o][t]===n[e]&&(r[e]=s[o][(t+1)%2],n.length,++a);++o}}function f(e,t){e.meta.rNodes.length>1&&(e.meta.backboneShift=g(e,e.meta.rNodes[1]-1,e.meta.terminalNodes[0]-1)),"RNA"===t&&e.meta.rNodes.length>2&&(e.meta.branchShift=g(e,e.meta.rNodes[2]-1,e.meta.terminalNodes[0]-1))}function g(e,t,n){return[d(e.atoms.x[t]-e.atoms.x[n]),d(e.atoms.y[t]-e.atoms.y[n])]}function y(e,t){if(void 0!==t){const n=t-1,r=e.atoms,s=e.bonds,o=e.meta;r.atomTypes.splice(n,1),r.x=w(Float32Array,r.x,n,1),r.y=w(Float32Array,r.y,n,1),r.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 a=0;for(;a<s.atomPairs.length;){const e=s.atomPairs[a][0],n=s.atomPairs[a][1];e===t||n===t?(s.atomPairs.splice(a,1),s.bondTypes=w(Uint32Array,s.bondTypes,a,1),s.bondConfiguration.has(a)&&s.bondConfiguration.delete(a),s.kwargs.has(a)&&s.kwargs.delete(a),--a):(s.atomPairs[a][0]=e>t?e-1:e,s.atomPairs[a][1]=n>t?n-1:n),++a}let i=Array.from(s.bondConfiguration.keys());i.forEach((e=>{if(s.bondConfiguration.has(e)&&e>n){const t=s.bondConfiguration.get(e);s.bondConfiguration.delete(e),s.bondConfiguration.set(e-1,t)}})),i=Array.from(s.kwargs.keys()),i.forEach((e=>{if(s.kwargs.has(e)&&e>n){const t=s.kwargs.get(e);s.kwargs.delete(e),s.kwargs.set(e-1,t)}}))}}function w(e,t,n,r){const s=new e(t.length-r);let o=0,a=0;for(;o<t.length;)o===n&&(o+=r),s[a]=t[o],++a,++o;return s}function b(e,t){let n;if(0===e)n=t>0?0:Math.PI;else if(0===t)n=e>0?-Math.PI/2:Math.PI/2;else{const r=t/e,s=Math.atan(r);n=e<0?Math.PI/2+s:-Math.PI/2+s}return n}function A(e,t){if(0!==t){const n=e.x,r=e.y,s=Math.cos(t),o=Math.sin(t);for(let e=0;e<n.length;++e){const t=n[e];n[e]=d(t*s-r[e]*o),r[e]=d(t*o+r[e]*s)}}}function C(e,t){if(t){const t=e.atoms.y;for(let e=0;e<t.length;e++)t[e]=-t[e]}else{const t=e.atoms.x;for(let e=0;e<t.length;e++)t[e]=-t[e]}const n=e.bonds.bondConfiguration;for(const[e,t]of n){const r=1===t?3:1;n.set(e,r)}}function T(e,t,n){const r=e.atoms.x,s=e.atoms.y;for(let e=0;e<r.length;++e)r[e]=d(r[e]+t),void 0!==n&&(s[e]=d(s[e]+n))}},1093:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,Q:()=>o});var r=n(7362);class s extends r.e{static get Chromatogram(){return void 0===this.chromatogram&&(this.chromatogram=new s({A:"green",C:"blue",G:"black",T:"red",U:"red",others:"gray"})),this.chromatogram}}class o{}o.SemType="Nucleotides",o.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",o.Names={A:"Adenine",C:"Cytosine",G:"Guanine",T:"Thymine",U:"Uracil"}},7362:(e,t,n)=>{"use strict";n.d(t,{e:()=>r});class r{static makePalette(e,t=!1,n=r){const s={};return e.forEach((e=>{const n=e[0],r=e[1];n.forEach(((e,n)=>{s[e]=this.colourPalette[r][t?0:n]}))})),new n(s)}constructor(e){this._palette=e}get(e){return this._palette[e]}}r.undefinedColor="rgb(100,100,100)",r.colourPalette={orange:["rgb(255,187,120)","rgb(245,167,100)","rgb(235,137,70)","rgb(205, 111, 71)"],all_green:["rgb(44,160,44)","rgb(74,160,74)","rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)","rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],all_blue:["rgb(31,119,180)","rgb(23,190,207)","rgb(122, 102, 189)","rgb(158,218,229)","rgb(141, 124, 217)","rgb(31, 120, 150)"],magenta:["rgb(162,106,192)","rgb(197,165,224)","rgb(208,113,218)"],red:["rgb(214,39,40)","rgb(255,152,150)"],st_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(31,119,180)"],dark_blue:["rgb(31,119,180)","rgb(31, 120, 150)"],light_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(108, 218, 229)","rgb(23,190,227)"],lilac_blue:["rgb(124,102,211)","rgb(149,134,217)","rgb(97, 81, 150)"],dark_green:["rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)"],green:["rgb(44,160,44)","rgb(74,160,74)"],light_green:["rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],st_green:["rgb(44,160,44)","rgb(152,223,138)","rgb(39, 174, 96)","rgb(74,160,74)"],pink:["rgb(247,182,210)"],brown:["rgb(140,86,75)","rgb(102, 62, 54)"],gray:["rgb(127,127,127)","rgb(199,199,199)","rgb(196,156,148)","rgb(222, 222, 180)"],yellow:["rgb(188,189,34)"],white:["rgb(230,230,230)"]}},4152:(e,t,n)=>{"use strict";n.d(t,{$u:()=>a,oT:()=>l});var r=n(6082),s=n(7362);class o{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 a{}class i extends a{get(e){return"#666666"}}class c extends a{static buildPalette(){return[].concat(...Object.values(s.e.colourPalette))}get(e){const t=o.hashCode(e)%c.palette.length;return function(e){if(null==e)return"rgb(100,100,100)";const t=r.Color.fromHtml(e),n=r.Color.g(t),s=r.Color.r(t),o=r.Color.b(t),a=Math.sqrt(Math.pow(0-s,2)+Math.pow(0-n,2)+Math.pow(0-o,2));return a>210?`rgb(${s/a*210},${n/a*210},${o/a*210})`:r.Color.toRgb(t)}(c.palette[t])}}c.palette=c.buildPalette();class l extends s.e{static get Gray(){return void 0===this.gray&&(this.gray=new i),this.gray}static get Color(){return void 0===this.color&&(this.color=new c),this.color}}},6642:(e,t,n)=>{"use strict";n.d(t,{h:()=>a,s:()=>i});var r=n(4328),s=n(1858),o=n(8070);function a(e){let t=null,n=null;try{n=e.dart?e.gridColumn:null,t=n?n.temp:null}catch{[n,t]=[null,null]}const r=e.cell.column;if(t=t??r.temp,!t)throw new Error("Grid cell renderer back store (GridColumn or Column) not found.");return[n,r,t]}class i{constructor(e,t,n){this.gridCol=e,this.tableCol=t,this.logger=n,this.subs=[],this.destroyed=!1,this.viewerId=++i.viewerCounter,this.errors=[],this._onRendered=new s.Subject,this.reset(),this.tableCol&&this.tableCol.dataFrame&&this.subs.push(this.tableCol.dataFrame.onDataChanged.subscribe((()=>{try{this.reset()}catch(e){this.logger.error(e)}}))),this.tableCol&&this.subs.push(r.events.onTableRemoved.subscribe((e=>{try{const t=e.args.dataFrame;this.tableCol?.dataFrame.id!==t.id||this.destroyed||this.destroy()}catch(e){this.logger.error(e)}}))),this.gridCol&&this.subs.push(r.events.onViewRemoving.subscribe((e=>{try{const t=e.args.view;this.gridCol?.dart&&this.gridCol.grid&&this.gridCol?.grid?.dart&&this.gridCol?.grid?.view?.id===t.id&&!this.destroyed&&this.destroy()}catch(e){this.logger.error(e)}})))}toLog(){return`${this.constructor.name}<${this.viewerId}>`}destroy(){for(const e of this.subs)e.unsubscribe();this.destroyed=!0}invalidateGrid(){this.gridCol&&this.gridCol.dart&&this.gridCol.grid?.invalidate()}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`)}}i.viewerCounter=-1},6882:(e,t,n)=>{"use strict";n.d(t,{B:()=>l,J:()=>u});var r=n(6082),s=n(1991),o=n.n(s),a=n(826),i=n(6642),c=n(6718);function l(e,t){let n,r=100,s=0,o=e.length-1;for(;s<=o;){if(n=Math.floor((o+s)/2),e[n]<=t&&t<e[n+1])return n;if(t<e[n]?o=n-1:s=n+1,--r<=0)throw new Error(`Get position for pointer x = ${t} searching has not converged on ${JSON.stringify(e)}. `)}return null}class u extends i.s{constructor(e,t,n,s,o){super(e,t,n),this.monomerLengthLimit=s,this.propsProvider=o,this.colWidth=0,this._monomerLengthList=null,this.separatorWidth=5,this._processedMaxVisibleSeqLength=0,this._monomerLengthMap={},this._monomerStructureMap={},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()}))),(0,c.pj)().then((e=>{if(this.destroyed)return;const t=e.getBioLib();this.subs.push(t.onChanged.subscribe((()=>{this.reset(),this.gridCol?.grid?.invalidate()})))}))}reset(){this.propsProvider&&(this.props=this.propsProvider()),this._processedRows=r.BitSet.create(this.tableCol.length),this._monomerLengthList=null,this._monomerLengthMap={},this._monomerStructureMap={}}getCellMonomerLengths(e,t){this.colWidth<t&&(this.colWidth=t,this.reset());const n=this.props.seqHandler.isMsa()?this.getCellMonomerLengthsForSeqMsa():this.getCellMonomerLengthsForSeq(e),r=new Array(n.length+1);r[0]=5;for(let e=1;e<r.length;e++)r[e]=r[e-1]+n[e-1];return[n,r]}getCellMonomerLengthsForSeq(e){this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(this.tableCol.length).fill(null));const t=this.props.separatorWidth+1*this.props.monomerCharWidth,n=Math.ceil(this.colWidth/t),r=a.GO.forColumn(this.tableCol).getSplitted(e).originals,s=Math.min(n,r.length);let o=this._monomerLengthList[e];if(null===o||o.length<s){o=this._monomerLengthList[e]=new Array(r.length);let t=0;for(let e=0;e<s;++e){const n=r[e],s=this.props.monomerToShort(n,this.monomerLengthLimit),a=(this.props.seqHandler.isSeparator()?this.separatorWidth:this.props.separatorWidth)+s.length*this.props.monomerCharWidth;if(o[e]=a,t+=a,t>this.colWidth)break}}return o}getCellMonomerLengthsForSeqMsa(){var e;this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(1).fill(null)),(e=this._monomerLengthList)[0]??(e[0]=new Array(0));const t=this._monomerLengthList[0],{startIdx:n,endIdx:r}=(()=>{try{const e=this.gridCol&&this.gridCol.dart?this.gridCol.grid:null;return e&&e.dart?{startIdx:Math.max(Math.floor((e?.vertScroll.min??0)-10),0),endIdx:Math.min(Math.ceil((e?.vertScroll.max??0)+10),this.tableCol.length)}:{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}catch(e){return{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}})(),s=this.props.separatorWidth+1*this.props.monomerCharWidth,o=Math.ceil(this.colWidth/s);for(let e=n;e<r;e++){if(this._processedRows.get(e)&&o<=this._processedMaxVisibleSeqLength)continue;const n=a.GO.forColumn(this.tableCol).getSplitted(e,o).originals,r=Math.min(o,n.length);r>t.length&&t.push(...new Array(r-t.length).fill(s));let i=0;for(let e=0;e<r;++e){const r=n[e],s=this.props.monomerToShort(r,this.monomerLengthLimit),o=this.props.separatorWidth+s.length*this.props.monomerCharWidth;if(t[e]=Math.max(t[e]??0,o),i+=o,i>=this.colWidth)break}this._processedMaxVisibleSeqLength=Math.max(this._processedMaxVisibleSeqLength,o)}return t}getPosition(e,t,n){const[r,s]=this.getCellMonomerLengths(e,n),i=a.GO.forColumn(this.tableCol);return 0===o()(i.getSplitted(e).originals).toArray().length?null:l(s,t)}setMonomerLengthLimit(e){this.monomerLengthLimit=e,this.reset()}setSeparatorWidth(e){this.props.separatorWidth=e,this.reset()}isMsa(){return this.props.seqHandler.isMsa()}}},3151:(e,t,n)=>{"use strict";n.d(t,{EK:()=>o,f6:()=>r,q7:()=>s});const r=["symbol","molfile","rgroups","name"],s="p",o=new RegExp(`[rd]\\((\\w)\\)${s}?`,"g")},9192:(e,t,n)=>{"use strict";function r(e){return"string"==typeof e||e instanceof String?e:"StateError"===e.constructor.name?e.message:"StateError"===e.constructor.name&&"$thrownJsError"in e?r(e.$thrownJsError):e instanceof Error?e.message:e.toString()}function s(e){return e instanceof Error?e.stack:"StateError"===e.constructor.name&&"$thrownJsError"in e?s(e.$thrownJsError):void 0}function o(e){return[r(e),s(e)]}n.d(t,{AP:()=>o})},3516:(e,t,n)=>{"use strict";n.d(t,{m:()=>a});var r=n(6082),s=n(826),o=n(439);class a{get descriptionsArray(){return this._descriptionsArray}get sequencesArray(){return this._sequencesArray}parseMacromolecule(e,t){return this._fileContent.slice(e,t).split(/\s/).join("")}parseColumns(){const e=/^>(.*)$/gm;let t,n=0;for(;t=e.exec(this._fileContent);){const r=this._fileContent.substring(t.index+1,e.lastIndex);this._descriptionsArray.push(r),0!==n&&this._sequencesArray.push(this.parseMacromolecule(n,t.index)),n=e.lastIndex+1}this._sequencesArray.push(this.parseMacromolecule(n,-1))}importFasta(){const e=r.Column.fromStrings("description",this.descriptionsArray),t=r.Column.fromStrings("sequence",this.sequencesArray);return t.semType=r.SEMTYPE.MACROMOLECULE,t.meta.units=o.Hi.FASTA,s.GO.forColumn(t),[r.DataFrame.fromColumns([e,t])]}constructor(e){this._descriptionsArray=[],this._sequencesArray=[],this._fileContent=e,this.parseColumns()}}},6873:(e,t,n)=>{"use strict";n.d(t,{dW:()=>a,fD:()=>o});var r=n(6082),s=(n(1991),n(2003));function o(){const e=[];return e.push(r.Column.fromList("string","MSA",new Array(10**6).fill("meI/hHis/Aca/N/T/dE/Thr_PO3H2/Aca/D-Tyr_Et/Tyr_ab-dehydroMe/dV/E/N/D-Orn/D-aThr//Phe_4Me"))),e.push(r.Column.fromList(r.COLUMN_TYPE.FLOAT,"Activity",new Array(10**6).fill(5.30751))),e}function a(e=10**5){const t="meI/hHis/Aca/N//dE/Thr_PO3H2/Aca/D-Tyr_Et/Tyr_ab-dehydroMe".repeat(Math.ceil(e/10)).slice(0,-1),n=r.Column.fromList(r.COLUMN_TYPE.STRING,"MSA",new Array(100).fill(t));n.semType=r.SEMTYPE.MACROMOLECULE,n.meta.units=s.Hi.SEPARATOR,n.setTag(s.gp.separator,"/"),n.setTag(s.gp.alphabet,s.YI.UN),n.setTag(s.gp.alphabetIsMultichar,"true");const o=[];return o.push(n),o.push(r.Column.fromList(r.COLUMN_TYPE.FLOAT,"Activity",new Array(100).fill(7.30751))),o}n(826),n(9322)},439:(e,t,n)=>{"use strict";n.d(t,{B5:()=>c,Hi:()=>r,Vl:()=>l,YI:()=>s,gp:()=>o,q7:()=>u,z1:()=>i});var r,s,o,a=n(2738);!function(e){e.FASTA="fasta",e.SEPARATOR="separator",e.HELM="helm"}(r||(r={})),function(e){e.DNA="DNA",e.RNA="RNA",e.PT="PT",e.UN="UN"}(s||(s={})),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 i=", ",c=/(?:\[([A-Za-z0-9_\-,()]+)\])|([A-Za-z\-])/g,l=new class{constructor(){this.fasta={peptide:new Set(["G","L","Y","S","E","Q","D","N","F","A","K","R","H","C","V","P","W","I","M","T"]),dna:new Set(["A","C","G","T"]),rna:new Set(["A","C","G","U"])}}},u=[new a.aD(s.PT,l.fasta.peptide,.5),new a.aD(s.DNA,l.fasta.dna,.55),new a.aD(s.RNA,l.fasta.rna,.55)]},2003:(e,t,n)=>{"use strict";n.d(t,{Hi:()=>r.Hi,J9:()=>s.J9,Qf:()=>s.Qf,SM:()=>s.SM,YI:()=>r.YI,dh:()=>s.dh,gp:()=>r.gp,mn:()=>s.mn,nq:()=>s.nq,ny:()=>s.ny,q7:()=>r.q7,qp:()=>s.qp,z1:()=>r.z1,zS:()=>s.zS});var r=n(439),s=n(9322)},2738:(e,t,n)=>{"use strict";n.d(t,{XN:()=>o,_S:()=>r,aD:()=>s});const r="";class s{constructor(e,t,n){this.name=e,this.alphabet=t,this.cutoff=n}}class o extends s{constructor(e,t,n){super(e.name,e.alphabet,e.cutoff),this.freq=t,this.similarity=n}}},9322:(e,t,n)=>{"use strict";n.d(t,{Mu:()=>p,pc:()=>x,Qf:()=>_,nq:()=>P,ny:()=>M,Iv:()=>v,dh:()=>b,vZ:()=>g,zS:()=>S,SM:()=>$,mn:()=>N,J9:()=>y,tm:()=>w,qp:()=>T});var r=n(6082),s=n(1991),o=n.n(s),a=n(2738),i=n(439),c=n(826);class l extends Float32Array{}var u=n(3629),d=n(8924),h=n(1093),m=n(4152);class p{get length(){return this.mList.length}get canonicals(){return this.mList}get originals(){return this.mList}isGap(e){return this.getOriginal(e)===this.gapOriginalMonomer}getCanonical(e){if(this.length<=e)throw new Error("Index out of bounds");return this.mList[e]}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 f{get length(){return this.seqS.length}get canonicals(){return this.seqS}get originals(){return this.seqS}isGap(e){return this.getOriginal(e)===c.b9[i.Hi.FASTA]}getCanonical(e){if(this.length<=e)throw new Error("Index out of bounds");return this.isGap(e)?a._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}}function g(e,t,n){const r=e.categories;return function(e,t){const n={};let r=!0,s=null;for(const o of e)if(null==s?s=o.length:o.length!==s&&(r=!1),o.length>=t)for(const e of o.canonicals)e in n||(n[e]=0),n[e]+=1;return{freq:n,sameLength:r}}(o().enumerate(e.getRawData()).map((([e,t])=>n(r[e]))),t)}const y=e=>{const t=o()(e.toString().matchAll(i.B5)).map((e=>e[2]??e[1])).toArray();return new p(t,c.b9[i.Hi.FASTA])},w=e=>e?new f(e):new p([],c.b9[i.Hi.FASTA]);function b(e,t=void 0){return n=>{if(n){let r;const s=new RegExp(String.raw`"-"|'-'|[^${e}]+`,"g");if(void 0!==t){s.lastIndex=0,r=new Array(Math.ceil(t));let e=null,o=0;for(;null!==(e=s.exec(n))&&o<t;)r[o++]=e[0].replace('"-"',"").replace("'-'","");r.splice(o)}else r=n.replaceAll('"-"',"").replaceAll("'-'","").split(e,t);return new p(r,c.b9[i.Hi.SEPARATOR])}return new p([],c.b9[i.Hi.SEPARATOR])}}const A=/(PEPTIDE1|DNA1|RNA1)\{([^}]+)}/g,C=/\[([^\[\]]+)]/g,T=e=>{A.lastIndex=0;const t=A.exec(e.toString()),n=t?t[2]:null,r=n?n.split("."):[];return new p(r.map((e=>{C.lastIndex=0;const t=C.exec(e);return t&&t.length>=2?t[1]:e})),c.b9[i.Hi.HELM])};function v(e,t,n=void 0){if(e.toLowerCase().startsWith(i.Hi.FASTA))return y;if(e.toLowerCase().startsWith(i.Hi.SEPARATOR))return b(t,n);if(e.toLowerCase().startsWith(i.Hi.HELM))return T;throw new Error(`Unexpected units ${e} .`)}const E=/([^\W_]+)/g;function S(e,t){if(e.length<=t)return e;const n=e.match(E),r=e.length>t||(n?.length??0)>1,s=n?.[0]??" ";return r?s.substring(0,t-1)+"…":s}function _(e){switch(e){case i.YI.DNA:return i.Vl.fasta.dna;case i.YI.RNA:return i.Vl.fasta.rna;case i.YI.PT:return i.Vl.fasta.peptide;default:throw new Error(`Unsupported alphabet '${e}'.`)}}function P(e,t,n="-"){const r=new Set([...new Set(Object.keys(e)),...t]);r.delete(n);const s=[],o=[];for(const n of r)s.push(n in e?e[n]:0),o.push(t.has(n)?1:0);const a=new l(s),i=new l(o);return(0,u.KE)(a,i)/((0,u.wQ)(a)*(0,u.wQ)(i))}function x(e,t,n="-"){const r=t.map((t=>{const r=P(e,t.alphabet,n);return new a.XN(t,e,r)}));let s;const o=Math.max(...r.map((e=>e.similarity>e.cutoff?e.similarity:-1)));return s=o>0?r.find((e=>e.similarity===o)).name:i.YI.UN,s}function $(e,t=5){let n;return n=e.semType==r.SEMTYPE.MACROMOLECULE?c.GO.forColumn(e).alphabet:x(g(e,t,y).freq,i.q7),M(n)}function M(e){switch(e){case i.YI.PT:return d.X.GrokGroups;case i.YI.DNA:case i.YI.RNA:return h.A.Chromatogram;default:return m.oT.Color}}function N(e){const t=e.columns.bySemTypeAll(r.SEMTYPE.MACROMOLECULE);let n=t.find((e=>{const t=e.meta.units;return!!t&&-1!==t.indexOf("MSA")}))??null;return!n&&t.length>0&&(n=t[0]),n}},826:(e,t,n)=>{"use strict";n.d(t,{GO:()=>p,b9:()=>m});var r=n(6082),s=n(1991),o=n.n(s),a=n(2003),i=n(2738),c=n(9322),l=n(6863),u=n(6718),d=n(3151);const h=new class{constructor(){this.seqHandler="seq-handler",this.notationProvider="seq-handler.notation-provider"}},m={[a.Hi.FASTA]:"-",[a.Hi.SEPARATOR]:"",[a.Hi.HELM]:"*"};class p{constructor(e){if(this._splitter=null,this.cached=!0,this._splitted=null,this.columnVersion=null,this._stats=null,this._maxLength=null,this._posList=null,this._joiner=void 0,e.type!==r.TYPE.STRING)throw new Error(`Unexpected column type '${e.type}', must be '${r.TYPE.STRING}'.`);this._column=e;const t=this._column.meta.units;if(null==t)throw new Error("Units are not specified in column");if(this._units=t,this._notation=this.getNotation(),this._defaultGapOriginal=this.isFasta()?m[a.Hi.FASTA]:this.isHelm()?m[a.Hi.HELM]:m[a.Hi.SEPARATOR],!this.column.tags.has(a.gp.aligned)||!this.column.tags.has(a.gp.alphabet)||!this.column.tags.has(a.gp.alphabetIsMultichar)&&!this.isHelm()&&this.alphabet===a.YI.UN)if(this.isFasta())p.setUnitsToFastaColumn(this);else if(this.isSeparator()){const t=e.getTag(a.gp.separator);p.setUnitsToSeparatorColumn(this,t)}else{if(!this.isHelm())throw new Error(`Unexpected units '${this.column.meta.units}'.`);p.setUnitsToHelmColumn(this)}if(!this.column.tags.has(a.gp.alphabetIsMultichar))if(this.isHelm())this.column.setTag(a.gp.alphabetIsMultichar,"true");else if(["UN"].includes(this.alphabet))throw new Error(`For column '${this.column.name}' of alphabet '${this.alphabet}' tag '${a.gp.alphabetIsMultichar}' is mandatory.`);this.notationProvider=this.column.temp[h.notationProvider]??null,this.columnVersion=this.column.version}static setUnitsToFastaColumn(e){if(e.column.semType!==r.SEMTYPE.MACROMOLECULE||e.column.meta.units!==a.Hi.FASTA)throw new Error(`The column of notation '${a.Hi.FASTA}' must be '${r.SEMTYPE.MACROMOLECULE}'.`);e.column.meta.units=a.Hi.FASTA,p.setTags(e)}static setUnitsToSeparatorColumn(e,t){if(e.column.semType!==r.SEMTYPE.MACROMOLECULE||e.column.meta.units!==a.Hi.SEPARATOR)throw new Error(`The column of notation '${a.Hi.SEPARATOR}' must be '${r.SEMTYPE.MACROMOLECULE}'.`);if(!t)throw new Error(`The column of notation '${a.Hi.SEPARATOR}' must have the separator tag.`);e.column.meta.units=a.Hi.SEPARATOR,e.column.setTag(a.gp.separator,t),p.setTags(e)}static setUnitsToHelmColumn(e){if(e.column.semType!==r.SEMTYPE.MACROMOLECULE)throw new Error(`The column of notation '${a.Hi.HELM}' must be '${r.SEMTYPE.MACROMOLECULE}'`);e.column.meta.units=a.Hi.HELM,p.setTags(e)}static setTags(e){const t=e.column.meta.units;if([a.Hi.FASTA,a.Hi.SEPARATOR].includes(t)){if(!e.column.getTag(a.gp.alphabet)&&0===Object.keys(e.stats.freq).length)throw new Error("Alphabet is empty and not annotated.");let t=e.column.getTag(a.gp.aligned);null===t&&(t=e.stats.sameLength?"SEQ.MSA":"SEQ",e.column.setTag(a.gp.aligned,t));let n=e.column.getTag(a.gp.alphabet);if(null===n&&(n=(0,c.pc)(e.stats.freq,a.q7),e.column.setTag(a.gp.alphabet,n)),n===a.YI.UN){const t=Object.keys(e.stats.freq).length,n=Object.keys(e.stats.freq).some((e=>e.length>1));e.column.setTag(a.gp.alphabetSize,t.toString()),e.column.setTag(a.gp.alphabetIsMultichar,n?"true":"false")}}}get column(){return this._column}get length(){return this._column.length}get units(){return this._units}get notation(){return this._notation}get defaultGapOriginal(){return this._defaultGapOriginal}get separator(){const e=this.column.getTag(a.gp.separator)??void 0;if(this.notation===a.Hi.SEPARATOR&&void 0===e)throw new Error(`Separator is mandatory for column '${this.column.name}' of notation '${this.notation}'.`);return e}get aligned(){const e=this.column.getTag(a.gp.aligned);if(!e&&(this.isFasta()||this.isSeparator()))throw new Error("Tag aligned not set");return e}get alphabet(){const e=this.column.getTag(a.gp.alphabet);if(!e&&(this.isFasta()||this.isSeparator()))throw new Error("Tag alphabet not set");return e}get helmCompatible(){return this.column.getTag(a.gp.isHelmCompatible)}getAlphabetSize(){if(this.notation==a.Hi.HELM||this.alphabet==a.YI.UN){const e=this.column.getTag(a.gp.alphabetSize);let t;if(e)t=parseInt(e);else{const e=this.stats;t=Object.keys(e.freq).length}return t}switch(this.alphabet){case a.YI.PT:return 20;case a.YI.DNA:case a.YI.RNA:return 4;case"NT":return console.warn("Unexpected alphabet 'NT'."),4;default:throw new Error(`Unexpected alphabet '${this.alphabet}'.`)}}getAlphabetIsMultichar(){return this.notation===a.Hi.HELM||this.alphabet===a.YI.UN&&"true"===this.column.getTag(a.gp.alphabetIsMultichar)}getSplitted(e,t){if(this.cached&&void 0===t){this.column.version===this.columnVersion&&null!==this._splitted||(this.columnVersion=this.column.version,this._splitted=new Array(this.column.length));let t=this._splitted[e]?this._splitted[e].deref():void 0;if(!t){const n=this.column.get(e);t=this.splitter(n),this._splitted[e]=new WeakRef(t)}return t}{const n=this.column.get(e);return this.getSplitter(t)(n)}}get stats(){if(null===this._stats){const e={};let t=!0,n=null;const r=this.column.length;for(let s=0;s<r;++s){const r=this.getSplitted(s);null==n?n=r.length:r.length!==n&&(t=!1);for(const t of r.canonicals)t in e||(e[t]=0),e[t]+=1}this._stats={freq:e,sameLength:t}}return this._stats}get maxLength(){return null===this._maxLength&&(this._maxLength=0===this.column.length?0:Math.max(...o().count(0).take(this.column.length).map((e=>this.getSplitted(e).length)))),this._maxLength}get posList(){if(null===this._posList){const e=this.column.getTag(a.gp.positionNames);this._posList=e?e.split(a.z1).map((e=>e.trim())):o().count(1).take(this.maxLength).map((e=>e.toString())).toArray()}return this._posList}isFasta(){return this.notation===a.Hi.FASTA}isSeparator(){return this.notation===a.Hi.SEPARATOR}isHelm(){return this.notation===a.Hi.HELM}isRna(){return this.alphabet===a.YI.RNA}isDna(){return this.alphabet===a.YI.DNA}isPeptide(){return this.alphabet===a.YI.PT}isMsa(){return!!this.aligned&&this.aligned.toUpperCase().includes("MSA")}isHelmCompatible(){return"true"===this.helmCompatible}isGap(e){return!e||e===this._defaultGapOriginal}getNotation(){if(this.units.toLowerCase().startsWith(a.Hi.FASTA))return a.Hi.FASTA;if(this.units.toLowerCase().startsWith(a.Hi.SEPARATOR))return a.Hi.SEPARATOR;if(this.units.toLowerCase().startsWith(a.Hi.HELM))return a.Hi.HELM;throw new Error(`Column '${this.column.name}' has unexpected notation '${this.units}'.`)}getHelmWrappers(){return[this.isDna()||this.isRna()||this.isHelmCompatible()?"RNA1{":"PEPTIDE1{",this.isDna()?"d(":this.isRna()?"r(":"",this.isDna()||this.isRna()?")p":"","}$$$$"]}getNewColumn(e,t,n,s){const o=this.column,i=e.toLowerCase()+"("+o.name+")",c=n??o.dataFrame.columns.getUnusedName(i),l=r.Column.fromList("string",c,s??new Array(this.column.length).fill(""));if(l.semType=r.SEMTYPE.MACROMOLECULE,l.meta.units=e,e===a.Hi.SEPARATOR){if(!t)throw new Error(`Notation '${a.Hi.SEPARATOR}' requires separator value.`);l.setTag(a.gp.separator,t)}l.setTag(r.TAGS.CELL_RENDERER,e===a.Hi.HELM?"helm":"sequence");const u=o.getTag(a.gp.aligned);u&&l.setTag(a.gp.aligned,u);let d=o.getTag(a.gp.alphabet);d||this.notation!==a.Hi.HELM||e===a.Hi.HELM||(d=a.YI.UN),null!=d&&l.setTag(a.gp.alphabet,d);let h=o.getTag(a.gp.alphabetSize);null!=d&&h&&l.setTag(a.gp.alphabetSize,h);const m=o.getTag(a.gp.alphabetIsMultichar);return null!=d&&void 0!==m&&l.setTag(a.gp.alphabetIsMultichar,m),e==a.Hi.HELM&&(h=this.getAlphabetSize().toString(),l.setTag(a.gp.alphabetSize,h)),l}getNewColumnFromList(e,t){return this.getNewColumn(this.notation,this.separator,e,t)}static getNewColumn(e){const t=p.forColumn(e),n=t.notation;return t.getNewColumn(n)}static unitsStringIsValid(e){return e=e.toLowerCase(),[a.Hi.FASTA,a.Hi.SEPARATOR,a.Hi.HELM].some((t=>e.startsWith(t.toLowerCase())))}static getNewColumnFromParams(e,t,n){if(!p.unitsStringIsValid(n))throw new Error("Invalid format of 'units' parameter");const s=r.Column.fromList("string",t,new Array(e).fill(""));return s.semType=r.SEMTYPE.MACROMOLECULE,s.meta.units=n,s}getSplitter(e){let t=null;if(t=this.notationProvider?this.notationProvider.splitter:null,t)return t;if(this.units.toLowerCase().startsWith(a.Hi.FASTA))return null===this.column.getTag(a.gp.alphabet)||this.getAlphabetIsMultichar()?a.J9:c.tm;if(this.units.toLowerCase().startsWith(a.Hi.SEPARATOR))return(0,a.dh)(this.separator,e);if(this.units.toLowerCase().startsWith(a.Hi.HELM))return a.qp;throw new Error(`Unexpected units ${this.units} .`)}split(e){return this.splitter(e)}getDistanceFunctionName(){if(!this.isFasta())throw new Error("Only FASTA notation is supported");if(this.isMsa())return l.Z.HAMMING;switch(this.alphabet){case a.YI.DNA:case a.YI.RNA:case a.YI.PT:}return l.Z.LEVENSHTEIN}getDistanceFunction(){return l.V[this.getDistanceFunctionName()]()}async checkHelmCompatibility(){if(this.column.tags.has(a.gp.isHelmCompatible))return"true"===this.column.getTag(a.gp.isHelmCompatible);const e=(await(0,u.pj)()).getBioLib().getMonomerSymbolsByType("PEPTIDE"),t=new Set(e),n=((0,a.dh)(this.separator),new Set),r=this.column.length,s=this.column.getRawData();for(let e=0;e<r;++e){const r=s[e];if(!(r in n)){n.add(r);const s=this.getSplitted(e);for(const e of s.canonicals)if(!t.has(e))return this.column.setTag(a.gp.isHelmCompatible,"false"),!1}}return this.column.setTag(a.gp.isHelmCompatible,"true"),!0}get splitter(){return null===this._splitter&&(this._splitter=this.getSplitter()),this._splitter}toFasta(e){return e===a.Hi.FASTA}toSeparator(e){return e===a.Hi.SEPARATOR}toHelm(e){return e===a.Hi.HELM}convertHelmToFastaSeparator(e,t,n,r){r||(r=this.toFasta(t)?m[a.Hi.FASTA]:m[a.Hi.SEPARATOR]),n||(n=this.toFasta(t)?"":this.separator);const s=e.startsWith("RNA"),o=this.splitter(e),i=[];for(let e=0;e<o.length;++e){let n=o.getOriginal(e);if(s&&(n=n.replace(d.EK,"")),n===m[a.Hi.HELM])i.push(r);else if(this.toFasta(t)&&n.length>1){const e="["+n+"]";i.push(e)}else i.push(n)}return i.join(n)}convert(e,t){const n=this.getJoiner({notation:e,separator:t}),r=this.getNewColumn(e,t);return r.init((e=>{const t=this.getSplitted(e);return n(t)})),r}getRegion(e,t,n){const r=this.getNewColumn(this.notation,this.separator);r.name=n;const s=e??0,o=t??this.maxLength-1,i=this.getJoiner(),l=o-s+1,u=m[this.notation];r.init((e=>{const t=this.getSplitted(e),n=new Array(l);for(let e=0;e<l;++e){const r=s+e;n[e]=r<t.length?t.getOriginal(r):u}return i(new c.Mu(n,u))}));const d=e=>{const t=e.split(",").map((e=>e.trim())),n=new Array(l);for(let e=0;e<l;++e){const r=s+e;n[e]=r<t.length?t[r]:"?"}return n.join(a.z1)},h=this.column.getTag(a.gp.positionNames);h&&r.setTag(a.gp.positionNames,d(h));const p=this.column.getTag(a.gp.positionLabels);return p&&r.setTag(a.gp.positionLabels,d(p)),r}get joiner(){return this._joiner||(this._joiner=this.getJoiner()),this._joiner}getJoiner(e){const t=e?e.notation:this.notation,n=e?e.separator:this.separator;let r;const s=this;switch(t){case a.Hi.FASTA:r=function(e){return s.joinToFasta(e,s.isHelm())};break;case a.Hi.SEPARATOR:if(!n)throw new Error(`Separator is mandatory for notation '${t}'.`);r=function(e){return f(e,n,s.isHelm())};break;case a.Hi.HELM:{const e=s.alphabet===a.YI.DNA||s.alphabet===a.YI.RNA,t=s.getHelmWrappers();r=function(n){return g(n,t,e)};break}default:throw new Error(`Unexpected notation '${t}'.`)}return r}getConverter(e,t=void 0){if(e===a.Hi.SEPARATOR&&!t)throw new Error(`Target separator is not specified for target units '${a.Hi.SEPARATOR}'.`);const n=this;if(e===a.Hi.FASTA)return function(e){return n.convertToFasta(e)};if(e===a.Hi.HELM)return function(e){return n.convertToHelm(e)};if(e===a.Hi.SEPARATOR)return function(e){return n.convertToSeparator(e,t)};throw new Error}static forColumn(e){let t=e.temp[h.seqHandler];return t&&t.columnVersion===e.version||(t=e.temp[h.seqHandler]=new p(e)),t}joinToFasta(e,t){const n=new Array(e.length);for(let r=0;r<e.length;++r){const s=e.getOriginal(r);let o=e.getOriginal(r);t&&(o=o.replace(d.EK,"$1")),s===i._S?o=m[a.Hi.FASTA]:s===d.q7?o="":o.length>1&&(o="["+o+"]"),n[r]=o}return n.join("")}convertToFasta(e){const t=this.splitter,n=this.isHelm()?this.splitterAsHelmNucl(e):t(e);return this.joinToFasta(n,this.isHelm())}convertToSeparator(e,t){return f(this.isHelm()?this.splitterAsHelmNucl(e):this.splitter(e),t,this.isHelm())}convertToHelm(e){const t=this.getHelmWrappers(),n=e.startsWith("DNA")||e.startsWith("RNA");return g(this.splitter(e),t,n)}splitterAsHelmNucl(e){const t=this.splitter(e),n=new Array(t.length),r=e.startsWith("DNA"),s=e.startsWith("RNA");for(let e=0;e<t.length;++e){let o=t.getOriginal(e);(r||s)&&(o=o.replace(d.EK,"$1"),o=o===d.q7?null:o),n[e]=o||null}return new c.Mu(n.filter((e=>!!e)),m[a.Hi.HELM])}}function f(e,t,n){const r=new Array(e.length);for(let t=0;t<e.length;++t){const s=e.getCanonical(t);let o=e.getOriginal(t);n&&(o=o.replace(d.EK,"$1")),s===i._S?o=m[a.Hi.SEPARATOR]:s===d.q7&&(o=""),r[t]=o}return r.join(t)}function g(e,t,n){const[r,s,o,c]=t,l=new Array(e.length);for(let t=0;t<e.length;++t){const r=e.getCanonical(t);let c=e.getOriginal(t);r===i._S?c=m[a.Hi.HELM]:(n&&(c=c.replace(d.EK,"$1")),c=1===c.length?`${s}${c}${o}`:`${s}[${c}]${o}`),l[t]=c}return`${r}${l.join(".")}${c}`}},3077:(e,t,n)=>{"use strict";n.d(t,{R:()=>o});var r=n(6082),s=n(826);function o(e){const t=e=>{const t=a.columns.addNewString((e+1).toString());return n.push(t),t},n=[],o=e.length,a=r.DataFrame.create(o),i=s.GO.forColumn(e);for(let e=0;e<o;++e){const r=i.getSplitted(e);for(let s=0;s<r.length;++s){const o=r.getOriginal(s);((n[s]??null)||t(s)).set(e,o,!1)}}return a}},7602:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var r,s=n(9192);!function(e){e[e.error=0]="error",e[e.warning=1]="warning",e[e.info=2]="info",e[e.debug=3]="debug"}(r||(r={}));class 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[r,o]=(0,s.AP)(t);this.logger.error(`${e}, SYNC syncId = ${n}, ERROR:\n${r}`,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:()=>u,Lp:()=>o,P4:()=>a,fH:()=>s,gp:()=>r,lT:()=>c,mH:()=>i});var r,s,o,a,i,c,l=n(6082);!function(e){e.tooltipWebLogo=".tooltipWebLogo"}(r||(r={})),function(e){e.Entropy="Entropy",e.full="100%"}(s||(s={})),function(e){e.TOP="top",e.MIDDLE="middle",e.BOTTOM="bottom"}(o||(o={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(a||(a={})),function(e){e.AUTO="auto",e.ON="on",e.OFF="off"}(i||(i={})),function(e){e.Filtered="Filtered",e.Selected="Selected"}(c||(c={}));const u=new class{constructor(){this.sequenceColumnName=null,this.valueAggrType=l.AGG.TOTAL_COUNT,this.valueColumnName="Activity",this.startPositionName=null,this.endPositionName=null,this.skipEmptySequences=!0,this.skipEmptyPositions=!1,this.shrinkEmptyTail=!0,this.backgroundColor=4294967295,this.positionHeight=s.Entropy,this.positionWidth=16,this.verticalAlignment=o.MIDDLE,this.horizontalAlignment=a.CENTER,this.fixWidth=!1,this.fitArea=!0,this.minHeight=50,this.maxHeight=100,this.showPositionLabels=!0,this.positionMarginState=i.AUTO,this.positionMargin=0,this.filterSource=c.Filtered}}},5540:(e,t,n)=>{"use strict";e=n.hmd(e);var r,s=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){var t,n,s=void 0!==e?e:{};s.ready=new Promise((function(e,r){t=e,n=r}));var o,a=Object.assign({},s),i="object"==typeof window,c="function"==typeof importScripts,l=("object"==typeof process&&"object"==typeof process.versions&&process.versions.node,"");(i||c)&&(c?l=self.location.href:"undefined"!=typeof document&&document.currentScript&&(l=document.currentScript.src),r&&(l=r),l=0!==l.indexOf("blob:")?l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):"",c&&(o=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)})),s.print||console.log.bind(console);var u,d,h=s.printErr||console.warn.bind(console);Object.assign(s,a),a=null,s.arguments&&s.arguments,s.thisProgram&&s.thisProgram,s.quit&&s.quit,s.wasmBinary&&(u=s.wasmBinary),s.noExitRuntime,"object"!=typeof WebAssembly&&E("no native wasm support detected");var m,p,f,g=!1;function y(){var e=d.buffer;s.HEAP8=m=new Int8Array(e),s.HEAP16=new Int16Array(e),s.HEAP32=new Int32Array(e),s.HEAPU8=p=new Uint8Array(e),s.HEAPU16=new Uint16Array(e),s.HEAPU32=f=new Uint32Array(e),s.HEAPF32=new Float32Array(e),s.HEAPF64=new Float64Array(e)}var w=[],b=[],A=[],C=0,T=null,v=null;function E(e){s.onAbort&&s.onAbort(e),h(e="Aborted("+e+")"),g=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var S,_;function P(e){return e.startsWith("data:application/octet-stream;base64,")}function x(e){try{if(e==S&&u)return new Uint8Array(u);if(o)return o(e);throw"both async and sync fetching of the wasm failed"}catch(e){E(e)}}function $(e,t,n){return function(e){return u||!i&&!c||"function"!=typeof fetch?Promise.resolve().then((function(){return x(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 x(e)}))}(e).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(n,(function(e){h("failed to asynchronously prepare wasm: "+e),E(e)}))}function M(e){for(;e.length>0;)e.shift()(s)}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,m[this.ptr+12|0]=e},this.get_caught=function(){return 0!=m[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,m[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=m[this.ptr+13|0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){f[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return f[this.ptr+16>>2]},this.get_exception_ptr=function(){if(V(this.get_type()))return f[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function I(e){var t=d.buffer;try{return d.grow(e-t.byteLength+65535>>>16),y(),1}catch(e){}}function L(e){return s["_"+e]}P(S="wasmDbscan.wasm")||(_=S,S=s.locateFile?s.locateFile(_,l):l+_);var R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(e,t,n,r,s){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 r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t}(e)+1,n=k(t);return function(e,t,n){!function(e,t,n,r){if(!(r>0))return 0;for(var s=n+r-1,o=0;o<e.length;++o){var a=e.charCodeAt(o);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),a<=127){if(n>=s)break;t[n++]=a}else if(a<=2047){if(n+1>=s)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=s)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=s)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}t[n]=0}(e,p,t,n)}(e,n,t),n}(e)),t},array:e=>{var t,n,r=k(e.length);return t=e,n=r,m.set(t,n),r}},a=L(e),i=[],c=0;if(r)for(var l=0;l<r.length;l++){var u=o[n[l]];u?(0===c&&(c=G()),i[l]=u(r[l])):i[l]=r[l]}var d=a.apply(null,i);return function(e){return 0!==c&&D(c),function(e){return"string"===t?(n=e)?function(e,t,n){for(var r=t+n,s=t;e[s]&&!(s>=r);)++s;if(s-t>16&&e.buffer&&R)return R.decode(e.subarray(t,s));for(var o="";t<s;){var a=e[t++];if(128&a){var i=63&e[t++];if(192!=(224&a)){var c=63&e[t++];if((a=224==(240&a)?(15&a)<<12|i<<6|c:(7&a)<<18|i<<12|c<<6|63&e[t++])<65536)o+=String.fromCharCode(a);else{var l=a-65536;o+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else o+=String.fromCharCode((31&a)<<6|i)}else o+=String.fromCharCode(a)}return o}(p,n,r):"":"boolean"===t?Boolean(e):e;var n,r}(e)}(d)}var H,F={__cxa_throw:function(e,t,n){throw new N(e).init(t,n),e},abort:function(){E("")},emscripten_memcpy_big:function(e,t,n){p.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=p.length,r=2147483648;if((e>>>=0)>r)return!1;for(var s=1;s<=4;s*=2){var o=n*(1+.2/s);if(o=Math.min(o,e+100663296),I(Math.min(r,(t=Math.max(e,o))+(65536-t%65536)%65536)))return!0}return!1}},G=(function(){var e,t,r,o,a={env:F,wasi_snapshot_preview1:F};function i(e,t){var n,r=e.exports;return s.asm=r,d=s.asm.memory,y(),s.asm.__indirect_function_table,n=s.asm.__wasm_call_ctors,b.unshift(n),function(){if(C--,s.monitorRunDependencies&&s.monitorRunDependencies(C),0==C&&(null!==T&&(clearInterval(T),T=null),v)){var e=v;v=null,e()}}(),r}if(C++,s.monitorRunDependencies&&s.monitorRunDependencies(C),s.instantiateWasm)try{return s.instantiateWasm(a,i)}catch(e){h("Module.instantiateWasm callback failed with error: "+e),n(e)}(e=u,t=S,r=a,o=function(e){i(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||P(t)||"function"!=typeof fetch?$(t,r,o):fetch(t,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(o,(function(e){return h("wasm streaming compile failed: "+e),h("falling back to ArrayBuffer instantiation"),$(t,r,o)}))}))).catch(n)}(),s._dbscan=function(){return(s._dbscan=s.asm.dbscan).apply(null,arguments)},s._malloc=function(){return(s._malloc=s.asm.malloc).apply(null,arguments)},s._free=function(){return(s._free=s.asm.free).apply(null,arguments)},function(){return(G=s.asm.stackSave).apply(null,arguments)}),D=function(){return(D=s.asm.stackRestore).apply(null,arguments)},k=function(){return(k=s.asm.stackAlloc).apply(null,arguments)},V=function(){return(V=s.asm.__cxa_is_pointer_type).apply(null,arguments)};function U(){function e(){H||(H=!0,s.calledRun=!0,g||(M(b),t(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),function(){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)e=s.postRun.shift(),A.unshift(e);var e;M(A)}()))}C>0||(function(){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)e=s.preRun.shift(),w.unshift(e);var e;M(w)}(),C>0||(s.setStatus?(s.setStatus("Running..."),setTimeout((function(){setTimeout((function(){s.setStatus("")}),1),e()}),1)):e()))}if(s.ccall=O,s.cwrap=function(e,t,n,r){var s=!n||n.every((e=>"number"===e||"boolean"===e));return"string"!==t&&s&&!r?L(e):function(){return O(e,t,n,arguments)}},v=function e(){H||U(),H||(v=e)},s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return U(),e.ready});"object"==typeof exports?e.exports=s:"function"==typeof define&&n.amdO?define([],(function(){return s})):"object"==typeof exports&&(exports.exportCppDbscanLib=s)},6295:(e,t,n)=>{"use strict";n.d(t,{$1:()=>i,Hr:()=>v,Ii:()=>p,T6:()=>T,TK:()=>A,a4:()=>h,be:()=>m,gt:()=>y,iS:()=>a,ij:()=>w,lO:()=>d,lP:()=>g,rR:()=>f,tO:()=>c,v_:()=>l,yK:()=>b,zn:()=>u});var r=n(8774),s=n(8498),o=n(6863);s.aT.Tanimoto,s.aT.Dice,s.aT.Asymmetric,s.aT.BraunBlanquet,s.aT.Cosine,s.aT.Kulczynski,s.aT.McConnaughey,s.aT.RogotGoldberg,s.aT.Russel,s.aT.Sokal,s.aT.Hamming,s.aT.Euclidean,s.aT.Tanimoto,s.aT.Dice,s.aT.Asymmetric,s.aT.BraunBlanquet,s.aT.Cosine,s.aT.Kulczynski,s.aT.McConnaughey,s.aT.RogotGoldberg,s.aT.Russel,s.aT.Sokal,s.aT.Hamming,s.aT.Euclidean;const a=[s.aT.Tanimoto,s.aT.Dice,s.aT.Cosine];function i(e,t){const n=e.trueCount()+t.trueCount();if(0==n)return 1;const r=e.andWithCountBits(t,!0);return r/(n-r)}function c(e,t){return 1-i(e,t)}function l(e,t){return C(i(new r.A(e,32*e.length),new r.A(t,32*t.length)))}function u(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 d(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 h(e,t){return Math.sqrt(e.trueCount()+t.trueCount()-2*e.andWithCountBits(t,!0))}function m(e,t){return e.trueCount()+t.trueCount()-2*e.andWithCountBits(t,!0)}function p(e,t){return 1-function(e,t){const n=e.trueCount()+t.trueCount(),r=e.andWithCountBits(t,!0);return r/(2*n-3*r)}(e,t)}function f(e,t){return C(function(e,t){const n=e.trueCount()+t.trueCount(),r=e.trueCount()*t.trueCount();return 0==r?0:e.andWithCountBits(t,!0)*n/(2*r)}(e,t))}function g(e,t){return C(function(e,t){const n=e.trueCount()+t.trueCount(),r=e.trueCount()*t.trueCount();return 0==r?0:(e.andWithCountBits(t,!0)*n-r)/r}(e,t))}function y(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 w(e,t){return C(function(e,t){const n=Math.max(e.trueCount(),t.trueCount());return 0==n?0:e.andWithCountBits(t,!0)/n}(e,t))}function b(e,t){return C(function(e,t){return 0==e.length?0:e.andWithCountBits(t,!0)/e.length}(e,t))}function A(e,t){return C(function(e,t){const n=e.andWithCountBits(t,!0),r=e.countBits(!0)+t.countBits(!0),s=e.length,o=s-r+n;return n==s||o==s?1:n/r+o/(2*s-r)}(e,t))}function C(e){return 0===e?3402823e32:1/e-1}function T(e){if(e&&null!=e.range&&e.range>0){const t=e.range;return(e,n)=>Math.abs(e-n)/t}return(e,t)=>Math.abs(e-t)}function v(e){const t=function(e){const t=e?.mostCommon??new Set;return(e,n)=>{const r=e.length,s=n.length;let o=0,a=0,i=0;for(;a<r&&i<s;)e[a]===n[i]?(t?.has(e[a])||++o,++a,++i):e[a]<n[i]?++a:++i;return o}}(e);return(e,n)=>0===n.length||0===e.length?1e4:Math.min(e.length,n.length)/(t(e,n)+1e-4)}s.aT.Tanimoto,s.aT.Asymmetric,s.aT.Cosine,s.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:()=>r,Gi:()=>i,YP:()=>l,_X:()=>a,n3:()=>s,vb:()=>c});const r="dim-red-preprocessing-function",s="supportedSemTypes",o="supportedTypes",a="supportedUnits",i="supportedDistanceFunctions",c="bypassLargeDataWarning",l="show-scatterplot-progress"},6863:(e,t,n)=>{"use strict";function r(e={}){const t=function(){if(!e||!e.scoringMatrix||!e.alphabetIndexes)return(e,t)=>e===t?0:1;if(e.scoringMatrix.length!==Object.keys(e.alphabetIndexes).length)throw new Error("Scoring matrix and alphabet indexes should have the same length");const t=e.alphabetIndexes,n=e.scoringMatrix,r=Math.min(...Object.keys(t).map((e=>e.charCodeAt(0))))+1,s=new Float32Array((n.length+r)*(n.length+r));return Object.entries(t).forEach((([e,r])=>{const o=n[r];Object.entries(t).forEach((([t,r])=>{s[e.charCodeAt(0)*n.length+t.charCodeAt(0)]=o[r]}))})),(e,t)=>1-s[e.charCodeAt(0)*n.length+t.charCodeAt(0)]}(),n=e?.threshold??0;return(e,r)=>{let s=0;const o=e.length,a=r.length,i=Math.ceil(Math.max(o,a)*(1-n));o!==a&&(s=Math.abs(o-a));let c=0;for(let n=0;n<Math.min(o,a);n++)if(e[n]!==r[n]&&(c+=t(e[n],r[n]),c>i))return 1;return c+=s,c/=Math.max(o,a),c}}n.d(t,{Z:()=>a,V:()=>i});var s=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 a;!function(e){e.HAMMING="Hamming",e.LEVENSHTEIN="Levenshtein",e.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",e.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(a||(a={}));const i={[a.HAMMING]:r,[a.LEVENSHTEIN]:function(){return(e,t)=>(0,s.I)(e,t)/Math.max(e.length,t.length)},[a.NEEDLEMANN_WUNSCH]:function(e){const t=new Uint16Array(65536),{gapOpen:n,gapExtend:r,scoringMatrix:s,alphabetIndexes:a}={...o,...e};Object.entries(a).forEach((([e,n])=>t[e.charCodeAt(0)]=n));const i=[new Float32Array(1e4),new Float32Array(1e4)];return(e,o)=>{const a=new Array(e.length+1).fill(!1),c=new Array(e.length+1).fill(!1);let l=0,u=1;for(let t=1;t<e.length+1;t++)i[0][t]=-n-(t-1)*r,i[1][t]=0;i[0][0]=0;for(let d=1;d<o.length+1;d++){i[u][0]=-n-(d-1)*r;for(let h=1;h<e.length+1;h++){const m=i[l][h-1]+s[t[e.charCodeAt(h-1)]][t[o.charCodeAt(d-1)]],p=i[l][h]-(a[h]?r:n),f=i[u][h-1]-(c[h-1]?r:n);i[u][h]=Math.max(m,f,p),i[u][h]===m?(a[h]=!1,c[h]=!1):i[u][h]===f?(a[h]=!1,c[h]=!0):(a[h]=!0,c[h]=!1)}l=u,u=(u+1)%2}const d=Math.max(e.length,o.length);return(d-i[l][e.length])/d}},[a.MONOMER_CHEMICAL_DISTANCE]:r}},9039:(e,t,n)=>{"use strict";var r;n.d(t,{c:()=>r}),function(e){e.UMAP="UMAP",e.T_SNE="t-SNE"}(r||(r={}))},8498:(e,t,n)=>{"use strict";var r,s,o,a,i,c,l;n.d(t,{EG:()=>i,Pn:()=>s,RR:()=>c,Wn:()=>l,aT:()=>o,m6:()=>a,xL:()=>r}),function(e){e.Levenshtein="Levenshtein",e.JaroWinkler="Jaro-Winkler",e.Manhattan="Manhattan",e.Onehot="One-Hot"}(r||(r={})),function(e){e.Euclidean="Euclidean"}(s||(s={})),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"}(o||(o={})),function(e){e.TanimotoIntArray="TanimotoIntArray"}(a||(a={})),function(e){e.Vector="Vector",e.String="String",e.BitArray="BitArray",e.MacroMolecule="MacroMolecule",e.Number="Number",e.IntArray="IntArray",e.NumberArray="NumberArray"}(i||(i={})),function(e){e.Difference="Difference"}(c||(c={})),function(e){e.CommonItems="Common Items"}(l||(l={}))},2780:(e,t,n)=>{"use strict";n.d(t,{aT:()=>r.aT});var r=n(8498);n(9336)},9336:(e,t,n)=>{"use strict";var r=n(2787),s=n(944),o=n(6295),a=n(3629),i=n(6863),c=n(8498);const l={[c.Pn.Euclidean]:a.ou},u={[c.xL.Levenshtein]:r.I,[c.xL.JaroWinkler]:s.Vb,[c.xL.Manhattan]:function(e,t){if(e.length!==t.length)return 1;{let n=0;for(let r=1;r<e.length;r++)n+=e[r]==t[r]?0:1;return n/e.length}},[c.xL.Onehot]:function(e,t){return e===t?0:1}},d={[c.aT.Tanimoto]:o.tO,[c.aT.Dice]:o.zn,[c.aT.Asymmetric]:o.gt,[c.aT.BraunBlanquet]:o.ij,[c.aT.Cosine]:o.lO,[c.aT.Kulczynski]:o.rR,[c.aT.McConnaughey]:o.lP,[c.aT.RogotGoldberg]:o.TK,[c.aT.Russel]:o.yK,[c.aT.Sokal]:o.Ii,[c.aT.Hamming]:o.be,[c.aT.Euclidean]:o.a4},h={[c.m6.TanimotoIntArray]:o.v_},m={[c.RR.Difference]:o.T6},p={[c.Wn.CommonItems]:o.Hr},f={[c.EG.Vector]:{[c.Pn.Euclidean]:l[c.Pn.Euclidean]},[c.EG.String]:{[c.xL.Levenshtein]:u[c.xL.Levenshtein],[c.xL.JaroWinkler]:u[c.xL.JaroWinkler],[c.xL.Manhattan]:u[c.xL.Manhattan],[c.xL.Onehot]:u[c.xL.Onehot]},[c.EG.BitArray]:{[c.aT.Tanimoto]:d[c.aT.Tanimoto],[c.aT.Dice]:d[c.aT.Dice],[c.aT.Asymmetric]:d[c.aT.Asymmetric],[c.aT.BraunBlanquet]:d[c.aT.BraunBlanquet],[c.aT.Cosine]:d[c.aT.Cosine],[c.aT.Kulczynski]:d[c.aT.Kulczynski],[c.aT.McConnaughey]:d[c.aT.McConnaughey],[c.aT.RogotGoldberg]:d[c.aT.RogotGoldberg],[c.aT.Russel]:d[c.aT.Russel],[c.aT.Sokal]:d[c.aT.Sokal]},[c.EG.MacroMolecule]:{[i.Z.HAMMING]:i.V[i.Z.HAMMING],[i.Z.LEVENSHTEIN]:i.V[i.Z.LEVENSHTEIN],[i.Z.NEEDLEMANN_WUNSCH]:i.V[i.Z.NEEDLEMANN_WUNSCH],[i.Z.MONOMER_CHEMICAL_DISTANCE]:i.V[i.Z.MONOMER_CHEMICAL_DISTANCE]},[c.EG.Number]:{[c.RR.Difference]:m[c.RR.Difference]},[c.EG.IntArray]:{[c.m6.TanimotoIntArray]:h[c.m6.TanimotoIntArray]},[c.EG.NumberArray]:{[c.Wn.CommonItems]:p[c.Wn.CommonItems]}};Object.keys(f).reduce(((e,t)=>{for(const n of Object.keys(f[t]))e[n]=t;return e}),{})},8774:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});class r{constructor(e,t=!1){if(this._length=0,this._version=0,this._updateLevel=0,this._selectedCount=0,this._selectedCountVersion=-1,this._selectedIndexesVersion=-1,this._versionedName="",this._versionedNameVersion=-1,this.SHRINK_THRESHOLD=256,"number"==typeof e){const n=e,s=r._createBuffer(n);if(t)for(let e=0;e<s.length;e++)s[e]=-1;this._data=s,this._length=n}else{if(!(e instanceof Uint32Array))throw new Error("Invalid constructor");this._data=e,this._length=t}}getRawData(){return this._data}assureGoez(e,t){if(e<0)throw new Error(`${t} should be greater than zero`)}assureInRange(e,t,n,r){if(e<t||e>n)throw new Error(`Argument ${r} (${e}) out of range (${t}, ${n})`)}copy(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}copyFrom(e){if(this._length!=e._length)throw new Error(`Lengths differ (${this._length} != ${e._length})`);this.copy(e._data,this._data,this.lengthInInts),this._version++}get length(){return this._length}get buffer(){return this._data}set buffer(e){this._data=e,this._version++}get version(){return this._version}set version(e){this._version=e}incrementVersion(e=!0){this._version++}get lengthInInts(){return Math.floor((this._length+31)/32)}get versionedName(){return this._version==this._versionedNameVersion?this._versionedName:""}set versionedName(e){this._versionedName=e,this._versionedNameVersion=this._version}get self(){return this}setLength(e){if(e<0)throw new Error("should be >= 0");if(e==this._length)return;const t=Math.floor((e+31)/32);if(t>this._data.length||t+this.SHRINK_THRESHOLD<this._data.length){const e=new Uint32Array(t);this.copy(this._data,e,t>this._data.length?this._data.length:t),this._data=e}e>this._length&&(this._length%32>0&&(this._data[this.lengthInInts-1]&=(1<<(this._length%32&31))-1),this._data.fill(0,this.lengthInInts,t)),this._length=e,this._version++}static fromAnd(e,t){if(e._length!=t._length)throw new Error(`Lengths differ (${e._length} != ${t._length})`);const n=new r(e._length);n._length=e._length,n._data=r._createBuffer(n._length),n._version=0;const s=e.lengthInInts;for(let r=0;r<s;r++)n._data[r]=e._data[r]&t._data[r];return n}static _createBuffer(e){return new Uint32Array(Math.floor((e+31)/32))}static fromValues(e){const t=new r(e.length);t._version=0;for(let n=0;n<t._length;n++)e[n]&&(t._data[Math.floor(n/32)]|=1<<(n%32&31));return t}static fromSeq(e,t){const n=new r(e);for(let r=0;r<e;++r)n.setBit(r,t(r));return n._version=0,n}static fromString(e){return r.fromSeq(e.length,(t=>"1"==e.charAt(t)))}static fromUint32Array(e,t){const n=new r(e);return n._data=t,n}static fromBytes(e){const t=e.length,n=new r(8*t);n._data=new Uint32Array(Math.floor((t+3)/4)),n._length=8*t;let s=0,o=0;for(;t-o>=4;)n._data[s++]=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[s]=(255&e[o+2])<<16),t-o==2&&(n._data[s]|=(255&e[o+1])<<8),t-o==1&&(n._data[s]|=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 r(0,!1);return e._data=Uint32Array.from(this._data),e._length=this._length,e._version=this._version,e}init(e,t){this.setAll(!1,!1);for(let t=0;t<this._length;t++)e(t)&&(this._data[Math.floor(t/32)]|=1<<(t%32&31));return this.incrementVersion(t),this}invert(e=!0){for(let e=0;e<this._data.length;e++)this._data[e]^=-1;this.incrementVersion(e)}setAll(e,t=!1){const n=e?-1:0,r=this.lengthInInts;for(let e=0;e<r;e++)this._data[e]=n;this.incrementVersion(t)}setIndexes(e,t=!0,n=!0,r=!0){n&&this.setAll(!t,!1);for(const n of e)this.setFast(n,t);this.incrementVersion(r)}everyIndex(e,t=!0){for(const n of e)if(this.getBit(n)!=t)return!1;return!0}anyIndex(e,t=!0){for(const n of e)if(this.getBit(n)==t)return!0;return!1}setWhere(e,t=!0,n=!0,r=!0,s=!0){if(n&&s&&this.setAll(!t,!1),s)for(let n=0;n<this._length;n++)e(n)&&this.setFast(n,t);else for(let n=0;n<this._length;n++)this.setFast(n,e(n)?t:!t);this.incrementVersion(r)}getRange(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let r=e;r<t;++r)n.push(this.getBit(r));return r.fromValues(n)}getRangeAsList(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let r=e;r<t;++r)n.push(this.getBit(r));return n}setRange(e,t,n,r=!0){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length-1,"to");const s=Math.min(e,t),o=Math.max(e,t);if(n)for(let e=s;e<=o;e++)this.setTrue(e);else for(let e=s;e<=o;e++)this.setFalse(e);return this.incrementVersion(r),this}setRandom(e,t,n=!0){if(e<0||e>this._length)throw new Error("n must be >= 0 && <= Count");e>this._length/2&&this.setRandom(this._length-e,!t),this.setAll(!t);for(let n=0;n<e;){const e=Math.floor(Math.random()*this._length);this.getBit(e)!=t&&(this.setFast(e,t),n++)}this.incrementVersion(n)}and(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]&=e._data[t];return this.incrementVersion(t),this}andNot(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");const n=this.lengthInInts;for(let t=0;t<n;t++)this._data[t]&=~e._data[t];return this.incrementVersion(t),this}notAnd(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]=~this._data[t]&e._data[t];return this.incrementVersion(t),this}not(e=!0){for(let e=0,t=this.lengthInInts;e<t;e++)this._data[e]=~this._data[e];return this.incrementVersion(e),this}or(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]|=e._data[t];return this.incrementVersion(t),this}xor(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]^=e._data[t];return this.incrementVersion(t),this}insertAt(e,t,n=!1){if(this.assureInRange(e,0,this._length,"pos"),0==t)return;const r=this._length;this.setLength(this._length+t);for(let n=r-1;n>=e;n--)this.setBit(n+t,this.getBit(n));for(let r=e;r<e+t;r++)this.setBit(r,n)}removeAt(e,t=1){if(t<0)throw new Error("n cannot be negative");if(this.assureInRange(e,0,this._length-t,"pos"),this.contains(!0))for(let n=e;n<this._length-t;n++)this.setBit(n,this.getBit(n+t));this.setLength(this._length-t)}removeByMask(e,t=!0){if(this._length!=e.length)throw new Error("length != mask.length");if(e==this)this.setLength(e.countBits(!t)),this.setAll(!t);else{let n=0;for(let r=-1;-1!=(r=e.findNext(r,!t));)this.setFast(n++,this.getBit(r));this._length=n,this._version++}return this}getBit(e){return!!(this._data[Math.floor(e/32)]&1<<(31&e))}setBit(e,t,n=!0){this.setFast(e,t),this._version++}setFast(e,t){t?this._data[Math.floor(e/32)]|=1<<(31&e):this._data[Math.floor(e/32)]&=~(1<<(31&e))}setTrue(e){this._data[Math.floor(e/32)]|=1<<(31&e)}setFalse(e){this._data[Math.floor(e/32)]&=~(1<<(31&e))}trueCount(){return this.countBits(!0)}falseCount(){return this.countBits(!1)}countBits(e){if(0==this._length)return 0;if(this._selectedCountVersion!=this._version){this._selectedCount=0;const e=this.lengthInInts;let t=0;for(;t<e-1;t++)for(let e=this._data[t];0!=e;e>>>=8)this._selectedCount+=r._onBitCount[255&e];let n=this._data[t];const s=31&this._length;for(0!=s&&(n&=~(4294967295<<s));0!=n;n>>>=8)this._selectedCount+=r._onBitCount[255&n];this._selectedCountVersion=this._version}return e?this._selectedCount:this._length-this._selectedCount}countWhere(e){let t=0;if(this.trueCount()==this._length)for(let n=0;n<this._length;n++)t+=e(n)?1:0;else for(let n=-1;-1!=(n=this.findNext(n,!0));)t+=e(n)?1:0;return t}andWithCountBits(e,t){if(0==this._length)return 0;let n=0;const s=this.lengthInInts;let o=0;for(;o<s-1;o++)for(let t=this._data[o]&e._data[o];0!=t;t>>>=8)n+=r._onBitCount[255&t];let a=this._data[o]&e._data[o];const i=31&this._length;for(0!=i&&(a&=~(4294967295<<i));0!=a;a>>>=8)n+=r._onBitCount[255&a];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 s=this.lengthInInts;for(let o=Math.floor(e/32);o<s;o++){let s=t?this._data[o]:~this._data[o];if(0!=n)s&=4294967295<<n&4294967295,n=0;else if(!t&&-4294967296==s)continue;for(let t=0;0!=s;t+=8,s>>>=8){const n=r._firstOnBit[255&s];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 s=Math.floor(e/32);s>=0;s--){let e=t?this._data[s]:~this._data[s];0!=n&&(e&=~(4294967295<<n),n=0);for(let t=24;0!=e;t-=8,e<<=8){const n=r._lastOnBit[e>>>24];if(n>=0)return n+32*s+t}}return-1}}r._onBitCount=Int8Array.from([0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8]),r._firstOnBit=Int8Array.from([-1,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0]),r._lastOnBit=Int8Array.from([-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7])},8070:(e,t,n)=>{"use strict";n.d(t,{Pl:()=>G,bk:()=>Y,gM:()=>F,L1:()=>H,cb:()=>B,E3:()=>I,J6:()=>O,Wj:()=>L,Xk:()=>R,N$:()=>k,t6:()=>N,PE:()=>$,rd:()=>M,Bl:()=>K,CN:()=>b});var r=n(4328),s=n(6082);n(9982);const o=s.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,,,,,,,,,,,,,,,,,,,,,');o.columns.add(s.Column.fromList(s.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var a=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function i(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}c((r=r.apply(e,t||[])).next())}))};function i(e,t,n,s,o,i,c,l,u=!0){return a(this,void 0,void 0,(function*(){let d=null;if(yield M(s,(n=>a(this,void 0,void 0,(function*(){let n=null;for(const r of e.viewers)r.type===t&&(n=r);if(!n)throw Error("Viewer hasn't been added");if(yield Promise.resolve(),i&&(yield i(n)),o){const t=null!=l?l:{};t.tv=e,t.viewer=n,d=yield o(t,u)}yield $(r.events.onViewerClosed,(()=>{I(n.subs.some((e=>!e.closed)),!1)}),(()=>n.close()),3e3)}))),(()=>a(this,void 0,void 0,(function*(){c?e.loadLayout(c):yield function(e,t,n){return a(this,void 0,void 0,(function*(){let r;return n?(r=yield e.dataFrame.plot.fromType(t),e.dockManager.dock(r)):r=e.addViewer(t),r}))}(e,t,n)}))),6e4,"TEST_EVENT_ASYNC"),d)return d}))}function c(e,t=!0){return a(this,void 0,void 0,(function*(){const n=e.tv.dataFrame,r=n.clone();Array.from(n.row(0).cells).forEach((e=>e.value=null));const s=n.rowCount<20?Math.floor(n.rowCount/2):10;n.rows.select((e=>e.idx>=0&&e.idx<s)),t&&(yield B(50));for(let e=s;e<2*s;e++)n.filter.set(e,!1);t&&(yield B(50)),n.currentRowIdx=1,n.columns.names().slice(0,Math.ceil(n.columns.length/2)).forEach((e=>n.columns.remove(e))),t&&(yield B(100)),e.tv.dataFrame=r,yield B(50)}))}function l(e,t=!0){return a(this,void 0,void 0,(function*(){const t=e.tv.dataFrame;setTimeout((()=>t.filter.set(0,!t.filter.get(0))),0)}))}function u(e,t=!0){return a(this,void 0,void 0,(function*(){let t,n;try{t=e.viewer.getOptions(!0).look}catch(e){throw new Error("Viewer's .getOptions() error.",{cause:e})}try{n=e.viewer.getProperties()}catch(e){throw new Error("Viewer's .getProperties() error.",{cause:e})}const r={};return Object.keys(t).filter((e=>"boolean"==typeof t[e])).forEach((e=>r[e]=!t[e])),n.filter((e=>null!==e.choices)).forEach((e=>r[e.name]=e.choices.find((n=>n!==t[e.name])))),e.viewer.setOptions(r),yield B(300),{layout:e.tv.saveLayout(),savedProps:e.viewer.getOptions().look}}))}function d(e,t=!0){return a(this,void 0,void 0,(function*(){I(JSON.stringify(e.viewer.getOptions().look),JSON.stringify(e.savedProps))}))}var h=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function i(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}c((r=r.apply(e,t||[])).next())}))};const m=3e4,p=108e5,f=console.log.bind(console),g=console.info.bind(console),y=console.warn.bind(console),w=console.error.bind(console),b={},A="Auto Tests",C="Demo",T="Detectors",v="Core",E={};let S;var _;!function(e){e.notNull=function(e,t){if(null==e)throw new Error(`${null==t?"Value":t} not defined`)}}(_||(_={}));class P{constructor(e,t){this.catchUnhandled=!0,this.report=!1,void 0!==e&&(this.catchUnhandled=e),void 0!==t&&(this.report=t)}}class x{constructor(e,t,n,r){var s;this.category=e,this.name=t,null!=r||(r={}),null!==(s=r.timeout)&&void 0!==s||(r.timeout=m),this.options=r,this.test=()=>h(this,void 0,void 0,(function*(){return new Promise(((e,t)=>h(this,void 0,void 0,(function*(){let r="";try{r=yield n()}catch(e){t(e)}e(r)}))))}))}}function $(e,t,n,r=0,s="timeout"){return h(this,void 0,void 0,(function*(){return new Promise(((o,a)=>{const i=e.subscribe((e=>{try{t(e),o("OK")}catch(e){a(e)}finally{i.unsubscribe(),clearTimeout(c)}})),c=setTimeout((()=>{i.unsubscribe(),a(s)}),r);n()}))}))}function M(e,t,n,r=0,s="timeout"){return h(this,void 0,void 0,(function*(){return new Promise(((o,a)=>{const i=e.subscribe((e=>{t(e).then((()=>{o("OK")})).catch((e=>{a(e)})).finally((()=>{i.unsubscribe(),clearTimeout(c)}))})),c=setTimeout((()=>{i.unsubscribe(),a(s)}),r);n()}))}))}function N(e,t,n){null==b[S]&&(b[S]={}),null==b[S].tests&&(b[S].tests=[]),b[S].tests.push(new x(S,e,t,n))}function I(e,t=!0,n){if(n=n?`${n}, `:"",e!==t)throw new Error(`${n}Expected "${t}", got "${e}"`)}function L(e,t,n=.001,r){if(e===Number.POSITIVE_INFINITY&&t===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY&&t===Number.NEGATIVE_INFINITY||e===Number.NaN&&t===Number.NaN||isNaN(e)&&isNaN(t))return;const s=Math.abs(e-t)<n;if(I(s,!0,`${null!=r?r:""} (tolerance = ${n})`),!s)throw new Error(`Expected ${t}, got ${e} (tolerance = ${n})`)}function R(e,t){for(const[n,r]of Object.entries(t)){if(!e.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const t=e[n];if(t instanceof Array&&r instanceof Array)O(t,r);else if(t instanceof Object&&r instanceof Object)R(t,r);else if(Number.isFinite(t)&&Number.isFinite(r))L(t,r);else if(t!=r)throw new Error(`Expected (${r}) for key '${n}', got (${t})`)}}function O(e,t){const n=e.length,r=t.length;if(n!=r)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${r}`);for(let r=0;r<n;r++)if(e[r]instanceof Array&&t[r]instanceof Array)O(e[r],t[r]);else if(e[r]instanceof Object&&t[r]instanceof Object)R(e[r],t[r]);else if(e[r]!=t[r])throw new Error(`Expected ${t[r]} at position ${r}, got ${e[r]}`)}function H(e,t,n){var r;S=e,t(),b[S]&&(b[S].clear=null===(r=null==n?void 0:n.clear)||void 0===r||r,b[S].timeout=null==n?void 0:n.timeout,b[S].benchmarks=null==n?void 0:n.benchmarks)}function F(e){null==b[S]&&(b[S]={}),b[S].before=e}function G(e){null==b[S]&&(b[S]={}),b[S].after=e}function D(e,t){return e.replace(new RegExp(t.name,"gi"),t.nqName)}function k(e){var t,n,a,i,c,l,u,d;return h(this,void 0,void 0,(function*(){const p=null===(n=null===(t=r.functions.getCurrentCall())||void 0===t?void 0:t.func)||void 0===n?void 0:n.package;yield function(e){var t;return h(this,void 0,void 0,(function*(){const n=e.id;if(E[n])return;const s=b;if(void 0!==s[A]||void 0!==s[C]||Object.keys(s).find((e=>e.startsWith(A)||e.startsWith(v))))return void(E[n]=!0);if("DevTools"===e.name)for(const e of window.dartTests){const n=e.name.split(/\s*\|\s*!/g),r=null!==(t=n.pop())&&void 0!==t?t:e.name,o=n.length?v+": "+n.join(": "):v;void 0===s[o]&&(s[o]={tests:[],clear:!0}),s[o].tests.push(new x(o,r,e.test,{isAggregated:!1,timeout:m}))}const a=[],i=[],c=[],l=yield r.dapi.functions.filter(`package.id = "${n}"`).list(),u=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const e of l){const t=e.options.test,n=e.options.demoPath;if(t&&Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const o=t[n].matchAll(u),i={};Array.from(o).forEach((e=>{e[0].startsWith("skip")?i.skip=e[1]:e[0].startsWith("wait")?i.wait=parseInt(e[2]):e[0].startsWith("cat")?i.cat=e[3]:e[0].startsWith("timeout")&&(i.timeout=parseInt(e[4]))}));const c=new x(A,1===t.length?e.name:`${e.name} ${n+1}`,(()=>h(this,void 0,void 0,(function*(){const s=yield r.functions.eval(D(t[n],e));if(i.wait&&(yield B(i.wait)),"boolean"==typeof s&&!s)throw`Failed: ${t[n]}, expected true, got ${s}`}))),{skipReason:i.skip,timeout:i.timeout});if(i.cat){const e=A+": "+i.cat;c.category=e,void 0===s[e]&&(s[e]={tests:[],clear:!0}),s[e].tests.push(c)}else a.push(c)}if(n){const t=e.options.demoWait?parseInt(e.options.demoWait):void 0,n=new x(C,e.friendlyName,(()=>h(this,void 0,void 0,(function*(){r.shell.clearLastError(),yield e.apply(),yield B(t||2e3);const n=yield r.shell.lastError;if(n)throw new Error(n)}))),{skipReason:e.options.demoSkip});i.push(n)}if(e.hasTag("semTypeDetector")){const t=new x(T,e.friendlyName,(()=>h(this,void 0,void 0,(function*(){const t=[];for(const n of o.clone().columns){const r=yield e.apply([n]);t.push(r||n.semType)}I(t.filter((e=>e)).length,1)}))),{skipReason:e.options.skipTest});c.push(t)}}E[n]=!0,a.length&&(s[A]={tests:a,clear:!0}),i.length&&(s[C]={tests:i,clear:!0}),c.length&&(s[T]={tests:c,clear:!1})}))}(p);const S=[];console.log("Running tests"),null!=e||(e={}),null!==(a=(d=e).testContext)&&void 0!==a||(d.testContext=new P),r.shell.clearLastError();const _=[],$=function(){const e=[];return console.log=(...t)=>{e.push(...t),f(...t)},console.info=(...t)=>{e.push(...t),g(...t)},console.warn=(...t)=>{e.push(...t),y(...t)},console.error=(...t)=>{e.push(...t),w(...t)},e}();try{for(const[t,n]of Object.entries(b)){if((null==e?void 0:e.category)&&!t.toLowerCase().startsWith(null==e?void 0:e.category.toLowerCase())||(null===(i=e.exclude)||void 0===i?void 0:i.some((e=>t.startsWith(e)))))continue;f(`Started ${t} category`),_.push(t);const o=null===(c=n.tests)||void 0===c?void 0:c.every((e=>{var t;return null===(t=e.options)||void 0===t?void 0:t.skipReason}));try{n.before&&!o&&(yield W((()=>h(this,void 0,void 0,(function*(){yield n.before()}))),1e5,`before ${e.category}: timeout error`))}catch(e){n.beforeStatus=yield V(e)}const a=null!==(l=n.tests)&&void 0!==l?l:[],d=[];if(n.clear)for(let t=0;t<a.length;t++){a[t].options&&void 0===(null===(u=a[t].options)||void 0===u?void 0:u.benchmark)&&(a[t].options||(a[t].options={}),a[t].options.benchmark=n.isAllTestsEnabledBenchmarkMode||!1);let o=yield U(a[t],null==e?void 0:e.test,$,n.timeout,p.name,e.verbose);o&&d.push(o),r.shell.closeAll(),s.Balloon.closeAll()}else for(let t=0;t<a.length;t++){let r=yield U(a[t],null==e?void 0:e.test,$,n.timeout,p.name,e.verbose);r&&d.push(r)}const m=d.filter((e=>"skipped"!=e.result));try{n.after&&!o&&(yield W((()=>h(this,void 0,void 0,(function*(){yield n.after()}))),1e5,`After ${e.category}: timeout error`))}catch(e){n.afterStatus=yield V(e)}n.afterStatus&&m.push({category:t,name:"after",result:n.afterStatus,success:!1,ms:0,skipped:!1}),n.beforeStatus&&m.push({category:t,name:"before",result:n.beforeStatus,success:!1,ms:0,skipped:!1}),S.push(...m)}}finally{console.log=f,console.info=g,console.warn=y,console.error=w}if(e.testContext.catchUnhandled){yield B(1e3);const e=yield r.shell.lastError,t={category:"Unhandled exceptions",name:"Exception",result:null!=e?e:"",success:!e,ms:0,skipped:!1};S.push(t),t.package=p.name,null!=r.shell.reportTest?yield r.shell.reportTest("package",t):yield fetch(`${r.dapi.root}/log/tests/package`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)})}return S}))}function V(e){return h(this,void 0,void 0,(function*(){return`${e.toString()}\n${e.stack?yield s.Logger.translateStackTrace(e.stack):""}`}))}function U(e,t,n,o,a,i){var c,l,u,d,g,y,b,A;return h(this,void 0,void 0,(function*(){let h;n.length=0;let C="package";const T=null!=t&&e.name.toLowerCase()!==t.toLowerCase();let v=(null===(c=e.options)||void 0===c?void 0:c.skipReason)||T,E=T?"skipped":null===(l=e.options)||void 0===l?void 0:l.skipReason;if(s.Test.isInBenchmark&&!(null===(u=e.options)||void 0===u?void 0:u.benchmark))return void f(`SKIPPED: ${e.category} ${e.name} doesnt available in benchmark mode`);v||f(`Started ${e.category} ${e.name}`);const S=Date.now();try{if(v)h={success:!0,result:E,ms:0,skipped:!0};else{let t=(null===(d=e.options)||void 0===d?void 0:d.timeout)===m&&o?o:null===(g=e.options)||void 0===g?void 0:g.timeout;t=s.Test.isInBenchmark?p:t,h={success:!0,result:null!==(y=yield W(e.test,t))&&void 0!==y?y:"OK",ms:0,skipped:!1}}}catch(e){w(e),h={success:!1,result:yield V(e),ms:0,skipped:!1}}if((null===(b=e.options)||void 0===b?void 0:b.isAggregated)&&h.result.constructor===s.DataFrame){const e=h.result.col("success");if(e&&(h.success=e.stats.sum===e.length),!i){const e=h.result;e.columns.remove("stack"),e.rows.removeWhere((e=>e.get("success"))),h.result=e}h.result=h.result.toCsv()}if(h.logs=n.join("\n"),h.ms=Date.now()-S,v||f(`Finished ${e.category} ${e.name} for ${h.ms} ms`),h.category=e.category,h.name=e.name,!T){let t={success:h.success,result:h.result,ms:h.ms,skipped:h.skipped,package:a,category:e.category,name:e.name,logs:h.logs};if(h.result.constructor==Object){const e=Object.keys(h.result).reduce(((e,t)=>Object.assign(Object.assign({},e),{["result."+t]:h.result[t]})),{});t=Object.assign(Object.assign({},t),e)}t.result instanceof s.DataFrame&&(t.result=JSON.stringify(null===(A=t.result)||void 0===A?void 0:A.toJson())||""),null!=r.shell.reportTest?yield r.shell.reportTest(C,t):yield fetch(`${r.dapi.root}/log/tests/${C}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)})}return h}))}function B(e){return h(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,e)))}))}function Y(e,t="Timeout exceeded",n=500,r=50){return h(this,void 0,void 0,(function*(){return new Promise(((s,o)=>{setTimeout((()=>{clearInterval(a),o(new Error(t))}),n);const a=setInterval((()=>{e()&&(clearInterval(a),s())}),r)}))}))}function W(e,t,n="EXECUTION TIMEOUT"){return h(this,void 0,void 0,(function*(){let r=null;const s=new Promise(((e,s)=>{r=setTimeout((()=>{s(n)}),t)}));try{return yield Promise.race([e(),s])}finally{r&&clearTimeout(r)}}))}const j=s.DataFrame.fromColumns([s.Column.fromStrings("col",["val1","val2","val3"])]);function K(e,t,n){var s;return h(this,void 0,void 0,(function*(){const o=null!==(s=null==n?void 0:n.packageName)&&void 0!==s?s:"";(null==n?void 0:n.detectSemanticTypes)&&(yield r.data.detectSemanticTypes(t));const a=r.shell.addTableView(t);try{yield i(a,e,o,r.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield i(a,e,o,r.events.onViewerAdded,void 0,n.awaitViewer)),(null==n?void 0:n.readOnly)||(yield i(a,e,o,r.events.onViewerAdded,c),(null==n?void 0:n.awaitViewer)&&(yield i(a,e,o,r.events.onViewerAdded,c,n.awaitViewer)));let t=null;t=yield i(a,e,o,r.events.onViewerAdded,u),(null==n?void 0:n.awaitViewer)&&(t=yield i(a,e,o,r.events.onViewerAdded,u,n.awaitViewer)),yield i(a,e,o,r.events.onViewLayoutApplied,d,void 0,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps}),(null==n?void 0:n.awaitViewer)&&(yield i(a,e,o,r.events.onViewLayoutApplied,d,n.awaitViewer,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps})),!1!==(null==n?void 0:n.arbitraryDfTest)&&(a.dataFrame=j,yield B(50),yield i(a,e,o,r.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield i(a,e,o,r.events.onViewerAdded,void 0,n.awaitViewer))),yield i(a,e,o,r.events.onViewerAdded,l),(null==n?void 0:n.awaitViewer)&&(yield i(a,e,o,r.events.onViewerAdded,l,n.awaitViewer))}finally{}}))}},3629:(e,t,n)=>{"use strict";function r(e=!1,t="Assertion error."){if(!e)throw new Error(t)}function s(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*e[n];return Math.sqrt(t)}function o(e,t){if(e.length!=t.length)throw new Error("The dimensionality of the vectors must match");let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}function a(e,t){let n=0;const r=e.length;if(r!==t.length)throw new Error("The dimensionality of the vectors must match");for(let s=0;s<r;++s)n+=Math.pow(e[s]-t[s],2);return Math.sqrt(n)}function i(e){const t=e.length;let n=0,r=0;for(let s=0;s<t;++s)n+=e[s],r+=Math.pow(e[s],2);const s=n/t,o=1/Math.sqrt(r/t-Math.pow(s,2));for(let n=0;n<t;++n)e[n]=(e[n]-s)*o;return e}n.d(t,{KE:()=>o,S8:()=>i,ou:()=>a,vA:()=>r,wQ:()=>s})},1913:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3282),s=n(9029),o=n(1520),a=n(2586),i=n(8708),c=n(2023),l="errorMessage",u=new r.Name("emUsed"),d={required:"missingProperty",dependencies:"property",dependentRequired:"property"},h=/\$\{[^}]+\}/,m=/\$\{([^}]+)\}/g,p=/^""\s*\+\s*|\s*\+\s*""$/g;const f=(e,t={})=>{if(!e.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(e.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return e.addKeyword(function(e){return{keyword:l,schemaType:["string","object"],post:!0,code(t){const{gen:n,data:f,schema:g,schemaValue:y,it:w}=t;if(!1===w.createErrors)return;const b=g,A=s.strConcat(c.default.instancePath,w.errorPath);function C(e,t){return s.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${u}`,r._`${e}.instancePath === ${A}`,r._`${e}.keyword in ${t}`,r._`${e}.schemaPath.indexOf(${w.errSchemaPath}) === 0`,r._`/^\\/[^\\/]*$/.test(${e}.schemaPath.slice(${w.errSchemaPath.length}))`)}function T(e,t){const r=[];for(const n in e){const e=t[n];h.test(e)&&r.push([n,E(e)])}return n.object(...r)}function v(e){return h.test(e)?new o._Code(o.safeStringify(e).replace(m,((e,t)=>`" + JSON.stringify(${a.getData(t,w)}) + "`)).replace(p,"")):r.stringify(e)}function E(e){return r._`function(){return ${v(e)}}`}n.if(r._`${c.default.errors} > 0`,(()=>{if("object"==typeof b){const[o,a]=function(e){let t,n;for(const r in e){if("properties"===r||"items"===r)continue;const s=e[r];if("object"==typeof s){t||(t={});const e=t[r]={};for(const t in s)e[t]=[]}else n||(n={}),n[r]=[]}return[t,n]}(b);a&&function(s){const o=n.const("emErrors",r.stringify(s)),a=n.const("templates",T(s,g));n.forOf("err",c.default.vErrors,(e=>n.if(C(e,o),(()=>n.code(r._`${o}[${e}.keyword].push(${e})`).assign(r._`${e}.${u}`,!0)))));const{singleError:l}=e;if(l){const e=n.let("message",r._`""`),s=n.let("paramsErrors",r._`[]`);d((t=>{n.if(e,(()=>n.code(r._`${e} += ${"string"==typeof l?l:";"}`))),n.code(r._`${e} += ${h(t)}`),n.assign(s,r._`${s}.concat(${o}[${t}])`)})),i.reportError(t,{message:e,params:r._`{errors: ${s}}`})}else d((e=>i.reportError(t,{message:h(e),params:r._`{errors: ${o}[${e}]}`})));function d(e){n.forIn("key",o,(t=>n.if(r._`${o}[${t}].length`,(()=>e(t)))))}function h(e){return r._`${e} in ${a} ? ${a}[${e}]() : ${y}[${e}]`}}(a),o&&function(e){const s=n.const("emErrors",r.stringify(e)),o=[];for(const t in e)o.push([t,T(e[t],g[t])]);const a=n.const("templates",n.object(...o)),l=n.scopeValue("obj",{ref:d,code:r.stringify(d)}),h=n.let("emPropParams"),m=n.let("emParamsErrors");n.forOf("err",c.default.vErrors,(e=>n.if(C(e,s),(()=>{n.assign(h,r._`${l}[${e}.keyword]`),n.assign(m,r._`${s}[${e}.keyword][${e}.params[${h}]]`),n.if(m,(()=>n.code(r._`${m}.push(${e})`).assign(r._`${e}.${u}`,!0)))})))),n.forIn("key",s,(e=>n.forIn("keyProp",r._`${s}[${e}]`,(o=>{n.assign(m,r._`${s}[${e}][${o}]`),n.if(r._`${m}.length`,(()=>{const s=n.const("tmpl",r._`${a}[${e}] && ${a}[${e}][${o}]`);i.reportError(t,{message:r._`${s} ? ${s}() : ${y}[${e}][${o}]`,params:r._`{errors: ${m}}`})}))}))))}(o),function(e){const{props:o,items:a}=e;if(!o&&!a)return;const d=r._`typeof ${f} == "object"`,h=r._`Array.isArray(${f})`,m=n.let("emErrors");let p,w;const b=n.let("templates");function C(e,t){n.assign(m,r.stringify(e)),n.assign(b,T(e,t))}o&&a?(p=n.let("emChildKwd"),n.if(d),n.if(h,(()=>{C(a,g.items),n.assign(p,r.str`items`)}),(()=>{C(o,g.properties),n.assign(p,r.str`properties`)})),w=r._`[${p}]`):a?(n.if(h),C(a,g.items),w=r._`.items`):o&&(n.if(s.and(d,s.not(h))),C(o,g.properties),w=r._`.properties`),n.forOf("err",c.default.vErrors,(e=>function(e,t,o){n.if(s.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${u}`,r._`${e}.instancePath.indexOf(${A}) === 0`),(()=>{const s=n.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:r._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),a=n.const("emMatches",r._`${s}.exec(${e}.instancePath.slice(${A}.length))`),i=n.const("emChild",r._`${a} && ${a}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);n.if(r._`${i} !== undefined && ${i} in ${t}`,(()=>o(i)))}))}(e,m,(t=>n.code(r._`${m}[${t}].push(${e})`).assign(r._`${e}.${u}`,!0))))),n.forIn("key",m,(e=>n.if(r._`${m}[${e}].length`,(()=>{i.reportError(t,{message:r._`${e} in ${b} ? ${b}[${e}]() : ${y}${w}[${e}]`,params:r._`{errors: ${m}[${e}]}`}),n.assign(r._`${c.default.vErrors}[${c.default.errors}-1].instancePath`,r._`${A} + "/" + ${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}(b))}const o="string"==typeof b?b:b._;o&&function(e){const o=n.const("emErrs",r._`[]`);n.forOf("err",c.default.vErrors,(e=>n.if(function(e){return s.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${u}`,s.or(r._`${e}.instancePath === ${A}`,s.and(r._`${e}.instancePath.indexOf(${A}) === 0`,r._`${e}.instancePath[${A}.length] === "/"`)),r._`${e}.schemaPath.indexOf(${w.errSchemaPath}) === 0`,r._`${e}.schemaPath[${w.errSchemaPath}.length] === "/"`)}(e),(()=>n.code(r._`${o}.push(${e})`).assign(r._`${e}.${u}`,!0))))),n.if(r._`${o}.length`,(()=>i.reportError(t,{message:v(e),params:r._`{errors: ${o}}`})))}(o),e.keepErrors||function(){const e=n.const("emErrs",r._`[]`);n.forOf("err",c.default.vErrors,(t=>n.if(r._`!${t}.${u}`,(()=>n.code(r._`${e}.push(${t})`))))),n.assign(c.default.vErrors,e).assign(c.default.errors,r._`${e}.length`)}()}))},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}(t))};t.default=f,e.exports=f,e.exports.default=f},7433:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const r=n(4042),s=n(6105),o=n(6653),a=n(9572),i="https://json-schema.org/draft/2020-12/schema";class c extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),s.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;t&&(a.default.call(this,e),this.refs["http://json-schema.org/schema"]=i)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv2020=c,e.exports=t=c,e.exports.Ajv2020=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var l=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var h=n(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})},3282:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=n(4042),s=n(6144),o=n(6653),a=n(2079),i=["/properties"],c="http://json-schema.org/draft-07/schema";class l extends r.default{_addVocabularies(){super._addVocabularies(),s.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(a,i):a;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var h=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var m=n(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})},1520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class s extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function o(e,...t){const n=[e[0]];let r=0;for(;r<t.length;)c(n,t[r]),n.push(e[++r]);return new s(n)}t._Code=s,t.nil=new s(""),t._=o;const a=new s("+");function i(e,...t){const n=[u(e[0])];let r=0;for(;r<t.length;)n.push(a),c(n,t[r]),n.push(a,u(e[++r]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===a){const n=l(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new s(n)}function c(e,t){var n;t instanceof s?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:u(Array.isArray(n)?n.join(","):n))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof r||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof r?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=i,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:i`${e}${t}`},t.stringify=function(e){return new s(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new s(`.${e}`):o`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new s(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new s(e.toString())}},9029:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const r=n(1520),s=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 a=n(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),t.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};class i{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends i{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?s.varKinds.var:this.varKind,r=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=N(this.rhs,e,t)),this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}class l extends i{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof r.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=N(this.rhs,e,t),this}get names(){return M(this.lhs instanceof r.Name?{}:{...this.lhs.names},this.rhs)}}class u extends l{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class h extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class m extends i{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends i{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 r._CodeOrName?this.code.names:{}}}class f extends i{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let r=n.length;for(;r--;){const s=n[r];s.optimizeNames(e,t)||(I(e,s.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>$(e,t.names)),{})}}class g extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends f{}class w extends g{}w.kind="else";class b 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 w(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(L(e),t instanceof b?[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 M(e,this.condition),this.else&&$(e,this.else.names),e}}b.kind="if";class A extends g{}A.kind="for";class C extends A{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 $(super.names,this.iteration.names)}}class T extends A{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){const t=e.es5?s.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){const e=M(super.names,this.from);return M(e,this.to)}}class v extends A{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=N(this.iterable,e,t),this}get names(){return $(super.names,this.iterable.names)}}class E 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)}}E.kind="func";class S extends f{render(e){return"return "+super.render(e)}}S.kind="return";class _ extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(r=this.finally)||void 0===r||r.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&$(e,this.catch.names),this.finally&&$(e,this.finally.names),e}}class P extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}P.kind="catch";class x extends g{render(e){return"finally"+super.render(e)}}function $(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function M(e,t){return t instanceof r._CodeOrName?$(e,t.names):e}function N(e,t,n){return e instanceof r.Name?o(e):(s=e)instanceof r._Code&&s._items.some((e=>e instanceof r.Name&&1===t[e.str]&&void 0!==n[e.str]))?new r._Code(e._items.reduce(((e,t)=>(t instanceof r.Name&&(t=o(t)),t instanceof r._Code?e.push(...t._items):e.push(t),e)),[])):e;var s;function o(e){const r=n[e.str];return void 0===r||1!==t[e.str]?e:(delete t[e.str],r)}}function I(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function L(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:r._`!${F(e)}`}x.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 s.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){const s=this._scope.toName(t);return void 0!==n&&r&&(this._constants[s.str]=n),this._leafNode(new c(e,s,n)),s}const(e,t,n){return this._def(s.varKinds.const,e,t,n)}let(e,t,n){return this._def(s.varKinds.let,e,t,n)}var(e,t,n){return this._def(s.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new l(e,t,n))}add(e,n){return this._leafNode(new u(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==r.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[n,s]of e)t.length>1&&t.push(","),t.push(n),(n!==s||this.opts.es5)&&(t.push(":"),(0,r.addCodeArg)(t,s));return t.push("}"),new r._Code(t)}if(e,t,n){if(this._blockNode(new b(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 b(e))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode(b,w)}_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,r,o=(this.opts.es5?s.varKinds.var:s.varKinds.let)){const a=this._scope.toName(e);return this._for(new T(o,a,t,n),(()=>r(a)))}forOf(e,t,n,o=s.varKinds.const){const a=this._scope.toName(e);if(this.opts.es5){const e=t instanceof r.Name?t:this.var("_arr",t);return this.forRange("_i",0,r._`${e}.length`,(t=>{this.var(a,r._`${e}[${t}]`),n(a)}))}return this._for(new v("of",o,a,t),(()=>n(a)))}forIn(e,t,n,o=(this.opts.es5?s.varKinds.var:s.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,r._`Object.keys(${t})`,n);const a=this._scope.toName(e);return this._for(new v("in",o,a,t),(()=>n(a)))}endFor(){return this._endBlockNode(A)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new h(e))}return(e){const t=new S;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new _;if(this._blockNode(r),this.code(e),t){const e=this.name("e");this._currNode=r.catch=new P(e),t(e)}return n&&(this._currNode=r.finally=new x,this.code(n)),this._endBlockNode(P,x)}throw(e){return this._leafNode(new m(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=r.nil,n,s){return this._blockNode(new E(e,t,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(E)}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 b))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=L;const R=H(t.operators.AND);t.and=function(...e){return e.reduce(R)};const O=H(t.operators.OR);function H(e){return(t,n)=>t===r.nil?n:n===r.nil?t:r._`${F(t)} ${e} ${F(n)}`}function F(e){return e instanceof r.Name?e:r._`(${e})`}t.or=function(...e){return e.reduce(O)}},7845:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const r=n(1520);class s 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 r.Name("const"),let:new r.Name("let"),var:new r.Name("var")};class a{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof r.Name?e:this.name(e)}name(e){return new r.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=a;class i extends r.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=r._`.${new r.Name(t)}[${n}]`}}t.ValueScopeName=i;const c=r._`\n`;t.ValueScope=class extends a{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:r.nil}}get(){return this._scope}name(e){return new i(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(e),{prefix:s}=r,o=null!==(n=t.key)&&void 0!==n?n:t.ref;let a=this._values[s];if(a){const e=a.get(o);if(e)return e}else a=this._values[s]=new Map;a.set(o,r);const i=this._scope[s]||(this._scope[s]=[]),c=i.length;return i[c]=t.ref,r.setValue(t,{property:s,itemIndex:c}),r}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return r._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n,a={},i){let c=r.nil;for(const l in e){const u=e[l];if(!u)continue;const d=a[l]=a[l]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,o.Started);let a=n(e);if(a){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;c=r._`${c}${n} ${e} = ${a};${this.opts._n}`}else{if(!(a=null==i?void 0:i(e)))throw new s(e);c=r._`${c}${a}${this.opts._n}`}d.set(e,o.Completed)}))}return c}}},8708:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const r=n(9029),s=n(4227),o=n(2023);function a(e,t){const n=e.const("err",t);e.if(r._`${o.default.vErrors} === null`,(()=>e.assign(o.default.vErrors,r._`[${n}]`)),r._`${o.default.vErrors}.push(${n})`),e.code(r._`${o.default.errors}++`)}function i(e,t){const{gen:n,validateName:s,schemaEnv:o}=e;o.$async?n.throw(r._`new ${e.ValidationError}(${t})`):(n.assign(r._`${s}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>r.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?r.str`"${e}" keyword must be ${t} ($data)`:r.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,s,o){const{it:c}=e,{gen:u,compositeRule:d,allErrors:h}=c,m=l(e,n,s);(null!=o?o:d||h)?a(u,m):i(c,r._`[${m}]`)},t.reportExtraError=function(e,n=t.keywordError,r){const{it:s}=e,{gen:c,compositeRule:u,allErrors:d}=s;a(c,l(e,n,r)),u||d||i(s,o.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(o.default.errors,t),e.if(r._`${o.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(r._`${o.default.vErrors}.length`,t)),(()=>e.assign(o.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:s,errsCount:a,it:i}){if(void 0===a)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",a,o.default.errors,(a=>{e.const(c,r._`${o.default.vErrors}[${a}]`),e.if(r._`${c}.instancePath === undefined`,(()=>e.assign(r._`${c}.instancePath`,(0,r.strConcat)(o.default.instancePath,i.errorPath)))),e.assign(r._`${c}.schemaPath`,r.str`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign(r._`${c}.schema`,n),e.assign(r._`${c}.data`,s))}))};const c={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function l(e,t,n){const{createErrors:s}=e.it;return!1===s?r._`{}`:function(e,t,n={}){const{gen:s,it:a}=e,i=[u(a,n),d(e,n)];return function(e,{params:t,message:n},s){const{keyword:a,data:i,schemaValue:l,it:u}=e,{opts:d,propertyName:h,topSchemaRef:m,schemaPath:p}=u;s.push([c.keyword,a],[c.params,"function"==typeof t?t(e):t||r._`{}`]),d.messages&&s.push([c.message,"function"==typeof n?n(e):n]),d.verbose&&s.push([c.schema,l],[c.parentSchema,r._`${m}${p}`],[o.default.data,i]),h&&s.push([c.propertyName,h])}(e,t,i),s.object(...i)}(e,t,n)}function u({errorPath:e},{instancePath:t}){const n=t?r.str`${e}${(0,s.getErrorPath)(t,s.Type.Str)}`:e;return[o.default.instancePath,(0,r.strConcat)(o.default.instancePath,n)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:o}){let a=o?t:r.str`${t}/${e}`;return n&&(a=r.str`${a}${(0,s.getErrorPath)(n,s.Type.Str)}`),[c.schemaPath,a]}},3835:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const r=n(9029),s=n(3558),o=n(2023),a=n(6939),i=n(4227),c=n(2586);class l{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,a.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function u(e){const t=h.call(this,e);if(t)return t;const n=(0,a.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:l}=this.opts.code,{ownProperties:u}=this.opts,d=new r.CodeGen(this.scope,{es5:i,lines:l,ownProperties:u});let m;e.$async&&(m=d.scopeValue("Error",{ref:s.default,code:r._`require("ajv/dist/runtime/validation_error").default`}));const p=d.scopeName("validate");e.validateName=p;const f={gen:d,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,r.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:m,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:r.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:r._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,c.validateFunctionCode)(f),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(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(p,{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:p,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=f;n.evaluated={props:e instanceof r.Name?void 0:e,items:t instanceof r.Name?void 0:t,dynamicProps:e instanceof r.Name,dynamicItems:t instanceof r.Name},n.source&&(n.source.evaluated=(0,r.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function d(e){return(0,a.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function h(e){for(const r of this._compilations)if(n=e,(t=r).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return r;var t,n}function m(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||p.call(this,e,t)}function p(e,t){const n=this.opts.uriResolver.parse(t),r=(0,a._getFullPath)(this.opts.uriResolver,n);let s=(0,a.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===s)return g.call(this,n,e);const o=(0,a.normalizeId)(r),i=this.refs[o]||this.schemas[o];if("string"==typeof i){const t=p.call(this,e,i);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,n,t)}if("object"==typeof(null==i?void 0:i.schema)){if(i.validate||u.call(this,i),o===(0,a.normalizeId)(t)){const{schema:t}=i,{schemaId:n}=this.opts,r=t[n];return r&&(s=(0,a.resolveUrl)(this.opts.uriResolver,s,r)),new l({schema:t,schemaId:n,root:e,baseId:s})}return g.call(this,n,i)}}t.SchemaEnv=l,t.compileSchema=u,t.resolveRef=function(e,t,n){var r;n=(0,a.resolveUrl)(this.opts.uriResolver,t,n);const s=e.refs[n];if(s)return s;let o=m.call(this,e,n);if(void 0===o){const s=null===(r=e.localRefs)||void 0===r?void 0:r[n],{schemaId:a}=this.opts;s&&(o=new l({schema:s,schemaId:a,root:e,baseId:t}))}return void 0!==o?e.refs[n]=d.call(this,o):void 0},t.getCompilingSchema=h,t.resolveSchema=p;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:n,root:r}){var s;if("/"!==(null===(s=e.fragment)||void 0===s?void 0:s[0]))return;for(const r of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,i.unescapeFragment)(r)];if(void 0===e)return;const s="object"==typeof(n=e)&&n[this.opts.schemaId];!f.has(r)&&s&&(t=(0,a.resolveUrl)(this.opts.uriResolver,t,s))}let o;if("boolean"!=typeof n&&n.$ref&&!(0,i.schemaHasRulesButRef)(n,this.RULES)){const e=(0,a.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=p.call(this,r,e)}const{schemaId:c}=this.opts;return o=o||new l({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema?o:void 0}},2023:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s={data:new r.Name("data"),valCxt:new r.Name("valCxt"),instancePath:new r.Name("instancePath"),parentData:new r.Name("parentData"),parentDataProperty:new r.Name("parentDataProperty"),rootData:new r.Name("rootData"),dynamicAnchors:new r.Name("dynamicAnchors"),vErrors:new r.Name("vErrors"),errors:new r.Name("errors"),this:new r.Name("this"),self:new r.Name("self"),scope:new r.Name("scope"),json:new r.Name("json"),jsonPos:new r.Name("jsonPos"),jsonLen:new r.Name("jsonLen"),jsonPart:new r.Name("jsonPart")};t.default=s},4551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6939);class s extends Error{constructor(e,t,n,s){super(s||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,r.resolveUrl)(e,t,n),this.missingSchema=(0,r.normalizeId)((0,r.getFullPath)(e,this.missingRef))}}t.default=s},6939:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const r=n(4227),s=n(2017),o=n(7106),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&l(e)<=t)};const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(i.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(c))return!0;if("object"==typeof n&&c(n))return!0}return!1}function l(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!a.has(n)&&("object"==typeof e[n]&&(0,r.eachItem)(e[n],(e=>t+=l(e))),t===1/0))return 1/0}return t}function u(e,t="",n){!1!==n&&(t=m(t));const r=e.parse(t);return d(e,r)}function d(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=d;const h=/#\/?$/;function m(e){return e?e.replace(h,""):""}t.normalizeId=m,t.resolveUrl=function(e,t,n){return n=m(n),e.resolve(t,n)};const p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:r}=this.opts,a=m(e[n]||t),i={"":a},c=u(r,a,!1),l={},d=new Set;return o(e,{allKeys:!0},((e,t,r,s)=>{if(void 0===s)return;const o=c+t;let a=i[s];function u(t){const n=this.opts.uriResolver.resolve;if(t=m(a?n(a,t):t),d.has(t))throw f(t);d.add(t);let r=this.refs[t];return"string"==typeof r&&(r=this.refs[r]),"object"==typeof r?h(e,r.schema,t):t!==m(o)&&("#"===t[0]?(h(e,l[t],t),l[t]=e):this.refs[t]=o),t}function g(e){if("string"==typeof e){if(!p.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[n]&&(a=u.call(this,e[n])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),i[t]=a})),l;function h(e,t,n){if(void 0!==t&&!s(e,t))throw f(n)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},396:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},4227:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const r=n(9029),s=n(1520);function o(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const s=r.RULES.keywords;for(const n in t)s[n]||p(e,`unknown keyword: "${n}"`)}function a(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function i(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function l({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:s}){return(o,a,i,c)=>{const l=void 0===i?a:i instanceof r.Name?(a instanceof r.Name?e(o,a,i):t(o,a,i),i):a instanceof r.Name?(t(o,i,a),a):n(a,i);return c!==r.Name||l instanceof r.Name?l:s(o,l)}}function u(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",r._`{}`);return void 0!==t&&d(e,n,t),n}function d(e,t,n){Object.keys(n).forEach((n=>e.assign(r._`${t}${(0,r.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!a(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRules=a,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,s,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return r._`${n}`}return r._`${e}${t}${(0,r.getProperty)(s)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(i(e))},t.escapeJsonPointer=i,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>{e.if(r._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,r._`${n} || {}`).code(r._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,r._`${n} || {}`),d(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,r._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>e.assign(n,!0===t||r._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=d;const h={};var m;function p(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:h[t.code]||(h[t.code]=new s._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(m||(t.Type=m={})),t.getErrorPath=function(e,t,n){if(e instanceof r.Name){const s=t===m.Num;return n?s?r._`"[" + ${e} + "]"`:r._`"['" + ${e} + "']"`:s?r._`"/" + ${e}`:r._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,r.getProperty)(e).toString():"/"+i(e)},t.checkStrictMode=p},7887:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>r(e,t)))}function r(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},r){const s=t.RULES.types[r];return s&&!0!==s&&n(e,s)},t.shouldUseGroup=n,t.shouldUseRule=r},8727:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const r=n(8708),s=n(9029),o=n(2023),a={message:"boolean schema is false"};function i(e,t){const{gen:n,data:s}=e,o={gen:n,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,r.reportError)(o,a,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:r}=e;!1===n?i(e,!1):"object"==typeof n&&!0===n.$async?t.return(o.default.data):(t.assign(s._`${r}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:r}=e;!1===r?(n.var(t,!1),i(e)):n.var(t,!0)}},208:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const r=n(396),s=n(7887),o=n(8708),a=n(9029),i=n(4227);var c;function l(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(r.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c||(t.DataType=c={})),t.getSchemaTypes=function(e){const t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=l,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:r,opts:o}=e,i=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,o.coerceTypes),l=t.length>0&&!(0===i.length&&1===t.length&&(0,s.schemaHasRulesForType)(e,t[0]));if(l){const s=h(t,r,o.strictNumbers,c.Wrong);n.if(s,(()=>{i.length?function(e,t,n){const{gen:r,data:s,opts:o}=e,i=r.let("dataType",a._`typeof ${s}`),c=r.let("coerced",a._`undefined`);"array"===o.coerceTypes&&r.if(a._`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,(()=>r.assign(s,a._`${s}[0]`).assign(i,a._`typeof ${s}`).if(h(t,s,o.strictNumbers),(()=>r.assign(c,s))))),r.if(a._`${c} !== undefined`);for(const e of n)(u.has(e)||"array"===e&&"array"===o.coerceTypes)&&l(e);function l(e){switch(e){case"string":return void r.elseIf(a._`${i} == "number" || ${i} == "boolean"`).assign(c,a._`"" + ${s}`).elseIf(a._`${s} === null`).assign(c,a._`""`);case"number":return void r.elseIf(a._`${i} == "boolean" || ${s} === null
|
|
1
|
+
var bio_test;(()=>{var e={8924:(e,t,n)=>{"use strict";n.d(t,{X:()=>s});var r=n(7362);class s extends r.e{static get Lesk(){return void 0===this.lesk&&(this.lesk=this.makePalette([[["G","A","S","T"],"orange"],[["C","V","I","L","P","F","Y","M","W"],"all_green"],[["N","Q","H"],"magenta"],[["D","E"],"red"],[["K","R"],"all_blue"]],!1,s)),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,s)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new s({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 s.aaSynonyms?s.aaSynonyms[e]:e;return super.get(t)}}s.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class o{static getPalette(e="grok"){switch(e){case"grok":return s.GrokGroups;case"lesk":return s.Lesk;default:throw new Error(`ChemPalette: scheme \`${e}\` does not exist`)}}static getInnerOuter(e){let t=0,n="",r="";for(const s of e)"("==s?t++:")"==s?t--:t?n+=s:r+=s;return isNaN(parseInt(n))?[r,n]:[r,""]}static getColorAAPivot(e="",t="grok"){const n=this.getPalette(t);let[r,s]=this.getInnerOuter(e);if(r=r.length>6?`${r.slice(0,3)}...`:r,s=s.length>6?`${s.slice(0,3)}...`:s,1==e.length||"("==e[1]){const t=e[0]?.toUpperCase();return t in n?[n.get(t),t,s,1]:[this.undefinedColor,r,s,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,s,2]:[this.undefinedColor,r,s,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,s,3]:[this.undefinedColor,r,s,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,s,4]:[this.undefinedColor,r,s,4]}return[this.undefinedColor,r,s,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"}},9124:(e,t,n)=>{"use strict";n.d(t,{b:()=>o});var r=n(7389),s=n(6082);async function o(){const e="Helm",t=s.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()}r.input.helmAsync=async function(e,t){return(await o()).createHelmInput(e,t)}},4356:(e,t,n)=>{"use strict";n.d(t,{Eu:()=>l,so:()=>o,ub:()=>c,yZ:()=>u});var r=n(4328);const s="Libraries",o="System:AppData/Bio/monomer-libraries/",a={explicit:["HELMCoreLibrary.json"],exclude:[]};let i=Promise.resolve();async function c(){let e;return i=i.then((async()=>{const t=await r.dapi.userDataStorage.getValue(s,"Settings",!0);e=t?JSON.parse(t):{exclude:[],explicit:[]},e.exclude=e.exclude instanceof Array?e.exclude:[],e.explicit=e.explicit instanceof Array?e.explicit:[],console.debug(`Bio: getUserLibSettings()\n${JSON.stringify(e,void 0,2)}`)})),await i,e}async function l(e){i=i.then((async()=>{console.debug(`Bio: setUserLibSettings()\n${JSON.stringify(e,void 0,2)}`),await r.dapi.userDataStorage.postValue(s,"Settings",JSON.stringify(e),!0)})),await i}async function u(){await l(a)}},6718:(e,t,n)=>{"use strict";n.d(t,{A7:()=>d,pj:()=>c,uL:()=>l});var r=n(6082),s=n(4328),o=n(6295),a=(n(3151),n(2738)),i=(n(826),n(3077));async function c(){const e=r.Func.find({package:"Bio",name:"getMonomerLibHelper"});if(0===e.length)throw new Error('Package "Bio" must be installed for MonomerLibHelper.');return(await e[0].prepare().call()).getOutputParamValue()}async function l(e,t){e instanceof r.Column&&(e=(0,i.R)(e).columns.toList());const n=(await c()).getBioLib(),o=new Array(e.length),l=e[0].length,u=new Float32Array(l);for(let i=0;i<e.length;++i){const c=i<t.length?t.getCanonical(i):a._S,d=n.getMonomer("PEPTIDE",c)?.smiles??"";d||s.shell.warning(`Reference monomer ${c} not found in monomer library`);const h=e[i],m=h.getRawData(),p=h.categories,f=p.indexOf("");if(o[i]={categories:p,data:m,emptyIndex:f},void 0===c)continue;const g=r.Column.fromStrings("smiles",p.map((e=>n.getMonomer("PEPTIDE",e)?.smiles??""))),y=(r.DataFrame.fromColumns([g]),await s.chem.getSimilarities(g,d)),w=y?y.getRawData():null;if(w)for(let e=0;e<l;++e){const t=m[e];c!==a._S&&t!==f?u[e]+=w[t]:c===a._S&&t===f&&(u[e]+=1)}}for(let n=0;n<u.length;++n){let s=u[n]/t.length;for(let a=0;a<e.length;++a){const e=o[a];if(a>=t.length&&e.data[n]!==e.emptyIndex||e.data[n]===e.emptyIndex&&a<t.length){s=r.FLOAT_NULL;break}}u[n]=s}return r.Column.fromFloat32Array("Similarity",u)}async function u(e){const t=(await c()).getBioLib(),n=[],o={},a=e.map((e=>t.getMonomer("PEPTIDE",e)?.smiles??"")),i=r.Column.fromStrings("smiles",a);for(let t=0;t<a.length;++t){o[e[t]]=t;const r=a[t],c=""===r?new Array(a.length).fill(0):(await s.chem.getSimilarities(i,r)).getRawData();c[t]=1,n[t]=Array.from(c)}return{scoringMatrix:n,alphabetIndexes:o}}async function d(e,t="Morgan"){const n=(await c()).getBioLib(),s=new Array(e.length).fill(0).map((()=>new Array(e.length).fill(0))),a={},i=e.map((e=>n.getMonomer("PEPTIDE",e)?.smiles??"")),l=r.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 u(e);const d=r.Column.fromStrings("smiles",i),h=(r.DataFrame.fromColumns([d]),(await l.apply({col:d,fingerprintType:t}))?.entries);if(!h)return console.warn(`${t} Fingerprints could not be calculated for monomers from chem package.\n falling back to Morgan fingerprints`),await u(e);for(let t=0;t<h.length;++t)if(s[t][t]=1,a[e[t]]=t,h[t])for(let e=t+1;e<h.length;++e)h[e]&&(s[t][e]=s[e][t]=(0,o.$1)(h[t],h[e]));return{scoringMatrix:s,alphabetIndexes:a}}},7384:(e,t,n)=>{"use strict";n.d(t,{C4:()=>h});var r=n(4328),s=n(6082),o=n(1991),a=n.n(o),i=n(439),c=n(826);const l={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:"d",RIBOSE:"r",PHOSPHATE:"p",OXYGEN:"O",HYDROGEN:"H"};var u=n(3151);function d(e){return Math.round(l.PRECISION_FACTOR*e)/l.PRECISION_FACTOR}async function h(e,t,o){if(0===s.Func.find({package:"Chem",name:"getRdKitModule"}).length)return{col:null,warnings:['Transformation to atomic level requires the package "Chem" installed.']};if(t.semType!==s.SEMTYPE.MACROMOLECULE)return{col:null,warnings:[`Only the ${s.SEMTYPE.MACROMOLECULE} columns can be converted to atomic level, the chosen column has semType '${t.semType}'`]};let d=t;const h=c.GO.forColumn(t);h.isHelm()&&(d=h.convert(i.Hi.SEPARATOR,"."),d.name=t.name);const p=c.GO.forColumn(d).alphabet;let f;if(p===i.YI.PT||p===i.YI.UN)f="PEPTIDE";else{if(p!==i.YI.RNA&&p!==i.YI.DNA)return{col:null,warnings:[`Unexpected column's '${d.name}' alphabet '${p}'.`]};f="RNA"}const g=function(e){const t=e.length,n=new Array(t),s=c.GO.forColumn(e);let o=!1;for(let e=0;e<t;++e){const t=s.getSplitted(e);o||(o=0===t.length),n[e]=a()(t.canonicals).filter((e=>!s.isGap(e))).map((e=>e)).toArray()}return o&&r.shell.warning(`Some values in the "${e.name}" column are empty`),n}(d),y=await async function(e,t,n,s){const o=function(e,t,n){const r=new Map;for(const s of e.getMonomerSymbolsByType(t)){const o=e.getMonomer(t,s);if("RNA"===t&&("Branch"===o.monomerType||n===i.YI.DNA&&o.symbol===l.DEOXYRIBOSE||n===i.YI.RNA&&o.symbol===l.RIBOSE||o.symbol===l.PHOSPHATE)||"PEPTIDE"===t&&"Branch"!==o.monomerType){const e={};u.f6.forEach((t=>{e[t]=o[t]})),r.set(o.symbol,e)}}return r}(t,n,s),a=new Map,c=await r.functions.call("Chem:getRdKitModule"),d={value:null};if("RNA"===n){const e=s===i.YI.RNA?[l.RIBOSE,l.PHOSPHATE]:[l.DEOXYRIBOSE,l.PHOSPHATE];for(const t of e)m(a,t,o,c,n,d)}for(let t=0;t<e.length;++t){const r=e[t];for(const e of r)if(""!==e)try{m(a,e,o,c,n,d)}catch(t){const n=t instanceof Error?t.message:t.toString(),r=t instanceof Error?t.stack:void 0;throw console.error(`bio lib: getMonomersDictFromLib() sym='${e}', error:\n${n}\n${r}`),new Error(`Can't get monomer '${e}' from library: ${n}`)}}return a}(g,o,f,p),w=d.length,{molfileList:b,molfileWarningList:A}=await async function(e,t,r,s,o){const a=Math.max(navigator.hardwareConcurrency-2,1),i=new Array(a).fill(null).map((()=>new Worker(new URL(n.p+n.u(248),n.b)))),c=o/a;let l=[],u=[];const d=new Array(a);for(let n=0;n<a;n++){const l=Math.floor(n*c),u=n===a-1?o:Math.floor((n+1)*c);i[n].postMessage({monomerSequencesArray:e,monomersDict:t,alphabet:r,polymerType:s,start:l,end:u}),d[n]=new Promise((e=>{i[n].onmessage=({data:{molfileList:t,molfileWarningList:n}})=>{e({molfileList:t,molfileWarningList:n})}}))}return(await Promise.all(d)).forEach((e=>{l=l.concat(...e.molfileList),u=u.concat(...e.molfileWarningList)})),setTimeout((()=>{i.forEach((e=>{e.terminate()}))}),0),{molfileList:l,molfileWarningList:u}}(g,y,p,f,w);if(A.length>.05*w)throw new Error("Too many errors getting molfiles.");const C=`molfile(${d.name})`,T=e.columns.getUnusedName(C),v=s.Column.fromStrings(T,b);return v.semType=s.SEMTYPE.MOLECULE,v.meta.units=s.UNITS.Molecule.MOLBLOCK,{col:v,warnings:A}}function m(e,t,n,r,s,o){if(!e.has(t)){const a=function(e,t,n,r,s){if(t.has(e)){const a=t.get(e),i=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}(a.rgroups),c=(o=a.molfile).includes("V3000")?function(e){const t=new Map,n=/M V30 (\d+) R#.+RGROUPS=\((\d+) (\d+)\).*/gm;let r;for(;null!==(r=n.exec(e));)r.index===n.lastIndex&&n.lastIndex++,t.set(parseInt(r[1]),parseInt(r[3]));return t}(o):function(e){const t=new Map;let n=e.indexOf(l.V2K_A_LINE,0),r=n;for(;-1!==n;){r=e.indexOf("\n",n);const s=parseInt(e.substring(n,r).replace(/^A\s+/,""));n=e.indexOf("R",r),r=e.indexOf("\n",n);const o=parseInt(e.substring(n,r).replace(/^R/,""));t.set(s,o),n=e.indexOf(l.V2K_A_LINE,r)}for(n=e.indexOf(l.V2K_RGP_LINE,0),r=e.indexOf("\n",n);-1!==n;){n+=l.V2K_RGP_SHIFT,r=e.indexOf("\n",n);const s=e.substring(n,r).replaceAll(/\s+/g," ").split(" ").map((e=>parseInt(e))).slice(1);for(let e=0;e<s.length;e+=2){if(t.has(s[e])&&t.get(s[e])!==s[e+1])throw new Error(`r-group index ${s[e]} has already been added with a different value`);t.set(s[e],s[e+1])}n=e.indexOf(l.V2K_RGP_LINE,r)}return t}(o),u=a.molfile.includes("V3000")?a.molfile:function(e,t){const n=t.get_mol(e),r=n.get_v3Kmolblock();return n.delete(),r}(function(e){let t=e.indexOf(l.V2K_A_LINE,0);-1===t&&(t=e.indexOf(l.V2K_RGP_LINE));const n=e.indexOf(l.V3K_END,t);return e.substring(0,t)+e.substring(n)}(a.molfile),n),h=function(e){let t=(e=e.replaceAll("\r","")).indexOf(l.V3K_BEGIN_COUNTS_LINE)+l.V3K_COUNTS_SHIFT,n=e.indexOf(" ",t+1);const r=parseInt(e.substring(t,n));return t=n+1,n=e.indexOf(" ",t+1),{atomCount:r,bondCount:parseInt(e.substring(t,n))}}(u),m=function(e,t){const n=new Array(t),r=new Float32Array(t),s=new Float32Array(t),o=new Array(t);let a=e.indexOf(l.V3K_BEGIN_ATOM_BLOCK);a=e.indexOf("\n",a);let i=a;for(let c=0;c<t;c++){a=e.indexOf(l.V3K_BEGIN_DATA_LINE,a)+l.V3K_IDX_SHIFT,i=e.indexOf(" ",a),a=i+1,i=e.indexOf(" ",a),n[c]=e.substring(a,i);const t=new Array(2);for(let n=0;n<2;++n)a=i+1,i=e.indexOf(" ",a),t[n]=parseFloat(e.substring(a,i));r[c]=t[0],s[c]=t[1],a=i,i=e.indexOf("\n",a)+1,o[c]=e.slice(a,i),a=i}return{atomTypes:n,x:r,y:s,kwargs:o}}(u,h.atomCount),g=function(e,t){const n=new Uint32Array(t),r=new Array(t),s=new Map,o=new Map;let a=e.indexOf(l.V3K_BEGIN_BOND_BLOCK);a=e.indexOf("\n",a);let i=a;for(let c=0;c<t;++c){const t=new Array(3);a=e.indexOf(l.V3K_BEGIN_DATA_LINE,i)+l.V3K_IDX_SHIFT,i=e.indexOf(" ",a);for(let n=0;n<3;++n)a=i+1,i=Math.min(e.indexOf("\n",a),e.indexOf(" ",a)),t[n]=parseInt(e.slice(a,i));n[c]=t[0],r[c]=t.slice(1);const u=e.indexOf("\n",a);let d=e.slice(i,u),h=d.indexOf(l.V3K_BOND_CONFIG);if(-1!==h){h=d.indexOf("=",h)+1;let e=d.indexOf(" ",h);-1===e&&(e=d.length);const t=parseInt(d.slice(h,e));s.set(c,t);const n=l.V3K_BOND_CONFIG+t.toString();d=d.replace(n,"")}d||o.set(c,d)}return{bondTypes:n,atomPairs:r,bondConfiguration:s,kwargs:o}}(u,h.bondCount),w=function(e,t,n,r){const s={backboneShift:null,branchShift:null,terminalNodes:[],rNodes:[]};return function(e,t,n){for(const[r,s]of n)e.atomTypes[r-1]=t[s-1]}(e,n,r),function(e,t){t.rNodes=Array.from(e.keys());for(let n=0;n<t.rNodes.length;n++)for(const r of[1,2])if(e.get(t.rNodes[n])===r){const e=t.rNodes[r-1];t.rNodes[r-1]=t.rNodes[n],t.rNodes[n]=e}}(r,s),p(t,s),s}(m,g,i,c),v=function(e){let t=[],n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(");for(;-1!==n;){n+=28;const r=e.indexOf(")",n);t=t.concat(e.substring(n,r).split(" ").slice(1).map((e=>parseInt(e)))),n=r,n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(",n)}return t}(u),E={atoms:m,bonds:g,meta:w,stereoAtoms:v};return"PEPTIDE"===r?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,r=e.atoms.x,s=e.atoms.y;T(e,-r[t],-s[t]);const o=b(r[n],s[n]);A(e.atoms,-o),r[e.meta.rNodes[1]-1]<0&&function(e){C(e,!1)}(e);const a=function(e){const t=function(e){const t=new Map;for(const n of e.bonds.atomPairs)for(let e=0;e<2;e++){const r=n[e],s=n[(e+1)%2];t.has(r)?t.get(r)?.push(s):t.set(r,new Array(1).fill(s))}return t}(e);let n=0;const r=e.atoms.atomTypes.length;let s=0;for(;0===n;){const o=t.get(e.meta.terminalNodes[1])[s];if(e.atoms.atomTypes[o-1]===l.OXYGEN&&o!==e.meta.rNodes[1]&&(n=o),s++,s>r)throw new Error(`Search for double-bonded Oxygen in ${e} has exceeded the limit of ${r}`)}return n}(e);!function(e,t){e.atoms.y[e.meta.rNodes[1]-1]<0&&e.atoms.y[t-1]<0&&(function(e){C(e,!0)}(e),A(e.atoms,-function(e,t){return b(e,t)+Math.PI/2}(e.atoms.x[e.meta.terminalNodes[1]-1],e.atoms.y[e.meta.terminalNodes[1]-1])))}(e,a),function(e,t){const n=e.atoms.x;n[e.meta.rNodes[1]-1]>n[t-1]&&function(e,t,n){const r=t-1,s=n-1,o=e.atoms.x,a=e.atoms.y,i=o[r],c=a[r];o[r]=o[s],a[r]=a[s],o[s]=i,a[s]=c}(e,t,e.meta.rNodes[1])}(e,a)}(E):e===l.RIBOSE||e===l.DEOXYRIBOSE?function(e,t){const n=e.atoms.x,r=e.atoms.y;let s=e.meta.terminalNodes[0]-1;const o=e.meta.rNodes[1]-1;T(e,-n[s],-r[s]);const a=b(n[o],r[o]);A(e.atoms,3*Math.PI/2-a),t.value=function(e){const t=e.atoms.x,n=e.atoms.y,r=e.meta.rNodes[2]-1,s=e.meta.terminalNodes[2]-1,o=t[r]-t[s],a=n[r]-n[s];return Math.atan(a/o)+Math.PI/2}(e),s=e.meta.terminalNodes[0]-1,T(e,-n[s],-r[s])}(E,s):e===l.PHOSPHATE?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,r=e.atoms.x,s=e.atoms.y;T(e,-r[t],-s[t]);const o=b(r[n],s[n]);A(e.atoms,Math.PI/2-o)}(E):function(e,t){const n=e.atoms.x,r=e.atoms.y,s=e.meta.terminalNodes[0]-1,o=e.meta.rNodes[0]-1;T(e,-n[s],-r[s]);const a=b(n[o],r[o]),i=t.value;if(!i)throw new Error("The value of sugarBranchToOYAngle is null");A(e.atoms,Math.PI-a+i);const c=function(e,t){return d(Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2))}({x:n[e.meta.rNodes[0]-1],y:r[e.meta.rNodes[0]-1]},{x:n[e.meta.terminalNodes[0]-1],y:r[e.meta.terminalNodes[0]-1]});if(1!=c)for(let e=0;e<n.length;++e)n[e]=d(n[e]/c),r[e]=d(r[e]/c)}(E,s),function(e,t,n){"PEPTIDE"===e?(f(t,e),y(t,t.meta.rNodes[1])):n===l.RIBOSE||n===l.DEOXYRIBOSE?(y(t,t.meta.rNodes[1]),t.meta.rNodes[1]=t.meta.terminalNodes[1],p(t.bonds,t.meta),f(t,e),y(t,t.meta.rNodes[1]),y(t,t.meta.rNodes[0]),y(t,t.meta.rNodes[2])):n===l.PHOSPHATE&&(t.meta.terminalNodes[0]=t.meta.rNodes[0],T(t,-t.atoms.x[t.meta.terminalNodes[0]-1],-t.atoms.y[t.meta.terminalNodes[0]-1]),f(t,e),y(t,t.meta.rNodes[1]))}(r,E,e),function(e){let t=0;for(;t<e.atoms.atomTypes.length;)e.atoms.atomTypes[t]===l.HYDROGEN&&(y(e,t+1),--t),++t}(E),E}var o;return null}(t,n,r,s,o);if(!a)throw new Error(`Monomer with symbol '${t}' is absent the monomer library`);e.set(t,a)}}function p(e,t){const n=t.rNodes;t.terminalNodes=new Array(n.length).fill(0);const r=t.terminalNodes,s=e.atomPairs;let o=0,a=0;for(;o<s.length&&a<r.length;){for(let e=0;e<r.length;++e)for(let t=0;t<2;++t)s[o][t]===n[e]&&(r[e]=s[o][(t+1)%2],n.length,++a);++o}}function f(e,t){e.meta.rNodes.length>1&&(e.meta.backboneShift=g(e,e.meta.rNodes[1]-1,e.meta.terminalNodes[0]-1)),"RNA"===t&&e.meta.rNodes.length>2&&(e.meta.branchShift=g(e,e.meta.rNodes[2]-1,e.meta.terminalNodes[0]-1))}function g(e,t,n){return[d(e.atoms.x[t]-e.atoms.x[n]),d(e.atoms.y[t]-e.atoms.y[n])]}function y(e,t){if(void 0!==t){const n=t-1,r=e.atoms,s=e.bonds,o=e.meta;r.atomTypes.splice(n,1),r.x=w(Float32Array,r.x,n,1),r.y=w(Float32Array,r.y,n,1),r.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 a=0;for(;a<s.atomPairs.length;){const e=s.atomPairs[a][0],n=s.atomPairs[a][1];e===t||n===t?(s.atomPairs.splice(a,1),s.bondTypes=w(Uint32Array,s.bondTypes,a,1),s.bondConfiguration.has(a)&&s.bondConfiguration.delete(a),s.kwargs.has(a)&&s.kwargs.delete(a),--a):(s.atomPairs[a][0]=e>t?e-1:e,s.atomPairs[a][1]=n>t?n-1:n),++a}let i=Array.from(s.bondConfiguration.keys());i.forEach((e=>{if(s.bondConfiguration.has(e)&&e>n){const t=s.bondConfiguration.get(e);s.bondConfiguration.delete(e),s.bondConfiguration.set(e-1,t)}})),i=Array.from(s.kwargs.keys()),i.forEach((e=>{if(s.kwargs.has(e)&&e>n){const t=s.kwargs.get(e);s.kwargs.delete(e),s.kwargs.set(e-1,t)}}))}}function w(e,t,n,r){const s=new e(t.length-r);let o=0,a=0;for(;o<t.length;)o===n&&(o+=r),s[a]=t[o],++a,++o;return s}function b(e,t){let n;if(0===e)n=t>0?0:Math.PI;else if(0===t)n=e>0?-Math.PI/2:Math.PI/2;else{const r=t/e,s=Math.atan(r);n=e<0?Math.PI/2+s:-Math.PI/2+s}return n}function A(e,t){if(0!==t){const n=e.x,r=e.y,s=Math.cos(t),o=Math.sin(t);for(let e=0;e<n.length;++e){const t=n[e];n[e]=d(t*s-r[e]*o),r[e]=d(t*o+r[e]*s)}}}function C(e,t){if(t){const t=e.atoms.y;for(let e=0;e<t.length;e++)t[e]=-t[e]}else{const t=e.atoms.x;for(let e=0;e<t.length;e++)t[e]=-t[e]}const n=e.bonds.bondConfiguration;for(const[e,t]of n){const r=1===t?3:1;n.set(e,r)}}function T(e,t,n){const r=e.atoms.x,s=e.atoms.y;for(let e=0;e<r.length;++e)r[e]=d(r[e]+t),void 0!==n&&(s[e]=d(s[e]+n))}},1093:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,Q:()=>o});var r=n(7362);class s extends r.e{static get Chromatogram(){return void 0===this.chromatogram&&(this.chromatogram=new s({A:"green",C:"blue",G:"black",T:"red",U:"red",others:"gray"})),this.chromatogram}}class o{}o.SemType="Nucleotides",o.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",o.Names={A:"Adenine",C:"Cytosine",G:"Guanine",T:"Thymine",U:"Uracil"}},7362:(e,t,n)=>{"use strict";n.d(t,{e:()=>r});class r{static makePalette(e,t=!1,n=r){const s={};return e.forEach((e=>{const n=e[0],r=e[1];n.forEach(((e,n)=>{s[e]=this.colourPalette[r][t?0:n]}))})),new n(s)}constructor(e){this._palette=e}get(e){return this._palette[e]}}r.undefinedColor="rgb(100,100,100)",r.colourPalette={orange:["rgb(255,187,120)","rgb(245,167,100)","rgb(235,137,70)","rgb(205, 111, 71)"],all_green:["rgb(44,160,44)","rgb(74,160,74)","rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)","rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],all_blue:["rgb(31,119,180)","rgb(23,190,207)","rgb(122, 102, 189)","rgb(158,218,229)","rgb(141, 124, 217)","rgb(31, 120, 150)"],magenta:["rgb(162,106,192)","rgb(197,165,224)","rgb(208,113,218)"],red:["rgb(214,39,40)","rgb(255,152,150)"],st_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(31,119,180)"],dark_blue:["rgb(31,119,180)","rgb(31, 120, 150)"],light_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(108, 218, 229)","rgb(23,190,227)"],lilac_blue:["rgb(124,102,211)","rgb(149,134,217)","rgb(97, 81, 150)"],dark_green:["rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)"],green:["rgb(44,160,44)","rgb(74,160,74)"],light_green:["rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],st_green:["rgb(44,160,44)","rgb(152,223,138)","rgb(39, 174, 96)","rgb(74,160,74)"],pink:["rgb(247,182,210)"],brown:["rgb(140,86,75)","rgb(102, 62, 54)"],gray:["rgb(127,127,127)","rgb(199,199,199)","rgb(196,156,148)","rgb(222, 222, 180)"],yellow:["rgb(188,189,34)"],white:["rgb(230,230,230)"]}},4152:(e,t,n)=>{"use strict";n.d(t,{$u:()=>a,oT:()=>l});var r=n(6082),s=n(7362);class o{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 a{}class i extends a{get(e){return"#666666"}}class c extends a{static buildPalette(){return[].concat(...Object.values(s.e.colourPalette))}get(e){const t=o.hashCode(e)%c.palette.length;return function(e){if(null==e)return"rgb(100,100,100)";const t=r.Color.fromHtml(e),n=r.Color.g(t),s=r.Color.r(t),o=r.Color.b(t),a=Math.sqrt(Math.pow(0-s,2)+Math.pow(0-n,2)+Math.pow(0-o,2));return a>210?`rgb(${s/a*210},${n/a*210},${o/a*210})`:r.Color.toRgb(t)}(c.palette[t])}}c.palette=c.buildPalette();class l extends s.e{static get Gray(){return void 0===this.gray&&(this.gray=new i),this.gray}static get Color(){return void 0===this.color&&(this.color=new c),this.color}}},6642:(e,t,n)=>{"use strict";n.d(t,{h:()=>a,s:()=>i});var r=n(4328),s=n(1858),o=n(8070);function a(e){let t=null,n=null;try{n=e.dart?e.gridColumn:null,t=n?n.temp:null}catch{[n,t]=[null,null]}const r=e.cell.column;if(t=t??r.temp,!t)throw new Error("Grid cell renderer back store (GridColumn or Column) not found.");return[n,r,t]}class i{constructor(e,t,n){this.gridCol=e,this.tableCol=t,this.logger=n,this.subs=[],this.destroyed=!1,this.viewerId=++i.viewerCounter,this.errors=[],this._onRendered=new s.Subject,this.reset(),this.tableCol&&this.tableCol.dataFrame&&this.subs.push(this.tableCol.dataFrame.onDataChanged.subscribe((()=>{try{this.reset()}catch(e){this.logger.error(e)}}))),this.tableCol&&this.subs.push(r.events.onTableRemoved.subscribe((e=>{try{const t=e.args.dataFrame;this.tableCol?.dataFrame.id!==t.id||this.destroyed||this.destroy()}catch(e){this.logger.error(e)}}))),this.gridCol&&this.subs.push(r.events.onViewRemoving.subscribe((e=>{try{const t=e.args.view;this.gridCol?.dart&&this.gridCol.grid&&this.gridCol?.grid?.dart&&this.gridCol?.grid?.view?.id===t.id&&!this.destroyed&&this.destroy()}catch(e){this.logger.error(e)}})))}toLog(){return`${this.constructor.name}<${this.viewerId}>`}destroy(){for(const e of this.subs)e.unsubscribe();this.destroyed=!0}invalidateGrid(){this.gridCol&&this.gridCol.dart&&this.gridCol.grid?.invalidate()}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`)}}i.viewerCounter=-1},6882:(e,t,n)=>{"use strict";n.d(t,{B:()=>l,J:()=>u});var r=n(6082),s=n(1991),o=n.n(s),a=n(826),i=n(6642),c=n(6718);function l(e,t){let n,r=100,s=0,o=e.length-1;for(;s<=o;){if(n=Math.floor((o+s)/2),e[n]<=t&&t<e[n+1])return n;if(t<e[n]?o=n-1:s=n+1,--r<=0)throw new Error(`Get position for pointer x = ${t} searching has not converged on ${JSON.stringify(e)}. `)}return null}class u extends i.s{constructor(e,t,n,s,o){super(e,t,n),this.monomerLengthLimit=s,this.propsProvider=o,this.colWidth=0,this._monomerLengthList=null,this.separatorWidth=5,this._processedMaxVisibleSeqLength=0,this._monomerLengthMap={},this._monomerStructureMap={},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()}))),(0,c.pj)().then((e=>{if(this.destroyed)return;const t=e.getBioLib();this.subs.push(t.onChanged.subscribe((()=>{this.reset(),this.gridCol?.grid?.invalidate()})))}))}reset(){this.propsProvider&&(this.props=this.propsProvider()),this._processedRows=r.BitSet.create(this.tableCol.length),this._monomerLengthList=null,this._monomerLengthMap={},this._monomerStructureMap={}}getCellMonomerLengths(e,t){this.colWidth<t&&(this.colWidth=t,this.reset());const n=this.props.seqHandler.isMsa()?this.getCellMonomerLengthsForSeqMsa():this.getCellMonomerLengthsForSeq(e),r=new Array(n.length+1);r[0]=5;for(let e=1;e<r.length;e++)r[e]=r[e-1]+n[e-1];return[n,r]}getCellMonomerLengthsForSeq(e){this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(this.tableCol.length).fill(null));const t=this.props.separatorWidth+1*this.props.monomerCharWidth,n=Math.ceil(this.colWidth/t),r=a.GO.forColumn(this.tableCol).getSplitted(e).originals,s=Math.min(n,r.length);let o=this._monomerLengthList[e];if(null===o||o.length<s){o=this._monomerLengthList[e]=new Array(r.length);let t=0;for(let e=0;e<s;++e){const n=r[e],s=this.props.monomerToShort(n,this.monomerLengthLimit),a=(this.props.seqHandler.isSeparator()?this.separatorWidth:this.props.separatorWidth)+s.length*this.props.monomerCharWidth;if(o[e]=a,t+=a,t>this.colWidth)break}}return o}getCellMonomerLengthsForSeqMsa(){var e;this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(1).fill(null)),(e=this._monomerLengthList)[0]??(e[0]=new Array(0));const t=this._monomerLengthList[0],{startIdx:n,endIdx:r}=(()=>{try{const e=this.gridCol&&this.gridCol.dart?this.gridCol.grid:null;return e&&e.dart?{startIdx:Math.max(Math.floor((e?.vertScroll.min??0)-10),0),endIdx:Math.min(Math.ceil((e?.vertScroll.max??0)+10),this.tableCol.length)}:{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}catch(e){return{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}})(),s=this.props.separatorWidth+1*this.props.monomerCharWidth,o=Math.ceil(this.colWidth/s);for(let e=n;e<r;e++){if(this._processedRows.get(e)&&o<=this._processedMaxVisibleSeqLength)continue;const n=a.GO.forColumn(this.tableCol).getSplitted(e,o).originals,r=Math.min(o,n.length);r>t.length&&t.push(...new Array(r-t.length).fill(s));let i=0;for(let e=0;e<r;++e){const r=n[e],s=this.props.monomerToShort(r,this.monomerLengthLimit),o=this.props.separatorWidth+s.length*this.props.monomerCharWidth;if(t[e]=Math.max(t[e]??0,o),i+=o,i>=this.colWidth)break}this._processedMaxVisibleSeqLength=Math.max(this._processedMaxVisibleSeqLength,o)}return t}getPosition(e,t,n){const[r,s]=this.getCellMonomerLengths(e,n),i=a.GO.forColumn(this.tableCol);return 0===o()(i.getSplitted(e).originals).toArray().length?null:l(s,t)}setMonomerLengthLimit(e){this.monomerLengthLimit=e,this.reset()}setSeparatorWidth(e){this.props.separatorWidth=e,this.reset()}isMsa(){return this.props.seqHandler.isMsa()}}},3151:(e,t,n)=>{"use strict";n.d(t,{EK:()=>o,f6:()=>r,q7:()=>s});const r=["symbol","molfile","rgroups","name"],s="p",o=new RegExp(`[rd]\\((\\w)\\)${s}?`,"g")},9192:(e,t,n)=>{"use strict";function r(e){return"string"==typeof e||e instanceof String?e:"StateError"===e.constructor.name?e.message:"StateError"===e.constructor.name&&"$thrownJsError"in e?r(e.$thrownJsError):e instanceof Error?e.message:e.toString()}function s(e){return e instanceof Error?e.stack:"StateError"===e.constructor.name&&"$thrownJsError"in e?s(e.$thrownJsError):void 0}function o(e){return[r(e),s(e)]}n.d(t,{AP:()=>o})},3516:(e,t,n)=>{"use strict";n.d(t,{m:()=>a});var r=n(6082),s=n(826),o=n(439);class a{get descriptionsArray(){return this._descriptionsArray}get sequencesArray(){return this._sequencesArray}parseMacromolecule(e,t){return this._fileContent.slice(e,t).split(/\s/).join("")}parseColumns(){const e=/^>(.*)$/gm;let t,n=0;for(;t=e.exec(this._fileContent);){const r=this._fileContent.substring(t.index+1,e.lastIndex);this._descriptionsArray.push(r),0!==n&&this._sequencesArray.push(this.parseMacromolecule(n,t.index)),n=e.lastIndex+1}this._sequencesArray.push(this.parseMacromolecule(n,-1))}importFasta(){const e=r.Column.fromStrings("description",this.descriptionsArray),t=r.Column.fromStrings("sequence",this.sequencesArray);return t.semType=r.SEMTYPE.MACROMOLECULE,t.meta.units=o.Hi.FASTA,s.GO.forColumn(t),[r.DataFrame.fromColumns([e,t])]}constructor(e){this._descriptionsArray=[],this._sequencesArray=[],this._fileContent=e,this.parseColumns()}}},6873:(e,t,n)=>{"use strict";n.d(t,{dW:()=>a,fD:()=>o});var r=n(6082),s=(n(1991),n(2003));function o(){const e=[];return e.push(r.Column.fromList("string","MSA",new Array(10**6).fill("meI/hHis/Aca/N/T/dE/Thr_PO3H2/Aca/D-Tyr_Et/Tyr_ab-dehydroMe/dV/E/N/D-Orn/D-aThr//Phe_4Me"))),e.push(r.Column.fromList(r.COLUMN_TYPE.FLOAT,"Activity",new Array(10**6).fill(5.30751))),e}function a(e=10**5){const t="meI/hHis/Aca/N//dE/Thr_PO3H2/Aca/D-Tyr_Et/Tyr_ab-dehydroMe".repeat(Math.ceil(e/10)).slice(0,-1),n=r.Column.fromList(r.COLUMN_TYPE.STRING,"MSA",new Array(100).fill(t));n.semType=r.SEMTYPE.MACROMOLECULE,n.meta.units=s.Hi.SEPARATOR,n.setTag(s.gp.separator,"/"),n.setTag(s.gp.alphabet,s.YI.UN),n.setTag(s.gp.alphabetIsMultichar,"true");const o=[];return o.push(n),o.push(r.Column.fromList(r.COLUMN_TYPE.FLOAT,"Activity",new Array(100).fill(7.30751))),o}n(826),n(9322)},439:(e,t,n)=>{"use strict";n.d(t,{B5:()=>c,Hi:()=>r,Vl:()=>l,YI:()=>s,gp:()=>o,q7:()=>u,z1:()=>i});var r,s,o,a=n(2738);!function(e){e.FASTA="fasta",e.SEPARATOR="separator",e.HELM="helm"}(r||(r={})),function(e){e.DNA="DNA",e.RNA="RNA",e.PT="PT",e.UN="UN"}(s||(s={})),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 i=", ",c=/(?:\[([A-Za-z0-9_\-,()]+)\])|([A-Za-z\-])/g,l=new class{constructor(){this.fasta={peptide:new Set(["G","L","Y","S","E","Q","D","N","F","A","K","R","H","C","V","P","W","I","M","T"]),dna:new Set(["A","C","G","T"]),rna:new Set(["A","C","G","U"])}}},u=[new a.aD(s.PT,l.fasta.peptide,.5),new a.aD(s.DNA,l.fasta.dna,.55),new a.aD(s.RNA,l.fasta.rna,.55)]},2003:(e,t,n)=>{"use strict";n.d(t,{Hi:()=>r.Hi,J9:()=>s.J9,Qf:()=>s.Qf,SM:()=>s.SM,YI:()=>r.YI,dh:()=>s.dh,gp:()=>r.gp,mn:()=>s.mn,nq:()=>s.nq,ny:()=>s.ny,q7:()=>r.q7,qp:()=>s.qp,z1:()=>r.z1,zS:()=>s.zS});var r=n(439),s=n(9322)},2738:(e,t,n)=>{"use strict";n.d(t,{XN:()=>o,_S:()=>r,aD:()=>s});const r="";class s{constructor(e,t,n){this.name=e,this.alphabet=t,this.cutoff=n}}class o extends s{constructor(e,t,n){super(e.name,e.alphabet,e.cutoff),this.freq=t,this.similarity=n}}},9322:(e,t,n)=>{"use strict";n.d(t,{Mu:()=>p,pc:()=>x,Qf:()=>_,nq:()=>P,ny:()=>M,Iv:()=>v,dh:()=>b,vZ:()=>g,zS:()=>S,SM:()=>$,mn:()=>N,J9:()=>y,tm:()=>w,qp:()=>T});var r=n(6082),s=n(1991),o=n.n(s),a=n(2738),i=n(439),c=n(826);class l extends Float32Array{}var u=n(3629),d=n(8924),h=n(1093),m=n(4152);class p{get length(){return this.mList.length}get canonicals(){return this.mList}get originals(){return this.mList}isGap(e){return this.getOriginal(e)===this.gapOriginalMonomer}getCanonical(e){if(this.length<=e)throw new Error("Index out of bounds");return this.mList[e]}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 f{get length(){return this.seqS.length}get canonicals(){return this.seqS}get originals(){return this.seqS}isGap(e){return this.getOriginal(e)===c.b9[i.Hi.FASTA]}getCanonical(e){if(this.length<=e)throw new Error("Index out of bounds");return this.isGap(e)?a._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}}function g(e,t,n){const r=e.categories;return function(e,t){const n={};let r=!0,s=null;for(const o of e)if(null==s?s=o.length:o.length!==s&&(r=!1),o.length>=t)for(const e of o.canonicals)e in n||(n[e]=0),n[e]+=1;return{freq:n,sameLength:r}}(o().enumerate(e.getRawData()).map((([e,t])=>n(r[e]))),t)}const y=e=>{const t=o()(e.toString().matchAll(i.B5)).map((e=>e[2]??e[1])).toArray();return new p(t,c.b9[i.Hi.FASTA])},w=e=>e?new f(e):new p([],c.b9[i.Hi.FASTA]);function b(e,t=void 0){return n=>{if(n){let r;const s=new RegExp(String.raw`"-"|'-'|[^${e}]+`,"g");if(void 0!==t){s.lastIndex=0,r=new Array(Math.ceil(t));let e=null,o=0;for(;null!==(e=s.exec(n))&&o<t;)r[o++]=e[0].replace('"-"',"").replace("'-'","");r.splice(o)}else r=n.replaceAll('"-"',"").replaceAll("'-'","").split(e,t);return new p(r,c.b9[i.Hi.SEPARATOR])}return new p([],c.b9[i.Hi.SEPARATOR])}}const A=/(PEPTIDE1|DNA1|RNA1)\{([^}]+)}/g,C=/\[([^\[\]]+)]/g,T=e=>{A.lastIndex=0;const t=A.exec(e.toString()),n=t?t[2]:null,r=n?n.split("."):[];return new p(r.map((e=>{C.lastIndex=0;const t=C.exec(e);return t&&t.length>=2?t[1]:e})),c.b9[i.Hi.HELM])};function v(e,t,n=void 0){if(e.toLowerCase().startsWith(i.Hi.FASTA))return y;if(e.toLowerCase().startsWith(i.Hi.SEPARATOR))return b(t,n);if(e.toLowerCase().startsWith(i.Hi.HELM))return T;throw new Error(`Unexpected units ${e} .`)}const E=/([^\W_]+)/g;function S(e,t){if(e.length<=t)return e;const n=e.match(E),r=e.length>t||(n?.length??0)>1,s=n?.[0]??" ";return r?s.substring(0,t-1)+"…":s}function _(e){switch(e){case i.YI.DNA:return i.Vl.fasta.dna;case i.YI.RNA:return i.Vl.fasta.rna;case i.YI.PT:return i.Vl.fasta.peptide;default:throw new Error(`Unsupported alphabet '${e}'.`)}}function P(e,t,n="-"){const r=new Set([...new Set(Object.keys(e)),...t]);r.delete(n);const s=[],o=[];for(const n of r)s.push(n in e?e[n]:0),o.push(t.has(n)?1:0);const a=new l(s),i=new l(o);return(0,u.KE)(a,i)/((0,u.wQ)(a)*(0,u.wQ)(i))}function x(e,t,n="-"){const r=t.map((t=>{const r=P(e,t.alphabet,n);return new a.XN(t,e,r)}));let s;const o=Math.max(...r.map((e=>e.similarity>e.cutoff?e.similarity:-1)));return s=o>0?r.find((e=>e.similarity===o)).name:i.YI.UN,s}function $(e,t=5){let n;return n=e.semType==r.SEMTYPE.MACROMOLECULE?c.GO.forColumn(e).alphabet:x(g(e,t,y).freq,i.q7),M(n)}function M(e){switch(e){case i.YI.PT:return d.X.GrokGroups;case i.YI.DNA:case i.YI.RNA:return h.A.Chromatogram;default:return m.oT.Color}}function N(e){const t=e.columns.bySemTypeAll(r.SEMTYPE.MACROMOLECULE);let n=t.find((e=>{const t=e.meta.units;return!!t&&-1!==t.indexOf("MSA")}))??null;return!n&&t.length>0&&(n=t[0]),n}},826:(e,t,n)=>{"use strict";n.d(t,{GO:()=>p,b9:()=>m});var r=n(6082),s=n(1991),o=n.n(s),a=n(2003),i=n(2738),c=n(9322),l=n(6863),u=n(6718),d=n(3151);const h=new class{constructor(){this.seqHandler="seq-handler",this.notationProvider="seq-handler.notation-provider"}},m={[a.Hi.FASTA]:"-",[a.Hi.SEPARATOR]:"",[a.Hi.HELM]:"*"};class p{constructor(e){if(this._splitter=null,this.cached=!0,this._splitted=null,this.columnVersion=null,this._stats=null,this._maxLength=null,this._posList=null,this._joiner=void 0,e.type!==r.TYPE.STRING)throw new Error(`Unexpected column type '${e.type}', must be '${r.TYPE.STRING}'.`);this._column=e;const t=this._column.meta.units;if(null==t)throw new Error("Units are not specified in column");if(this._units=t,this._notation=this.getNotation(),this._defaultGapOriginal=this.isFasta()?m[a.Hi.FASTA]:this.isHelm()?m[a.Hi.HELM]:m[a.Hi.SEPARATOR],!this.column.tags.has(a.gp.aligned)||!this.column.tags.has(a.gp.alphabet)||!this.column.tags.has(a.gp.alphabetIsMultichar)&&!this.isHelm()&&this.alphabet===a.YI.UN)if(this.isFasta())p.setUnitsToFastaColumn(this);else if(this.isSeparator()){const t=e.getTag(a.gp.separator);p.setUnitsToSeparatorColumn(this,t)}else{if(!this.isHelm())throw new Error(`Unexpected units '${this.column.meta.units}'.`);p.setUnitsToHelmColumn(this)}if(!this.column.tags.has(a.gp.alphabetIsMultichar))if(this.isHelm())this.column.setTag(a.gp.alphabetIsMultichar,"true");else if(["UN"].includes(this.alphabet))throw new Error(`For column '${this.column.name}' of alphabet '${this.alphabet}' tag '${a.gp.alphabetIsMultichar}' is mandatory.`);this.notationProvider=this.column.temp[h.notationProvider]??null,this.columnVersion=this.column.version}static setUnitsToFastaColumn(e){if(e.column.semType!==r.SEMTYPE.MACROMOLECULE||e.column.meta.units!==a.Hi.FASTA)throw new Error(`The column of notation '${a.Hi.FASTA}' must be '${r.SEMTYPE.MACROMOLECULE}'.`);e.column.meta.units=a.Hi.FASTA,p.setTags(e)}static setUnitsToSeparatorColumn(e,t){if(e.column.semType!==r.SEMTYPE.MACROMOLECULE||e.column.meta.units!==a.Hi.SEPARATOR)throw new Error(`The column of notation '${a.Hi.SEPARATOR}' must be '${r.SEMTYPE.MACROMOLECULE}'.`);if(!t)throw new Error(`The column of notation '${a.Hi.SEPARATOR}' must have the separator tag.`);e.column.meta.units=a.Hi.SEPARATOR,e.column.setTag(a.gp.separator,t),p.setTags(e)}static setUnitsToHelmColumn(e){if(e.column.semType!==r.SEMTYPE.MACROMOLECULE)throw new Error(`The column of notation '${a.Hi.HELM}' must be '${r.SEMTYPE.MACROMOLECULE}'`);e.column.meta.units=a.Hi.HELM,p.setTags(e)}static setTags(e){const t=e.column.meta.units;if([a.Hi.FASTA,a.Hi.SEPARATOR].includes(t)){if(!e.column.getTag(a.gp.alphabet)&&0===Object.keys(e.stats.freq).length)throw new Error("Alphabet is empty and not annotated.");let t=e.column.getTag(a.gp.aligned);null===t&&(t=e.stats.sameLength?"SEQ.MSA":"SEQ",e.column.setTag(a.gp.aligned,t));let n=e.column.getTag(a.gp.alphabet);if(null===n&&(n=(0,c.pc)(e.stats.freq,a.q7),e.column.setTag(a.gp.alphabet,n)),n===a.YI.UN){const t=Object.keys(e.stats.freq).length,n=Object.keys(e.stats.freq).some((e=>e.length>1));e.column.setTag(a.gp.alphabetSize,t.toString()),e.column.setTag(a.gp.alphabetIsMultichar,n?"true":"false")}}}get column(){return this._column}get length(){return this._column.length}get units(){return this._units}get notation(){return this._notation}get defaultGapOriginal(){return this._defaultGapOriginal}get separator(){const e=this.column.getTag(a.gp.separator)??void 0;if(this.notation===a.Hi.SEPARATOR&&void 0===e)throw new Error(`Separator is mandatory for column '${this.column.name}' of notation '${this.notation}'.`);return e}get aligned(){const e=this.column.getTag(a.gp.aligned);if(!e&&(this.isFasta()||this.isSeparator()))throw new Error("Tag aligned not set");return e}get alphabet(){const e=this.column.getTag(a.gp.alphabet);if(!e&&(this.isFasta()||this.isSeparator()))throw new Error("Tag alphabet not set");return e}get helmCompatible(){return this.column.getTag(a.gp.isHelmCompatible)}getAlphabetSize(){if(this.notation==a.Hi.HELM||this.alphabet==a.YI.UN){const e=this.column.getTag(a.gp.alphabetSize);let t;if(e)t=parseInt(e);else{const e=this.stats;t=Object.keys(e.freq).length}return t}switch(this.alphabet){case a.YI.PT:return 20;case a.YI.DNA:case a.YI.RNA:return 4;case"NT":return console.warn("Unexpected alphabet 'NT'."),4;default:throw new Error(`Unexpected alphabet '${this.alphabet}'.`)}}getAlphabetIsMultichar(){return this.notation===a.Hi.HELM||this.alphabet===a.YI.UN&&"true"===this.column.getTag(a.gp.alphabetIsMultichar)}getSplitted(e,t){if(this.cached&&void 0===t){this.column.version===this.columnVersion&&null!==this._splitted||(this.columnVersion=this.column.version,this._splitted=new Array(this.column.length));let t=this._splitted[e]?this._splitted[e].deref():void 0;if(!t){const n=this.column.get(e);t=this.splitter(n),this._splitted[e]=new WeakRef(t)}return t}{const n=this.column.get(e);return this.getSplitter(t)(n)}}get stats(){if(null===this._stats){const e={};let t=!0,n=null;const r=this.column.length;for(let s=0;s<r;++s){const r=this.getSplitted(s);null==n?n=r.length:r.length!==n&&(t=!1);for(const t of r.canonicals)t in e||(e[t]=0),e[t]+=1}this._stats={freq:e,sameLength:t}}return this._stats}get maxLength(){return null===this._maxLength&&(this._maxLength=0===this.column.length?0:Math.max(...o().count(0).take(this.column.length).map((e=>this.getSplitted(e).length)))),this._maxLength}get posList(){if(null===this._posList){const e=this.column.getTag(a.gp.positionNames);this._posList=e?e.split(a.z1).map((e=>e.trim())):o().count(1).take(this.maxLength).map((e=>e.toString())).toArray()}return this._posList}isFasta(){return this.notation===a.Hi.FASTA}isSeparator(){return this.notation===a.Hi.SEPARATOR}isHelm(){return this.notation===a.Hi.HELM}isRna(){return this.alphabet===a.YI.RNA}isDna(){return this.alphabet===a.YI.DNA}isPeptide(){return this.alphabet===a.YI.PT}isMsa(){return!!this.aligned&&this.aligned.toUpperCase().includes("MSA")}isHelmCompatible(){return"true"===this.helmCompatible}isGap(e){return!e||e===this._defaultGapOriginal}getNotation(){if(this.units.toLowerCase().startsWith(a.Hi.FASTA))return a.Hi.FASTA;if(this.units.toLowerCase().startsWith(a.Hi.SEPARATOR))return a.Hi.SEPARATOR;if(this.units.toLowerCase().startsWith(a.Hi.HELM))return a.Hi.HELM;throw new Error(`Column '${this.column.name}' has unexpected notation '${this.units}'.`)}getHelmWrappers(){return[this.isDna()||this.isRna()||this.isHelmCompatible()?"RNA1{":"PEPTIDE1{",this.isDna()?"d(":this.isRna()?"r(":"",this.isDna()||this.isRna()?")p":"","}$$$$"]}getNewColumn(e,t,n,s){const o=this.column,i=e.toLowerCase()+"("+o.name+")",c=n??o.dataFrame.columns.getUnusedName(i),l=r.Column.fromList("string",c,s??new Array(this.column.length).fill(""));if(l.semType=r.SEMTYPE.MACROMOLECULE,l.meta.units=e,e===a.Hi.SEPARATOR){if(!t)throw new Error(`Notation '${a.Hi.SEPARATOR}' requires separator value.`);l.setTag(a.gp.separator,t)}l.setTag(r.TAGS.CELL_RENDERER,e===a.Hi.HELM?"helm":"sequence");const u=o.getTag(a.gp.aligned);u&&l.setTag(a.gp.aligned,u);let d=o.getTag(a.gp.alphabet);d||this.notation!==a.Hi.HELM||e===a.Hi.HELM||(d=a.YI.UN),null!=d&&l.setTag(a.gp.alphabet,d);let h=o.getTag(a.gp.alphabetSize);null!=d&&h&&l.setTag(a.gp.alphabetSize,h);const m=o.getTag(a.gp.alphabetIsMultichar);return null!=d&&void 0!==m&&l.setTag(a.gp.alphabetIsMultichar,m),e==a.Hi.HELM&&(h=this.getAlphabetSize().toString(),l.setTag(a.gp.alphabetSize,h)),l}getNewColumnFromList(e,t){return this.getNewColumn(this.notation,this.separator,e,t)}static getNewColumn(e){const t=p.forColumn(e),n=t.notation;return t.getNewColumn(n)}static unitsStringIsValid(e){return e=e.toLowerCase(),[a.Hi.FASTA,a.Hi.SEPARATOR,a.Hi.HELM].some((t=>e.startsWith(t.toLowerCase())))}static getNewColumnFromParams(e,t,n){if(!p.unitsStringIsValid(n))throw new Error("Invalid format of 'units' parameter");const s=r.Column.fromList("string",t,new Array(e).fill(""));return s.semType=r.SEMTYPE.MACROMOLECULE,s.meta.units=n,s}getSplitter(e){let t=null;if(t=this.notationProvider?this.notationProvider.splitter:null,t)return t;if(this.units.toLowerCase().startsWith(a.Hi.FASTA))return null===this.column.getTag(a.gp.alphabet)||this.getAlphabetIsMultichar()?a.J9:c.tm;if(this.units.toLowerCase().startsWith(a.Hi.SEPARATOR))return(0,a.dh)(this.separator,e);if(this.units.toLowerCase().startsWith(a.Hi.HELM))return a.qp;throw new Error(`Unexpected units ${this.units} .`)}split(e){return this.splitter(e)}getDistanceFunctionName(){if(!this.isFasta())throw new Error("Only FASTA notation is supported");if(this.isMsa())return l.Z.HAMMING;switch(this.alphabet){case a.YI.DNA:case a.YI.RNA:case a.YI.PT:}return l.Z.LEVENSHTEIN}getDistanceFunction(){return l.V[this.getDistanceFunctionName()]()}async checkHelmCompatibility(){if(this.column.tags.has(a.gp.isHelmCompatible))return"true"===this.column.getTag(a.gp.isHelmCompatible);const e=(await(0,u.pj)()).getBioLib().getMonomerSymbolsByType("PEPTIDE"),t=new Set(e),n=((0,a.dh)(this.separator),new Set),r=this.column.length,s=this.column.getRawData();for(let e=0;e<r;++e){const r=s[e];if(!(r in n)){n.add(r);const s=this.getSplitted(e);for(const e of s.canonicals)if(!t.has(e))return this.column.setTag(a.gp.isHelmCompatible,"false"),!1}}return this.column.setTag(a.gp.isHelmCompatible,"true"),!0}get splitter(){return null===this._splitter&&(this._splitter=this.getSplitter()),this._splitter}toFasta(e){return e===a.Hi.FASTA}toSeparator(e){return e===a.Hi.SEPARATOR}toHelm(e){return e===a.Hi.HELM}convertHelmToFastaSeparator(e,t,n,r){r||(r=this.toFasta(t)?m[a.Hi.FASTA]:m[a.Hi.SEPARATOR]),n||(n=this.toFasta(t)?"":this.separator);const s=e.startsWith("RNA"),o=this.splitter(e),i=[];for(let e=0;e<o.length;++e){let n=o.getOriginal(e);if(s&&(n=n.replace(d.EK,"")),n===m[a.Hi.HELM])i.push(r);else if(this.toFasta(t)&&n.length>1){const e="["+n+"]";i.push(e)}else i.push(n)}return i.join(n)}convert(e,t){const n=this.getJoiner({notation:e,separator:t}),r=this.getNewColumn(e,t);return r.init((e=>{const t=this.getSplitted(e);return n(t)})),r}getRegion(e,t,n){const r=this.getNewColumn(this.notation,this.separator);r.name=n;const s=e??0,o=t??this.maxLength-1,i=this.getJoiner(),l=o-s+1,u=m[this.notation];r.init((e=>{const t=this.getSplitted(e),n=new Array(l);for(let e=0;e<l;++e){const r=s+e;n[e]=r<t.length?t.getOriginal(r):u}return i(new c.Mu(n,u))}));const d=e=>{const t=e.split(",").map((e=>e.trim())),n=new Array(l);for(let e=0;e<l;++e){const r=s+e;n[e]=r<t.length?t[r]:"?"}return n.join(a.z1)},h=this.column.getTag(a.gp.positionNames);h&&r.setTag(a.gp.positionNames,d(h));const p=this.column.getTag(a.gp.positionLabels);return p&&r.setTag(a.gp.positionLabels,d(p)),r}get joiner(){return this._joiner||(this._joiner=this.getJoiner()),this._joiner}getJoiner(e){const t=e?e.notation:this.notation,n=e?e.separator:this.separator;let r;const s=this;switch(t){case a.Hi.FASTA:r=function(e){return s.joinToFasta(e,s.isHelm())};break;case a.Hi.SEPARATOR:if(!n)throw new Error(`Separator is mandatory for notation '${t}'.`);r=function(e){return f(e,n,s.isHelm())};break;case a.Hi.HELM:{const e=s.alphabet===a.YI.DNA||s.alphabet===a.YI.RNA,t=s.getHelmWrappers();r=function(n){return g(n,t,e)};break}default:throw new Error(`Unexpected notation '${t}'.`)}return r}getConverter(e,t=void 0){if(e===a.Hi.SEPARATOR&&!t)throw new Error(`Target separator is not specified for target units '${a.Hi.SEPARATOR}'.`);const n=this;if(e===a.Hi.FASTA)return function(e){return n.convertToFasta(e)};if(e===a.Hi.HELM)return function(e){return n.convertToHelm(e)};if(e===a.Hi.SEPARATOR)return function(e){return n.convertToSeparator(e,t)};throw new Error}static forColumn(e){let t=e.temp[h.seqHandler];return t&&t.columnVersion===e.version||(t=e.temp[h.seqHandler]=new p(e)),t}joinToFasta(e,t){const n=new Array(e.length);for(let r=0;r<e.length;++r){const s=e.getOriginal(r);let o=e.getOriginal(r);t&&(o=o.replace(d.EK,"$1")),s===i._S?o=m[a.Hi.FASTA]:s===d.q7?o="":o.length>1&&(o="["+o+"]"),n[r]=o}return n.join("")}convertToFasta(e){const t=this.splitter,n=this.isHelm()?this.splitterAsHelmNucl(e):t(e);return this.joinToFasta(n,this.isHelm())}convertToSeparator(e,t){return f(this.isHelm()?this.splitterAsHelmNucl(e):this.splitter(e),t,this.isHelm())}convertToHelm(e){const t=this.getHelmWrappers(),n=e.startsWith("DNA")||e.startsWith("RNA");return g(this.splitter(e),t,n)}splitterAsHelmNucl(e){const t=this.splitter(e),n=new Array(t.length),r=e.startsWith("DNA"),s=e.startsWith("RNA");for(let e=0;e<t.length;++e){let o=t.getOriginal(e);(r||s)&&(o=o.replace(d.EK,"$1"),o=o===d.q7?null:o),n[e]=o||null}return new c.Mu(n.filter((e=>!!e)),m[a.Hi.HELM])}}function f(e,t,n){const r=new Array(e.length);for(let t=0;t<e.length;++t){const s=e.getCanonical(t);let o=e.getOriginal(t);n&&(o=o.replace(d.EK,"$1")),s===i._S?o=m[a.Hi.SEPARATOR]:s===d.q7&&(o=""),r[t]=o}return r.join(t)}function g(e,t,n){const[r,s,o,c]=t,l=new Array(e.length);for(let t=0;t<e.length;++t){const r=e.getCanonical(t);let c=e.getOriginal(t);r===i._S?c=m[a.Hi.HELM]:(n&&(c=c.replace(d.EK,"$1")),c=1===c.length?`${s}${c}${o}`:`${s}[${c}]${o}`),l[t]=c}return`${r}${l.join(".")}${c}`}},3077:(e,t,n)=>{"use strict";n.d(t,{R:()=>o});var r=n(6082),s=n(826);function o(e){const t=e=>{const t=a.columns.addNewString((e+1).toString());return n.push(t),t},n=[],o=e.length,a=r.DataFrame.create(o),i=s.GO.forColumn(e);for(let e=0;e<o;++e){const r=i.getSplitted(e);for(let s=0;s<r.length;++s){const o=r.getOriginal(s);((n[s]??null)||t(s)).set(e,o,!1)}}return a}},7602:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var r,s=n(9192);!function(e){e[e.error=0]="error",e[e.warning=1]="warning",e[e.info=2]="info",e[e.debug=3]="debug"}(r||(r={}));class 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[r,o]=(0,s.AP)(t);this.logger.error(`${e}, SYNC syncId = ${n}, ERROR:\n${r}`,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:()=>u,Lp:()=>o,P4:()=>a,fH:()=>s,gp:()=>r,lT:()=>c,mH:()=>i});var r,s,o,a,i,c,l=n(6082);!function(e){e.tooltipWebLogo=".tooltipWebLogo"}(r||(r={})),function(e){e.Entropy="Entropy",e.full="100%"}(s||(s={})),function(e){e.TOP="top",e.MIDDLE="middle",e.BOTTOM="bottom"}(o||(o={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(a||(a={})),function(e){e.AUTO="auto",e.ON="on",e.OFF="off"}(i||(i={})),function(e){e.Filtered="Filtered",e.Selected="Selected"}(c||(c={}));const u=new class{constructor(){this.sequenceColumnName=null,this.valueAggrType=l.AGG.TOTAL_COUNT,this.valueColumnName="Activity",this.startPositionName=null,this.endPositionName=null,this.skipEmptySequences=!0,this.skipEmptyPositions=!1,this.shrinkEmptyTail=!0,this.backgroundColor=4294967295,this.positionHeight=s.Entropy,this.positionWidth=16,this.verticalAlignment=o.MIDDLE,this.horizontalAlignment=a.CENTER,this.fixWidth=!1,this.fitArea=!0,this.minHeight=50,this.maxHeight=100,this.showPositionLabels=!0,this.positionMarginState=i.AUTO,this.positionMargin=0,this.filterSource=c.Filtered}}},5540:(e,t,n)=>{"use strict";e=n.hmd(e);var r,s=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){var t,n,s=void 0!==e?e:{};s.ready=new Promise((function(e,r){t=e,n=r}));var o,a=Object.assign({},s),i="object"==typeof window,c="function"==typeof importScripts,l=("object"==typeof process&&"object"==typeof process.versions&&process.versions.node,"");(i||c)&&(c?l=self.location.href:"undefined"!=typeof document&&document.currentScript&&(l=document.currentScript.src),r&&(l=r),l=0!==l.indexOf("blob:")?l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):"",c&&(o=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)})),s.print||console.log.bind(console);var u,d,h=s.printErr||console.warn.bind(console);Object.assign(s,a),a=null,s.arguments&&s.arguments,s.thisProgram&&s.thisProgram,s.quit&&s.quit,s.wasmBinary&&(u=s.wasmBinary),s.noExitRuntime,"object"!=typeof WebAssembly&&E("no native wasm support detected");var m,p,f,g=!1;function y(){var e=d.buffer;s.HEAP8=m=new Int8Array(e),s.HEAP16=new Int16Array(e),s.HEAP32=new Int32Array(e),s.HEAPU8=p=new Uint8Array(e),s.HEAPU16=new Uint16Array(e),s.HEAPU32=f=new Uint32Array(e),s.HEAPF32=new Float32Array(e),s.HEAPF64=new Float64Array(e)}var w=[],b=[],A=[],C=0,T=null,v=null;function E(e){s.onAbort&&s.onAbort(e),h(e="Aborted("+e+")"),g=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var S,_;function P(e){return e.startsWith("data:application/octet-stream;base64,")}function x(e){try{if(e==S&&u)return new Uint8Array(u);if(o)return o(e);throw"both async and sync fetching of the wasm failed"}catch(e){E(e)}}function $(e,t,n){return function(e){return u||!i&&!c||"function"!=typeof fetch?Promise.resolve().then((function(){return x(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 x(e)}))}(e).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(n,(function(e){h("failed to asynchronously prepare wasm: "+e),E(e)}))}function M(e){for(;e.length>0;)e.shift()(s)}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,m[this.ptr+12|0]=e},this.get_caught=function(){return 0!=m[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,m[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=m[this.ptr+13|0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){f[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return f[this.ptr+16>>2]},this.get_exception_ptr=function(){if(V(this.get_type()))return f[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function I(e){var t=d.buffer;try{return d.grow(e-t.byteLength+65535>>>16),y(),1}catch(e){}}function L(e){return s["_"+e]}P(S="wasmDbscan.wasm")||(_=S,S=s.locateFile?s.locateFile(_,l):l+_);var R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(e,t,n,r,s){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 r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t}(e)+1,n=k(t);return function(e,t,n){!function(e,t,n,r){if(!(r>0))return 0;for(var s=n+r-1,o=0;o<e.length;++o){var a=e.charCodeAt(o);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o)),a<=127){if(n>=s)break;t[n++]=a}else if(a<=2047){if(n+1>=s)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=s)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=s)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}t[n]=0}(e,p,t,n)}(e,n,t),n}(e)),t},array:e=>{var t,n,r=k(e.length);return t=e,n=r,m.set(t,n),r}},a=L(e),i=[],c=0;if(r)for(var l=0;l<r.length;l++){var u=o[n[l]];u?(0===c&&(c=G()),i[l]=u(r[l])):i[l]=r[l]}var d=a.apply(null,i);return function(e){return 0!==c&&D(c),function(e){return"string"===t?(n=e)?function(e,t,n){for(var r=t+n,s=t;e[s]&&!(s>=r);)++s;if(s-t>16&&e.buffer&&R)return R.decode(e.subarray(t,s));for(var o="";t<s;){var a=e[t++];if(128&a){var i=63&e[t++];if(192!=(224&a)){var c=63&e[t++];if((a=224==(240&a)?(15&a)<<12|i<<6|c:(7&a)<<18|i<<12|c<<6|63&e[t++])<65536)o+=String.fromCharCode(a);else{var l=a-65536;o+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else o+=String.fromCharCode((31&a)<<6|i)}else o+=String.fromCharCode(a)}return o}(p,n,r):"":"boolean"===t?Boolean(e):e;var n,r}(e)}(d)}var H,F={__cxa_throw:function(e,t,n){throw new N(e).init(t,n),e},abort:function(){E("")},emscripten_memcpy_big:function(e,t,n){p.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=p.length,r=2147483648;if((e>>>=0)>r)return!1;for(var s=1;s<=4;s*=2){var o=n*(1+.2/s);if(o=Math.min(o,e+100663296),I(Math.min(r,(t=Math.max(e,o))+(65536-t%65536)%65536)))return!0}return!1}},G=(function(){var e,t,r,o,a={env:F,wasi_snapshot_preview1:F};function i(e,t){var n,r=e.exports;return s.asm=r,d=s.asm.memory,y(),s.asm.__indirect_function_table,n=s.asm.__wasm_call_ctors,b.unshift(n),function(){if(C--,s.monitorRunDependencies&&s.monitorRunDependencies(C),0==C&&(null!==T&&(clearInterval(T),T=null),v)){var e=v;v=null,e()}}(),r}if(C++,s.monitorRunDependencies&&s.monitorRunDependencies(C),s.instantiateWasm)try{return s.instantiateWasm(a,i)}catch(e){h("Module.instantiateWasm callback failed with error: "+e),n(e)}(e=u,t=S,r=a,o=function(e){i(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||P(t)||"function"!=typeof fetch?$(t,r,o):fetch(t,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(o,(function(e){return h("wasm streaming compile failed: "+e),h("falling back to ArrayBuffer instantiation"),$(t,r,o)}))}))).catch(n)}(),s._dbscan=function(){return(s._dbscan=s.asm.dbscan).apply(null,arguments)},s._malloc=function(){return(s._malloc=s.asm.malloc).apply(null,arguments)},s._free=function(){return(s._free=s.asm.free).apply(null,arguments)},function(){return(G=s.asm.stackSave).apply(null,arguments)}),D=function(){return(D=s.asm.stackRestore).apply(null,arguments)},k=function(){return(k=s.asm.stackAlloc).apply(null,arguments)},V=function(){return(V=s.asm.__cxa_is_pointer_type).apply(null,arguments)};function U(){function e(){H||(H=!0,s.calledRun=!0,g||(M(b),t(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),function(){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)e=s.postRun.shift(),A.unshift(e);var e;M(A)}()))}C>0||(function(){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)e=s.preRun.shift(),w.unshift(e);var e;M(w)}(),C>0||(s.setStatus?(s.setStatus("Running..."),setTimeout((function(){setTimeout((function(){s.setStatus("")}),1),e()}),1)):e()))}if(s.ccall=O,s.cwrap=function(e,t,n,r){var s=!n||n.every((e=>"number"===e||"boolean"===e));return"string"!==t&&s&&!r?L(e):function(){return O(e,t,n,arguments)}},v=function e(){H||U(),H||(v=e)},s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return U(),e.ready});"object"==typeof exports?e.exports=s:"function"==typeof define&&n.amdO?define([],(function(){return s})):"object"==typeof exports&&(exports.exportCppDbscanLib=s)},6295:(e,t,n)=>{"use strict";n.d(t,{$1:()=>i,Hr:()=>v,Ii:()=>p,T6:()=>T,TK:()=>A,a4:()=>h,be:()=>m,gt:()=>y,iS:()=>a,ij:()=>w,lO:()=>d,lP:()=>g,rR:()=>f,tO:()=>c,v_:()=>l,yK:()=>b,zn:()=>u});var r=n(8774),s=n(8498),o=n(6863);s.aT.Tanimoto,s.aT.Dice,s.aT.Asymmetric,s.aT.BraunBlanquet,s.aT.Cosine,s.aT.Kulczynski,s.aT.McConnaughey,s.aT.RogotGoldberg,s.aT.Russel,s.aT.Sokal,s.aT.Hamming,s.aT.Euclidean,s.aT.Tanimoto,s.aT.Dice,s.aT.Asymmetric,s.aT.BraunBlanquet,s.aT.Cosine,s.aT.Kulczynski,s.aT.McConnaughey,s.aT.RogotGoldberg,s.aT.Russel,s.aT.Sokal,s.aT.Hamming,s.aT.Euclidean;const a=[s.aT.Tanimoto,s.aT.Dice,s.aT.Cosine];function i(e,t){const n=e.trueCount()+t.trueCount();if(0==n)return 1;const r=e.andWithCountBits(t,!0);return r/(n-r)}function c(e,t){return 1-i(e,t)}function l(e,t){return C(i(new r.A(e,32*e.length),new r.A(t,32*t.length)))}function u(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 d(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 h(e,t){return Math.sqrt(e.trueCount()+t.trueCount()-2*e.andWithCountBits(t,!0))}function m(e,t){return e.trueCount()+t.trueCount()-2*e.andWithCountBits(t,!0)}function p(e,t){return 1-function(e,t){const n=e.trueCount()+t.trueCount(),r=e.andWithCountBits(t,!0);return r/(2*n-3*r)}(e,t)}function f(e,t){return C(function(e,t){const n=e.trueCount()+t.trueCount(),r=e.trueCount()*t.trueCount();return 0==r?0:e.andWithCountBits(t,!0)*n/(2*r)}(e,t))}function g(e,t){return C(function(e,t){const n=e.trueCount()+t.trueCount(),r=e.trueCount()*t.trueCount();return 0==r?0:(e.andWithCountBits(t,!0)*n-r)/r}(e,t))}function y(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 w(e,t){return C(function(e,t){const n=Math.max(e.trueCount(),t.trueCount());return 0==n?0:e.andWithCountBits(t,!0)/n}(e,t))}function b(e,t){return C(function(e,t){return 0==e.length?0:e.andWithCountBits(t,!0)/e.length}(e,t))}function A(e,t){return C(function(e,t){const n=e.andWithCountBits(t,!0),r=e.countBits(!0)+t.countBits(!0),s=e.length,o=s-r+n;return n==s||o==s?1:n/r+o/(2*s-r)}(e,t))}function C(e){return 0===e?3402823e32:1/e-1}function T(e){if(e&&null!=e.range&&e.range>0){const t=e.range;return(e,n)=>Math.abs(e-n)/t}return(e,t)=>Math.abs(e-t)}function v(e){const t=function(e){const t=e?.mostCommon??new Set;return(e,n)=>{const r=e.length,s=n.length;let o=0,a=0,i=0;for(;a<r&&i<s;)e[a]===n[i]?(t?.has(e[a])||++o,++a,++i):e[a]<n[i]?++a:++i;return o}}(e);return(e,n)=>0===n.length||0===e.length?1e4:Math.min(e.length,n.length)/(t(e,n)+1e-4)}s.aT.Tanimoto,s.aT.Asymmetric,s.aT.Cosine,s.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:()=>r,Gi:()=>i,YP:()=>l,_X:()=>a,n3:()=>s,vb:()=>c});const r="dim-red-preprocessing-function",s="supportedSemTypes",o="supportedTypes",a="supportedUnits",i="supportedDistanceFunctions",c="bypassLargeDataWarning",l="show-scatterplot-progress"},6863:(e,t,n)=>{"use strict";function r(e={}){const t=function(){if(!e||!e.scoringMatrix||!e.alphabetIndexes)return(e,t)=>e===t?0:1;if(e.scoringMatrix.length!==Object.keys(e.alphabetIndexes).length)throw new Error("Scoring matrix and alphabet indexes should have the same length");const t=e.alphabetIndexes,n=e.scoringMatrix,r=Math.min(...Object.keys(t).map((e=>e.charCodeAt(0))))+1,s=new Float32Array((n.length+r)*(n.length+r));return Object.entries(t).forEach((([e,r])=>{const o=n[r];Object.entries(t).forEach((([t,r])=>{s[e.charCodeAt(0)*n.length+t.charCodeAt(0)]=o[r]}))})),(e,t)=>1-s[e.charCodeAt(0)*n.length+t.charCodeAt(0)]}(),n=e?.threshold??0;return(e,r)=>{let s=0;const o=e.length,a=r.length,i=Math.ceil(Math.max(o,a)*(1-n));o!==a&&(s=Math.abs(o-a));let c=0;for(let n=0;n<Math.min(o,a);n++)if(e[n]!==r[n]&&(c+=t(e[n],r[n]),c>i))return 1;return c+=s,c/=Math.max(o,a),c}}n.d(t,{Z:()=>a,V:()=>i});var s=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 a;!function(e){e.HAMMING="Hamming",e.LEVENSHTEIN="Levenshtein",e.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",e.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(a||(a={}));const i={[a.HAMMING]:r,[a.LEVENSHTEIN]:function(){return(e,t)=>(0,s.I)(e,t)/Math.max(e.length,t.length)},[a.NEEDLEMANN_WUNSCH]:function(e){const t=new Uint16Array(65536),{gapOpen:n,gapExtend:r,scoringMatrix:s,alphabetIndexes:a}={...o,...e};Object.entries(a).forEach((([e,n])=>t[e.charCodeAt(0)]=n));const i=[new Float32Array(1e4),new Float32Array(1e4)];return(e,o)=>{const a=new Array(e.length+1).fill(!1),c=new Array(e.length+1).fill(!1);let l=0,u=1;for(let t=1;t<e.length+1;t++)i[0][t]=-n-(t-1)*r,i[1][t]=0;i[0][0]=0;for(let d=1;d<o.length+1;d++){i[u][0]=-n-(d-1)*r;for(let h=1;h<e.length+1;h++){const m=i[l][h-1]+s[t[e.charCodeAt(h-1)]][t[o.charCodeAt(d-1)]],p=i[l][h]-(a[h]?r:n),f=i[u][h-1]-(c[h-1]?r:n);i[u][h]=Math.max(m,f,p),i[u][h]===m?(a[h]=!1,c[h]=!1):i[u][h]===f?(a[h]=!1,c[h]=!0):(a[h]=!0,c[h]=!1)}l=u,u=(u+1)%2}const d=Math.max(e.length,o.length);return(d-i[l][e.length])/d}},[a.MONOMER_CHEMICAL_DISTANCE]:r}},9039:(e,t,n)=>{"use strict";var r;n.d(t,{c:()=>r}),function(e){e.UMAP="UMAP",e.T_SNE="t-SNE"}(r||(r={}))},8498:(e,t,n)=>{"use strict";var r,s,o,a,i,c,l;n.d(t,{EG:()=>i,Pn:()=>s,RR:()=>c,Wn:()=>l,aT:()=>o,m6:()=>a,xL:()=>r}),function(e){e.Levenshtein="Levenshtein",e.JaroWinkler="Jaro-Winkler",e.Manhattan="Manhattan",e.Onehot="One-Hot"}(r||(r={})),function(e){e.Euclidean="Euclidean"}(s||(s={})),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"}(o||(o={})),function(e){e.TanimotoIntArray="TanimotoIntArray"}(a||(a={})),function(e){e.Vector="Vector",e.String="String",e.BitArray="BitArray",e.MacroMolecule="MacroMolecule",e.Number="Number",e.IntArray="IntArray",e.NumberArray="NumberArray"}(i||(i={})),function(e){e.Difference="Difference"}(c||(c={})),function(e){e.CommonItems="Common Items"}(l||(l={}))},2780:(e,t,n)=>{"use strict";n.d(t,{aT:()=>r.aT});var r=n(8498);n(9336)},9336:(e,t,n)=>{"use strict";var r=n(2787),s=n(944),o=n(6295),a=n(3629),i=n(6863),c=n(8498);const l={[c.Pn.Euclidean]:a.ou},u={[c.xL.Levenshtein]:r.I,[c.xL.JaroWinkler]:s.Vb,[c.xL.Manhattan]:function(e,t){if(e.length!==t.length)return 1;{let n=0;for(let r=1;r<e.length;r++)n+=e[r]==t[r]?0:1;return n/e.length}},[c.xL.Onehot]:function(e,t){return e===t?0:1}},d={[c.aT.Tanimoto]:o.tO,[c.aT.Dice]:o.zn,[c.aT.Asymmetric]:o.gt,[c.aT.BraunBlanquet]:o.ij,[c.aT.Cosine]:o.lO,[c.aT.Kulczynski]:o.rR,[c.aT.McConnaughey]:o.lP,[c.aT.RogotGoldberg]:o.TK,[c.aT.Russel]:o.yK,[c.aT.Sokal]:o.Ii,[c.aT.Hamming]:o.be,[c.aT.Euclidean]:o.a4},h={[c.m6.TanimotoIntArray]:o.v_},m={[c.RR.Difference]:o.T6},p={[c.Wn.CommonItems]:o.Hr},f={[c.EG.Vector]:{[c.Pn.Euclidean]:l[c.Pn.Euclidean]},[c.EG.String]:{[c.xL.Levenshtein]:u[c.xL.Levenshtein],[c.xL.JaroWinkler]:u[c.xL.JaroWinkler],[c.xL.Manhattan]:u[c.xL.Manhattan],[c.xL.Onehot]:u[c.xL.Onehot]},[c.EG.BitArray]:{[c.aT.Tanimoto]:d[c.aT.Tanimoto],[c.aT.Dice]:d[c.aT.Dice],[c.aT.Asymmetric]:d[c.aT.Asymmetric],[c.aT.BraunBlanquet]:d[c.aT.BraunBlanquet],[c.aT.Cosine]:d[c.aT.Cosine],[c.aT.Kulczynski]:d[c.aT.Kulczynski],[c.aT.McConnaughey]:d[c.aT.McConnaughey],[c.aT.RogotGoldberg]:d[c.aT.RogotGoldberg],[c.aT.Russel]:d[c.aT.Russel],[c.aT.Sokal]:d[c.aT.Sokal]},[c.EG.MacroMolecule]:{[i.Z.HAMMING]:i.V[i.Z.HAMMING],[i.Z.LEVENSHTEIN]:i.V[i.Z.LEVENSHTEIN],[i.Z.NEEDLEMANN_WUNSCH]:i.V[i.Z.NEEDLEMANN_WUNSCH],[i.Z.MONOMER_CHEMICAL_DISTANCE]:i.V[i.Z.MONOMER_CHEMICAL_DISTANCE]},[c.EG.Number]:{[c.RR.Difference]:m[c.RR.Difference]},[c.EG.IntArray]:{[c.m6.TanimotoIntArray]:h[c.m6.TanimotoIntArray]},[c.EG.NumberArray]:{[c.Wn.CommonItems]:p[c.Wn.CommonItems]}};Object.keys(f).reduce(((e,t)=>{for(const n of Object.keys(f[t]))e[n]=t;return e}),{})},8774:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});class r{constructor(e,t=!1){if(this._length=0,this._version=0,this._updateLevel=0,this._selectedCount=0,this._selectedCountVersion=-1,this._selectedIndexesVersion=-1,this._versionedName="",this._versionedNameVersion=-1,this.SHRINK_THRESHOLD=256,"number"==typeof e){const n=e,s=r._createBuffer(n);if(t)for(let e=0;e<s.length;e++)s[e]=-1;this._data=s,this._length=n}else{if(!(e instanceof Uint32Array))throw new Error("Invalid constructor");this._data=e,this._length=t}}getRawData(){return this._data}assureGoez(e,t){if(e<0)throw new Error(`${t} should be greater than zero`)}assureInRange(e,t,n,r){if(e<t||e>n)throw new Error(`Argument ${r} (${e}) out of range (${t}, ${n})`)}copy(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}copyFrom(e){if(this._length!=e._length)throw new Error(`Lengths differ (${this._length} != ${e._length})`);this.copy(e._data,this._data,this.lengthInInts),this._version++}get length(){return this._length}get buffer(){return this._data}set buffer(e){this._data=e,this._version++}get version(){return this._version}set version(e){this._version=e}incrementVersion(e=!0){this._version++}get lengthInInts(){return Math.floor((this._length+31)/32)}get versionedName(){return this._version==this._versionedNameVersion?this._versionedName:""}set versionedName(e){this._versionedName=e,this._versionedNameVersion=this._version}get self(){return this}setLength(e){if(e<0)throw new Error("should be >= 0");if(e==this._length)return;const t=Math.floor((e+31)/32);if(t>this._data.length||t+this.SHRINK_THRESHOLD<this._data.length){const e=new Uint32Array(t);this.copy(this._data,e,t>this._data.length?this._data.length:t),this._data=e}e>this._length&&(this._length%32>0&&(this._data[this.lengthInInts-1]&=(1<<(this._length%32&31))-1),this._data.fill(0,this.lengthInInts,t)),this._length=e,this._version++}static fromAnd(e,t){if(e._length!=t._length)throw new Error(`Lengths differ (${e._length} != ${t._length})`);const n=new r(e._length);n._length=e._length,n._data=r._createBuffer(n._length),n._version=0;const s=e.lengthInInts;for(let r=0;r<s;r++)n._data[r]=e._data[r]&t._data[r];return n}static _createBuffer(e){return new Uint32Array(Math.floor((e+31)/32))}static fromValues(e){const t=new r(e.length);t._version=0;for(let n=0;n<t._length;n++)e[n]&&(t._data[Math.floor(n/32)]|=1<<(n%32&31));return t}static fromSeq(e,t){const n=new r(e);for(let r=0;r<e;++r)n.setBit(r,t(r));return n._version=0,n}static fromString(e){return r.fromSeq(e.length,(t=>"1"==e.charAt(t)))}static fromUint32Array(e,t){const n=new r(e);return n._data=t,n}static fromBytes(e){const t=e.length,n=new r(8*t);n._data=new Uint32Array(Math.floor((t+3)/4)),n._length=8*t;let s=0,o=0;for(;t-o>=4;)n._data[s++]=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[s]=(255&e[o+2])<<16),t-o==2&&(n._data[s]|=(255&e[o+1])<<8),t-o==1&&(n._data[s]|=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 r(0,!1);return e._data=Uint32Array.from(this._data),e._length=this._length,e._version=this._version,e}init(e,t){this.setAll(!1,!1);for(let t=0;t<this._length;t++)e(t)&&(this._data[Math.floor(t/32)]|=1<<(t%32&31));return this.incrementVersion(t),this}invert(e=!0){for(let e=0;e<this._data.length;e++)this._data[e]^=-1;this.incrementVersion(e)}setAll(e,t=!1){const n=e?-1:0,r=this.lengthInInts;for(let e=0;e<r;e++)this._data[e]=n;this.incrementVersion(t)}setIndexes(e,t=!0,n=!0,r=!0){n&&this.setAll(!t,!1);for(const n of e)this.setFast(n,t);this.incrementVersion(r)}everyIndex(e,t=!0){for(const n of e)if(this.getBit(n)!=t)return!1;return!0}anyIndex(e,t=!0){for(const n of e)if(this.getBit(n)==t)return!0;return!1}setWhere(e,t=!0,n=!0,r=!0,s=!0){if(n&&s&&this.setAll(!t,!1),s)for(let n=0;n<this._length;n++)e(n)&&this.setFast(n,t);else for(let n=0;n<this._length;n++)this.setFast(n,e(n)?t:!t);this.incrementVersion(r)}getRange(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let r=e;r<t;++r)n.push(this.getBit(r));return r.fromValues(n)}getRangeAsList(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let r=e;r<t;++r)n.push(this.getBit(r));return n}setRange(e,t,n,r=!0){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length-1,"to");const s=Math.min(e,t),o=Math.max(e,t);if(n)for(let e=s;e<=o;e++)this.setTrue(e);else for(let e=s;e<=o;e++)this.setFalse(e);return this.incrementVersion(r),this}setRandom(e,t,n=!0){if(e<0||e>this._length)throw new Error("n must be >= 0 && <= Count");e>this._length/2&&this.setRandom(this._length-e,!t),this.setAll(!t);for(let n=0;n<e;){const e=Math.floor(Math.random()*this._length);this.getBit(e)!=t&&(this.setFast(e,t),n++)}this.incrementVersion(n)}and(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]&=e._data[t];return this.incrementVersion(t),this}andNot(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");const n=this.lengthInInts;for(let t=0;t<n;t++)this._data[t]&=~e._data[t];return this.incrementVersion(t),this}notAnd(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]=~this._data[t]&e._data[t];return this.incrementVersion(t),this}not(e=!0){for(let e=0,t=this.lengthInInts;e<t;e++)this._data[e]=~this._data[e];return this.incrementVersion(e),this}or(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]|=e._data[t];return this.incrementVersion(t),this}xor(e,t=!0){if(this._length!=e._length)throw new Error("Array lengths differ.");for(let t=0,n=this.lengthInInts;t<n;t++)this._data[t]^=e._data[t];return this.incrementVersion(t),this}insertAt(e,t,n=!1){if(this.assureInRange(e,0,this._length,"pos"),0==t)return;const r=this._length;this.setLength(this._length+t);for(let n=r-1;n>=e;n--)this.setBit(n+t,this.getBit(n));for(let r=e;r<e+t;r++)this.setBit(r,n)}removeAt(e,t=1){if(t<0)throw new Error("n cannot be negative");if(this.assureInRange(e,0,this._length-t,"pos"),this.contains(!0))for(let n=e;n<this._length-t;n++)this.setBit(n,this.getBit(n+t));this.setLength(this._length-t)}removeByMask(e,t=!0){if(this._length!=e.length)throw new Error("length != mask.length");if(e==this)this.setLength(e.countBits(!t)),this.setAll(!t);else{let n=0;for(let r=-1;-1!=(r=e.findNext(r,!t));)this.setFast(n++,this.getBit(r));this._length=n,this._version++}return this}getBit(e){return!!(this._data[Math.floor(e/32)]&1<<(31&e))}setBit(e,t,n=!0){this.setFast(e,t),this._version++}setFast(e,t){t?this._data[Math.floor(e/32)]|=1<<(31&e):this._data[Math.floor(e/32)]&=~(1<<(31&e))}setTrue(e){this._data[Math.floor(e/32)]|=1<<(31&e)}setFalse(e){this._data[Math.floor(e/32)]&=~(1<<(31&e))}trueCount(){return this.countBits(!0)}falseCount(){return this.countBits(!1)}countBits(e){if(0==this._length)return 0;if(this._selectedCountVersion!=this._version){this._selectedCount=0;const e=this.lengthInInts;let t=0;for(;t<e-1;t++)for(let e=this._data[t];0!=e;e>>>=8)this._selectedCount+=r._onBitCount[255&e];let n=this._data[t];const s=31&this._length;for(0!=s&&(n&=~(4294967295<<s));0!=n;n>>>=8)this._selectedCount+=r._onBitCount[255&n];this._selectedCountVersion=this._version}return e?this._selectedCount:this._length-this._selectedCount}countWhere(e){let t=0;if(this.trueCount()==this._length)for(let n=0;n<this._length;n++)t+=e(n)?1:0;else for(let n=-1;-1!=(n=this.findNext(n,!0));)t+=e(n)?1:0;return t}andWithCountBits(e,t){if(0==this._length)return 0;let n=0;const s=this.lengthInInts;let o=0;for(;o<s-1;o++)for(let t=this._data[o]&e._data[o];0!=t;t>>>=8)n+=r._onBitCount[255&t];let a=this._data[o]&e._data[o];const i=31&this._length;for(0!=i&&(a&=~(4294967295<<i));0!=a;a>>>=8)n+=r._onBitCount[255&a];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 s=this.lengthInInts;for(let o=Math.floor(e/32);o<s;o++){let s=t?this._data[o]:~this._data[o];if(0!=n)s&=4294967295<<n&4294967295,n=0;else if(!t&&-4294967296==s)continue;for(let t=0;0!=s;t+=8,s>>>=8){const n=r._firstOnBit[255&s];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 s=Math.floor(e/32);s>=0;s--){let e=t?this._data[s]:~this._data[s];0!=n&&(e&=~(4294967295<<n),n=0);for(let t=24;0!=e;t-=8,e<<=8){const n=r._lastOnBit[e>>>24];if(n>=0)return n+32*s+t}}return-1}}r._onBitCount=Int8Array.from([0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8]),r._firstOnBit=Int8Array.from([-1,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0]),r._lastOnBit=Int8Array.from([-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7])},8070:(e,t,n)=>{"use strict";n.d(t,{Pl:()=>G,bk:()=>Y,gM:()=>F,L1:()=>H,cb:()=>B,E3:()=>I,J6:()=>O,Wj:()=>L,Xk:()=>R,N$:()=>k,t6:()=>N,PE:()=>$,rd:()=>M,Bl:()=>K,CN:()=>b});var r=n(4328),s=n(6082);n(9982);const o=s.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,,,,,,,,,,,,,,,,,,,,,');o.columns.add(s.Column.fromList(s.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var a=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function i(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}c((r=r.apply(e,t||[])).next())}))};function i(e,t,n,s,o,i,c,l,u=!0){return a(this,void 0,void 0,(function*(){let d=null;if(yield M(s,(n=>a(this,void 0,void 0,(function*(){let n=null;for(const r of e.viewers)r.type===t&&(n=r);if(!n)throw Error("Viewer hasn't been added");if(yield Promise.resolve(),i&&(yield i(n)),o){const t=null!=l?l:{};t.tv=e,t.viewer=n,d=yield o(t,u)}yield $(r.events.onViewerClosed,(()=>{I(n.subs.some((e=>!e.closed)),!1)}),(()=>n.close()),3e3)}))),(()=>a(this,void 0,void 0,(function*(){c?e.loadLayout(c):yield function(e,t,n){return a(this,void 0,void 0,(function*(){let r;return n?(r=yield e.dataFrame.plot.fromType(t),e.dockManager.dock(r)):r=e.addViewer(t),r}))}(e,t,n)}))),6e4,"TEST_EVENT_ASYNC"),d)return d}))}function c(e,t=!0){return a(this,void 0,void 0,(function*(){const n=e.tv.dataFrame,r=n.clone();Array.from(n.row(0).cells).forEach((e=>e.value=null));const s=n.rowCount<20?Math.floor(n.rowCount/2):10;n.rows.select((e=>e.idx>=0&&e.idx<s)),t&&(yield B(50));for(let e=s;e<2*s;e++)n.filter.set(e,!1);t&&(yield B(50)),n.currentRowIdx=1,n.columns.names().slice(0,Math.ceil(n.columns.length/2)).forEach((e=>n.columns.remove(e))),t&&(yield B(100)),e.tv.dataFrame=r,yield B(50)}))}function l(e,t=!0){return a(this,void 0,void 0,(function*(){const t=e.tv.dataFrame;setTimeout((()=>t.filter.set(0,!t.filter.get(0))),0)}))}function u(e,t=!0){return a(this,void 0,void 0,(function*(){let t,n;try{t=e.viewer.getOptions(!0).look}catch(e){throw new Error("Viewer's .getOptions() error.",{cause:e})}try{n=e.viewer.getProperties()}catch(e){throw new Error("Viewer's .getProperties() error.",{cause:e})}const r={};return Object.keys(t).filter((e=>"boolean"==typeof t[e])).forEach((e=>r[e]=!t[e])),n.filter((e=>null!==e.choices)).forEach((e=>r[e.name]=e.choices.find((n=>n!==t[e.name])))),e.viewer.setOptions(r),yield B(300),{layout:e.tv.saveLayout(),savedProps:e.viewer.getOptions().look}}))}function d(e,t=!0){return a(this,void 0,void 0,(function*(){I(JSON.stringify(e.viewer.getOptions().look),JSON.stringify(e.savedProps))}))}var h=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function i(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}c((r=r.apply(e,t||[])).next())}))};const m=3e4,p=108e5,f=console.log.bind(console),g=console.info.bind(console),y=console.warn.bind(console),w=console.error.bind(console),b={},A="Auto Tests",C="Demo",T="Detectors",v="Core",E={};let S;var _;!function(e){e.notNull=function(e,t){if(null==e)throw new Error(`${null==t?"Value":t} not defined`)}}(_||(_={}));class P{constructor(e,t){this.catchUnhandled=!0,this.report=!1,void 0!==e&&(this.catchUnhandled=e),void 0!==t&&(this.report=t)}}class x{constructor(e,t,n,r){var s;this.category=e,this.name=t,null!=r||(r={}),null!==(s=r.timeout)&&void 0!==s||(r.timeout=m),this.options=r,this.test=()=>h(this,void 0,void 0,(function*(){return new Promise(((e,t)=>h(this,void 0,void 0,(function*(){let r="";try{r=yield n()}catch(e){t(e)}e(r)}))))}))}}function $(e,t,n,r=0,s="timeout"){return h(this,void 0,void 0,(function*(){return new Promise(((o,a)=>{const i=e.subscribe((e=>{try{t(e),o("OK")}catch(e){a(e)}finally{i.unsubscribe(),clearTimeout(c)}})),c=setTimeout((()=>{i.unsubscribe(),a(s)}),r);n()}))}))}function M(e,t,n,r=0,s="timeout"){return h(this,void 0,void 0,(function*(){return new Promise(((o,a)=>{const i=e.subscribe((e=>{t(e).then((()=>{o("OK")})).catch((e=>{a(e)})).finally((()=>{i.unsubscribe(),clearTimeout(c)}))})),c=setTimeout((()=>{i.unsubscribe(),a(s)}),r);n()}))}))}function N(e,t,n){null==b[S]&&(b[S]={}),null==b[S].tests&&(b[S].tests=[]),b[S].tests.push(new x(S,e,t,n))}function I(e,t=!0,n){if(n=n?`${n}, `:"",e!==t)throw new Error(`${n}Expected "${t}", got "${e}"`)}function L(e,t,n=.001,r){if(e===Number.POSITIVE_INFINITY&&t===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY&&t===Number.NEGATIVE_INFINITY||e===Number.NaN&&t===Number.NaN||isNaN(e)&&isNaN(t))return;const s=Math.abs(e-t)<n;if(I(s,!0,`${null!=r?r:""} (tolerance = ${n})`),!s)throw new Error(`Expected ${t}, got ${e} (tolerance = ${n})`)}function R(e,t){for(const[n,r]of Object.entries(t)){if(!e.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const t=e[n];if(t instanceof Array&&r instanceof Array)O(t,r);else if(t instanceof Object&&r instanceof Object)R(t,r);else if(Number.isFinite(t)&&Number.isFinite(r))L(t,r);else if(t!=r)throw new Error(`Expected (${r}) for key '${n}', got (${t})`)}}function O(e,t){const n=e.length,r=t.length;if(n!=r)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${r}`);for(let r=0;r<n;r++)if(e[r]instanceof Array&&t[r]instanceof Array)O(e[r],t[r]);else if(e[r]instanceof Object&&t[r]instanceof Object)R(e[r],t[r]);else if(e[r]!=t[r])throw new Error(`Expected ${t[r]} at position ${r}, got ${e[r]}`)}function H(e,t,n){var r;S=e,t(),b[S]&&(b[S].clear=null===(r=null==n?void 0:n.clear)||void 0===r||r,b[S].timeout=null==n?void 0:n.timeout,b[S].benchmarks=null==n?void 0:n.benchmarks)}function F(e){null==b[S]&&(b[S]={}),b[S].before=e}function G(e){null==b[S]&&(b[S]={}),b[S].after=e}function D(e,t){return e.replace(new RegExp(t.name,"gi"),t.nqName)}function k(e){var t,n,a,i,c,l,u,d;return h(this,void 0,void 0,(function*(){const p=null===(n=null===(t=r.functions.getCurrentCall())||void 0===t?void 0:t.func)||void 0===n?void 0:n.package;yield function(e){var t;return h(this,void 0,void 0,(function*(){const n=e.id;if(E[n])return;const s=b;if(void 0!==s[A]||void 0!==s[C]||Object.keys(s).find((e=>e.startsWith(A)||e.startsWith(v))))return void(E[n]=!0);if("DevTools"===e.name)for(const e of window.dartTests){const n=e.name.split(/\s*\|\s*!/g),r=null!==(t=n.pop())&&void 0!==t?t:e.name,o=n.length?v+": "+n.join(": "):v;void 0===s[o]&&(s[o]={tests:[],clear:!0}),s[o].tests.push(new x(o,r,e.test,{isAggregated:!1,timeout:m}))}const a=[],i=[],c=[],l=yield r.dapi.functions.filter(`package.id = "${n}"`).list(),u=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const e of l){const t=e.options.test,n=e.options.demoPath;if(t&&Array.isArray(t)&&t.length)for(let n=0;n<t.length;n++){const o=t[n].matchAll(u),i={};Array.from(o).forEach((e=>{e[0].startsWith("skip")?i.skip=e[1]:e[0].startsWith("wait")?i.wait=parseInt(e[2]):e[0].startsWith("cat")?i.cat=e[3]:e[0].startsWith("timeout")&&(i.timeout=parseInt(e[4]))}));const c=new x(A,1===t.length?e.name:`${e.name} ${n+1}`,(()=>h(this,void 0,void 0,(function*(){const s=yield r.functions.eval(D(t[n],e));if(i.wait&&(yield B(i.wait)),"boolean"==typeof s&&!s)throw`Failed: ${t[n]}, expected true, got ${s}`}))),{skipReason:i.skip,timeout:i.timeout});if(i.cat){const e=A+": "+i.cat;c.category=e,void 0===s[e]&&(s[e]={tests:[],clear:!0}),s[e].tests.push(c)}else a.push(c)}if(n){const t=e.options.demoWait?parseInt(e.options.demoWait):void 0,n=new x(C,e.friendlyName,(()=>h(this,void 0,void 0,(function*(){r.shell.clearLastError(),yield e.apply(),yield B(t||2e3);const n=yield r.shell.lastError;if(n)throw new Error(n)}))),{skipReason:e.options.demoSkip});i.push(n)}if(e.hasTag("semTypeDetector")){const t=new x(T,e.friendlyName,(()=>h(this,void 0,void 0,(function*(){const t=[];for(const n of o.clone().columns){const r=yield e.apply([n]);t.push(r||n.semType)}I(t.filter((e=>e)).length,1)}))),{skipReason:e.options.skipTest});c.push(t)}}E[n]=!0,a.length&&(s[A]={tests:a,clear:!0}),i.length&&(s[C]={tests:i,clear:!0}),c.length&&(s[T]={tests:c,clear:!1})}))}(p);const S=[];console.log("Running tests"),null!=e||(e={}),null!==(a=(d=e).testContext)&&void 0!==a||(d.testContext=new P),r.shell.clearLastError();const _=[],$=function(){const e=[];return console.log=(...t)=>{e.push(...t),f(...t)},console.info=(...t)=>{e.push(...t),g(...t)},console.warn=(...t)=>{e.push(...t),y(...t)},console.error=(...t)=>{e.push(...t),w(...t)},e}();try{for(const[t,n]of Object.entries(b)){if((null==e?void 0:e.category)&&!t.toLowerCase().startsWith(null==e?void 0:e.category.toLowerCase())||(null===(i=e.exclude)||void 0===i?void 0:i.some((e=>t.startsWith(e)))))continue;f(`Started ${t} category`),_.push(t);const o=null===(c=n.tests)||void 0===c?void 0:c.every((e=>{var t;return null===(t=e.options)||void 0===t?void 0:t.skipReason}));try{n.before&&!o&&(yield W((()=>h(this,void 0,void 0,(function*(){yield n.before()}))),1e5,`before ${e.category}: timeout error`))}catch(e){n.beforeStatus=yield V(e)}const a=null!==(l=n.tests)&&void 0!==l?l:[],d=[];if(n.clear)for(let t=0;t<a.length;t++){a[t].options&&void 0===(null===(u=a[t].options)||void 0===u?void 0:u.benchmark)&&(a[t].options||(a[t].options={}),a[t].options.benchmark=n.isAllTestsEnabledBenchmarkMode||!1);let o=yield U(a[t],null==e?void 0:e.test,$,n.timeout,p.name,e.verbose);o&&d.push(o),r.shell.closeAll(),s.Balloon.closeAll()}else for(let t=0;t<a.length;t++){let r=yield U(a[t],null==e?void 0:e.test,$,n.timeout,p.name,e.verbose);r&&d.push(r)}const m=d.filter((e=>"skipped"!=e.result));try{n.after&&!o&&(yield W((()=>h(this,void 0,void 0,(function*(){yield n.after()}))),1e5,`After ${e.category}: timeout error`))}catch(e){n.afterStatus=yield V(e)}n.afterStatus&&m.push({category:t,name:"after",result:n.afterStatus,success:!1,ms:0,skipped:!1}),n.beforeStatus&&m.push({category:t,name:"before",result:n.beforeStatus,success:!1,ms:0,skipped:!1}),S.push(...m)}}finally{console.log=f,console.info=g,console.warn=y,console.error=w}if(e.testContext.catchUnhandled){yield B(1e3);const e=yield r.shell.lastError,t={category:"Unhandled exceptions",name:"Exception",result:null!=e?e:"",success:!e,ms:0,skipped:!1};S.push(t),t.package=p.name,null!=r.shell.reportTest?yield r.shell.reportTest("package",t):yield fetch(`${r.dapi.root}/log/tests/package`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)})}return S}))}function V(e){return h(this,void 0,void 0,(function*(){return`${e.toString()}\n${e.stack?yield s.Logger.translateStackTrace(e.stack):""}`}))}function U(e,t,n,o,a,i){var c,l,u,d,g,y,b,A;return h(this,void 0,void 0,(function*(){let h;n.length=0;let C="package";const T=null!=t&&e.name.toLowerCase()!==t.toLowerCase();let v=(null===(c=e.options)||void 0===c?void 0:c.skipReason)||T,E=T?"skipped":null===(l=e.options)||void 0===l?void 0:l.skipReason;if(s.Test.isInBenchmark&&!(null===(u=e.options)||void 0===u?void 0:u.benchmark))return void f(`SKIPPED: ${e.category} ${e.name} doesnt available in benchmark mode`);v||f(`Started ${e.category} ${e.name}`);const S=Date.now();try{if(v)h={success:!0,result:E,ms:0,skipped:!0};else{let t=(null===(d=e.options)||void 0===d?void 0:d.timeout)===m&&o?o:null===(g=e.options)||void 0===g?void 0:g.timeout;t=s.Test.isInBenchmark?p:t,h={success:!0,result:null!==(y=yield W(e.test,t))&&void 0!==y?y:"OK",ms:0,skipped:!1}}}catch(e){w(e),h={success:!1,result:yield V(e),ms:0,skipped:!1}}if((null===(b=e.options)||void 0===b?void 0:b.isAggregated)&&h.result.constructor===s.DataFrame){const e=h.result.col("success");if(e&&(h.success=e.stats.sum===e.length),!i){const e=h.result;e.columns.remove("stack"),e.rows.removeWhere((e=>e.get("success"))),h.result=e}h.result=h.result.toCsv()}if(h.logs=n.join("\n"),h.ms=Date.now()-S,v||f(`Finished ${e.category} ${e.name} for ${h.ms} ms`),h.category=e.category,h.name=e.name,!T){let t={success:h.success,result:h.result,ms:h.ms,skipped:h.skipped,package:a,category:e.category,name:e.name,logs:h.logs};if(h.result.constructor==Object){const e=Object.keys(h.result).reduce(((e,t)=>Object.assign(Object.assign({},e),{["result."+t]:h.result[t]})),{});t=Object.assign(Object.assign({},t),e)}t.result instanceof s.DataFrame&&(t.result=JSON.stringify(null===(A=t.result)||void 0===A?void 0:A.toJson())||""),null!=r.shell.reportTest?yield r.shell.reportTest(C,t):yield fetch(`${r.dapi.root}/log/tests/${C}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)})}return h}))}function B(e){return h(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,e)))}))}function Y(e,t="Timeout exceeded",n=500,r=50){return h(this,void 0,void 0,(function*(){return new Promise(((s,o)=>{setTimeout((()=>{clearInterval(a),o(new Error(t))}),n);const a=setInterval((()=>{e()&&(clearInterval(a),s())}),r)}))}))}function W(e,t,n="EXECUTION TIMEOUT"){return h(this,void 0,void 0,(function*(){let r=null;const s=new Promise(((e,s)=>{r=setTimeout((()=>{s(n)}),t)}));try{return yield Promise.race([e(),s])}finally{r&&clearTimeout(r)}}))}const j=s.DataFrame.fromColumns([s.Column.fromStrings("col",["val1","val2","val3"])]);function K(e,t,n){var s;return h(this,void 0,void 0,(function*(){const o=null!==(s=null==n?void 0:n.packageName)&&void 0!==s?s:"";(null==n?void 0:n.detectSemanticTypes)&&(yield r.data.detectSemanticTypes(t));const a=r.shell.addTableView(t);try{yield i(a,e,o,r.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield i(a,e,o,r.events.onViewerAdded,void 0,n.awaitViewer)),(null==n?void 0:n.readOnly)||(yield i(a,e,o,r.events.onViewerAdded,c),(null==n?void 0:n.awaitViewer)&&(yield i(a,e,o,r.events.onViewerAdded,c,n.awaitViewer)));let t=null;t=yield i(a,e,o,r.events.onViewerAdded,u),(null==n?void 0:n.awaitViewer)&&(t=yield i(a,e,o,r.events.onViewerAdded,u,n.awaitViewer)),yield i(a,e,o,r.events.onViewLayoutApplied,d,void 0,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps}),(null==n?void 0:n.awaitViewer)&&(yield i(a,e,o,r.events.onViewLayoutApplied,d,n.awaitViewer,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps})),!1!==(null==n?void 0:n.arbitraryDfTest)&&(a.dataFrame=j,yield B(50),yield i(a,e,o,r.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield i(a,e,o,r.events.onViewerAdded,void 0,n.awaitViewer))),yield i(a,e,o,r.events.onViewerAdded,l),(null==n?void 0:n.awaitViewer)&&(yield i(a,e,o,r.events.onViewerAdded,l,n.awaitViewer))}finally{}}))}},3629:(e,t,n)=>{"use strict";function r(e=!1,t="Assertion error."){if(!e)throw new Error(t)}function s(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*e[n];return Math.sqrt(t)}function o(e,t){if(e.length!=t.length)throw new Error("The dimensionality of the vectors must match");let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}function a(e,t){let n=0;const r=e.length;if(r!==t.length)throw new Error("The dimensionality of the vectors must match");for(let s=0;s<r;++s)n+=Math.pow(e[s]-t[s],2);return Math.sqrt(n)}function i(e){const t=e.length;let n=0,r=0;for(let s=0;s<t;++s)n+=e[s],r+=Math.pow(e[s],2);const s=n/t,o=1/Math.sqrt(r/t-Math.pow(s,2));for(let n=0;n<t;++n)e[n]=(e[n]-s)*o;return e}n.d(t,{KE:()=>o,S8:()=>i,ou:()=>a,vA:()=>r,wQ:()=>s})},1913:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3282),s=n(9029),o=n(1520),a=n(2586),i=n(8708),c=n(2023),l="errorMessage",u=new r.Name("emUsed"),d={required:"missingProperty",dependencies:"property",dependentRequired:"property"},h=/\$\{[^}]+\}/,m=/\$\{([^}]+)\}/g,p=/^""\s*\+\s*|\s*\+\s*""$/g;const f=(e,t={})=>{if(!e.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(e.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return e.addKeyword(function(e){return{keyword:l,schemaType:["string","object"],post:!0,code(t){const{gen:n,data:f,schema:g,schemaValue:y,it:w}=t;if(!1===w.createErrors)return;const b=g,A=s.strConcat(c.default.instancePath,w.errorPath);function C(e,t){return s.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${u}`,r._`${e}.instancePath === ${A}`,r._`${e}.keyword in ${t}`,r._`${e}.schemaPath.indexOf(${w.errSchemaPath}) === 0`,r._`/^\\/[^\\/]*$/.test(${e}.schemaPath.slice(${w.errSchemaPath.length}))`)}function T(e,t){const r=[];for(const n in e){const e=t[n];h.test(e)&&r.push([n,E(e)])}return n.object(...r)}function v(e){return h.test(e)?new o._Code(o.safeStringify(e).replace(m,((e,t)=>`" + JSON.stringify(${a.getData(t,w)}) + "`)).replace(p,"")):r.stringify(e)}function E(e){return r._`function(){return ${v(e)}}`}n.if(r._`${c.default.errors} > 0`,(()=>{if("object"==typeof b){const[o,a]=function(e){let t,n;for(const r in e){if("properties"===r||"items"===r)continue;const s=e[r];if("object"==typeof s){t||(t={});const e=t[r]={};for(const t in s)e[t]=[]}else n||(n={}),n[r]=[]}return[t,n]}(b);a&&function(s){const o=n.const("emErrors",r.stringify(s)),a=n.const("templates",T(s,g));n.forOf("err",c.default.vErrors,(e=>n.if(C(e,o),(()=>n.code(r._`${o}[${e}.keyword].push(${e})`).assign(r._`${e}.${u}`,!0)))));const{singleError:l}=e;if(l){const e=n.let("message",r._`""`),s=n.let("paramsErrors",r._`[]`);d((t=>{n.if(e,(()=>n.code(r._`${e} += ${"string"==typeof l?l:";"}`))),n.code(r._`${e} += ${h(t)}`),n.assign(s,r._`${s}.concat(${o}[${t}])`)})),i.reportError(t,{message:e,params:r._`{errors: ${s}}`})}else d((e=>i.reportError(t,{message:h(e),params:r._`{errors: ${o}[${e}]}`})));function d(e){n.forIn("key",o,(t=>n.if(r._`${o}[${t}].length`,(()=>e(t)))))}function h(e){return r._`${e} in ${a} ? ${a}[${e}]() : ${y}[${e}]`}}(a),o&&function(e){const s=n.const("emErrors",r.stringify(e)),o=[];for(const t in e)o.push([t,T(e[t],g[t])]);const a=n.const("templates",n.object(...o)),l=n.scopeValue("obj",{ref:d,code:r.stringify(d)}),h=n.let("emPropParams"),m=n.let("emParamsErrors");n.forOf("err",c.default.vErrors,(e=>n.if(C(e,s),(()=>{n.assign(h,r._`${l}[${e}.keyword]`),n.assign(m,r._`${s}[${e}.keyword][${e}.params[${h}]]`),n.if(m,(()=>n.code(r._`${m}.push(${e})`).assign(r._`${e}.${u}`,!0)))})))),n.forIn("key",s,(e=>n.forIn("keyProp",r._`${s}[${e}]`,(o=>{n.assign(m,r._`${s}[${e}][${o}]`),n.if(r._`${m}.length`,(()=>{const s=n.const("tmpl",r._`${a}[${e}] && ${a}[${e}][${o}]`);i.reportError(t,{message:r._`${s} ? ${s}() : ${y}[${e}][${o}]`,params:r._`{errors: ${m}}`})}))}))))}(o),function(e){const{props:o,items:a}=e;if(!o&&!a)return;const d=r._`typeof ${f} == "object"`,h=r._`Array.isArray(${f})`,m=n.let("emErrors");let p,w;const b=n.let("templates");function C(e,t){n.assign(m,r.stringify(e)),n.assign(b,T(e,t))}o&&a?(p=n.let("emChildKwd"),n.if(d),n.if(h,(()=>{C(a,g.items),n.assign(p,r.str`items`)}),(()=>{C(o,g.properties),n.assign(p,r.str`properties`)})),w=r._`[${p}]`):a?(n.if(h),C(a,g.items),w=r._`.items`):o&&(n.if(s.and(d,s.not(h))),C(o,g.properties),w=r._`.properties`),n.forOf("err",c.default.vErrors,(e=>function(e,t,o){n.if(s.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${u}`,r._`${e}.instancePath.indexOf(${A}) === 0`),(()=>{const s=n.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:r._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),a=n.const("emMatches",r._`${s}.exec(${e}.instancePath.slice(${A}.length))`),i=n.const("emChild",r._`${a} && ${a}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);n.if(r._`${i} !== undefined && ${i} in ${t}`,(()=>o(i)))}))}(e,m,(t=>n.code(r._`${m}[${t}].push(${e})`).assign(r._`${e}.${u}`,!0))))),n.forIn("key",m,(e=>n.if(r._`${m}[${e}].length`,(()=>{i.reportError(t,{message:r._`${e} in ${b} ? ${b}[${e}]() : ${y}${w}[${e}]`,params:r._`{errors: ${m}[${e}]}`}),n.assign(r._`${c.default.vErrors}[${c.default.errors}-1].instancePath`,r._`${A} + "/" + ${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}(b))}const o="string"==typeof b?b:b._;o&&function(e){const o=n.const("emErrs",r._`[]`);n.forOf("err",c.default.vErrors,(e=>n.if(function(e){return s.and(r._`${e}.keyword !== ${l}`,r._`!${e}.${u}`,s.or(r._`${e}.instancePath === ${A}`,s.and(r._`${e}.instancePath.indexOf(${A}) === 0`,r._`${e}.instancePath[${A}.length] === "/"`)),r._`${e}.schemaPath.indexOf(${w.errSchemaPath}) === 0`,r._`${e}.schemaPath[${w.errSchemaPath}.length] === "/"`)}(e),(()=>n.code(r._`${o}.push(${e})`).assign(r._`${e}.${u}`,!0))))),n.if(r._`${o}.length`,(()=>i.reportError(t,{message:v(e),params:r._`{errors: ${o}}`})))}(o),e.keepErrors||function(){const e=n.const("emErrs",r._`[]`);n.forOf("err",c.default.vErrors,(t=>n.if(r._`!${t}.${u}`,(()=>n.code(r._`${e}.push(${t})`))))),n.assign(c.default.vErrors,e).assign(c.default.errors,r._`${e}.length`)}()}))},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}(t))};t.default=f,e.exports=f,e.exports.default=f},7433:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const r=n(4042),s=n(6105),o=n(6653),a=n(9572),i="https://json-schema.org/draft/2020-12/schema";class c extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),s.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;t&&(a.default.call(this,e),this.refs["http://json-schema.org/schema"]=i)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv2020=c,e.exports=t=c,e.exports.Ajv2020=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var l=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var h=n(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})},3282:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=n(4042),s=n(6144),o=n(6653),a=n(2079),i=["/properties"],c="http://json-schema.org/draft-07/schema";class l extends r.default{_addVocabularies(){super._addVocabularies(),s.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(a,i):a;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var h=n(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var m=n(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})},1520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class s extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function o(e,...t){const n=[e[0]];let r=0;for(;r<t.length;)c(n,t[r]),n.push(e[++r]);return new s(n)}t._Code=s,t.nil=new s(""),t._=o;const a=new s("+");function i(e,...t){const n=[u(e[0])];let r=0;for(;r<t.length;)n.push(a),c(n,t[r]),n.push(a,u(e[++r]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===a){const n=l(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new s(n)}function c(e,t){var n;t instanceof s?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:u(Array.isArray(n)?n.join(","):n))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof r||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof r?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=i,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:i`${e}${t}`},t.stringify=function(e){return new s(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new s(`.${e}`):o`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new s(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new s(e.toString())}},9029:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const r=n(1520),s=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 a=n(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),t.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};class i{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends i{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?s.varKinds.var:this.varKind,r=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=N(this.rhs,e,t)),this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}class l extends i{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof r.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=N(this.rhs,e,t),this}get names(){return M(this.lhs instanceof r.Name?{}:{...this.lhs.names},this.rhs)}}class u extends l{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class h extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class m extends i{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends i{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 r._CodeOrName?this.code.names:{}}}class f extends i{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let r=n.length;for(;r--;){const s=n[r];s.optimizeNames(e,t)||(I(e,s.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>$(e,t.names)),{})}}class g extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends f{}class w extends g{}w.kind="else";class b 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 w(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(L(e),t instanceof b?[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 M(e,this.condition),this.else&&$(e,this.else.names),e}}b.kind="if";class A extends g{}A.kind="for";class C extends A{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 $(super.names,this.iteration.names)}}class T extends A{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){const t=e.es5?s.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){const e=M(super.names,this.from);return M(e,this.to)}}class v extends A{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=N(this.iterable,e,t),this}get names(){return $(super.names,this.iterable.names)}}class E 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)}}E.kind="func";class S extends f{render(e){return"return "+super.render(e)}}S.kind="return";class _ extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(r=this.finally)||void 0===r||r.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&$(e,this.catch.names),this.finally&&$(e,this.finally.names),e}}class P extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}P.kind="catch";class x extends g{render(e){return"finally"+super.render(e)}}function $(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function M(e,t){return t instanceof r._CodeOrName?$(e,t.names):e}function N(e,t,n){return e instanceof r.Name?o(e):(s=e)instanceof r._Code&&s._items.some((e=>e instanceof r.Name&&1===t[e.str]&&void 0!==n[e.str]))?new r._Code(e._items.reduce(((e,t)=>(t instanceof r.Name&&(t=o(t)),t instanceof r._Code?e.push(...t._items):e.push(t),e)),[])):e;var s;function o(e){const r=n[e.str];return void 0===r||1!==t[e.str]?e:(delete t[e.str],r)}}function I(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function L(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:r._`!${F(e)}`}x.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 s.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){const s=this._scope.toName(t);return void 0!==n&&r&&(this._constants[s.str]=n),this._leafNode(new c(e,s,n)),s}const(e,t,n){return this._def(s.varKinds.const,e,t,n)}let(e,t,n){return this._def(s.varKinds.let,e,t,n)}var(e,t,n){return this._def(s.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new l(e,t,n))}add(e,n){return this._leafNode(new u(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==r.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[n,s]of e)t.length>1&&t.push(","),t.push(n),(n!==s||this.opts.es5)&&(t.push(":"),(0,r.addCodeArg)(t,s));return t.push("}"),new r._Code(t)}if(e,t,n){if(this._blockNode(new b(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 b(e))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode(b,w)}_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,r,o=(this.opts.es5?s.varKinds.var:s.varKinds.let)){const a=this._scope.toName(e);return this._for(new T(o,a,t,n),(()=>r(a)))}forOf(e,t,n,o=s.varKinds.const){const a=this._scope.toName(e);if(this.opts.es5){const e=t instanceof r.Name?t:this.var("_arr",t);return this.forRange("_i",0,r._`${e}.length`,(t=>{this.var(a,r._`${e}[${t}]`),n(a)}))}return this._for(new v("of",o,a,t),(()=>n(a)))}forIn(e,t,n,o=(this.opts.es5?s.varKinds.var:s.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,r._`Object.keys(${t})`,n);const a=this._scope.toName(e);return this._for(new v("in",o,a,t),(()=>n(a)))}endFor(){return this._endBlockNode(A)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new h(e))}return(e){const t=new S;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new _;if(this._blockNode(r),this.code(e),t){const e=this.name("e");this._currNode=r.catch=new P(e),t(e)}return n&&(this._currNode=r.finally=new x,this.code(n)),this._endBlockNode(P,x)}throw(e){return this._leafNode(new m(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=r.nil,n,s){return this._blockNode(new E(e,t,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(E)}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 b))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=L;const R=H(t.operators.AND);t.and=function(...e){return e.reduce(R)};const O=H(t.operators.OR);function H(e){return(t,n)=>t===r.nil?n:n===r.nil?t:r._`${F(t)} ${e} ${F(n)}`}function F(e){return e instanceof r.Name?e:r._`(${e})`}t.or=function(...e){return e.reduce(O)}},7845:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const r=n(1520);class s 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 r.Name("const"),let:new r.Name("let"),var:new r.Name("var")};class a{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof r.Name?e:this.name(e)}name(e){return new r.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=a;class i extends r.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=r._`.${new r.Name(t)}[${n}]`}}t.ValueScopeName=i;const c=r._`\n`;t.ValueScope=class extends a{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:r.nil}}get(){return this._scope}name(e){return new i(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(e),{prefix:s}=r,o=null!==(n=t.key)&&void 0!==n?n:t.ref;let a=this._values[s];if(a){const e=a.get(o);if(e)return e}else a=this._values[s]=new Map;a.set(o,r);const i=this._scope[s]||(this._scope[s]=[]),c=i.length;return i[c]=t.ref,r.setValue(t,{property:s,itemIndex:c}),r}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return r._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n,a={},i){let c=r.nil;for(const l in e){const u=e[l];if(!u)continue;const d=a[l]=a[l]||new Map;u.forEach((e=>{if(d.has(e))return;d.set(e,o.Started);let a=n(e);if(a){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;c=r._`${c}${n} ${e} = ${a};${this.opts._n}`}else{if(!(a=null==i?void 0:i(e)))throw new s(e);c=r._`${c}${a}${this.opts._n}`}d.set(e,o.Completed)}))}return c}}},8708:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const r=n(9029),s=n(4227),o=n(2023);function a(e,t){const n=e.const("err",t);e.if(r._`${o.default.vErrors} === null`,(()=>e.assign(o.default.vErrors,r._`[${n}]`)),r._`${o.default.vErrors}.push(${n})`),e.code(r._`${o.default.errors}++`)}function i(e,t){const{gen:n,validateName:s,schemaEnv:o}=e;o.$async?n.throw(r._`new ${e.ValidationError}(${t})`):(n.assign(r._`${s}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>r.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?r.str`"${e}" keyword must be ${t} ($data)`:r.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,s,o){const{it:c}=e,{gen:u,compositeRule:d,allErrors:h}=c,m=l(e,n,s);(null!=o?o:d||h)?a(u,m):i(c,r._`[${m}]`)},t.reportExtraError=function(e,n=t.keywordError,r){const{it:s}=e,{gen:c,compositeRule:u,allErrors:d}=s;a(c,l(e,n,r)),u||d||i(s,o.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(o.default.errors,t),e.if(r._`${o.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(r._`${o.default.vErrors}.length`,t)),(()=>e.assign(o.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:s,errsCount:a,it:i}){if(void 0===a)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",a,o.default.errors,(a=>{e.const(c,r._`${o.default.vErrors}[${a}]`),e.if(r._`${c}.instancePath === undefined`,(()=>e.assign(r._`${c}.instancePath`,(0,r.strConcat)(o.default.instancePath,i.errorPath)))),e.assign(r._`${c}.schemaPath`,r.str`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign(r._`${c}.schema`,n),e.assign(r._`${c}.data`,s))}))};const c={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function l(e,t,n){const{createErrors:s}=e.it;return!1===s?r._`{}`:function(e,t,n={}){const{gen:s,it:a}=e,i=[u(a,n),d(e,n)];return function(e,{params:t,message:n},s){const{keyword:a,data:i,schemaValue:l,it:u}=e,{opts:d,propertyName:h,topSchemaRef:m,schemaPath:p}=u;s.push([c.keyword,a],[c.params,"function"==typeof t?t(e):t||r._`{}`]),d.messages&&s.push([c.message,"function"==typeof n?n(e):n]),d.verbose&&s.push([c.schema,l],[c.parentSchema,r._`${m}${p}`],[o.default.data,i]),h&&s.push([c.propertyName,h])}(e,t,i),s.object(...i)}(e,t,n)}function u({errorPath:e},{instancePath:t}){const n=t?r.str`${e}${(0,s.getErrorPath)(t,s.Type.Str)}`:e;return[o.default.instancePath,(0,r.strConcat)(o.default.instancePath,n)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:o}){let a=o?t:r.str`${t}/${e}`;return n&&(a=r.str`${a}${(0,s.getErrorPath)(n,s.Type.Str)}`),[c.schemaPath,a]}},3835:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const r=n(9029),s=n(3558),o=n(2023),a=n(6939),i=n(4227),c=n(2586);class l{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,a.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function u(e){const t=h.call(this,e);if(t)return t;const n=(0,a.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:i,lines:l}=this.opts.code,{ownProperties:u}=this.opts,d=new r.CodeGen(this.scope,{es5:i,lines:l,ownProperties:u});let m;e.$async&&(m=d.scopeValue("Error",{ref:s.default,code:r._`require("ajv/dist/runtime/validation_error").default`}));const p=d.scopeName("validate");e.validateName=p;const f={gen:d,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,r.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:m,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:r.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:r._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,c.validateFunctionCode)(f),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(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(p,{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:p,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=f;n.evaluated={props:e instanceof r.Name?void 0:e,items:t instanceof r.Name?void 0:t,dynamicProps:e instanceof r.Name,dynamicItems:t instanceof r.Name},n.source&&(n.source.evaluated=(0,r.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function d(e){return(0,a.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function h(e){for(const r of this._compilations)if(n=e,(t=r).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return r;var t,n}function m(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||p.call(this,e,t)}function p(e,t){const n=this.opts.uriResolver.parse(t),r=(0,a._getFullPath)(this.opts.uriResolver,n);let s=(0,a.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===s)return g.call(this,n,e);const o=(0,a.normalizeId)(r),i=this.refs[o]||this.schemas[o];if("string"==typeof i){const t=p.call(this,e,i);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,n,t)}if("object"==typeof(null==i?void 0:i.schema)){if(i.validate||u.call(this,i),o===(0,a.normalizeId)(t)){const{schema:t}=i,{schemaId:n}=this.opts,r=t[n];return r&&(s=(0,a.resolveUrl)(this.opts.uriResolver,s,r)),new l({schema:t,schemaId:n,root:e,baseId:s})}return g.call(this,n,i)}}t.SchemaEnv=l,t.compileSchema=u,t.resolveRef=function(e,t,n){var r;n=(0,a.resolveUrl)(this.opts.uriResolver,t,n);const s=e.refs[n];if(s)return s;let o=m.call(this,e,n);if(void 0===o){const s=null===(r=e.localRefs)||void 0===r?void 0:r[n],{schemaId:a}=this.opts;s&&(o=new l({schema:s,schemaId:a,root:e,baseId:t}))}return void 0!==o?e.refs[n]=d.call(this,o):void 0},t.getCompilingSchema=h,t.resolveSchema=p;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:n,root:r}){var s;if("/"!==(null===(s=e.fragment)||void 0===s?void 0:s[0]))return;for(const r of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,i.unescapeFragment)(r)];if(void 0===e)return;const s="object"==typeof(n=e)&&n[this.opts.schemaId];!f.has(r)&&s&&(t=(0,a.resolveUrl)(this.opts.uriResolver,t,s))}let o;if("boolean"!=typeof n&&n.$ref&&!(0,i.schemaHasRulesButRef)(n,this.RULES)){const e=(0,a.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=p.call(this,r,e)}const{schemaId:c}=this.opts;return o=o||new l({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema?o:void 0}},2023:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s={data:new r.Name("data"),valCxt:new r.Name("valCxt"),instancePath:new r.Name("instancePath"),parentData:new r.Name("parentData"),parentDataProperty:new r.Name("parentDataProperty"),rootData:new r.Name("rootData"),dynamicAnchors:new r.Name("dynamicAnchors"),vErrors:new r.Name("vErrors"),errors:new r.Name("errors"),this:new r.Name("this"),self:new r.Name("self"),scope:new r.Name("scope"),json:new r.Name("json"),jsonPos:new r.Name("jsonPos"),jsonLen:new r.Name("jsonLen"),jsonPart:new r.Name("jsonPart")};t.default=s},4551:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6939);class s extends Error{constructor(e,t,n,s){super(s||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,r.resolveUrl)(e,t,n),this.missingSchema=(0,r.normalizeId)((0,r.getFullPath)(e,this.missingRef))}}t.default=s},6939:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const r=n(4227),s=n(2017),o=n(7106),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&l(e)<=t)};const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(i.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(c))return!0;if("object"==typeof n&&c(n))return!0}return!1}function l(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!a.has(n)&&("object"==typeof e[n]&&(0,r.eachItem)(e[n],(e=>t+=l(e))),t===1/0))return 1/0}return t}function u(e,t="",n){!1!==n&&(t=m(t));const r=e.parse(t);return d(e,r)}function d(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=d;const h=/#\/?$/;function m(e){return e?e.replace(h,""):""}t.normalizeId=m,t.resolveUrl=function(e,t,n){return n=m(n),e.resolve(t,n)};const p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:r}=this.opts,a=m(e[n]||t),i={"":a},c=u(r,a,!1),l={},d=new Set;return o(e,{allKeys:!0},((e,t,r,s)=>{if(void 0===s)return;const o=c+t;let a=i[s];function u(t){const n=this.opts.uriResolver.resolve;if(t=m(a?n(a,t):t),d.has(t))throw f(t);d.add(t);let r=this.refs[t];return"string"==typeof r&&(r=this.refs[r]),"object"==typeof r?h(e,r.schema,t):t!==m(o)&&("#"===t[0]?(h(e,l[t],t),l[t]=e):this.refs[t]=o),t}function g(e){if("string"==typeof e){if(!p.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[n]&&(a=u.call(this,e[n])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),i[t]=a})),l;function h(e,t,n){if(void 0!==t&&!s(e,t))throw f(n)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},396:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},4227:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const r=n(9029),s=n(1520);function o(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const s=r.RULES.keywords;for(const n in t)s[n]||p(e,`unknown keyword: "${n}"`)}function a(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function i(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function l({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:s}){return(o,a,i,c)=>{const l=void 0===i?a:i instanceof r.Name?(a instanceof r.Name?e(o,a,i):t(o,a,i),i):a instanceof r.Name?(t(o,i,a),a):n(a,i);return c!==r.Name||l instanceof r.Name?l:s(o,l)}}function u(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",r._`{}`);return void 0!==t&&d(e,n,t),n}function d(e,t,n){Object.keys(n).forEach((n=>e.assign(r._`${t}${(0,r.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!a(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRules=a,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,s,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return r._`${n}`}return r._`${e}${t}${(0,r.getProperty)(s)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(i(e))},t.escapeJsonPointer=i,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>{e.if(r._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,r._`${n} || {}`).code(r._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,r._`${n} || {}`),d(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:l({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,r._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>e.assign(n,!0===t||r._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=d;const h={};var m;function p(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:h[t.code]||(h[t.code]=new s._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(m||(t.Type=m={})),t.getErrorPath=function(e,t,n){if(e instanceof r.Name){const s=t===m.Num;return n?s?r._`"[" + ${e} + "]"`:r._`"['" + ${e} + "']"`:s?r._`"/" + ${e}`:r._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,r.getProperty)(e).toString():"/"+i(e)},t.checkStrictMode=p},7887:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>r(e,t)))}function r(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},r){const s=t.RULES.types[r];return s&&!0!==s&&n(e,s)},t.shouldUseGroup=n,t.shouldUseRule=r},8727:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const r=n(8708),s=n(9029),o=n(2023),a={message:"boolean schema is false"};function i(e,t){const{gen:n,data:s}=e,o={gen:n,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,r.reportError)(o,a,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:r}=e;!1===n?i(e,!1):"object"==typeof n&&!0===n.$async?t.return(o.default.data):(t.assign(s._`${r}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:r}=e;!1===r?(n.var(t,!1),i(e)):n.var(t,!0)}},208:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const r=n(396),s=n(7887),o=n(8708),a=n(9029),i=n(4227);var c;function l(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(r.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c||(t.DataType=c={})),t.getSchemaTypes=function(e){const t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=l,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:r,opts:o}=e,i=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,o.coerceTypes),l=t.length>0&&!(0===i.length&&1===t.length&&(0,s.schemaHasRulesForType)(e,t[0]));if(l){const s=h(t,r,o.strictNumbers,c.Wrong);n.if(s,(()=>{i.length?function(e,t,n){const{gen:r,data:s,opts:o}=e,i=r.let("dataType",a._`typeof ${s}`),c=r.let("coerced",a._`undefined`);"array"===o.coerceTypes&&r.if(a._`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,(()=>r.assign(s,a._`${s}[0]`).assign(i,a._`typeof ${s}`).if(h(t,s,o.strictNumbers),(()=>r.assign(c,s))))),r.if(a._`${c} !== undefined`);for(const e of n)(u.has(e)||"array"===e&&"array"===o.coerceTypes)&&l(e);function l(e){switch(e){case"string":return void r.elseIf(a._`${i} == "number" || ${i} == "boolean"`).assign(c,a._`"" + ${s}`).elseIf(a._`${s} === null`).assign(c,a._`""`);case"number":return void r.elseIf(a._`${i} == "boolean" || ${s} === null
|
|
2
2
|
|| (${i} == "string" && ${s} && ${s} == +${s})`).assign(c,a._`+${s}`);case"integer":return void r.elseIf(a._`${i} === "boolean" || ${s} === null
|
|
3
3
|
|| (${i} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(c,a._`+${s}`);case"boolean":return void r.elseIf(a._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(c,!1).elseIf(a._`${s} === "true" || ${s} === 1`).assign(c,!0);case"null":return r.elseIf(a._`${s} === "" || ${s} === 0 || ${s} === false`),void r.assign(c,null);case"array":r.elseIf(a._`${i} === "string" || ${i} === "number"
|
|
4
4
|
|| ${i} === "boolean" || ${s} === null`).assign(c,a._`[${s}]`)}}r.else(),p(e),r.endIf(),r.if(a._`${c} !== undefined`,(()=>{r.assign(s,c),function({gen:e,parentData:t,parentDataProperty:n},r){e.if(a._`${t} !== undefined`,(()=>e.assign(a._`${t}[${n}]`,r)))}(e,c)}))}(e,t,i):p(e)}))}return l};const u=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,r=c.Correct){const s=r===c.Correct?a.operators.EQ:a.operators.NEQ;let o;switch(e){case"null":return a._`${t} ${s} null`;case"array":o=a._`Array.isArray(${t})`;break;case"object":o=a._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=i(a._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return a._`typeof ${t} ${s} ${e}`}return r===c.Correct?o:(0,a.not)(o);function i(e=a.nil){return(0,a.and)(a._`typeof ${t} == "number"`,e,n?a._`isFinite(${t})`:a.nil)}}function h(e,t,n,r){if(1===e.length)return d(e[0],t,n,r);let s;const o=(0,i.toHash)(e);if(o.array&&o.object){const e=a._`typeof ${t} != "object"`;s=o.null?e:a._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else s=a.nil;o.number&&delete o.integer;for(const e in o)s=(0,a.and)(s,d(e,t,n,r));return s}t.checkDataType=d,t.checkDataTypes=h;const m={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?a._`{type: ${e}}`:a._`{type: ${t}}`};function p(e){const t=function(e){const{gen:t,data:n,schema:r}=e,s=(0,i.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:s,schemaValue:s,parentSchema:r,params:{},it:e}}(e);(0,o.reportError)(t,m)}t.reportTypeError=p},7870:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const r=n(9029),s=n(4227);function o(e,t,n){const{gen:o,compositeRule:a,data:i,opts:c}=e;if(void 0===n)return;const l=r._`${i}${(0,r.getProperty)(t)}`;if(a)return void(0,s.checkStrictMode)(e,`default is ignored for: ${l}`);let u=r._`${l} === undefined`;"empty"===c.useDefaults&&(u=r._`${u} || ${l} === null || ${l} === ""`),o.if(u,r._`${l} = ${(0,r.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:r}=e.schema;if("object"===t&&n)for(const t in n)o(e,t,n[t].default);else"array"===t&&Array.isArray(r)&&r.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 r=n(8727),s=n(208),o=n(7887),a=n(208),i=n(7870),c=n(3673),l=n(4495),u=n(9029),d=n(2023),h=n(6939),m=n(4227),p=n(8708);function f({gen:e,validateName:t,schema:n,schemaEnv:r,opts:s},o){s.code.es5?e.func(t,u._`${d.default.data}, ${d.default.valCxt}`,r.$async,(()=>{e.code(u._`"use strict"; ${g(n,s)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,u._`""`),e.var(d.default.parentData,u._`undefined`),e.var(d.default.parentDataProperty,u._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`{}`)}))}(e,s),e.code(o)})):e.func(t,u._`${d.default.data}, ${function(e){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}(s)}`,r.$async,(()=>e.code(g(n,s)).code(o)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?u._`/*# sourceURL=${n} */`:u.nil}function y({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function w(e){return"boolean"!=typeof e.schema}function b(e){(0,m.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:r,self:s}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function A(e,t){if(e.opts.jtd)return T(e,[],!1,t);const n=(0,s.getSchemaTypes)(e.schema);T(e,n,!(0,s.coerceAndCheckDataType)(e,n),t)}function C({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:s}){const o=n.$comment;if(!0===s.$comment)e.code(u._`${d.default.self}.logger.log(${o})`);else if("function"==typeof s.$comment){const n=u.str`${r}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code(u._`${d.default.self}.opts.$comment(${o}, ${n}, ${s}.schema)`)}}function T(e,t,n,r){const{gen:s,schema:i,data:c,allErrors:l,opts:h,self:p}=e,{RULES:f}=p;function g(m){(0,o.shouldUseGroup)(i,m)&&(m.type?(s.if((0,a.checkDataType)(m.type,c,h.strictNumbers)),v(e,m),1===t.length&&t[0]===m.type&&n&&(s.else(),(0,a.reportTypeError)(e)),s.endIf()):v(e,m),l||s.if(u._`${d.default.errors} === ${r||0}`))}!i.$ref||!h.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(i,f)?(h.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{E(e.dataTypes,t)||S(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const n=[];for(const r of e.dataTypes)E(t,r)?n.push(r):t.includes("integer")&&"number"===r&&n.push("integer");e.dataTypes=n}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&S(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const n=e.self.RULES.all;for(const r in n){const s=n[r];if("object"==typeof s&&(0,o.shouldUseRule)(e.schema,s)){const{type:n}=s.definition;n.length&&!n.some((e=>{return r=e,(n=t).includes(r)||"number"===r&&n.includes("integer");var n,r}))&&S(e,`missing type "${n.join(",")}" for keyword "${r}"`)}}}(e,e.dataTypes))}(e,t),s.block((()=>{for(const e of f.rules)g(e);g(f.post)}))):s.block((()=>P(e,"$ref",f.all.$ref.definition)))}function v(e,t){const{gen:n,schema:r,opts:{useDefaults:s}}=e;s&&(0,i.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,o.shouldUseRule)(r,n)&&P(e,n.keyword,n.definition,t.type)}))}function E(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function S(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,m.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){w(e)&&(b(e),y(e))?function(e){const{schema:t,opts:n,gen:r}=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,m.checkStrictMode)(e,"default is ignored in the schema root")}(e),r.let(d.default.vErrors,null),r.let(d.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",u._`${n}.evaluated`),t.if(u._`${e.evaluated}.dynamicProps`,(()=>t.assign(u._`${e.evaluated}.props`,u._`undefined`))),t.if(u._`${e.evaluated}.dynamicItems`,(()=>t.assign(u._`${e.evaluated}.items`,u._`undefined`)))}(e),A(e),function(e){const{gen:t,schemaEnv:n,validateName:r,ValidationError:s,opts:o}=e;n.$async?t.if(u._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(u._`new ${s}(${d.default.vErrors})`))):(t.assign(u._`${r}.errors`,d.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:n,items:r}){n instanceof u.Name&&e.assign(u._`${t}.props`,n),r instanceof u.Name&&e.assign(u._`${t}.items`,r)}(e),t.return(u._`${d.default.errors} === 0`))}(e)}))}(e):f(e,(()=>(0,r.topBoolOrEmptySchema)(e)))};class _{constructor(e,t,n){if((0,c.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.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",M(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,n){this.failResult((0,u.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(u._`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=u.nil){this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(e=u.nil,t=u.nil){if(!this.$data)return;const{gen:n,schemaCode:r,schemaType:s,def:o}=this;n.if((0,u.or)(u._`${r} === undefined`,t)),e!==u.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:r,it:s}=this;return(0,u.or)(function(){if(n.length){if(!(t instanceof u.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return u._`${(0,a.checkDataTypes)(e,t,s.opts.strictNumbers,a.DataType.Wrong)}`}return u.nil}(),function(){if(r.validateSchema){const n=e.scopeValue("validate$data",{ref:r.validateSchema});return u._`!${n}(${t})`}return u.nil}())}subschema(e,t){const n=(0,l.getSubschema)(this.it,e);(0,l.extendSubschemaData)(n,this.it,e),(0,l.extendSubschemaMode)(n,e);const s={...this.it,...n,items:void 0,props:void 0};return function(e,t){w(e)&&(b(e),y(e))?function(e,t){const{schema:n,gen:r,opts:s}=e;s.$comment&&n.$comment&&C(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,h.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=r.const("_errs",d.default.errors);A(e,o),r.var(t,u._`${o} === ${d.default.errors}`)}(e,t):(0,r.boolOrEmptySchema)(e,t)}(s,t),s}mergeEvaluated(e,t){const{it:n,gen:r}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=m.mergeEvaluated.props(r,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=m.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:r}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return r.if(t,(()=>this.mergeEvaluated(e,u.Name))),!0}}function P(e,t,n,r){const s=new _(e,n,t);"code"in n?n.code(s,r):s.$data&&n.validate?(0,c.funcKeywordCode)(s,n):"macro"in n?(0,c.macroKeywordCode)(s,n):(n.compile||n.validate)&&(0,c.funcKeywordCode)(s,n)}t.KeywordCxt=_;const x=/^\/(?:[^~]|~0|~1)*$/,$=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function M(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let s,o;if(""===e)return d.default.rootData;if("/"===e[0]){if(!x.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,o=d.default.rootData}else{const a=$.exec(e);if(!a)throw new Error(`Invalid JSON-pointer: ${e}`);const i=+a[1];if(s=a[2],"#"===s){if(i>=t)throw new Error(c("property/index",i));return r[t-i]}if(i>t)throw new Error(c("data",i));if(o=n[t-i],!s)return o}let a=o;const i=s.split("/");for(const e of i)e&&(o=u._`${o}${(0,u.getProperty)((0,m.unescapeJsonPointer)(e))}`,a=u._`${a} && ${o}`);return a;function c(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=M},3673:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const r=n(9029),s=n(2023),o=n(5765),a=n(8708);function i(e){const{gen:t,data:n,it:s}=e;t.if(s.parentData,(()=>t.assign(n,r._`${s.parentData}[${s.parentDataProperty}]`)))}function c(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,r.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:s,schema:o,parentSchema:a,it:i}=e,l=t.macro.call(i.self,o,a,i),u=c(n,s,l);!1!==i.opts.validateSchema&&i.self.validateSchema(l,!0);const d=n.name("valid");e.subschema({schema:l,schemaPath:r.nil,errSchemaPath:`${i.errSchemaPath}/${s}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:l,keyword:u,schema:d,parentSchema:h,$data:m,it:p}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(p,t);const f=!m&&t.compile?t.compile.call(p.self,d,h,p):t.validate,g=c(l,u,f),y=l.let("valid");function w(n=(t.async?r._`await `:r.nil)){const a=p.opts.passContext?s.default.this:s.default.self,i=!("compile"in t&&!m||!1===t.schema);l.assign(y,r._`${n}${(0,o.callValidateCode)(e,g,a,i)}`,t.modifying)}function b(e){var n;l.if((0,r.not)(null!==(n=t.valid)&&void 0!==n?n:y),e)}e.block$data(y,(function(){if(!1===t.errors)w(),t.modifying&&i(e),b((()=>e.error()));else{const n=t.async?function(){const e=l.let("ruleErrs",null);return l.try((()=>w(r._`await `)),(t=>l.assign(y,!1).if(r._`${t} instanceof ${p.ValidationError}`,(()=>l.assign(e,r._`${t}.errors`)),(()=>l.throw(t))))),e}():function(){const e=r._`${g}.errors`;return l.assign(e,null),w(r.nil),e}();t.modifying&&i(e),b((()=>function(e,t){const{gen:n}=e;n.if(r._`Array.isArray(${t})`,(()=>{n.assign(s.default.vErrors,r._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`).assign(s.default.errors,r._`${s.default.vErrors}.length`),(0,a.extendErrors)(e)}),(()=>e.error()))}(e,n)))}})),e.ok(null!==(n=t.valid)&&void 0!==n?n:y)},t.validSchemaType=function(e,t,n=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:n,errSchemaPath:r},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw new Error("ajv implementation error");const a=s.dependencies;if(null==a?void 0:a.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${r}": `+n.errorsText(s.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}},4495:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const r=n(9029),s=n(4227);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:o,schemaPath:a,errSchemaPath:i,topSchemaRef:c}){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:r._`${e.schemaPath}${(0,r.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[n],schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}${(0,r.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,s.escapeFragment)(n)}`}}if(void 0!==o){if(void 0===a||void 0===i||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:a,topSchemaRef:c,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:o,data:a,dataTypes:i,propertyName:c}){if(void 0!==a&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(void 0!==n){const{errorPath:a,dataPathArr:i,opts:c}=t;u(l.let("data",r._`${t.data}${(0,r.getProperty)(n)}`,!0)),e.errorPath=r.str`${a}${(0,s.getErrorPath)(n,o,c.jsPropertySyntax)}`,e.parentDataProperty=r._`${n}`,e.dataPathArr=[...i,e.parentDataProperty]}function u(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}void 0!==a&&(u(a instanceof r.Name?a:l.let("data",a,!0)),void 0!==c&&(e.propertyName=c)),i&&(e.dataTypes=i)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:s,allErrors:o}){void 0!==r&&(e.compositeRule=r),void 0!==s&&(e.createErrors=s),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 r=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return r.KeywordCxt}});var s=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});const o=n(3558),a=n(4551),i=n(396),c=n(3835),l=n(9029),u=n(6939),d=n(208),h=n(4227),m=n(3837),p=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"]),w={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."},b={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function A(e){var t,n,r,s,o,a,i,c,l,u,d,h,m,g,y,w,b,A,C,T,v,E,S,_,P;const x=e.strict,$=null===(t=e.code)||void 0===t?void 0:t.optimize,M=!0===$||void 0===$?1:$||0,N=null!==(r=null===(n=e.code)||void 0===n?void 0:n.regExp)&&void 0!==r?r:f,I=null!==(s=e.uriResolver)&&void 0!==s?s:p.default;return{strictSchema:null===(a=null!==(o=e.strictSchema)&&void 0!==o?o:x)||void 0===a||a,strictNumbers:null===(c=null!==(i=e.strictNumbers)&&void 0!==i?i:x)||void 0===c||c,strictTypes:null!==(u=null!==(l=e.strictTypes)&&void 0!==l?l:x)&&void 0!==u?u:"log",strictTuples:null!==(h=null!==(d=e.strictTuples)&&void 0!==d?d:x)&&void 0!==h?h:"log",strictRequired:null!==(g=null!==(m=e.strictRequired)&&void 0!==m?m:x)&&void 0!==g&&g,code:e.code?{...e.code,optimize:M,regExp:N}:{optimize:M,regExp:N},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(w=e.loopEnum)&&void 0!==w?w:200,meta:null===(b=e.meta)||void 0===b||b,messages:null===(A=e.messages)||void 0===A||A,inlineRefs:null===(C=e.inlineRefs)||void 0===C||C,schemaId:null!==(T=e.schemaId)&&void 0!==T?T:"$id",addUsedSchema:null===(v=e.addUsedSchema)||void 0===v||v,validateSchema:null===(E=e.validateSchema)||void 0===E||E,validateFormats:null===(S=e.validateFormats)||void 0===S||S,unicodeRegExp:null===(_=e.unicodeRegExp)||void 0===_||_,int32range:null===(P=e.int32range)||void 0===P||P,uriResolver:I}}class C{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...A(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:t,lines:n}),this.logger=function(e){if(!1===e)return x;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),T.call(this,w,e,"NOT SUPPORTED"),T.call(this,b,e,"DEPRECATED","warn"),this._metaOpts=P.call(this),e.formats&&S.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&_.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),E.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let r=m;"id"===n&&(r={...m},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const r=n(t);return"$async"in n||(this.errors=n.errors),r}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await s.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function s(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return i.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function i({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const n=await l.call(this,e);this.refs[e]||await s.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,r);return this}let s;if("object"==typeof e){const{schemaId:t}=this.opts;if(s=e[t],void 0!==s&&"string"!=typeof s)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const r=this.validate(n,e);if(!r&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return r}getSchema(e){let t;for(;"string"==typeof(t=v.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,r=new c.SchemaEnv({schema:{},schemaId:n});if(t=c.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=v.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,u.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(M.call(this,n,t),!t)return(0,h.eachItem)(n,(e=>N.call(this,e))),this;L.call(this,t);const r={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,h.eachItem)(n,0===r.type.length?e=>N.call(this,e,r):e=>r.type.forEach((t=>N.call(this,e,r,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex((t=>t.keyword===e));t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return e&&0!==e.length?e.map((e=>`${n}${e.instancePath} ${e.message}`)).reduce(((e,n)=>e+t+n)):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const r of t){const t=r.split("/").slice(1);let s=e;for(const e of t)s=s[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:r}=t.definition,o=s[e];r&&o&&(s[e]=O(o))}}return e}_removeAllSchemas(e,t){for(const n in e){const r=e[n];t&&!t.test(n)||("string"==typeof r?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,s=this.opts.addUsedSchema){let o;const{schemaId:a}=this.opts;if("object"==typeof e)o=e[a];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 i=this._cache.get(e);if(void 0!==i)return i;n=(0,u.normalizeId)(o||n);const l=u.getSchemaRefs.call(this,e,n);return i=new c.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:n,localRefs:l}),this._cache.set(i.schema,i),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=i),r&&this.validateSchema(e,!0),i}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function T(e,t,n,r="error"){for(const s in e){const o=s;o in t&&this.logger[r](`${n}: option ${s}. ${e[o]}`)}}function v(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function E(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function S(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function _(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function P(){const e={...this.opts};for(const t of g)delete e[t];return e}C.ValidationError=o.default,C.MissingRefError=a.default,t.default=C;const x={log(){},warn(){},error(){}},$=/^[a-z_$][a-z0-9_$:-]*$/i;function M(e,t){const{RULES:n}=this;if((0,h.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!$.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 r;const s=null==t?void 0:t.post;if(n&&s)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let a=s?o.post:o.rules.find((({type:e})=>e===n));if(a||(a={type:n,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;const i={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?I.call(this,a,i,t.before):a.rules.push(i),o.all[e]=i,null===(r=t.implements)||void 0===r||r.forEach((e=>this.addKeyword(e)))}function I(e,t,n){const r=e.rules.findIndex((e=>e.keyword===n));r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function L(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=O(t)),e.validateSchema=this.compile(t,!0))}const R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,R]}}},9572:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1678),s=n(7216),o=n(9547),a=n(8226),i=n(518),c=n(4588),l=n(5707),u=n(7082),d=["/properties"];t.default=function(e){return[r,s,o,a,i,t(this,c),l,t(this,u)].forEach((e=>this.addMetaSchema(e,void 0,!1))),this;function t(t,n){return e?t.$dataMetaSchema(n,d):n}}},6250:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2017);r.code='require("ajv/dist/runtime/equal").default',t.default=r},3853:(e,t)=>{"use strict";function n(e){const t=e.length;let n,r=0,s=0;for(;s<t;)r++,n=e.charCodeAt(s++),n>=55296&&n<=56319&&s<t&&(n=e.charCodeAt(s),56320==(64512&n)&&s++);return r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.code='require("ajv/dist/runtime/ucs2length").default'},5944:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8343);r.code='require("ajv/dist/runtime/uri").default',t.default=r},3558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=n},5457:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const r=n(9029),s=n(4227),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:r}=t;Array.isArray(r)?a(e,r):(0,s.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function a(e,t){const{gen:n,schema:o,data:a,keyword:i,it:c}=e;c.items=!0;const l=n.const("len",r._`${a}.length`);if(!1===o)e.setParams({len:t.length}),e.pass(r._`${l} <= ${t.length}`);else if("object"==typeof o&&!(0,s.alwaysValidSchema)(c,o)){const o=n.var("valid",r._`${l} <= ${t.length}`);n.if((0,r.not)(o),(()=>function(o){n.forRange("i",t.length,l,(t=>{e.subschema({keyword:i,dataProp:t,dataPropType:s.Type.Num},o),c.allErrors||n.if((0,r.not)(o),(()=>n.break()))}))}(o))),e.ok(o)}}t.validateAdditionalItems=a,t.default=o},8660:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),s=n(9029),o=n(2023),a=n(4227),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>s._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:i,data:c,errsCount:l,it:u}=e;if(!l)throw new Error("ajv implementation error");const{allErrors:d,opts:h}=u;if(u.props=!0,"all"!==h.removeAdditional&&(0,a.alwaysValidSchema)(u,n))return;const m=(0,r.allSchemaProperties)(i.properties),p=(0,r.allSchemaProperties)(i.patternProperties);function f(e){t.code(s._`delete ${c}[${e}]`)}function g(r){if("all"===h.removeAdditional||h.removeAdditional&&!1===n)f(r);else{if(!1===n)return e.setParams({additionalProperty:r}),e.error(),void(d||t.break());if("object"==typeof n&&!(0,a.alwaysValidSchema)(u,n)){const n=t.name("valid");"failing"===h.removeAdditional?(y(r,n,!1),t.if((0,s.not)(n),(()=>{e.reset(),f(r)}))):(y(r,n),d||t.if((0,s.not)(n),(()=>t.break())))}}}function y(t,n,r){const s={keyword:"additionalProperties",dataProp:t,dataPropType:a.Type.Str};!1===r&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(s,n)}t.forIn("key",c,(n=>{m.length||p.length?t.if(function(n){let o;if(m.length>8){const e=(0,a.schemaRefOrVal)(u,i.properties,"properties");o=(0,r.isOwnProperty)(t,e,n)}else o=m.length?(0,s.or)(...m.map((e=>s._`${n} === ${e}`))):s.nil;return p.length&&(o=(0,s.or)(o,...p.map((t=>s._`${(0,r.usePattern)(e,t)}.test(${n})`)))),(0,s.not)(o)}(n),(()=>g(n))):g(n)})),e.ok(s._`${l} === ${o.default.errors}`)}};t.default=i},5844:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),s={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const o=t.name("valid");n.forEach(((t,n)=>{if((0,r.alwaysValidSchema)(s,t))return;const a=e.subschema({keyword:"allOf",schemaProp:n},o);e.ok(o),e.mergeEvaluated(a)}))}};t.default=s},6505:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(5765).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r},2661:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?r.str`must contain at least ${e} valid item(s)`:r.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?r._`{minContains: ${e}}`:r._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:o,data:a,it:i}=e;let c,l;const{minContains:u,maxContains:d}=o;i.opts.next?(c=void 0===u?1:u,l=d):c=1;const h=t.const("len",r._`${a}.length`);if(e.setParams({min:c,max:l}),void 0===l&&0===c)return void(0,s.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==l&&c>l)return(0,s.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,s.alwaysValidSchema)(i,n)){let t=r._`${h} >= ${c}`;return void 0!==l&&(t=r._`${t} && ${h} <= ${l}`),void e.pass(t)}i.items=!0;const m=t.name("valid");function p(){const e=t.name("_valid"),n=t.let("count",0);f(e,(()=>t.if(e,(()=>function(e){t.code(r._`${e}++`),void 0===l?t.if(r._`${e} >= ${c}`,(()=>t.assign(m,!0).break())):(t.if(r._`${e} > ${l}`,(()=>t.assign(m,!1).break())),1===c?t.assign(m,!0):t.if(r._`${e} >= ${c}`,(()=>t.assign(m,!0))))}(n)))))}function f(n,r){t.forRange("i",0,h,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:s.Type.Num,compositeRule:!0},n),r()}))}void 0===l&&1===c?f(m,(()=>t.if(m,(()=>t.break())))):0===c?(t.let(m,!0),void 0!==l&&t.if(r._`${a}.length > 0`,p)):(t.let(m,!1),p()),e.result(m,(()=>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 r=n(9029),s=n(4227),o=n(5765);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const s=1===t?"property":"properties";return r.str`must have ${s} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:s}})=>r._`{property: ${e},
|