@datagrok/bio 2.12.20 → 2.12.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see package-test.js.LICENSE.txt */
2
- var bio_test;(()=>{var e={2012:(e,t,n)=>{"use strict";n.d(t,{f:()=>r});var s=n(9976);class r extends s.B{static get Lesk(){return void 0===this.lesk&&(this.lesk=this.makePalette([[["G","A","S","T"],"orange"],[["C","V","I","L","P","F","Y","M","W"],"all_green"],[["N","Q","H"],"magenta"],[["D","E"],"red"],[["K","R"],"all_blue"]],!1,r)),this.lesk}static get GrokGroups(){return void 0===this.grokGroups&&(this.grokGroups=this.makePalette([[["C","U"],"yellow"],[["G","P"],"red"],[["A","V","I","L","M","F","Y","W"],"all_green"],[["R","H","K"],"light_blue"],[["D","E"],"dark_blue"],[["S","T","N","Q"],"orange"]],!1,r)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new r({D:"#E60A0A",E:"#E60A0A",C:"#E6E600",M:"#E6E600",K:"#145AFF",R:"#145AFF",S:"#FA9600",T:"#FA9600",F:"#3232AA",Y:"#3232AA",N:"#00DCDC",Q:"#00DCDC",G:"#EBEBEB",L:"#0F820F",V:"#0F820F",I:"#0F820F",A:"#C8C8C8",W:"#B45AB4",H:"#8282D2",P:"#DC9682",others:"#BEA06E"})),this.rasMol}get(e){const t=e in r.aaSynonyms?r.aaSynonyms[e]:e;return super.get(t)}}r.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class i{static getPalette(e="grok"){switch(e){case"grok":return r.GrokGroups;case"lesk":return r.Lesk;default:throw new Error(`ChemPalette: scheme \`${e}\` does not exist`)}}static getInnerOuter(e){let t=0,n="",s="";for(const r of e)"("==r?t++:")"==r?t--:t?n+=r:s+=r;return isNaN(parseInt(n))?[s,n]:[s,""]}static getColorAAPivot(e="",t="grok"){const n=this.getPalette(t);let[s,r]=this.getInnerOuter(e);if(s=s.length>6?`${s.slice(0,3)}...`:s,r=r.length>6?`${r.slice(0,3)}...`:r,1==e.length||"("==e[1]){const t=e[0]?.toUpperCase();return t in n?[n.get(t),t,r,1]:[this.undefinedColor,s,r,1]}if("d"==e[0]&&e[1]in n&&(2==e.length||"("==e[2])){const t=e[1]?.toUpperCase();return t in n?[n.get(t),t,r,2]:[this.undefinedColor,s,r,2]}if(e.substring(0,3)in this.AAFullNames&&(3==e.length||"("==e[3])){const t=this.AAFullNames[e.substring(0,3)];return t in n?[n.get(t),t,r,3]:[this.undefinedColor,s,r,3]}if(e[0]?.toLowerCase()==e[0]&&e.substring(1,3)in this.AAFullNames&&(4==e.length||"("==e[4])){const t=this.AAFullNames[e.substring(1,3)];return t in n?[n.get(t),t,r,4]:[this.undefinedColor,s,r,4]}return[this.undefinedColor,s,r,0]}}i.SemType="Aminoacids",i.SemTypeMultipleAlignment="AminoacidsMultipleAlignment",i.undefinedColor="rgb(100,100,100)",i.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"},i.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"},i.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(*)*"},i.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"}},6584:(e,t,n)=>{"use strict";n.d(t,{BX:()=>i,nW:()=>l,tW:()=>c,tb:()=>u});var s=n(4469);const r="Libraries",i="System:AppData/Bio/monomer-libraries/",o={explicit:["HELMCoreLibrary.json"],exclude:[]};let a=Promise.resolve();async function l(){let e;return a=a.then((async()=>{const t=await s.dapi.userDataStorage.getValue(r,"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 a,e}async function c(e){a=a.then((async()=>{console.debug(`Bio: setUserLibSettings()\n${JSON.stringify(e,void 0,2)}`),await s.dapi.userDataStorage.postValue(r,"Settings",JSON.stringify(e),!0)})),await a}async function u(){await c(o)}},7228:(e,t,n)=>{"use strict";n.d(t,{JN:()=>a,Qx:()=>l});var s=n(976),r=n(4469),i=(n(5697),n(1047),n(6286)),o=(n(8607),n(8457));async function a(){const e=s.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 s.Column&&(e=(0,o.O)(e).columns.toList());const n=(await a()).getBioLib(),l=new Array(e.length),c=e[0].length,u=new Float32Array(c);for(let o=0;o<e.length;++o){const a=t.getCanonical(o),h=n.getMonomer("PEPTIDE",a)?.smiles??"",d=e[o],m=d.getRawData(),p=d.categories,f=p.indexOf("");if(l[o]={categories:p,data:m,emptyIndex:f},void 0===a)continue;const g=s.Column.fromStrings("smiles",p.map((e=>n.getMonomer("PEPTIDE",e)?.smiles??""))),y=(s.DataFrame.fromColumns([g]),(await r.chem.getSimilarities(g,h)).getRawData());for(let e=0;e<c;++e){const t=m[e];u[e]+=a!==i.G2&&t!==f?y[t]:a===i.G2&&t===f?1:0}}for(let n=0;n<u.length;++n){let r=u[n]/t.length;for(let i=0;i<e.length;++i){const e=l[i];if(i>=t.length&&e.data[n]!==e.emptyIndex||e.data[n]===e.emptyIndex&&i<t.length){r=s.FLOAT_NULL;break}}u[n]=r}return s.Column.fromFloat32Array("Similarity",u)}},8601:(e,t,n)=>{"use strict";n.d(t,{i0:()=>d});var s=n(4469),r=n(976),i=n(6414),o=n.n(i),a=n(1821),l=n(8607);const c={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(1047);function h(e){return Math.round(c.PRECISION_FACTOR*e)/c.PRECISION_FACTOR}async function d(e,t,i){if(0===r.Func.find({package:"Chem",name:"getRdKitModule"}).length)return{col:null,warnings:['Transformation to atomic level requires the package "Chem" installed.']};if(t.semType!==r.SEMTYPE.MACROMOLECULE)return{col:null,warnings:[`Only the ${r.SEMTYPE.MACROMOLECULE} columns can be converted to atomic level, the chosen column has semType '${t.semType}'`]};let h=t;const d=l.g.forColumn(t);d.isHelm()&&(h=d.convert(a.r2.SEPARATOR,"."),h.name=t.name);const p=l.g.forColumn(h).alphabet;let f;if("PT"===p||"UN"===p)f="PEPTIDE";else{if("RNA"!==p&&"DNA"!==p)return{col:null,warnings:[`Unexpected column's '${h.name}' alphabet '${p}'.`]};f="RNA"}const g=function(e){const t=e.length,n=new Array(t),r=l.g.forColumn(e);let i=!1;for(let e=0;e<t;++e){const t=r.getSplitted(e);i||(i=0===t.length),n[e]=o()(t.canonicals).filter((e=>!r.isGap(e))).map((e=>e)).toArray()}return i&&s.shell.warning(`Some values in the "${e.name}" column are empty`),n}(h),y=await async function(e,t,n,r){const i=function(e,t,n){const s=new Map;for(const r of e.getMonomerSymbolsByType(t)){const i=e.getMonomer(t,r);if("RNA"===t&&("Branch"===i.monomerType||"DNA"===n&&i.symbol===c.DEOXYRIBOSE||"RNA"===n&&i.symbol===c.RIBOSE||i.symbol===c.PHOSPHATE)||"PEPTIDE"===t&&"Branch"!==i.monomerType){const e={};u.rx.forEach((t=>{e[t]=i[t]})),s.set(i.symbol,e)}}return s}(t,n,r),o=new Map,a=await s.functions.call("Chem:getRdKitModule"),l={value:null};if("RNA"===n){const e="RNA"===r?[c.RIBOSE,c.PHOSPHATE]:[c.DEOXYRIBOSE,c.PHOSPHATE];for(const t of e)m(o,t,i,a,n,l)}for(let t=0;t<e.length;++t){const s=e[t];for(const e of s)if(""!==e)try{m(o,e,i,a,n,l)}catch(t){const n=t instanceof Error?t.message:t.toString(),s=t instanceof Error?t.stack:void 0;throw console.error(`bio lib: getMonomersDictFromLib() sym='${e}', error:\n${n}\n${s}`),new Error(`Can't get monomer '${e}' from library: ${n}`)}}return o}(g,i,f,p),w=h.length,{molfileList:b,molfileWarningList:A}=await async function(e,t,s,r,i){const o=Math.max(navigator.hardwareConcurrency-2,1),a=new Array(o).fill(null).map((()=>new Worker(new URL(n.p+n.u(79),n.b)))),l=i/o;let c=[],u=[];const h=new Array(o);for(let n=0;n<o;n++){const c=Math.floor(n*l),u=n===o-1?i:Math.floor((n+1)*l);a[n].postMessage({monomerSequencesArray:e,monomersDict:t,alphabet:s,polymerType:r,start:c,end:u}),h[n]=new Promise((e=>{a[n].onmessage=({data:{molfileList:t,molfileWarningList:n}})=>{e({molfileList:t,molfileWarningList:n})}}))}return(await Promise.all(h)).forEach((e=>{c=c.concat(...e.molfileList),u=u.concat(...e.molfileWarningList)})),setTimeout((()=>{a.forEach((e=>{e.terminate()}))}),0),{molfileList:c,molfileWarningList:u}}(g,y,p,f,w);if(A.length>.05*w)throw new Error("Too many errors getting molfiles.");const C=`molfile(${h.name})`,v=e.columns.getUnusedName(C),T=r.Column.fromStrings(v,b);return T.semType=r.SEMTYPE.MOLECULE,T.setTag(r.TAGS.UNITS,r.UNITS.Molecule.MOLBLOCK),{col:T,warnings:A}}function m(e,t,n,s,r,i){if(!e.has(t)){const o=function(e,t,n,s,r){if(t.has(e)){const o=t.get(e),a=function(e){const t=[];for(const n of e){let e=n.capGroupSmiles;e||(e=n.capGroupSMILES),e=e.replace(/(\[|\]|\*|:|\d)/g,""),t.push(e)}return t}(o.rgroups),l=(i=o.molfile).includes("V3000")?function(e){const t=new Map,n=/M V30 (\d+) R#.+RGROUPS=\((\d+) (\d+)\).*/gm;let s;for(;null!==(s=n.exec(e));)s.index===n.lastIndex&&n.lastIndex++,t.set(parseInt(s[1]),parseInt(s[3]));return t}(i):function(e){const t=new Map;let n=e.indexOf(c.V2K_A_LINE,0),s=n;for(;-1!==n;){s=e.indexOf("\n",n);const r=parseInt(e.substring(n,s).replace(/^A\s+/,""));n=e.indexOf("R",s),s=e.indexOf("\n",n);const i=parseInt(e.substring(n,s).replace(/^R/,""));t.set(r,i),n=e.indexOf(c.V2K_A_LINE,s)}for(n=e.indexOf(c.V2K_RGP_LINE,0),s=e.indexOf("\n",n);-1!==n;){n+=c.V2K_RGP_SHIFT,s=e.indexOf("\n",n);const r=e.substring(n,s).replaceAll(/\s+/g," ").split(" ").map((e=>parseInt(e))).slice(1);for(let e=0;e<r.length;e+=2){if(t.has(r[e])&&t.get(r[e])!==r[e+1])throw new Error(`r-group index ${r[e]} has already been added with a different value`);t.set(r[e],r[e+1])}n=e.indexOf(c.V2K_RGP_LINE,s)}return t}(i),u=o.molfile.includes("V3000")?o.molfile:function(e,t){const n=t.get_mol(e),s=n.get_v3Kmolblock();return n.delete(),s}(function(e){let t=e.indexOf(c.V2K_A_LINE,0);-1===t&&(t=e.indexOf(c.V2K_RGP_LINE));const n=e.indexOf(c.V3K_END,t);return e.substring(0,t)+e.substring(n)}(o.molfile),n),d=function(e){let t=(e=e.replaceAll("\r","")).indexOf(c.V3K_BEGIN_COUNTS_LINE)+c.V3K_COUNTS_SHIFT,n=e.indexOf(" ",t+1);const s=parseInt(e.substring(t,n));return t=n+1,n=e.indexOf(" ",t+1),{atomCount:s,bondCount:parseInt(e.substring(t,n))}}(u),m=function(e,t){const n=new Array(t),s=new Float32Array(t),r=new Float32Array(t),i=new Array(t);let o=e.indexOf(c.V3K_BEGIN_ATOM_BLOCK);o=e.indexOf("\n",o);let a=o;for(let l=0;l<t;l++){o=e.indexOf(c.V3K_BEGIN_DATA_LINE,o)+c.V3K_IDX_SHIFT,a=e.indexOf(" ",o),o=a+1,a=e.indexOf(" ",o),n[l]=e.substring(o,a);const t=new Array(2);for(let n=0;n<2;++n)o=a+1,a=e.indexOf(" ",o),t[n]=parseFloat(e.substring(o,a));s[l]=t[0],r[l]=t[1],o=a,a=e.indexOf("\n",o)+1,i[l]=e.slice(o,a),o=a}return{atomTypes:n,x:s,y:r,kwargs:i}}(u,d.atomCount),g=function(e,t){const n=new Uint32Array(t),s=new Array(t),r=new Map,i=new Map;let o=e.indexOf(c.V3K_BEGIN_BOND_BLOCK);o=e.indexOf("\n",o);let a=o;for(let l=0;l<t;++l){const t=new Array(3);o=e.indexOf(c.V3K_BEGIN_DATA_LINE,a)+c.V3K_IDX_SHIFT,a=e.indexOf(" ",o);for(let n=0;n<3;++n)o=a+1,a=Math.min(e.indexOf("\n",o),e.indexOf(" ",o)),t[n]=parseInt(e.slice(o,a));n[l]=t[0],s[l]=t.slice(1);const u=e.indexOf("\n",o);let h=e.slice(a,u),d=h.indexOf(c.V3K_BOND_CONFIG);if(-1!==d){d=h.indexOf("=",d)+1;let e=h.indexOf(" ",d);-1===e&&(e=h.length);const t=parseInt(h.slice(d,e));r.set(l,t);const n=c.V3K_BOND_CONFIG+t.toString();h=h.replace(n,"")}h||i.set(l,h)}return{bondTypes:n,atomPairs:s,bondConfiguration:r,kwargs:i}}(u,d.bondCount),w=function(e,t,n,s){const r={backboneShift:null,branchShift:null,terminalNodes:[],rNodes:[]};return function(e,t,n){for(const[s,r]of n)e.atomTypes[s-1]=t[r-1]}(e,n,s),function(e,t){t.rNodes=Array.from(e.keys());for(let n=0;n<t.rNodes.length;n++)for(const s of[1,2])if(e.get(t.rNodes[n])===s){const e=t.rNodes[s-1];t.rNodes[s-1]=t.rNodes[n],t.rNodes[n]=e}}(s,r),p(t,r),r}(m,g,a,l),T=function(e){let t=[],n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(");for(;-1!==n;){n+=28;const s=e.indexOf(")",n);t=t.concat(e.substring(n,s).split(" ").slice(1).map((e=>parseInt(e)))),n=s,n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(",n)}return t}(u),S={atoms:m,bonds:g,meta:w,stereoAtoms:T};return"PEPTIDE"===s?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,s=e.atoms.x,r=e.atoms.y;v(e,-s[t],-r[t]);const i=b(s[n],r[n]);A(e.atoms,-i),s[e.meta.rNodes[1]-1]<0&&function(e){C(e,!1)}(e);const o=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 s=n[e],r=n[(e+1)%2];t.has(s)?t.get(s)?.push(r):t.set(s,new Array(1).fill(r))}return t}(e);let n=0;const s=e.atoms.atomTypes.length;let r=0;for(;0===n;){const i=t.get(e.meta.terminalNodes[1])[r];if(e.atoms.atomTypes[i-1]===c.OXYGEN&&i!==e.meta.rNodes[1]&&(n=i),r++,r>s)throw new Error(`Search for double-bonded Oxygen in ${e} has exceeded the limit of ${s}`)}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,o),function(e,t){const n=e.atoms.x;n[e.meta.rNodes[1]-1]>n[t-1]&&function(e,t,n){const s=t-1,r=n-1,i=e.atoms.x,o=e.atoms.y,a=i[s],l=o[s];i[s]=i[r],o[s]=o[r],i[r]=a,o[r]=l}(e,t,e.meta.rNodes[1])}(e,o)}(S):e===c.RIBOSE||e===c.DEOXYRIBOSE?function(e,t){const n=e.atoms.x,s=e.atoms.y;let r=e.meta.terminalNodes[0]-1;const i=e.meta.rNodes[1]-1;v(e,-n[r],-s[r]);const o=b(n[i],s[i]);A(e.atoms,3*Math.PI/2-o),t.value=function(e){const t=e.atoms.x,n=e.atoms.y,s=e.meta.rNodes[2]-1,r=e.meta.terminalNodes[2]-1,i=t[s]-t[r],o=n[s]-n[r];return Math.atan(o/i)+Math.PI/2}(e),r=e.meta.terminalNodes[0]-1,v(e,-n[r],-s[r])}(S,r):e===c.PHOSPHATE?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,s=e.atoms.x,r=e.atoms.y;v(e,-s[t],-r[t]);const i=b(s[n],r[n]);A(e.atoms,Math.PI/2-i)}(S):function(e,t){const n=e.atoms.x,s=e.atoms.y,r=e.meta.terminalNodes[0]-1,i=e.meta.rNodes[0]-1;v(e,-n[r],-s[r]);const o=b(n[i],s[i]),a=t.value;if(!a)throw new Error("The value of sugarBranchToOYAngle is null");A(e.atoms,Math.PI-o+a);const l=function(e,t){return h(Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2))}({x:n[e.meta.rNodes[0]-1],y:s[e.meta.rNodes[0]-1]},{x:n[e.meta.terminalNodes[0]-1],y:s[e.meta.terminalNodes[0]-1]});if(1!=l)for(let e=0;e<n.length;++e)n[e]=h(n[e]/l),s[e]=h(s[e]/l)}(S,r),function(e,t,n){"PEPTIDE"===e?(f(t,e),y(t,t.meta.rNodes[1])):n===c.RIBOSE||n===c.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===c.PHOSPHATE&&(t.meta.terminalNodes[0]=t.meta.rNodes[0],v(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]))}(s,S,e),function(e){let t=0;for(;t<e.atoms.atomTypes.length;)e.atoms.atomTypes[t]===c.HYDROGEN&&(y(e,t+1),--t),++t}(S),S}var i;return null}(t,n,s,r,i);if(!o)throw new Error(`Monomer with symbol '${t}' is absent the monomer library`);e.set(t,o)}}function p(e,t){const n=t.rNodes;t.terminalNodes=new Array(n.length).fill(0);const s=t.terminalNodes,r=e.atomPairs;let i=0,o=0;for(;i<r.length&&o<s.length;){for(let e=0;e<s.length;++e)for(let t=0;t<2;++t)r[i][t]===n[e]&&(s[e]=r[i][(t+1)%2],n.length,++o);++i}}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[h(e.atoms.x[t]-e.atoms.x[n]),h(e.atoms.y[t]-e.atoms.y[n])]}function y(e,t){if(void 0!==t){const n=t-1,s=e.atoms,r=e.bonds,i=e.meta;s.atomTypes.splice(n,1),s.x=w(Float32Array,s.x,n,1),s.y=w(Float32Array,s.y,n,1),s.kwargs.splice(n,1);for(let e=0;e<i.terminalNodes.length;++e)i.terminalNodes[e]>t?--i.terminalNodes[e]:i.terminalNodes[e]===t&&(i.terminalNodes[e]=-1);for(let e=0;e<i.rNodes.length;++e)i.rNodes[e]>t?--i.rNodes[e]:i.rNodes[e]===t&&(i.rNodes[e]=-1);let o=0;for(;o<r.atomPairs.length;){const e=r.atomPairs[o][0],n=r.atomPairs[o][1];e===t||n===t?(r.atomPairs.splice(o,1),r.bondTypes=w(Uint32Array,r.bondTypes,o,1),r.bondConfiguration.has(o)&&r.bondConfiguration.delete(o),r.kwargs.has(o)&&r.kwargs.delete(o),--o):(r.atomPairs[o][0]=e>t?e-1:e,r.atomPairs[o][1]=n>t?n-1:n),++o}let a=Array.from(r.bondConfiguration.keys());a.forEach((e=>{if(r.bondConfiguration.has(e)&&e>n){const t=r.bondConfiguration.get(e);r.bondConfiguration.delete(e),r.bondConfiguration.set(e-1,t)}})),a=Array.from(r.kwargs.keys()),a.forEach((e=>{if(r.kwargs.has(e)&&e>n){const t=r.kwargs.get(e);r.kwargs.delete(e),r.kwargs.set(e-1,t)}}))}}function w(e,t,n,s){const r=new e(t.length-s);let i=0,o=0;for(;i<t.length;)i===n&&(i+=s),r[o]=t[i],++o,++i;return r}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 s=t/e,r=Math.atan(s);n=e<0?Math.PI/2+r:-Math.PI/2+r}return n}function A(e,t){if(0!==t){const n=e.x,s=e.y,r=Math.cos(t),i=Math.sin(t);for(let e=0;e<n.length;++e){const t=n[e];n[e]=h(t*r-s[e]*i),s[e]=h(t*i+s[e]*r)}}}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 s=1===t?3:1;n.set(e,s)}}function v(e,t,n){const s=e.atoms.x,r=e.atoms.y;for(let e=0;e<s.length;++e)s[e]=h(s[e]+t),void 0!==n&&(r[e]=h(r[e]+n))}},6137:(e,t,n)=>{"use strict";n.d(t,{J:()=>r,V:()=>i});var s=n(9976);class r extends s.B{static get Chromatogram(){return void 0===this.chromatogram&&(this.chromatogram=new r({A:"green",C:"blue",G:"black",T:"red",U:"red",others:"gray"})),this.chromatogram}}class i{}i.SemType="Nucleotides",i.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",i.Names={A:"Adenine",C:"Cytosine",G:"Guanine",T:"Thymine",U:"Uracil"}},9976:(e,t,n)=>{"use strict";n.d(t,{B:()=>s});class s{static makePalette(e,t=!1,n=s){const r={};return e.forEach((e=>{const n=e[0],s=e[1];n.forEach(((e,n)=>{r[e]=this.colourPalette[s][t?0:n]}))})),new n(r)}constructor(e){this._palette=e}get(e){return this._palette[e]}}s.undefinedColor="rgb(100,100,100)",s.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)"]}},7331:(e,t,n)=>{"use strict";n.d(t,{UE:()=>c,kQ:()=>o});var s=n(976),r=n(9976);class i{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 o{}class a extends o{get(e){return"#666666"}}class l extends o{static buildPalette(){return[].concat(...Object.values(r.B.colourPalette))}get(e){const t=i.hashCode(e)%l.palette.length;return function(e){if(null==e)return"rgb(100,100,100)";const t=s.Color.fromHtml(e),n=s.Color.g(t),r=s.Color.r(t),i=s.Color.b(t),o=Math.sqrt(Math.pow(0-r,2)+Math.pow(0-n,2)+Math.pow(0-i,2));return o>210?`rgb(${r/o*210},${n/o*210},${i/o*210})`:s.Color.toRgb(t)}(l.palette[t])}}l.palette=l.buildPalette();class c extends r.B{static get Gray(){return void 0===this.gray&&(this.gray=new a),this.gray}static get Color(){return void 0===this.color&&(this.color=new l),this.color}}},9713:(e,t,n)=>{"use strict";n.d(t,{N:()=>o,b:()=>a});var s=n(4469),r=n(701),i=n(2997);function o(e){let t=null,n=null;try{n=e.dart?e.gridColumn:null,t=n?n.temp:null}catch{[n,t]=[null,null]}const s=e.cell.column;if(t=t??s.temp,!t)throw new Error("Grid cell renderer back store (GridColumn or Column) not found.");return[n,s,t]}class a{constructor(e,t,n){this.gridCol=e,this.tableCol=t,this.logger=n,this.subs=[],this.destroyed=!1,this.viewerId=++a.viewerCounter,this.errors=[],this._onRendered=new r.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(s.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(s.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,i.zg)(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`)}}a.viewerCounter=-1},9611:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,m:()=>c});var s=n(976),r=n(6414),i=n.n(r),o=n(8607),a=n(9713),l=n(7228);function c(e,t){let n,s=100,r=0,i=e.length-1;for(;r<=i;){if(n=Math.floor((i+r)/2),e[n]<=t&&t<e[n+1])return n;if(t<e[n]?i=n-1:r=n+1,--s<=0)throw new Error(`Get position for pointer x = ${t} searching has not converged on ${JSON.stringify(e)}. `)}return null}class u extends a.b{get updated(){return this._updated}constructor(e,t,n,r){super(e,t,n),this.propsProvider=r,this._monomerLengthList=null,this.separatorWidth=5,this._processedMaxVisibleSeqLength=0,this._updated=!1,this._monomerLengthMap={},this._monomerStructureMap={},this.props=this.propsProvider(),this._processedRows=s.BitSet.create(this.tableCol.length),this.gridCol&&this.subs.push(this.gridCol.grid.onAfterDrawContent.subscribe((()=>{this._onRendered.next()}))),(0,l.JN)().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=s.BitSet.create(this.tableCol.length),this._monomerLengthList=null,this._monomerLengthMap={},this._monomerStructureMap={}}getCellMonomerLengths(e,t){const n=this.props.seqHandler.isMsa()?this.getCellMonomerLengthsForSeqMsa(t):this.getCellMonomerLengthsForSeq(e,t),s=new Array(n.length+1);s[0]=5;for(let e=1;e<s.length;e++)s[e]=s[e-1]+n[e-1];return[n,s]}getCellMonomerLengthsForSeq(e,t){null===this._monomerLengthList&&(this._monomerLengthList=new Array(this.tableCol.length).fill(null),this._updated=!0);const n=this.props.separatorWidth+1*this.props.monomerCharWidth,s=Math.ceil(t/n),r=o.g.forColumn(this.tableCol).getSplitted(e).originals,i=Math.min(s,r.length);let a=this._monomerLengthList[e];if(null===a||a.length<i){a=this._monomerLengthList[e]=new Array(r.length);let n=0;for(let e=0;e<i;++e){const s=r[e],i=this.props.monomerToShort(s,this.props.monomerLengthLimit),o=(this.props.seqHandler.isSeparator()?this.separatorWidth:this.props.separatorWidth)+i.length*this.props.monomerCharWidth;if(a[e]=o,n+=o,n>t)break}this._updated=!0}return a}getCellMonomerLengthsForSeqMsa(e){var t;null===this._monomerLengthList&&(this._monomerLengthList=new Array(1).fill(null),this._updated=!0),(t=this._monomerLengthList)[0]??(t[0]=new Array(0));const n=this._monomerLengthList[0],{startIdx:s,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)}}})(),i=this.props.separatorWidth+1*this.props.monomerCharWidth,a=Math.ceil(e/i);for(let t=s;t<r;t++){if(this._processedRows.get(t)&&a<=this._processedMaxVisibleSeqLength)continue;const s=o.g.forColumn(this.tableCol).getSplitted(t,a).originals,r=Math.min(a,s.length);r>n.length&&n.push(...new Array(r-n.length).fill(i));let l=0;for(let t=0;t<r;++t){const r=s[t],i=this.props.monomerToShort(r,this.props.monomerLengthLimit),o=this.props.separatorWidth+i.length*this.props.monomerCharWidth;if(n[t]=Math.max(n[t]??0,o),l+=o,l>=e)break}this._updated=!0,this._processedMaxVisibleSeqLength=Math.max(this._processedMaxVisibleSeqLength,a)}return n}getPosition(e,t,n){const[s,r]=this.getCellMonomerLengths(e,n),a=o.g.forColumn(this.tableCol);return 0===i()(a.getSplitted(e).originals).toArray().length?null:c(r,t)}setMonomerLengthLimit(e){this.props.monomerLengthLimit=e,this._updated=!0}setSeparatorWidth(e){this.props.separatorWidth=e,this._updated=!0}isMsa(){return this.props.seqHandler.isMsa()}}},1047:(e,t,n)=>{"use strict";n.d(t,{$3:()=>r,pU:()=>i,rx:()=>s});const s=["symbol","molfile","rgroups","name"],r="p",i=new RegExp(`[rd]\\((\\w)\\)${r}?`,"g")},7945:(e,t,n)=>{"use strict";function s(e){return"string"==typeof e||e instanceof String?e:"StateError"===e.constructor.name?e.message:"StateError"===e.constructor.name&&"$thrownJsError"in e?s(e.$thrownJsError):e instanceof Error?e.message:e.toString()}function r(e){return e instanceof Error?e.stack:"StateError"===e.constructor.name&&"$thrownJsError"in e?r(e.$thrownJsError):void 0}function i(e){return[s(e),r(e)]}n.d(t,{yf:()=>i})},5226:(e,t,n)=>{"use strict";n.d(t,{i:()=>o});var s=n(976),r=n(8607),i=n(1821);class o{get descriptionsArray(){return this._descriptionsArray}get sequencesArray(){return this._sequencesArray}parseMacromolecule(e,t){return this._fileContent.slice(e,t).split(/\s/).join("")}parseColumns(){const e=/^>(.*)$/gm;let t,n=0;for(;t=e.exec(this._fileContent);){const s=this._fileContent.substring(t.index+1,e.lastIndex);this._descriptionsArray.push(s),0!==n&&this._sequencesArray.push(this.parseMacromolecule(n,t.index)),n=e.lastIndex+1}this._sequencesArray.push(this.parseMacromolecule(n,-1))}importFasta(){const e=s.Column.fromStrings("description",this.descriptionsArray),t=s.Column.fromStrings("sequence",this.sequencesArray);return t.semType=s.SEMTYPE.MACROMOLECULE,t.setTag(s.TAGS.UNITS,i.r2.FASTA),r.g.forColumn(t),[s.DataFrame.fromColumns([e,t])]}constructor(e){this._descriptionsArray=[],this._sequencesArray=[],this._fileContent=e,this.parseColumns()}}},706:(e,t,n)=>{"use strict";n.d(t,{Ug:()=>i,io:()=>o});var s=n(976),r=n(8447);function i(){const e=[];return e.push(s.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(s.Column.fromList(s.COLUMN_TYPE.FLOAT,"Activity",new Array(10**6).fill(5.30751))),e}function o(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=s.Column.fromList(s.COLUMN_TYPE.STRING,"MSA",new Array(100).fill(t));n.semType=s.SEMTYPE.MACROMOLECULE,n.setTag(s.TAGS.UNITS,r.r2.SEPARATOR),n.setTag("separator","/"),n.setTag("alphabet","UN"),n.setTag(".alphabetIsMultichar","true");const i=[];return i.push(n),i.push(s.Column.fromList(s.COLUMN_TYPE.FLOAT,"Activity",new Array(100).fill(7.30751))),i}n(6414),n(8607),n(8260)},1821:(e,t,n)=>{"use strict";n.d(t,{BM:()=>o,CI:()=>i,XS:()=>l,r2:()=>s,se:()=>a});var s,r=n(6286);!function(e){e.FASTA="fasta",e.SEPARATOR="separator",e.HELM="helm"}(s||(s={}));const i=", ",o=/(?:\[([A-Za-z0-9_\-,()]+)\])|([A-Za-z\-])/g,a=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"])}}},l=[new r.LA("PT",a.fasta.peptide,.5),new r.LA("DNA",a.fasta.dna,.55),new r.LA("RNA",a.fasta.rna,.55)]},8447:(e,t,n)=>{"use strict";n.d(t,{Ar:()=>r.Ar,CI:()=>s.CI,GU:()=>r.GU,KX:()=>r.KX,XS:()=>s.XS,dQ:()=>r.dQ,gM:()=>r.gM,gP:()=>r.gP,kB:()=>r.kB,py:()=>r.py,r2:()=>s.r2,up:()=>r.up});var s=n(1821),r=n(8260)},6286:(e,t,n)=>{"use strict";n.d(t,{G2:()=>s,LA:()=>r,dJ:()=>i});const s="";class r{constructor(e,t,n){this.name=e,this.alphabet=t,this.cutoff=n}}class i extends r{constructor(e,t,n){super(e.name,e.alphabet,e.cutoff),this.freq=t,this.similarity=n}}},8260:(e,t,n)=>{"use strict";n.d(t,{wx:()=>p,w4:()=>P,gM:()=>_,KX:()=>x,py:()=>N,vU:()=>T,Ar:()=>b,jY:()=>g,GU:()=>E,dQ:()=>$,up:()=>M,kB:()=>y,FJ:()=>w,gP:()=>v});var s=n(976),r=n(6414),i=n.n(r),o=n(6286),a=n(1821),l=n(8607);class c extends Float32Array{}var u=n(850),h=n(2012),d=n(6137),m=n(7331);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)===l.lh[a.r2.FASTA]}getCanonical(e){if(this.length<=e)throw new Error("Index out of bounds");return this.isGap(e)?o.G2: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 s=e.categories;return function(e,t){const n={};let s=!0,r=null;for(const i of e)if(null==r?r=i.length:i.length!==r&&(s=!1),i.length>=t)for(const e of i.canonicals)e in n||(n[e]=0),n[e]+=1;return{freq:n,sameLength:s}}(i().enumerate(e.getRawData()).map((([e,t])=>n(s[e]))),t)}const y=e=>{const t=i()(e.toString().matchAll(a.BM)).map((e=>e[2]??e[1])).toArray();return new p(t,l.lh[a.r2.FASTA])},w=e=>e?new f(e):new p([],l.lh[a.r2.FASTA]);function b(e,t=undefined){return n=>{if(n){let s;const r=new RegExp(String.raw`"-"|'-'|[^${e}]+`,"g");if(void 0!==t){r.lastIndex=0,s=new Array(Math.ceil(t));let e=null,i=0;for(;null!==(e=r.exec(n))&&i<t;)s[i++]=e[0].replace('"-"',"").replace("'-'","");s.splice(i)}else s=n.replaceAll('"-"',"").replaceAll("'-'","").split(e,t);return new p(s,l.lh[a.r2.SEPARATOR])}return new p([],l.lh[a.r2.SEPARATOR])}}const A=/(PEPTIDE1|DNA1|RNA1)\{([^}]+)}/g,C=/\[([^\[\]]+)]/g,v=e=>{A.lastIndex=0;const t=A.exec(e.toString()),n=t?t[2]:null,s=n?n.split("."):[];return new p(s.map((e=>{C.lastIndex=0;const t=C.exec(e);return t&&t.length>=2?t[1]:e})),l.lh[a.r2.HELM])};function T(e,t,n=undefined){if(e.toLowerCase().startsWith(a.r2.FASTA))return y;if(e.toLowerCase().startsWith(a.r2.SEPARATOR))return b(t,n);if(e.toLowerCase().startsWith(a.r2.HELM))return v;throw new Error(`Unexpected units ${e} .`)}const S=/([^\W_]+)/g;function E(e,t){if(e.length<=t)return e;const n=e.match(S),s=e.length>t||(n?.length??0)>1,r=n?.[0]??" ";return s?r.substring(0,t-1)+"…":r}function _(e){switch(e){case"DNA":return a.se.fasta.dna;case"RNA":return a.se.fasta.rna;case"PT":return a.se.fasta.peptide;default:throw new Error(`Unsupported alphabet '${e}'.`)}}function x(e,t,n="-"){const s=new Set([...new Set(Object.keys(e)),...t]);s.delete(n);const r=[],i=[];for(const n of s)r.push(n in e?e[n]:0),i.push(t.has(n)?1:0);const o=new c(r),a=new c(i);return(0,u.MA)(o,a)/((0,u.$G)(o)*(0,u.$G)(a))}function P(e,t,n="-"){const s=t.map((t=>{const s=x(e,t.alphabet,n);return new o.dJ(t,e,s)}));let r;const i=Math.max(...s.map((e=>e.similarity>e.cutoff?e.similarity:-1)));return r=i>0?s.find((e=>e.similarity===i)).name:"UN",r}function $(e,t=5){let n;return n=e.semType==s.SEMTYPE.MACROMOLECULE?l.g.forColumn(e).alphabet:P(g(e,t,y).freq,a.XS),N(n)}function N(e){switch(e){case"PT":return h.f.GrokGroups;case"DNA":case"RNA":return d.J.Chromatogram;default:return m.UE.Color}}function M(e){const t=e.columns.bySemTypeAll(s.SEMTYPE.MACROMOLECULE);let n=t.find((e=>{const t=e.getTag(s.TAGS.UNITS);return!!t&&-1!==t.indexOf("MSA")}))??null;return!n&&t.length>0&&(n=t[0]),n}},8607:(e,t,n)=>{"use strict";n.d(t,{g:()=>p,lh:()=>m});var s=n(976),r=n(6414),i=n.n(r),o=n(8447),a=n(6286),l=n(8260),c=n(708),u=n(7228),h=n(1047);const d=new class{constructor(){this.seqHandler="seq-handler",this.notationProvider="seq-handler.notation-provider"}},m={[o.r2.FASTA]:"-",[o.r2.SEPARATOR]:"",[o.r2.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!==s.TYPE.STRING)throw new Error(`Unexpected column type '${e.type}', must be '${s.TYPE.STRING}'.`);this._column=e;const t=this._column.getTag(s.TAGS.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[o.r2.FASTA]:this.isHelm()?m[o.r2.HELM]:m[o.r2.SEPARATOR],!this.column.tags.has("aligned")||!this.column.tags.has("alphabet")||!this.column.tags.has(".alphabetIsMultichar")&&!this.isHelm()&&"UN"===this.alphabet)if(this.isFasta())p.setUnitsToFastaColumn(this);else if(this.isSeparator()){const t=e.getTag("separator");p.setUnitsToSeparatorColumn(this,t)}else{if(!this.isHelm())throw new Error(`Unexpected units '${this.column.getTag(s.TAGS.UNITS)}'.`);p.setUnitsToHelmColumn(this)}if(!this.column.tags.has(".alphabetIsMultichar"))if(this.isHelm())this.column.setTag(".alphabetIsMultichar","true");else if(["UN"].includes(this.alphabet))throw new Error(`For column '${this.column.name}' of alphabet '${this.alphabet}' tag '.alphabetIsMultichar' is mandatory.`);this.notationProvider=this.column.temp[d.notationProvider]??null,this.columnVersion=this.column.version}static setUnitsToFastaColumn(e){if(e.column.semType!==s.SEMTYPE.MACROMOLECULE||e.column.getTag(s.TAGS.UNITS)!==o.r2.FASTA)throw new Error(`The column of notation '${o.r2.FASTA}' must be '${s.SEMTYPE.MACROMOLECULE}'.`);e.column.setTag(s.TAGS.UNITS,o.r2.FASTA),p.setTags(e)}static setUnitsToSeparatorColumn(e,t){if(e.column.semType!==s.SEMTYPE.MACROMOLECULE||e.column.getTag(s.TAGS.UNITS)!==o.r2.SEPARATOR)throw new Error(`The column of notation '${o.r2.SEPARATOR}' must be '${s.SEMTYPE.MACROMOLECULE}'.`);if(!t)throw new Error(`The column of notation '${o.r2.SEPARATOR}' must have the separator tag.`);e.column.setTag(s.TAGS.UNITS,o.r2.SEPARATOR),e.column.setTag("separator",t),p.setTags(e)}static setUnitsToHelmColumn(e){if(e.column.semType!==s.SEMTYPE.MACROMOLECULE)throw new Error(`The column of notation '${o.r2.HELM}' must be '${s.SEMTYPE.MACROMOLECULE}'`);e.column.setTag(s.TAGS.UNITS,o.r2.HELM),p.setTags(e)}static setTags(e){const t=e.column.getTag(s.TAGS.UNITS);if([o.r2.FASTA,o.r2.SEPARATOR].includes(t)){if(!e.column.getTag("alphabet")&&0===Object.keys(e.stats.freq).length)throw new Error("Alphabet is empty and not annotated.");let t=e.column.getTag("aligned");null===t&&(t=e.stats.sameLength?"SEQ.MSA":"SEQ",e.column.setTag("aligned",t));let n=e.column.getTag("alphabet");if(null===n&&(n=(0,l.w4)(e.stats.freq,o.XS),e.column.setTag("alphabet",n)),"UN"===n){const t=Object.keys(e.stats.freq).length,n=Object.keys(e.stats.freq).some((e=>e.length>1));e.column.setTag(".alphabetSize",t.toString()),e.column.setTag(".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("separator")??void 0;if(this.notation===o.r2.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("aligned");if(!e&&(this.isFasta()||this.isSeparator()))throw new Error("Tag aligned not set");return e}get alphabet(){const e=this.column.getTag("alphabet");if(!e&&(this.isFasta()||this.isSeparator()))throw new Error("Tag alphabet not set");return e}get helmCompatible(){return this.column.getTag(".isHelmCompatible")}getAlphabetSize(){if(this.notation==o.r2.HELM||"UN"==this.alphabet){const e=this.column.getTag(".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"PT":return 20;case"DNA":case"RNA":return 4;case"NT":return console.warn("Unexpected alphabet 'NT'."),4;default:throw new Error(`Unexpected alphabet '${this.alphabet}'.`)}}getAlphabetIsMultichar(){return this.notation===o.r2.HELM||"UN"===this.alphabet&&"true"===this.column.getTag(".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 s=this.column.length;for(let r=0;r<s;++r){const s=this.getSplitted(r);null==n?n=s.length:s.length!==n&&(t=!1);for(const t of s.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(...i().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(".positionNames");this._posList=e?e.split(o.CI).map((e=>e.trim())):i().count(1).take(this.maxLength).map((e=>e.toString())).toArray()}return this._posList}isFasta(){return this.notation===o.r2.FASTA}isSeparator(){return this.notation===o.r2.SEPARATOR}isHelm(){return this.notation===o.r2.HELM}isRna(){return"RNA"===this.alphabet}isDna(){return"DNA"===this.alphabet}isPeptide(){return"PT"===this.alphabet}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(o.r2.FASTA))return o.r2.FASTA;if(this.units.toLowerCase().startsWith(o.r2.SEPARATOR))return o.r2.SEPARATOR;if(this.units.toLowerCase().startsWith(o.r2.HELM))return o.r2.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,r){const i=this.column,a=e.toLowerCase()+"("+i.name+")",l=n??i.dataFrame.columns.getUnusedName(a),c=s.Column.fromList("string",l,r??new Array(this.column.length).fill(""));if(c.semType=s.SEMTYPE.MACROMOLECULE,c.setTag(s.TAGS.UNITS,e),e===o.r2.SEPARATOR){if(!t)throw new Error(`Notation '${o.r2.SEPARATOR}' requires separator value.`);c.setTag("separator",t)}c.setTag(s.TAGS.CELL_RENDERER,"sequence");const u=i.getTag("aligned");u&&c.setTag("aligned",u);let h=i.getTag("alphabet");h||this.notation!==o.r2.HELM||e===o.r2.HELM||(h="UN"),null!=h&&c.setTag("alphabet",h);let d=i.getTag(".alphabetSize");null!=h&&d&&c.setTag(".alphabetSize",d);const m=i.getTag(".alphabetIsMultichar");return null!=h&&void 0!==m&&c.setTag(".alphabetIsMultichar",m),e==o.r2.HELM&&(d=this.getAlphabetSize().toString(),c.setTag(".alphabetSize",d)),c}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(),[o.r2.FASTA,o.r2.SEPARATOR,o.r2.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 r=s.Column.fromList("string",t,new Array(e).fill(""));return r.semType=s.SEMTYPE.MACROMOLECULE,r.setTag(s.TAGS.UNITS,n),r}getSplitter(e){let t=null;if(t=this.notationProvider?this.notationProvider.splitter:null,t)return t;if(this.units.toLowerCase().startsWith(o.r2.FASTA))return null===this.column.getTag("alphabet")||this.getAlphabetIsMultichar()?o.kB:l.FJ;if(this.units.toLowerCase().startsWith(o.r2.SEPARATOR))return(0,o.Ar)(this.separator,e);if(this.units.toLowerCase().startsWith(o.r2.HELM))return o.gP;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");return this.isMsa()?c.U.HAMMING:(this.alphabet,c.U.LEVENSHTEIN)}getDistanceFunction(){return c.o[this.getDistanceFunctionName()]()}async checkHelmCompatibility(){if(this.column.tags.has(".isHelmCompatible"))return"true"===this.column.getTag(".isHelmCompatible");const e=(await(0,u.JN)()).getBioLib().getMonomerSymbolsByType("PEPTIDE"),t=new Set(e),n=((0,o.Ar)(this.separator),new Set),s=this.column.length,r=this.column.getRawData();for(let e=0;e<s;++e){const s=r[e];if(!(s in n)){n.add(s);const r=this.getSplitted(e);for(const e of r.canonicals)if(!t.has(e))return this.column.setTag(".isHelmCompatible","false"),!1}}return this.column.setTag(".isHelmCompatible","true"),!0}get splitter(){return null===this._splitter&&(this._splitter=this.getSplitter()),this._splitter}toFasta(e){return e===o.r2.FASTA}toSeparator(e){return e===o.r2.SEPARATOR}toHelm(e){return e===o.r2.HELM}convertHelmToFastaSeparator(e,t,n,s){s||(s=this.toFasta(t)?m[o.r2.FASTA]:m[o.r2.SEPARATOR]),n||(n=this.toFasta(t)?"":this.separator);const r=e.startsWith("RNA"),i=this.splitter(e),a=[];for(let e=0;e<i.length;++e){let n=i.getOriginal(e);if(r&&(n=n.replace(h.pU,"")),n===m[o.r2.HELM])a.push(s);else if(this.toFasta(t)&&n.length>1){const e="["+n+"]";a.push(e)}else a.push(n)}return a.join(n)}convert(e,t){const n=this.getJoiner({notation:e,separator:t}),s=this.getNewColumn(e,t);return s.init((e=>{const t=this.getSplitted(e);return n(t)})),s}getRegion(e,t,n){const s=this.getNewColumn(this.notation,this.separator);s.name=n;const r=e??0,i=t??this.maxLength-1,a=this.getJoiner(),c=i-r+1,u=m[this.notation];s.init((e=>{const t=this.getSplitted(e),n=new Array(c);for(let e=0;e<c;++e){const s=r+e;n[e]=s<t.length?t.getOriginal(s):u}return a(new l.wx(n,u))}));const h=e=>{const t=e.split(",").map((e=>e.trim())),n=new Array(c);for(let e=0;e<c;++e){const s=r+e;n[e]=s<t.length?t[s]:"?"}return n.join(o.CI)},d=this.column.getTag(".positionNames");d&&s.setTag(".positionNames",h(d));const p=this.column.getTag(".positionLabels");return p&&s.setTag(".positionLabels",h(p)),s}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 s;const r=this;switch(t){case o.r2.FASTA:s=function(e){return r.joinToFasta(e,r.isHelm())};break;case o.r2.SEPARATOR:if(!n)throw new Error(`Separator is mandatory for notation '${t}'.`);s=function(e){return f(e,n,r.isHelm())};break;case o.r2.HELM:{const e="DNA"===r.alphabet||"RNA"===r.alphabet,t=r.getHelmWrappers();s=function(n){return g(n,t,e)};break}default:throw new Error(`Unexpected notation '${t}'.`)}return s}getConverter(e,t=undefined){if(e===o.r2.SEPARATOR&&!t)throw new Error(`Target separator is not specified for target units '${o.r2.SEPARATOR}'.`);const n=this;if(e===o.r2.FASTA)return function(e){return n.convertToFasta(e)};if(e===o.r2.HELM)return function(e){return n.convertToHelm(e)};if(e===o.r2.SEPARATOR)return function(e){return n.convertToSeparator(e,t)};throw new Error}static forColumn(e){let t=e.temp[d.seqHandler];return t&&t.columnVersion===e.version||(t=e.temp[d.seqHandler]=new p(e)),t}joinToFasta(e,t){const n=new Array(e.length);for(let s=0;s<e.length;++s){const r=e.getOriginal(s);let i=e.getOriginal(s);t&&(i=i.replace(h.pU,"$1")),r===a.G2?i=m[o.r2.FASTA]:r===h.$3?i="":i.length>1&&(i="["+i+"]"),n[s]=i}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),s=e.startsWith("DNA"),r=e.startsWith("RNA");for(let e=0;e<t.length;++e){let i=t.getOriginal(e);(s||r)&&(i=i.replace(h.pU,"$1"),i=i===h.$3?null:i),n[e]=i||null}return new l.wx(n.filter((e=>!!e)),m[o.r2.HELM])}}function f(e,t,n){const s=new Array(e.length);for(let t=0;t<e.length;++t){const r=e.getCanonical(t);let i=e.getOriginal(t);n&&(i=i.replace(h.pU,"$1")),r===a.G2?i=m[o.r2.SEPARATOR]:r===h.$3&&(i=""),s[t]=i}return s.join(t)}function g(e,t,n){const[s,r,i,l]=t,c=new Array(e.length);for(let t=0;t<e.length;++t){const s=e.getCanonical(t);let l=e.getOriginal(t);s===a.G2?l=m[o.r2.HELM]:(n&&(l=l.replace(h.pU,"$1")),l=1===l.length?`${r}${l}${i}`:`${r}[${l}]${i}`),c[t]=l}return`${s}${c.join(".")}${l}`}},8457:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});var s=n(976),r=n(8607);function i(e){const t=e=>{const t=o.columns.addNewString((e+1).toString());return n.push(t),t},n=[],i=e.length,o=s.DataFrame.create(i),a=r.g.forColumn(e);for(let e=0;e<i;++e){const s=a.getSplitted(e);for(let r=0;r<s.length;++r){const i=s.getOriginal(r);((n[r]??null)||t(r)).set(e,i,!1)}}return o}},172:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var s,r=n(7945);!function(e){e[e.error=0]="error",e[e.warning=1]="warning",e[e.info=2]="info",e[e.debug=3]="debug"}(s||(s={}));class i{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[s,i]=(0,r.yf)(t);this.logger.error(`${e}, SYNC syncId = ${n}, ERROR:\n${s}`,void 0,i),this.errors.push(t)}))}resetErrors(){const e=this.errors;return this.errors=[],e}}},9298:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>l,DX:()=>s,ES:()=>r,dE:()=>a,iD:()=>o,vS:()=>u,vw:()=>i});var s,r,i,o,a,l,c=n(976);!function(e){e.tooltipWebLogo=".tooltipWebLogo"}(s||(s={})),function(e){e.Entropy="Entropy",e.full="100%"}(r||(r={})),function(e){e.TOP="top",e.MIDDLE="middle",e.BOTTOM="bottom"}(i||(i={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(o||(o={})),function(e){e.AUTO="auto",e.ON="on",e.OFF="off"}(a||(a={})),function(e){e.Filtered="Filtered",e.Selected="Selected"}(l||(l={}));const u=new class{constructor(){this.sequenceColumnName=null,this.valueAggrType=c.AGG.TOTAL_COUNT,this.valueColumnName="Activity",this.startPositionName=null,this.endPositionName=null,this.skipEmptySequences=!0,this.skipEmptyPositions=!1,this.shrinkEmptyTail=!0,this.backgroundColor=4294967295,this.positionHeight=r.Entropy,this.positionWidth=16,this.verticalAlignment=i.MIDDLE,this.horizontalAlignment=o.CENTER,this.fixWidth=!1,this.fitArea=!0,this.minHeight=50,this.maxHeight=100,this.showPositionLabels=!0,this.positionMarginState=a.AUTO,this.positionMargin=0,this.filterSource=l.Filtered}}},7905:(e,t,n)=>{"use strict";e=n.hmd(e);var s,r=(s="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){var t,n,r=void 0!==e?e:{};r.ready=new Promise((function(e,s){t=e,n=s}));var i,o=Object.assign({},r),a="object"==typeof window,l="function"==typeof importScripts,c=("object"==typeof process&&"object"==typeof process.versions&&process.versions.node,"");(a||l)&&(l?c=self.location.href:"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),s&&(c=s),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"",l&&(i=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)})),r.print||console.log.bind(console);var u,h,d=r.printErr||console.warn.bind(console);Object.assign(r,o),o=null,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.quit&&r.quit,r.wasmBinary&&(u=r.wasmBinary),r.noExitRuntime,"object"!=typeof WebAssembly&&S("no native wasm support detected");var m,p,f,g=!1;function y(){var e=h.buffer;r.HEAP8=m=new Int8Array(e),r.HEAP16=new Int16Array(e),r.HEAP32=new Int32Array(e),r.HEAPU8=p=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=f=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}var w=[],b=[],A=[],C=0,v=null,T=null;function S(e){r.onAbort&&r.onAbort(e),d(e="Aborted("+e+")"),g=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var E,_,x="data:application/octet-stream;base64,";function P(e){return e.startsWith(x)}function $(e){try{if(e==E&&u)return new Uint8Array(u);if(i)return i(e);throw"both async and sync fetching of the wasm failed"}catch(e){S(e)}}function N(e,t,n){return function(e){return u||!a&&!l||"function"!=typeof fetch?Promise.resolve().then((function(){return $(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 $(e)}))}(e).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(n,(function(e){d("failed to asynchronously prepare wasm: "+e),S(e)}))}function M(e){for(;e.length>0;)e.shift()(r)}function L(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(W(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=h.buffer;try{return h.grow(e-t.byteLength+65535>>>16),y(),1}catch(e){}}function R(e){return r["_"+e]}P(E="wasmDbscan.wasm")||(_=E,E=r.locateFile?r.locateFile(_,c):c+_);var O="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function F(e,t,n,s,r){var i={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 s=e.charCodeAt(n);s<=127?t++:s<=2047?t+=2:s>=55296&&s<=57343?(t+=4,++n):t+=3}return t}(e)+1,n=H(t);return function(e,t,n){!function(e,t,n,s){if(!(s>0))return 0;for(var r=n+s-1,i=0;i<e.length;++i){var o=e.charCodeAt(i);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),o<=127){if(n>=r)break;t[n++]=o}else if(o<=2047){if(n+1>=r)break;t[n++]=192|o>>6,t[n++]=128|63&o}else if(o<=65535){if(n+2>=r)break;t[n++]=224|o>>12,t[n++]=128|o>>6&63,t[n++]=128|63&o}else{if(n+3>=r)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63,t[n++]=128|o>>6&63,t[n++]=128|63&o}}t[n]=0}(e,p,t,n)}(e,n,t),n}(e)),t},array:e=>{var t,n,s=H(e.length);return t=e,n=s,m.set(t,n),s}},o=R(e),a=[],l=0;if(s)for(var c=0;c<s.length;c++){var u=i[n[c]];u?(0===l&&(l=D()),a[c]=u(s[c])):a[c]=s[c]}var h=o.apply(null,a);return function(e){return 0!==l&&B(l),function(e){return"string"===t?(n=e)?function(e,t,n){for(var s=t+n,r=t;e[r]&&!(r>=s);)++r;if(r-t>16&&e.buffer&&O)return O.decode(e.subarray(t,r));for(var i="";t<r;){var o=e[t++];if(128&o){var a=63&e[t++];if(192!=(224&o)){var l=63&e[t++];if((o=224==(240&o)?(15&o)<<12|a<<6|l:(7&o)<<18|a<<12|l<<6|63&e[t++])<65536)i+=String.fromCharCode(o);else{var c=o-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&o)<<6|a)}else i+=String.fromCharCode(o)}return i}(p,n,s):"":"boolean"===t?Boolean(e):e;var n,s}(e)}(h)}var k,G={__cxa_throw:function(e,t,n){throw new L(e).init(t,n),e},abort:function(){S("")},emscripten_memcpy_big:function(e,t,n){p.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=p.length,s=2147483648;if((e>>>=0)>s)return!1;for(var r=1;r<=4;r*=2){var i=n*(1+.2/r);if(i=Math.min(i,e+100663296),I(Math.min(s,(t=Math.max(e,i))+(65536-t%65536)%65536)))return!0}return!1}},D=(function(){var e,t,s,i,o={env:G,wasi_snapshot_preview1:G};function a(e,t){var n,s=e.exports;return r.asm=s,h=r.asm.memory,y(),r.asm.__indirect_function_table,n=r.asm.__wasm_call_ctors,b.unshift(n),function(e){if(C--,r.monitorRunDependencies&&r.monitorRunDependencies(C),0==C&&(null!==v&&(clearInterval(v),v=null),T)){var t=T;T=null,t()}}(),s}if(C++,r.monitorRunDependencies&&r.monitorRunDependencies(C),r.instantiateWasm)try{return r.instantiateWasm(o,a)}catch(e){d("Module.instantiateWasm callback failed with error: "+e),n(e)}(e=u,t=E,s=o,i=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||P(t)||"function"!=typeof fetch?N(t,s,i):fetch(t,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,s).then(i,(function(e){return d("wasm streaming compile failed: "+e),d("falling back to ArrayBuffer instantiation"),N(t,s,i)}))}))).catch(n)}(),r._dbscan=function(){return(r._dbscan=r.asm.dbscan).apply(null,arguments)},r._malloc=function(){return(r._malloc=r.asm.malloc).apply(null,arguments)},r._free=function(){return(r._free=r.asm.free).apply(null,arguments)},function(){return(D=r.asm.stackSave).apply(null,arguments)}),B=function(){return(B=r.asm.stackRestore).apply(null,arguments)},H=function(){return(H=r.asm.stackAlloc).apply(null,arguments)},W=function(){return(W=r.asm.__cxa_is_pointer_type).apply(null,arguments)};function V(){function e(){k||(k=!0,r.calledRun=!0,g||(M(b),t(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)e=r.postRun.shift(),A.unshift(e);var e;M(A)}()))}C>0||(function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)e=r.preRun.shift(),w.unshift(e);var e;M(w)}(),C>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),e()}),1)):e()))}if(r.ccall=F,r.cwrap=function(e,t,n,s){var r=!n||n.every((e=>"number"===e||"boolean"===e));return"string"!==t&&r&&!s?R(e):function(){return F(e,t,n,arguments)}},T=function e(){k||V(),k||(T=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return V(),e.ready});"object"==typeof exports?e.exports=r:"function"==typeof define&&n.amdO?define([],(function(){return r})):"object"==typeof exports&&(exports.exportCppDbscanLib=r)},5697:(e,t,n)=>{"use strict";n.d(t,{Dz:()=>w,FV:()=>c,Jv:()=>T,KR:()=>l,MI:()=>A,NB:()=>p,UX:()=>m,WI:()=>d,Zd:()=>h,_h:()=>u,aW:()=>g,bX:()=>v,fX:()=>b,kg:()=>o,s:()=>f,yU:()=>y});var s=n(9657),r=n(1040),i=n(708);r.gk.Tanimoto,r.gk.Dice,r.gk.Asymmetric,r.gk.BraunBlanquet,r.gk.Cosine,r.gk.Kulczynski,r.gk.McConnaughey,r.gk.RogotGoldberg,r.gk.Russel,r.gk.Sokal,r.gk.Hamming,r.gk.Euclidean,r.gk.Tanimoto,r.gk.Dice,r.gk.Asymmetric,r.gk.BraunBlanquet,r.gk.Cosine,r.gk.Kulczynski,r.gk.McConnaughey,r.gk.RogotGoldberg,r.gk.Russel,r.gk.Sokal,r.gk.Hamming,r.gk.Euclidean;const o=[r.gk.Tanimoto,r.gk.Dice,r.gk.Cosine];function a(e,t){const n=e.trueCount()+t.trueCount();if(0==n)return 1;const s=e.andWithCountBits(t,!0);return s/(n-s)}function l(e,t){return 1-a(e,t)}function c(e,t){return C(a(new s.Z(e,32*e.length),new s.Z(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 h(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 d(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(),s=e.andWithCountBits(t,!0);return s/(2*n-3*s)}(e,t)}function f(e,t){return C(function(e,t){const n=e.trueCount()+t.trueCount(),s=e.trueCount()*t.trueCount();return 0==s?0:e.andWithCountBits(t,!0)*n/(2*s)}(e,t))}function g(e,t){return C(function(e,t){const n=e.trueCount()+t.trueCount(),s=e.trueCount()*t.trueCount();return 0==s?0:(e.andWithCountBits(t,!0)*n-s)/s}(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),s=e.countBits(!0)+t.countBits(!0),r=e.length,i=r-s+n;return n==r||i==r?1:n/s+i/(2*r-s)}(e,t))}function C(e){return 0===e?3402823e32:1/e-1}function v(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 T(e){const t=function(e){const t=e?.mostCommon??new Set;return(e,n)=>{const s=e.length,r=n.length;let i=0,o=0,a=0;for(;o<s&&a<r;)e[o]===n[a]?(t?.has(e[o])||++i,++o,++a):e[o]<n[a]?++o:++a;return i}}(e);return(e,n)=>0===n.length||0===e.length?1e4:Math.min(e.length,n.length)/(t(e,n)+1e-4)}r.gk.Tanimoto,r.gk.Asymmetric,r.gk.Cosine,r.gk.Sokal,i.U.HAMMING,i.U.LEVENSHTEIN,i.U.MONOMER_CHEMICAL_DISTANCE,i.U.NEEDLEMANN_WUNSCH},3277:(e,t,n)=>{"use strict";n.d(t,{Ec:()=>r,sS:()=>s});const s="bypassLargeDataWarning",r="show-scatterplot-progress"},708:(e,t,n)=>{"use strict";function s(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,s=Math.min(...Object.keys(t).map((e=>e.charCodeAt(0))))+1,r=new Float32Array((n.length+s)*(n.length+s));return Object.entries(t).forEach((([e,s])=>{const i=n[s];Object.entries(t).forEach((([t,s])=>{r[e.charCodeAt(0)*n.length+t.charCodeAt(0)]=i[s]}))})),(e,t)=>1-r[e.charCodeAt(0)*n.length+t.charCodeAt(0)]}(),n=e?.threshold??0;return(e,s)=>{let r=0;const i=e.length,o=s.length,a=Math.ceil(Math.max(i,o)*(1-n));i!==o&&(r=Math.abs(i-o));let l=0;for(let n=0;n<Math.min(i,o);n++)if(e[n]!==s[n]&&(l+=t(e[n],s[n]),l>a))return 1;return l+=r,l/=Math.max(i,o),l}}n.d(t,{U:()=>o,o:()=>a});var r=n(1811);const i={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 o;!function(e){e.HAMMING="Hamming",e.LEVENSHTEIN="Levenshtein",e.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",e.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(o||(o={}));const a={[o.HAMMING]:s,[o.LEVENSHTEIN]:function(){return(e,t)=>(0,r.T)(e,t)/Math.max(e.length,t.length)},[o.NEEDLEMANN_WUNSCH]:function(e){const t=new Uint16Array(65536),{gapOpen:n,gapExtend:s,scoringMatrix:r,alphabetIndexes:o}={...i,...e};Object.entries(o).forEach((([e,n])=>t[e.charCodeAt(0)]=n));const a=[new Float32Array(1e4),new Float32Array(1e4)];return(e,i)=>{const o=new Array(e.length+1).fill(!1),l=new Array(e.length+1).fill(!1);let c=0,u=1;for(let t=1;t<e.length+1;t++)a[0][t]=-n-(t-1)*s,a[1][t]=0;a[0][0]=0;for(let h=1;h<i.length+1;h++){a[u][0]=-n-(h-1)*s;for(let d=1;d<e.length+1;d++){const m=a[c][d-1]+r[t[e.charCodeAt(d-1)]][t[i.charCodeAt(h-1)]],p=a[c][d]-(o[d]?s:n),f=a[u][d-1]-(l[d-1]?s:n);a[u][d]=Math.max(m,f,p),a[u][d]===m?(o[d]=!1,l[d]=!1):a[u][d]===f?(o[d]=!1,l[d]=!0):(o[d]=!0,l[d]=!1)}c=u,u=(u+1)%2}const h=Math.max(e.length,i.length);return(h-a[c][e.length])/h}},[o.MONOMER_CHEMICAL_DISTANCE]:s}},4628:(e,t,n)=>{"use strict";var s;n.d(t,{A:()=>s}),function(e){e.UMAP="UMAP",e.T_SNE="t-SNE"}(s||(s={}))},1040:(e,t,n)=>{"use strict";var s,r,i,o,a,l,c;n.d(t,{CF:()=>r,Qe:()=>a,W:()=>s,Yc:()=>l,gd:()=>o,gj:()=>c,gk:()=>i}),function(e){e.Levenshtein="Levenshtein",e.JaroWinkler="Jaro-Winkler",e.Manhattan="Manhattan",e.Onehot="One-Hot"}(s||(s={})),function(e){e.Euclidean="Euclidean"}(r||(r={})),function(e){e.Tanimoto="Tanimoto",e.Dice="Dice",e.Asymmetric="Asymmetric",e.BraunBlanquet="Braun-Blanquet",e.Cosine="Cosine",e.Kulczynski="Kulczynski",e.McConnaughey="Mc-Connaughey",e.RogotGoldberg="Rogot-Goldberg",e.Russel="Russel",e.Sokal="Sokal",e.Hamming="Hamming",e.Euclidean="Euclidean"}(i||(i={})),function(e){e.TanimotoIntArray="TanimotoIntArray"}(o||(o={})),function(e){e.Vector="Vector",e.String="String",e.BitArray="BitArray",e.MacroMolecule="MacroMolecule",e.Number="Number",e.IntArray="IntArray",e.NumberArray="NumberArray"}(a||(a={})),function(e){e.Difference="Difference"}(l||(l={})),function(e){e.CommonItems="Common Items"}(c||(c={}))},6361:(e,t,n)=>{"use strict";n.d(t,{gk:()=>s.gk});var s=n(1040);n(7861)},7861:(e,t,n)=>{"use strict";var s=n(1811),r=n(3979),i=n(5697),o=n(850),a=n(708),l=n(1040);const c={[l.CF.Euclidean]:o.dP},u={[l.W.Levenshtein]:s.T,[l.W.JaroWinkler]:r.H$,[l.W.Manhattan]:function(e,t){if(e.length!==t.length)return 1;{let n=0;for(let s=1;s<e.length;s++)n+=e[s]==t[s]?0:1;return n/e.length}},[l.W.Onehot]:function(e,t){return e===t?0:1}},h={[l.gk.Tanimoto]:i.KR,[l.gk.Dice]:i._h,[l.gk.Asymmetric]:i.yU,[l.gk.BraunBlanquet]:i.Dz,[l.gk.Cosine]:i.Zd,[l.gk.Kulczynski]:i.s,[l.gk.McConnaughey]:i.aW,[l.gk.RogotGoldberg]:i.MI,[l.gk.Russel]:i.fX,[l.gk.Sokal]:i.NB,[l.gk.Hamming]:i.UX,[l.gk.Euclidean]:i.WI},d={[l.gd.TanimotoIntArray]:i.FV},m={[l.Yc.Difference]:i.bX},p={[l.gj.CommonItems]:i.Jv},f={[l.Qe.Vector]:{[l.CF.Euclidean]:c[l.CF.Euclidean]},[l.Qe.String]:{[l.W.Levenshtein]:u[l.W.Levenshtein],[l.W.JaroWinkler]:u[l.W.JaroWinkler],[l.W.Manhattan]:u[l.W.Manhattan],[l.W.Onehot]:u[l.W.Onehot]},[l.Qe.BitArray]:{[l.gk.Tanimoto]:h[l.gk.Tanimoto],[l.gk.Dice]:h[l.gk.Dice],[l.gk.Asymmetric]:h[l.gk.Asymmetric],[l.gk.BraunBlanquet]:h[l.gk.BraunBlanquet],[l.gk.Cosine]:h[l.gk.Cosine],[l.gk.Kulczynski]:h[l.gk.Kulczynski],[l.gk.McConnaughey]:h[l.gk.McConnaughey],[l.gk.RogotGoldberg]:h[l.gk.RogotGoldberg],[l.gk.Russel]:h[l.gk.Russel],[l.gk.Sokal]:h[l.gk.Sokal]},[l.Qe.MacroMolecule]:{[a.U.HAMMING]:a.o[a.U.HAMMING],[a.U.LEVENSHTEIN]:a.o[a.U.LEVENSHTEIN],[a.U.NEEDLEMANN_WUNSCH]:a.o[a.U.NEEDLEMANN_WUNSCH],[a.U.MONOMER_CHEMICAL_DISTANCE]:a.o[a.U.MONOMER_CHEMICAL_DISTANCE]},[l.Qe.Number]:{[l.Yc.Difference]:m[l.Yc.Difference]},[l.Qe.IntArray]:{[l.gd.TanimotoIntArray]:d[l.gd.TanimotoIntArray]},[l.Qe.NumberArray]:{[l.gj.CommonItems]:p[l.gj.CommonItems]}};Object.keys(f).reduce(((e,t)=>{for(const n of Object.keys(f[t]))e[n]=t;return e}),{})},9657:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});class s{constructor(e,t=!1){if(this._length=0,this._version=0,this._updateLevel=0,this._selectedCount=0,this._selectedCountVersion=-1,this._selectedIndexesVersion=-1,this._versionedName="",this._versionedNameVersion=-1,this.SHRINK_THRESHOLD=256,"number"==typeof e){const n=e,r=s._createBuffer(n);if(t)for(let e=0;e<r.length;e++)r[e]=-1;this._data=r,this._length=n}else{if(!(e instanceof Uint32Array))throw new Error("Invalid constructor");this._data=e,this._length=t}}getRawData(){return this._data}assureGoez(e,t){if(e<0)throw new Error(`${t} should be greater than zero`)}assureInRange(e,t,n,s){if(e<t||e>n)throw new Error(`Argument ${s} (${e}) out of range (${t}, ${n})`)}copy(e,t,n){for(let s=0;s<n;s++)t[s]=e[s]}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 s(e._length);n._length=e._length,n._data=s._createBuffer(n._length),n._version=0;const r=e.lengthInInts;for(let s=0;s<r;s++)n._data[s]=e._data[s]&t._data[s];return n}static _createBuffer(e){return new Uint32Array(Math.floor((e+31)/32))}static fromValues(e){const t=new s(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 s(e);for(let s=0;s<e;++s)n.setBit(s,t(s));return n._version=0,n}static fromString(e){return s.fromSeq(e.length,(t=>"1"==e.charAt(t)))}static fromUint32Array(e,t){const n=new s(e);return n._data=t,n}static fromBytes(e){const t=e.length,n=new s(8*t);n._data=new Uint32Array(Math.floor((t+3)/4)),n._length=8*t;let r=0,i=0;for(;t-i>=4;)n._data[r++]=255&e[i]|(255&e[i+1])<<8|(255&e[i+2])<<16|(255&e[i+3])<<24,i+=4;return t-i==3&&(n._data[r]=(255&e[i+2])<<16),t-i==2&&(n._data[r]|=(255&e[i+1])<<8),t-i==1&&(n._data[r]|=255&e[i]),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 s(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,s=this.lengthInInts;for(let e=0;e<s;e++)this._data[e]=n;this.incrementVersion(t)}setIndexes(e,t=!0,n=!0,s=!0){n&&this.setAll(!t,!1);for(const n of e)this.setFast(n,t);this.incrementVersion(s)}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,s=!0,r=!0){if(n&&r&&this.setAll(!t,!1),r)for(let n=0;n<this._length;n++)e(n)&&this.setFast(n,t);else for(let n=0;n<this._length;n++)this.setFast(n,e(n)?t:!t);this.incrementVersion(s)}getRange(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let s=e;s<t;++s)n.push(this.getBit(s));return s.fromValues(n)}getRangeAsList(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let s=e;s<t;++s)n.push(this.getBit(s));return n}setRange(e,t,n,s=!0){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length-1,"to");const r=Math.min(e,t),i=Math.max(e,t);if(n)for(let e=r;e<=i;e++)this.setTrue(e);else for(let e=r;e<=i;e++)this.setFalse(e);return this.incrementVersion(s),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 s=this._length;this.setLength(this._length+t);for(let n=s-1;n>=e;n--)this.setBit(n+t,this.getBit(n));for(let s=e;s<e+t;s++)this.setBit(s,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 s=-1;-1!=(s=e.findNext(s,!t));)this.setFast(n++,this.getBit(s));this._length=n,this._version++}return this}getBit(e){return 0!=(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+=s._onBitCount[255&e];let n=this._data[t];const r=31&this._length;for(0!=r&&(n&=~(4294967295<<r));0!=n;n>>>=8)this._selectedCount+=s._onBitCount[255&n];this._selectedCountVersion=this._version}return e?this._selectedCount:this._length-this._selectedCount}countWhere(e){let t=0;if(this.trueCount()==this._length)for(let n=0;n<this._length;n++)t+=e(n)?1:0;else for(let n=-1;-1!=(n=this.findNext(n,!0));)t+=e(n)?1:0;return t}andWithCountBits(e,t){if(0==this._length)return 0;let n=0;const r=this.lengthInInts;let i=0;for(;i<r-1;i++)for(let t=this._data[i]&e._data[i];0!=t;t>>>=8)n+=s._onBitCount[255&t];let o=this._data[i]&e._data[i];const a=31&this._length;for(0!=a&&(o&=~(4294967295<<a));0!=o;o>>>=8)n+=s._onBitCount[255&o];return t?n:this._length-n}clear(){this.setLength(0)}contains(e){return this.findNext(-1,e)>=0}get allTrue(){return this.countBits(!0)==this._length}get allFalse(){return this.countBits(!1)==this._length}get anyTrue(){return this.countBits(!0)>0}get anyFalse(){return this.countBits(!1)>0}findNext(e,t=!0){if(this.assureInRange(e,-1,this._length,"index"),e>=this._length-1)return-1;let n=31&(e=e<0?0:e+1);const r=this.lengthInInts;for(let i=Math.floor(e/32);i<r;i++){let r=t?this._data[i]:~this._data[i];if(0!=n)r&=4294967295<<n&4294967295,n=0;else if(!t&&-4294967296==r)continue;for(let t=0;0!=r;t+=8,r>>>=8){const n=s._firstOnBit[255&r];if(n>=0)return(e=n+32*i+t)>=this._length?-1:e}}return-1}findPrev(e,t=!0){if(0==e)return-1;this.assureInRange(e,-1,this._length,"index");let n=1+(e=e<0?this._length-1:e-1)&31;for(let r=Math.floor(e/32);r>=0;r--){let e=t?this._data[r]:~this._data[r];0!=n&&(e&=~(4294967295<<n),n=0);for(let t=24;0!=e;t-=8,e<<=8){const n=s._lastOnBit[e>>>24];if(n>=0)return n+32*r+t}}return-1}}s._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]),s._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]),s._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])},2997:(e,t,n)=>{"use strict";n.d(t,{X5:()=>k,ow:()=>V,bb:()=>F,W3:()=>O,gw:()=>W,l_:()=>M,f6:()=>R,jh:()=>L,Wh:()=>I,ci:()=>D,Bu:()=>N,zg:()=>P,zN:()=>$,AB:()=>j,QK:()=>w});var s=n(4469),r=n(976);n(9133);const i=r.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,,,,,,,,,,,,,,,,,,,,,');i.columns.add(r.Column.fromList(r.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var o=function(e,t,n,s){return new(n||(n=Promise))((function(r,i){function o(e){try{l(s.next(e))}catch(e){i(e)}}function a(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((s=s.apply(e,t||[])).next())}))};function a(e,t,n,s,r,i,a,l,c=!0){return o(this,void 0,void 0,(function*(){let u=null;if(yield $(s,(n=>o(this,void 0,void 0,(function*(){let n=null;for(const s of e.viewers)s.type===t&&(n=s);if(!n)throw Error("Viewer hasn't been added");if(yield Promise.resolve(),i&&(yield i(n)),r){const t=null!=l?l:{};t.tv=e,t.viewer=n,u=yield r(t,c)}n.close()}))),(()=>o(this,void 0,void 0,(function*(){a?e.loadLayout(a):yield function(e,t,n){return o(this,void 0,void 0,(function*(){let s;return n?(s=yield e.dataFrame.plot.fromType(t),e.dockManager.dock(s)):s=e.addViewer(t),s}))}(e,t,n)}))),6e4,"TEST_EVENT_ASYNC"),u)return u}))}function l(e,t=!0){return o(this,void 0,void 0,(function*(){const n=e.tv.dataFrame,s=n.clone();Array.from(n.row(0).cells).forEach((e=>e.value=null));const r=n.rowCount<20?Math.floor(n.rowCount/2):10;n.rows.select((e=>e.idx>=0&&e.idx<r)),t&&(yield W(50));for(let e=r;e<2*r;e++)n.filter.set(e,!1);t&&(yield W(50)),n.currentRowIdx=1,n.columns.names().slice(0,Math.ceil(n.columns.length/2)).forEach((e=>n.columns.remove(e))),t&&(yield W(100)),e.tv.dataFrame=s,yield W(50)}))}function c(e,t=!0){return o(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 s={};return Object.keys(t).filter((e=>"boolean"==typeof t[e])).forEach((e=>s[e]=!t[e])),n.filter((e=>null!==e.choices)).forEach((e=>s[e.name]=e.choices.find((n=>n!==t[e.name])))),e.viewer.setOptions(s),yield W(300),{layout:e.tv.saveLayout(),savedProps:e.viewer.getOptions().look}}))}function u(e,t=!0){return o(this,void 0,void 0,(function*(){M(JSON.stringify(e.viewer.getOptions().look),JSON.stringify(e.savedProps))}))}var h=function(e,t,n,s){return new(n||(n=Promise))((function(r,i){function o(e){try{l(s.next(e))}catch(e){i(e)}}function a(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((s=s.apply(e,t||[])).next())}))};const d=3e4,m=108e5,p=console.log.bind(console),f=console.info.bind(console),g=console.warn.bind(console),y=console.error.bind(console),w={},b="Auto Tests",A="Demo",C="Detectors",v="Core",T={};let S;var E;!function(e){e.notNull=function(e,t){if(null==e)throw new Error(`${null==t?"Value":t} not defined`)}}(E||(E={}));class _{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,s){var r;this.category=e,this.name=t,null!=s||(s={}),null!==(r=s.timeout)&&void 0!==r||(s.timeout=d),this.options=s,this.test=()=>h(this,void 0,void 0,(function*(){return new Promise(((e,t)=>h(this,void 0,void 0,(function*(){let s="";try{s=yield n()}catch(e){t(e)}e(s)}))))}))}}function P(e,t,n,s=0,r="timeout"){return h(this,void 0,void 0,(function*(){return new Promise(((i,o)=>{const a=e.subscribe((e=>{try{t(e),i("OK")}catch(e){o(e)}finally{a.unsubscribe(),clearTimeout(l)}})),l=setTimeout((()=>{a.unsubscribe(),o(r)}),s);n()}))}))}function $(e,t,n,s=0,r="timeout"){return h(this,void 0,void 0,(function*(){return new Promise(((i,o)=>{const a=e.subscribe((e=>{t(e).then((()=>{i("OK")})).catch((e=>{o(e)})).finally((()=>{a.unsubscribe(),clearTimeout(l)}))})),l=setTimeout((()=>{a.unsubscribe(),o(r)}),s);n()}))}))}function N(e,t,n){null==w[S]&&(w[S]={}),null==w[S].tests&&(w[S].tests=[]),w[S].tests.push(new x(S,e,t,n))}function M(e,t=!0,n){if(n=n?`${n}, `:"",e!==t)throw new Error(`${n}Expected "${t}", got "${e}"`)}function L(e,t,n=.001,s){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 r=Math.abs(e-t)<n;if(M(r,!0,`${null!=s?s:""} (tolerance = ${n})`),!r)throw new Error(`Expected ${t}, got ${e} (tolerance = ${n})`)}function I(e,t){for(const[n,s]of Object.entries(t)){if(!e.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const t=e[n];if(t instanceof Array&&s instanceof Array)R(t,s);else if(t instanceof Object&&s instanceof Object)I(t,s);else if(Number.isFinite(t)&&Number.isFinite(s))L(t,s);else if(t!=s)throw new Error(`Expected (${s}) for key '${n}', got (${t})`)}}function R(e,t){const n=e.length,s=t.length;if(n!=s)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${s}`);for(let s=0;s<n;s++)if(e[s]instanceof Array&&t[s]instanceof Array)R(e[s],t[s]);else if(e[s]instanceof Object&&t[s]instanceof Object)I(e[s],t[s]);else if(e[s]!=t[s])throw new Error(`Expected ${t[s]} at position ${s}, got ${e[s]}`)}function O(e,t,n){var s;S=e,t(),w[S]&&(w[S].clear=null===(s=null==n?void 0:n.clear)||void 0===s||s,w[S].timeout=null==n?void 0:n.timeout)}function F(e){null==w[S]&&(w[S]={}),w[S].before=e}function k(e){null==w[S]&&(w[S]={}),w[S].after=e}function G(e,t){return e.replace(new RegExp(t.name,"gi"),t.nqName)}function D(e){var t,n,o,a,l,c,u;return h(this,void 0,void 0,(function*(){const d=null===(n=null===(t=s.functions.getCurrentCall())||void 0===t?void 0:t.func)||void 0===n?void 0:n.package;yield function(e,t){var n;return h(this,void 0,void 0,(function*(){const t=e.id;if(T[t])return;const o=w;if(void 0!==o[b]||void 0!==o[A]||Object.keys(o).find((e=>e.startsWith(b)||e.startsWith(v))))return void(T[t]=!0);if("DevTools"===e.name){const e=r.Func.find({tags:["dartTest"]});for(const t of e){const e=t.name.split(/\s*\|\s*/g),s=null!==(n=e.pop())&&void 0!==n?n:t.name,r=e.length?v+": "+e.join(": "):v;void 0===o[r]&&(o[r]={tests:[],clear:!0}),o[r].tests.push(new x(r,s,(()=>h(this,void 0,void 0,(function*(){return yield t.apply()}))),{isAggregated:t.outputs.length>0,timeout:3e5}))}}const a=[],l=[],c=[],u=yield s.dapi.functions.filter(`package.id = "${t}"`).list(),d=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const e of u){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 r=t[n].matchAll(d),i={};Array.from(r).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 l=new x(b,1===t.length?e.name:`${e.name} ${n+1}`,(()=>h(this,void 0,void 0,(function*(){const r=yield s.functions.eval(G(t[n],e));if(i.wait&&(yield W(i.wait)),"boolean"==typeof r&&!r)throw`Failed: ${t[n]}, expected true, got ${r}`}))),{skipReason:i.skip,timeout:i.timeout});if(i.cat){const e=b+": "+i.cat;l.category=e,void 0===o[e]&&(o[e]={tests:[],clear:!0}),o[e].tests.push(l)}else a.push(l)}if(n){const t=e.options.demoWait?parseInt(e.options.demoWait):void 0,n=new x(A,e.friendlyName,(()=>h(this,void 0,void 0,(function*(){if(s.shell.lastError="",yield e.apply(),yield W(t||2e3),s.shell.lastError)throw new Error(s.shell.lastError)}))),{skipReason:e.options.demoSkip});l.push(n)}if(e.hasTag("semTypeDetector")){const t=new x(C,e.friendlyName,(()=>h(this,void 0,void 0,(function*(){const t=[];for(const n of i.clone().columns){const s=yield e.apply([n]);t.push(s||n.semType)}M(t.filter((e=>e)).length,1)}))),{skipReason:e.options.skipTest});c.push(t)}}T[t]=!0,a.length&&(o[b]={tests:a,clear:!0}),l.length&&(o[A]={tests:l,clear:!0}),c.length&&(o[C]={tests:c,clear:!1})}))}(d);const m=[];console.log("Running tests"),null!=e||(e={}),null!==(o=(u=e).testContext)&&void 0!==o||(u.testContext=new _),s.shell.lastError="";const S=[],E=function(){const e=[];return console.log=(...t)=>{e.push(...t),p(...t)},console.info=(...t)=>{e.push(...t),f(...t)},console.warn=(...t)=>{e.push(...t),g(...t)},console.error=(...t)=>{e.push(...t),y(...t)},e}();try{for(const[t,n]of Object.entries(w)){if((null==e?void 0:e.category)&&!t.toLowerCase().startsWith(null==e?void 0:e.category.toLowerCase())||(null===(a=e.exclude)||void 0===a?void 0:a.some((e=>t.startsWith(e)))))continue;p(`Started ${t} category`),S.push(t);const i=null===(l=n.tests)||void 0===l?void 0:l.every((e=>{var t;return null===(t=e.options)||void 0===t?void 0:t.skipReason}));try{n.before&&!i&&(yield n.before())}catch(e){n.beforeStatus=yield B(e)}const o=null!==(c=n.tests)&&void 0!==c?c:[],u=[];if(n.clear)for(let t=0;t<o.length;t++)u.push(yield H(o[t],null==e?void 0:e.test,E,n.timeout,d.name,e.verbose)),s.shell.closeAll(),r.Balloon.closeAll();else for(let t=0;t<o.length;t++)u.push(yield H(o[t],null==e?void 0:e.test,E,n.timeout,d.name,e.verbose));const h=u.filter((e=>"skipped"!=e.result));try{n.after&&!i&&(yield n.after())}catch(e){n.afterStatus=yield B(e)}n.afterStatus&&h.push({category:t,name:"after",result:n.afterStatus,success:!1,ms:0,skipped:!1}),n.beforeStatus&&h.push({category:t,name:"before",result:n.beforeStatus,success:!1,ms:0,skipped:!1}),m.push(...h)}}finally{console.log=p,console.info=f,console.warn=g,console.error=y}if(e.testContext.catchUnhandled&&(yield W(1e3),s.shell.lastError.length>0&&m.push({category:"Unhandled exceptions",name:"exceptions",result:s.shell.lastError,success:!1,ms:0,skipped:!1})),!e.test&&m.length){const t=m.filter((e=>e.success)).length,n=m.filter((e=>e.skipped)).length,i=m.filter((e=>!e.success)),o=d.name;for(const e of S){const t=m.filter((t=>t.category===e)),n=t.filter((e=>!e.success)).length,r={success:0===n,passed:t.filter((e=>e.success)).length,skipped:t.filter((e=>e.skipped)).length,failed:n,type:"package",packageName:o,category:e};s.log.usage(`${o}: ${e}`,r,`category-package ${o}: ${e}`)}if(!e.category){const e={success:0===i.length,passed:t,skipped:n,failed:i.length,type:"package",packageName:o};s.log.usage(o,e,`package-package ${o}`)}if(e.testContext.report){const e=new r.Logger,s="Package @package tested: @successful successful, @skipped skipped, @failed failed tests",o={successful:t,skipped:n,failed:i.length,package:d};for(const e of i)Object.assign(o,{[`${e.category} | ${e.name}`]:e.result});e.log(s,o,"package-tested")}}return m}))}function B(e){return h(this,void 0,void 0,(function*(){return`${e.toString()}\n${e.stack?yield r.Logger.translateStackTrace(e.stack):""}`}))}function H(e,t,n,i,o,a){var l,c,u,f,g,w;return h(this,void 0,void 0,(function*(){let h;n.length=0;let b="package";const A=null!=t&&e.name.toLowerCase()!==t.toLowerCase(),C=(null===(l=e.options)||void 0===l?void 0:l.skipReason)||A,v=A?"skipped":null===(c=e.options)||void 0===c?void 0:c.skipReason;C||p(`Started ${e.category} ${e.name}`);const T=Date.now();try{if(C)h={success:!0,result:v,ms:0,skipped:!0};else{let t=(null===(u=e.options)||void 0===u?void 0:u.timeout)===d&&i?i:null===(f=e.options)||void 0===f?void 0:f.timeout;t=r.Test.isInBenchmark&&t===d?m:t,h={success:!0,result:null!==(g=yield U(e.test,t))&&void 0!==g?g:"OK",ms:0,skipped:!1}}}catch(e){y(e),h={success:!1,result:yield B(e),ms:0,skipped:!1}}if((null===(w=e.options)||void 0===w?void 0:w.isAggregated)&&h.result.constructor===r.DataFrame){const e=h.result.col("success");if(b="core",e&&(h.success=e.stats.sum===e.length),!a){const e=h.result;e.columns.remove("stack"),e.rows.removeWhere((e=>e.get("success"))),h.result=e}h.result=h.result.toCsv()}if(h.logs=n.join("\n"),h.ms=Date.now()-T,C||p(`Finished ${e.category} ${e.name} for ${h.ms} ms`),h.category=e.category,h.name=e.name,!A){let t={success:h.success,result:h.result,ms:h.ms,skipped:h.skipped,type:b,packageName:o,category:e.category,test: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)}s.log.usage(`${o}: ${e.category}: ${e.name}`,t,`test-${b} ${o}: ${e.category}: ${e.name}`)}return h}))}function W(e){return h(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,e)))}))}function V(e,t="Timeout exceeded",n=500,s=50){return h(this,void 0,void 0,(function*(){return new Promise(((r,i)=>{setTimeout((()=>{clearInterval(o),i(new Error(t))}),n);const o=setInterval((()=>{e()&&(clearInterval(o),r())}),s)}))}))}function U(e,t){return h(this,void 0,void 0,(function*(){let n=null;const s=new Promise(((e,s)=>{n=setTimeout((()=>{s("EXECUTION TIMEOUT")}),t)}));try{return yield Promise.race([e(),s])}finally{n&&clearTimeout(n)}}))}const Y=r.DataFrame.fromColumns([r.Column.fromStrings("col",["val1","val2","val3"])]);function j(e,t,n){var r;return h(this,void 0,void 0,(function*(){const i=null!==(r=null==n?void 0:n.packageName)&&void 0!==r?r:"";(null==n?void 0:n.detectSemanticTypes)&&(yield s.data.detectSemanticTypes(t));const o=s.shell.addTableView(t);try{yield a(o,e,i,s.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield a(o,e,i,s.events.onViewerAdded,void 0,n.awaitViewer)),(null==n?void 0:n.readOnly)||(yield a(o,e,i,s.events.onViewerAdded,l),(null==n?void 0:n.awaitViewer)&&(yield a(o,e,i,s.events.onViewerAdded,l,n.awaitViewer)));let t=null;t=yield a(o,e,i,s.events.onViewerAdded,c),(null==n?void 0:n.awaitViewer)&&(t=yield a(o,e,i,s.events.onViewerAdded,c,n.awaitViewer)),yield a(o,e,i,s.events.onViewLayoutApplied,u,void 0,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps}),(null==n?void 0:n.awaitViewer)&&(yield a(o,e,i,s.events.onViewLayoutApplied,u,n.awaitViewer,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps})),!1!==(null==n?void 0:n.arbitraryDfTest)&&(o.dataFrame=Y,yield W(50),yield a(o,e,i,s.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield a(o,e,i,s.events.onViewerAdded,void 0,n.awaitViewer)))}finally{}}))}},850:(e,t,n)=>{"use strict";function s(e=!1,t="Assertion error."){if(!e)throw new Error(t)}function r(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*e[n];return Math.sqrt(t)}function i(e,t){if(e.length!=t.length)throw new Error("The dimensionality of the vectors must match");let n=0;for(let s=0;s<e.length;s++)n+=e[s]*t[s];return n}function o(e,t){let n=0;const s=e.length;if(s!==t.length)throw new Error("The dimensionality of the vectors must match");for(let r=0;r<s;++r)n+=Math.pow(e[r]-t[r],2);return Math.sqrt(n)}function a(e){const t=e.length;let n=0,s=0;for(let r=0;r<t;++r)n+=e[r],s+=Math.pow(e[r],2);const r=n/t,i=1/Math.sqrt(s/t-Math.pow(r,2));for(let n=0;n<t;++n)e[n]=(e[n]-r)*i;return e}n.d(t,{$G:()=>r,Fv:()=>a,MA:()=>i,dP:()=>o,hu:()=>s})},3351:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(1581),r=n(3487),i=n(7023),o=n(4815),a=n(4181),l=n(2141),c="errorMessage",u=new s.Name("emUsed"),h={required:"missingProperty",dependencies:"property",dependentRequired:"property"},d=/\$\{[^}]+\}/,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:c,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=r.strConcat(l.default.instancePath,w.errorPath);function C(e,t){return r.and(s._`${e}.keyword !== ${c}`,s._`!${e}.${u}`,s._`${e}.instancePath === ${A}`,s._`${e}.keyword in ${t}`,s._`${e}.schemaPath.indexOf(${w.errSchemaPath}) === 0`,s._`/^\\/[^\\/]*$/.test(${e}.schemaPath.slice(${w.errSchemaPath.length}))`)}function v(e,t){const s=[];for(const n in e){const e=t[n];d.test(e)&&s.push([n,S(e)])}return n.object(...s)}function T(e){return d.test(e)?new i._Code(i.safeStringify(e).replace(m,((e,t)=>`" + JSON.stringify(${o.getData(t,w)}) + "`)).replace(p,"")):s.stringify(e)}function S(e){return s._`function(){return ${T(e)}}`}n.if(s._`${l.default.errors} > 0`,(()=>{if("object"==typeof b){const[i,o]=function(e){let t,n;for(const s in e){if("properties"===s||"items"===s)continue;const r=e[s];if("object"==typeof r){t||(t={});const e=t[s]={};for(const t in r)e[t]=[]}else n||(n={}),n[s]=[]}return[t,n]}(b);o&&function(r){const i=n.const("emErrors",s.stringify(r)),o=n.const("templates",v(r,g));n.forOf("err",l.default.vErrors,(e=>n.if(C(e,i),(()=>n.code(s._`${i}[${e}.keyword].push(${e})`).assign(s._`${e}.${u}`,!0)))));const{singleError:c}=e;if(c){const e=n.let("message",s._`""`),r=n.let("paramsErrors",s._`[]`);h((t=>{n.if(e,(()=>n.code(s._`${e} += ${"string"==typeof c?c:";"}`))),n.code(s._`${e} += ${d(t)}`),n.assign(r,s._`${r}.concat(${i}[${t}])`)})),a.reportError(t,{message:e,params:s._`{errors: ${r}}`})}else h((e=>a.reportError(t,{message:d(e),params:s._`{errors: ${i}[${e}]}`})));function h(e){n.forIn("key",i,(t=>n.if(s._`${i}[${t}].length`,(()=>e(t)))))}function d(e){return s._`${e} in ${o} ? ${o}[${e}]() : ${y}[${e}]`}}(o),i&&function(e){const r=n.const("emErrors",s.stringify(e)),i=[];for(const t in e)i.push([t,v(e[t],g[t])]);const o=n.const("templates",n.object(...i)),c=n.scopeValue("obj",{ref:h,code:s.stringify(h)}),d=n.let("emPropParams"),m=n.let("emParamsErrors");n.forOf("err",l.default.vErrors,(e=>n.if(C(e,r),(()=>{n.assign(d,s._`${c}[${e}.keyword]`),n.assign(m,s._`${r}[${e}.keyword][${e}.params[${d}]]`),n.if(m,(()=>n.code(s._`${m}.push(${e})`).assign(s._`${e}.${u}`,!0)))})))),n.forIn("key",r,(e=>n.forIn("keyProp",s._`${r}[${e}]`,(i=>{n.assign(m,s._`${r}[${e}][${i}]`),n.if(s._`${m}.length`,(()=>{const r=n.const("tmpl",s._`${o}[${e}] && ${o}[${e}][${i}]`);a.reportError(t,{message:s._`${r} ? ${r}() : ${y}[${e}][${i}]`,params:s._`{errors: ${m}}`})}))}))))}(i),function(e){const{props:i,items:o}=e;if(!i&&!o)return;const h=s._`typeof ${f} == "object"`,d=s._`Array.isArray(${f})`,m=n.let("emErrors");let p,w;const b=n.let("templates");function C(e,t){n.assign(m,s.stringify(e)),n.assign(b,v(e,t))}i&&o?(p=n.let("emChildKwd"),n.if(h),n.if(d,(()=>{C(o,g.items),n.assign(p,s.str`items`)}),(()=>{C(i,g.properties),n.assign(p,s.str`properties`)})),w=s._`[${p}]`):o?(n.if(d),C(o,g.items),w=s._`.items`):i&&(n.if(r.and(h,r.not(d))),C(i,g.properties),w=s._`.properties`),n.forOf("err",l.default.vErrors,(e=>function(e,t,i){n.if(r.and(s._`${e}.keyword !== ${c}`,s._`!${e}.${u}`,s._`${e}.instancePath.indexOf(${A}) === 0`),(()=>{const r=n.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:s._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),o=n.const("emMatches",s._`${r}.exec(${e}.instancePath.slice(${A}.length))`),a=n.const("emChild",s._`${o} && ${o}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);n.if(s._`${a} !== undefined && ${a} in ${t}`,(()=>i(a)))}))}(e,m,(t=>n.code(s._`${m}[${t}].push(${e})`).assign(s._`${e}.${u}`,!0))))),n.forIn("key",m,(e=>n.if(s._`${m}[${e}].length`,(()=>{a.reportError(t,{message:s._`${e} in ${b} ? ${b}[${e}]() : ${y}${w}[${e}]`,params:s._`{errors: ${m}[${e}]}`}),n.assign(s._`${l.default.vErrors}[${l.default.errors}-1].instancePath`,s._`${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 i="string"==typeof b?b:b._;i&&function(e){const i=n.const("emErrs",s._`[]`);n.forOf("err",l.default.vErrors,(e=>n.if(function(e){return r.and(s._`${e}.keyword !== ${c}`,s._`!${e}.${u}`,r.or(s._`${e}.instancePath === ${A}`,r.and(s._`${e}.instancePath.indexOf(${A}) === 0`,s._`${e}.instancePath[${A}.length] === "/"`)),s._`${e}.schemaPath.indexOf(${w.errSchemaPath}) === 0`,s._`${e}.schemaPath[${w.errSchemaPath}.length] === "/"`)}(e),(()=>n.code(s._`${i}.push(${e})`).assign(s._`${e}.${u}`,!0))))),n.if(s._`${i}.length`,(()=>a.reportError(t,{message:T(e),params:s._`{errors: ${i}}`})))}(i),e.keepErrors||function(){const e=n.const("emErrs",s._`[]`);n.forOf("err",l.default.vErrors,(t=>n.if(s._`!${t}.${u}`,(()=>n.code(s._`${e}.push(${t})`))))),n.assign(l.default.vErrors,e).assign(l.default.errors,s._`${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},5128:(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=void 0;const s=n(7159),r=n(7299),i=n(1240),o=n(4087),a="https://json-schema.org/draft/2020-12/schema";class l extends s.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;t&&(o.default.call(this,e),this.refs["http://json-schema.org/schema"]=a)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var c=n(4815);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=n(3487);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var h=n(7426);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var d=n(6646);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.default}})},1581:(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=void 0;const s=n(7159),r=n(3924),i=n(1240),o=n(98),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends s.default{_addVocabularies(){super._addVocabularies(),r.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=n(4815);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var h=n(3487);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var d=n(7426);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var m=n(6646);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})},7023:(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 s 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=s;class r extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof s&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function i(e,...t){const n=[e[0]];let s=0;for(;s<t.length;)l(n,t[s]),n.push(e[++s]);return new r(n)}t._Code=r,t.nil=new r(""),t._=i;const o=new r("+");function a(e,...t){const n=[u(e[0])];let s=0;for(;s<t.length;)n.push(o),l(n,t[s]),n.push(o,u(e[++s]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===o){const n=c(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new r(n)}function l(e,t){var n;t instanceof r?e.push(...t._items):t instanceof s?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:u(Array.isArray(n)?n.join(","):n))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof s||'"'!==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 s?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=a,t.addCodeArg=l,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`},t.stringify=function(e){return new r(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new r(`.${e}`):i`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new r(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new r(e.toString())}},3487:(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 s=n(7023),r=n(8490);var i=n(7023);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var o=n(8490);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),t.operators={GT:new s._Code(">"),GTE:new s._Code(">="),LT:new s._Code("<"),LTE:new s._Code("<="),EQ:new s._Code("==="),NEQ:new s._Code("!=="),NOT:new s._Code("!"),OR:new s._Code("||"),AND:new s._Code("&&"),ADD:new s._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?r.varKinds.var:this.varKind,s=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=M(this.rhs,e,t)),this}get names(){return this.rhs instanceof s._CodeOrName?this.rhs.names:{}}}class c extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof s.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=M(this.rhs,e,t),this}get names(){return N(this.lhs instanceof s.Name?{}:{...this.lhs.names},this.rhs)}}class u extends c{constructor(e,t,n,s){super(e,n,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class m extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=M(this.code,e,t),this}get names(){return this.code instanceof s._CodeOrName?this.code.names:{}}}class f extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let s=n.length;for(;s--;){const r=n[s];r.optimizeNames(e,t)||(L(e,r.names),n.splice(s,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(I(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=M(this.condition,e,t),this}get names(){const e=super.names;return N(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=M(this.iteration,e,t),this}get names(){return $(super.names,this.iteration.names)}}class v extends A{constructor(e,t,n,s){super(),this.varKind=e,this.name=t,this.from=n,this.to=s}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${t} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){const e=N(super.names,this.from);return N(e,this.to)}}class T extends A{constructor(e,t,n,s){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=s}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=M(this.iterable,e,t),this}get names(){return $(super.names,this.iterable.names)}}class S 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)}}S.kind="func";class E extends f{render(e){return"return "+super.render(e)}}E.kind="return";class _ extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,s;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(s=this.finally)||void 0===s||s.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&$(e,this.catch.names),this.finally&&$(e,this.finally.names),e}}class x extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}x.kind="catch";class P 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 N(e,t){return t instanceof s._CodeOrName?$(e,t.names):e}function M(e,t,n){return e instanceof s.Name?i(e):(r=e)instanceof s._Code&&r._items.some((e=>e instanceof s.Name&&1===t[e.str]&&void 0!==n[e.str]))?new s._Code(e._items.reduce(((e,t)=>(t instanceof s.Name&&(t=i(t)),t instanceof s._Code?e.push(...t._items):e.push(t),e)),[])):e;var r;function i(e){const s=n[e.str];return void 0===s||1!==t[e.str]?e:(delete t[e.str],s)}}function L(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function I(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:s._`!${k(e)}`}P.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,s){const r=this._scope.toName(t);return void 0!==n&&s&&(this._constants[r.str]=n),this._leafNode(new l(e,r,n)),r}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new c(e,t,n))}add(e,n){return this._leafNode(new u(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==s.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[n,r]of e)t.length>1&&t.push(","),t.push(n),(n!==r||this.opts.es5)&&(t.push(":"),(0,s.addCodeArg)(t,r));return t.push("}"),new s._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,s,i=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const o=this._scope.toName(e);return this._for(new v(i,o,t,n),(()=>s(o)))}forOf(e,t,n,i=r.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof s.Name?t:this.var("_arr",t);return this.forRange("_i",0,s._`${e}.length`,(t=>{this.var(o,s._`${e}[${t}]`),n(o)}))}return this._for(new T("of",i,o,t),(()=>n(o)))}forIn(e,t,n,i=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,s._`Object.keys(${t})`,n);const o=this._scope.toName(e);return this._for(new T("in",i,o,t),(()=>n(o)))}endFor(){return this._endBlockNode(A)}label(e){return this._leafNode(new h(e))}break(e){return this._leafNode(new d(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const s=new _;if(this._blockNode(s),this.code(e),t){const e=this.name("e");this._currNode=s.catch=new x(e),t(e)}return n&&(this._currNode=s.finally=new P,this.code(n)),this._endBlockNode(x,P)}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=s.nil,n,r){return this._blockNode(new S(e,t,n)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof 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=I;const R=F(t.operators.AND);t.and=function(...e){return e.reduce(R)};const O=F(t.operators.OR);function F(e){return(t,n)=>t===s.nil?n:n===s.nil?t:s._`${k(t)} ${e} ${k(n)}`}function k(e){return e instanceof s.Name?e:s._`(${e})`}t.or=function(...e){return e.reduce(O)}},8490:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const s=n(7023);class r extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var i;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(i=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new s.Name("const"),let:new s.Name("let"),var:new s.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof s.Name?e:this.name(e)}name(e){return new s.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=o;class a extends s.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=s._`.${new s.Name(t)}[${n}]`}}t.ValueScopeName=a;const l=s._`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:s.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const s=this.toName(e),{prefix:r}=s,i=null!==(n=t.key)&&void 0!==n?n:t.ref;let o=this._values[r];if(o){const e=o.get(i);if(e)return e}else o=this._values[r]=new Map;o.set(i,s);const a=this._scope[r]||(this._scope[r]=[]),l=a.length;return a[l]=t.ref,s.setValue(t,{property:r,itemIndex:l}),s}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 s._`${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,o={},a){let l=s.nil;for(const c in e){const u=e[c];if(!u)continue;const h=o[c]=o[c]||new Map;u.forEach((e=>{if(h.has(e))return;h.set(e,i.Started);let o=n(e);if(o){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;l=s._`${l}${n} ${e} = ${o};${this.opts._n}`}else{if(!(o=null==a?void 0:a(e)))throw new r(e);l=s._`${l}${o}${this.opts._n}`}h.set(e,i.Completed)}))}return l}}},4181:(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 s=n(3487),r=n(6776),i=n(2141);function o(e,t){const n=e.const("err",t);e.if(s._`${i.default.vErrors} === null`,(()=>e.assign(i.default.vErrors,s._`[${n}]`)),s._`${i.default.vErrors}.push(${n})`),e.code(s._`${i.default.errors}++`)}function a(e,t){const{gen:n,validateName:r,schemaEnv:i}=e;i.$async?n.throw(s._`new ${e.ValidationError}(${t})`):(n.assign(s._`${r}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>s.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?s.str`"${e}" keyword must be ${t} ($data)`:s.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,r,i){const{it:l}=e,{gen:u,compositeRule:h,allErrors:d}=l,m=c(e,n,r);(null!=i?i:h||d)?o(u,m):a(l,s._`[${m}]`)},t.reportExtraError=function(e,n=t.keywordError,s){const{it:r}=e,{gen:l,compositeRule:u,allErrors:h}=r;o(l,c(e,n,s)),u||h||a(r,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(s._`${i.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(s._`${i.default.vErrors}.length`,t)),(()=>e.assign(i.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:r,errsCount:o,it:a}){if(void 0===o)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",o,i.default.errors,(o=>{e.const(l,s._`${i.default.vErrors}[${o}]`),e.if(s._`${l}.instancePath === undefined`,(()=>e.assign(s._`${l}.instancePath`,(0,s.strConcat)(i.default.instancePath,a.errorPath)))),e.assign(s._`${l}.schemaPath`,s.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(s._`${l}.schema`,n),e.assign(s._`${l}.data`,r))}))};const l={keyword:new s.Name("keyword"),schemaPath:new s.Name("schemaPath"),params:new s.Name("params"),propertyName:new s.Name("propertyName"),message:new s.Name("message"),schema:new s.Name("schema"),parentSchema:new s.Name("parentSchema")};function c(e,t,n){const{createErrors:r}=e.it;return!1===r?s._`{}`:function(e,t,n={}){const{gen:r,it:o}=e,a=[u(o,n),h(e,n)];return function(e,{params:t,message:n},r){const{keyword:o,data:a,schemaValue:c,it:u}=e,{opts:h,propertyName:d,topSchemaRef:m,schemaPath:p}=u;r.push([l.keyword,o],[l.params,"function"==typeof t?t(e):t||s._`{}`]),h.messages&&r.push([l.message,"function"==typeof n?n(e):n]),h.verbose&&r.push([l.schema,c],[l.parentSchema,s._`${m}${p}`],[i.default.data,a]),d&&r.push([l.propertyName,d])}(e,t,a),r.object(...a)}(e,t,n)}function u({errorPath:e},{instancePath:t}){const n=t?s.str`${e}${(0,r.getErrorPath)(t,r.Type.Str)}`:e;return[i.default.instancePath,(0,s.strConcat)(i.default.instancePath,n)]}function h({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:i}){let o=i?t:s.str`${t}/${e}`;return n&&(o=s.str`${o}${(0,r.getErrorPath)(n,r.Type.Str)}`),[l.schemaPath,o]}},5173:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const s=n(3487),r=n(7426),i=n(2141),o=n(2531),a=n(6776),l=n(4815);class c{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function u(e){const t=d.call(this,e);if(t)return t;const n=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:u}=this.opts,h=new s.CodeGen(this.scope,{es5:a,lines:c,ownProperties:u});let m;e.$async&&(m=h.scopeValue("Error",{ref:r.default,code:s._`require("ajv/dist/runtime/validation_error").default`}));const p=h.scopeName("validate");e.validateName=p;const f={gen:h,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[s.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,s.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:m,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:s.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:s._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,l.validateFunctionCode)(f),h.optimize(this.opts.code.optimize);const t=h.toString();g=`${h.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${i.default.self}`,`${i.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:h._values}),this.opts.unevaluated){const{props:e,items:t}=f;n.evaluated={props:e instanceof s.Name?void 0:e,items:t instanceof s.Name?void 0:t,dynamicProps:e instanceof s.Name,dynamicItems:t instanceof s.Name},n.source&&(n.source.evaluated=(0,s.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 h(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function d(e){for(const s of this._compilations)if(n=e,(t=s).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return s;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),s=(0,o._getFullPath)(this.opts.uriResolver,n);let r=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&s===r)return g.call(this,n,e);const i=(0,o.normalizeId)(s),a=this.refs[i]||this.schemas[i];if("string"==typeof a){const t=p.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||u.call(this,a),i===(0,o.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,s=t[n];return s&&(r=(0,o.resolveUrl)(this.opts.uriResolver,r,s)),new c({schema:t,schemaId:n,root:e,baseId:r})}return g.call(this,n,a)}}t.SchemaEnv=c,t.compileSchema=u,t.resolveRef=function(e,t,n){var s;n=(0,o.resolveUrl)(this.opts.uriResolver,t,n);const r=e.refs[n];if(r)return r;let i=m.call(this,e,n);if(void 0===i){const r=null===(s=e.localRefs)||void 0===s?void 0:s[n],{schemaId:o}=this.opts;r&&(i=new c({schema:r,schemaId:o,root:e,baseId:t}))}return void 0!==i?e.refs[n]=h.call(this,i):void 0},t.getCompilingSchema=d,t.resolveSchema=p;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:n,root:s}){var r;if("/"!==(null===(r=e.fragment)||void 0===r?void 0:r[0]))return;for(const s of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,a.unescapeFragment)(s)];if(void 0===e)return;const r="object"==typeof(n=e)&&n[this.opts.schemaId];!f.has(s)&&r&&(t=(0,o.resolveUrl)(this.opts.uriResolver,t,r))}let i;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,n.$ref);i=p.call(this,s,e)}const{schemaId:l}=this.opts;return i=i||new c({schema:n,schemaId:l,root:s,baseId:t}),i.schema!==i.root.schema?i:void 0}},2141:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(3487),r={data:new s.Name("data"),valCxt:new s.Name("valCxt"),instancePath:new s.Name("instancePath"),parentData:new s.Name("parentData"),parentDataProperty:new s.Name("parentDataProperty"),rootData:new s.Name("rootData"),dynamicAnchors:new s.Name("dynamicAnchors"),vErrors:new s.Name("vErrors"),errors:new s.Name("errors"),this:new s.Name("this"),self:new s.Name("self"),scope:new s.Name("scope"),json:new s.Name("json"),jsonPos:new s.Name("jsonPos"),jsonLen:new s.Name("jsonLen"),jsonPart:new s.Name("jsonPart")};t.default=r},6646:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(2531);class r extends Error{constructor(e,t,n,r){super(r||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,s.resolveUrl)(e,t,n),this.missingSchema=(0,s.normalizeId)((0,s.getFullPath)(e,this.missingRef))}}t.default=r},2531:(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 s=n(6776),r=n(4063),i=n(9461),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!l(e):!!t&&c(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(a.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(l))return!0;if("object"==typeof n&&l(n))return!0}return!1}function c(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!o.has(n)&&("object"==typeof e[n]&&(0,s.eachItem)(e[n],(e=>t+=c(e))),t===1/0))return 1/0}return t}function u(e,t="",n){!1!==n&&(t=m(t));const s=e.parse(t);return h(e,s)}function h(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=h;const d=/#\/?$/;function m(e){return e?e.replace(d,""):""}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:s}=this.opts,o=m(e[n]||t),a={"":o},l=u(s,o,!1),c={},h=new Set;return i(e,{allKeys:!0},((e,t,s,r)=>{if(void 0===r)return;const i=l+t;let o=a[r];function u(t){const n=this.opts.uriResolver.resolve;if(t=m(o?n(o,t):t),h.has(t))throw f(t);h.add(t);let s=this.refs[t];return"string"==typeof s&&(s=this.refs[s]),"object"==typeof s?d(e,s.schema,t):t!==m(i)&&("#"===t[0]?(d(e,c[t],t),c[t]=e):this.refs[t]=i),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]&&(o=u.call(this,e[n])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),a[t]=o})),c;function d(e,t,n){if(void 0!==t&&!r(e,t))throw f(n)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},3141:(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:{}}}},6776:(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 s=n(3487),r=n(7023);function i(e,t=e.schema){const{opts:n,self:s}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const r=s.RULES.keywords;for(const n in t)r[n]||p(e,`unknown keyword: "${n}"`)}function o(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(i,o,a,l)=>{const c=void 0===a?o:a instanceof s.Name?(o instanceof s.Name?e(i,o,a):t(i,o,a),a):o instanceof s.Name?(t(i,a,o),o):n(o,a);return l!==s.Name||c instanceof s.Name?c:r(i,c)}}function u(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",s._`{}`);return void 0!==t&&h(e,n,t),n}function h(e,t,n){Object.keys(n).forEach((n=>e.assign(s._`${t}${(0,s.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||(i(e,t),!o(t,e.self.RULES.all))},t.checkUnknownRules=i,t.schemaHasRules=o,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},n,r,i){if(!i){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return s._`${n}`}return s._`${e}${t}${(0,s.getProperty)(r)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,n)=>e.if(s._`${n} !== true && ${t} !== undefined`,(()=>{e.if(s._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,s._`${n} || {}`).code(s._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(s._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,s._`${n} || {}`),h(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,n)=>e.if(s._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,s._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(s._`${n} !== true`,(()=>e.assign(n,!0===t||s._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=h;const d={};var 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:d[t.code]||(d[t.code]=new r._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(m=t.Type||(t.Type={})),t.getErrorPath=function(e,t,n){if(e instanceof s.Name){const r=t===m.Num;return n?r?s._`"[" + ${e} + "]"`:s._`"['" + ${e} + "']"`:r?s._`"/" + ${e}`:s._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,s.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=p},8876:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>s(e,t)))}function s(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},s){const r=t.RULES.types[s];return r&&!0!==r&&n(e,r)},t.shouldUseGroup=n,t.shouldUseRule=s},5667:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const s=n(4181),r=n(3487),i=n(2141),o={message:"boolean schema is false"};function a(e,t){const{gen:n,data:r}=e,i={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,s.reportError)(i,o,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:s}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(i.default.data):(t.assign(r._`${s}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:s}=e;!1===s?(n.var(t,!1),a(e)):n.var(t,!0)}},453:(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 s=n(3141),r=n(8876),i=n(4181),o=n(3487),a=n(6776);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(s.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(l=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=c(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=c,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:s,opts:i}=e,a=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,i.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,r.schemaHasRulesForType)(e,t[0]));if(c){const r=d(t,s,i.strictNumbers,l.Wrong);n.if(r,(()=>{a.length?function(e,t,n){const{gen:s,data:r,opts:i}=e,a=s.let("dataType",o._`typeof ${r}`),l=s.let("coerced",o._`undefined`);"array"===i.coerceTypes&&s.if(o._`${a} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,(()=>s.assign(r,o._`${r}[0]`).assign(a,o._`typeof ${r}`).if(d(t,r,i.strictNumbers),(()=>s.assign(l,r))))),s.if(o._`${l} !== undefined`);for(const e of n)(u.has(e)||"array"===e&&"array"===i.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void s.elseIf(o._`${a} == "number" || ${a} == "boolean"`).assign(l,o._`"" + ${r}`).elseIf(o._`${r} === null`).assign(l,o._`""`);case"number":return void s.elseIf(o._`${a} == "boolean" || ${r} === null
2
+ var bio_test;(()=>{var e={2012:(e,t,n)=>{"use strict";n.d(t,{f:()=>r});var s=n(9976);class r extends s.B{static get Lesk(){return void 0===this.lesk&&(this.lesk=this.makePalette([[["G","A","S","T"],"orange"],[["C","V","I","L","P","F","Y","M","W"],"all_green"],[["N","Q","H"],"magenta"],[["D","E"],"red"],[["K","R"],"all_blue"]],!1,r)),this.lesk}static get GrokGroups(){return void 0===this.grokGroups&&(this.grokGroups=this.makePalette([[["C","U"],"yellow"],[["G","P"],"red"],[["A","V","I","L","M","F","Y","W"],"all_green"],[["R","H","K"],"light_blue"],[["D","E"],"dark_blue"],[["S","T","N","Q"],"orange"]],!1,r)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new r({D:"#E60A0A",E:"#E60A0A",C:"#E6E600",M:"#E6E600",K:"#145AFF",R:"#145AFF",S:"#FA9600",T:"#FA9600",F:"#3232AA",Y:"#3232AA",N:"#00DCDC",Q:"#00DCDC",G:"#EBEBEB",L:"#0F820F",V:"#0F820F",I:"#0F820F",A:"#C8C8C8",W:"#B45AB4",H:"#8282D2",P:"#DC9682",others:"#BEA06E"})),this.rasMol}get(e){const t=e in r.aaSynonyms?r.aaSynonyms[e]:e;return super.get(t)}}r.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class i{static getPalette(e="grok"){switch(e){case"grok":return r.GrokGroups;case"lesk":return r.Lesk;default:throw new Error(`ChemPalette: scheme \`${e}\` does not exist`)}}static getInnerOuter(e){let t=0,n="",s="";for(const r of e)"("==r?t++:")"==r?t--:t?n+=r:s+=r;return isNaN(parseInt(n))?[s,n]:[s,""]}static getColorAAPivot(e="",t="grok"){const n=this.getPalette(t);let[s,r]=this.getInnerOuter(e);if(s=s.length>6?`${s.slice(0,3)}...`:s,r=r.length>6?`${r.slice(0,3)}...`:r,1==e.length||"("==e[1]){const t=e[0]?.toUpperCase();return t in n?[n.get(t),t,r,1]:[this.undefinedColor,s,r,1]}if("d"==e[0]&&e[1]in n&&(2==e.length||"("==e[2])){const t=e[1]?.toUpperCase();return t in n?[n.get(t),t,r,2]:[this.undefinedColor,s,r,2]}if(e.substring(0,3)in this.AAFullNames&&(3==e.length||"("==e[3])){const t=this.AAFullNames[e.substring(0,3)];return t in n?[n.get(t),t,r,3]:[this.undefinedColor,s,r,3]}if(e[0]?.toLowerCase()==e[0]&&e.substring(1,3)in this.AAFullNames&&(4==e.length||"("==e[4])){const t=this.AAFullNames[e.substring(1,3)];return t in n?[n.get(t),t,r,4]:[this.undefinedColor,s,r,4]}return[this.undefinedColor,s,r,0]}}i.SemType="Aminoacids",i.SemTypeMultipleAlignment="AminoacidsMultipleAlignment",i.undefinedColor="rgb(100,100,100)",i.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"},i.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"},i.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(*)*"},i.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"}},6584:(e,t,n)=>{"use strict";n.d(t,{BX:()=>i,nW:()=>l,tW:()=>c,tb:()=>u});var s=n(4469);const r="Libraries",i="System:AppData/Bio/monomer-libraries/",o={explicit:["HELMCoreLibrary.json"],exclude:[]};let a=Promise.resolve();async function l(){let e;return a=a.then((async()=>{const t=await s.dapi.userDataStorage.getValue(r,"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 a,e}async function c(e){a=a.then((async()=>{console.debug(`Bio: setUserLibSettings()\n${JSON.stringify(e,void 0,2)}`),await s.dapi.userDataStorage.postValue(r,"Settings",JSON.stringify(e),!0)})),await a}async function u(){await c(o)}},7228:(e,t,n)=>{"use strict";n.d(t,{JN:()=>a,Qx:()=>l});var s=n(976),r=n(4469),i=(n(5697),n(1047),n(6286)),o=(n(8607),n(8457));async function a(){const e=s.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 s.Column&&(e=(0,o.O)(e).columns.toList());const n=(await a()).getBioLib(),l=new Array(e.length),c=e[0].length,u=new Float32Array(c);for(let o=0;o<e.length;++o){const a=t.getCanonical(o),h=n.getMonomer("PEPTIDE",a)?.smiles??"",d=e[o],m=d.getRawData(),p=d.categories,f=p.indexOf("");if(l[o]={categories:p,data:m,emptyIndex:f},void 0===a)continue;const g=s.Column.fromStrings("smiles",p.map((e=>n.getMonomer("PEPTIDE",e)?.smiles??""))),y=(s.DataFrame.fromColumns([g]),(await r.chem.getSimilarities(g,h)).getRawData());for(let e=0;e<c;++e){const t=m[e];u[e]+=a!==i.G2&&t!==f?y[t]:a===i.G2&&t===f?1:0}}for(let n=0;n<u.length;++n){let r=u[n]/t.length;for(let i=0;i<e.length;++i){const e=l[i];if(i>=t.length&&e.data[n]!==e.emptyIndex||e.data[n]===e.emptyIndex&&i<t.length){r=s.FLOAT_NULL;break}}u[n]=r}return s.Column.fromFloat32Array("Similarity",u)}},8601:(e,t,n)=>{"use strict";n.d(t,{i0:()=>d});var s=n(4469),r=n(976),i=n(6414),o=n.n(i),a=n(1821),l=n(8607);const c={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(1047);function h(e){return Math.round(c.PRECISION_FACTOR*e)/c.PRECISION_FACTOR}async function d(e,t,i){if(0===r.Func.find({package:"Chem",name:"getRdKitModule"}).length)return{col:null,warnings:['Transformation to atomic level requires the package "Chem" installed.']};if(t.semType!==r.SEMTYPE.MACROMOLECULE)return{col:null,warnings:[`Only the ${r.SEMTYPE.MACROMOLECULE} columns can be converted to atomic level, the chosen column has semType '${t.semType}'`]};let h=t;const d=l.g.forColumn(t);d.isHelm()&&(h=d.convert(a.r2.SEPARATOR,"."),h.name=t.name);const p=l.g.forColumn(h).alphabet;let f;if("PT"===p||"UN"===p)f="PEPTIDE";else{if("RNA"!==p&&"DNA"!==p)return{col:null,warnings:[`Unexpected column's '${h.name}' alphabet '${p}'.`]};f="RNA"}const g=function(e){const t=e.length,n=new Array(t),r=l.g.forColumn(e);let i=!1;for(let e=0;e<t;++e){const t=r.getSplitted(e);i||(i=0===t.length),n[e]=o()(t.canonicals).filter((e=>!r.isGap(e))).map((e=>e)).toArray()}return i&&s.shell.warning(`Some values in the "${e.name}" column are empty`),n}(h),y=await async function(e,t,n,r){const i=function(e,t,n){const s=new Map;for(const r of e.getMonomerSymbolsByType(t)){const i=e.getMonomer(t,r);if("RNA"===t&&("Branch"===i.monomerType||"DNA"===n&&i.symbol===c.DEOXYRIBOSE||"RNA"===n&&i.symbol===c.RIBOSE||i.symbol===c.PHOSPHATE)||"PEPTIDE"===t&&"Branch"!==i.monomerType){const e={};u.rx.forEach((t=>{e[t]=i[t]})),s.set(i.symbol,e)}}return s}(t,n,r),o=new Map,a=await s.functions.call("Chem:getRdKitModule"),l={value:null};if("RNA"===n){const e="RNA"===r?[c.RIBOSE,c.PHOSPHATE]:[c.DEOXYRIBOSE,c.PHOSPHATE];for(const t of e)m(o,t,i,a,n,l)}for(let t=0;t<e.length;++t){const s=e[t];for(const e of s)if(""!==e)try{m(o,e,i,a,n,l)}catch(t){const n=t instanceof Error?t.message:t.toString(),s=t instanceof Error?t.stack:void 0;throw console.error(`bio lib: getMonomersDictFromLib() sym='${e}', error:\n${n}\n${s}`),new Error(`Can't get monomer '${e}' from library: ${n}`)}}return o}(g,i,f,p),w=h.length,{molfileList:b,molfileWarningList:A}=await async function(e,t,s,r,i){const o=Math.max(navigator.hardwareConcurrency-2,1),a=new Array(o).fill(null).map((()=>new Worker(new URL(n.p+n.u(79),n.b)))),l=i/o;let c=[],u=[];const h=new Array(o);for(let n=0;n<o;n++){const c=Math.floor(n*l),u=n===o-1?i:Math.floor((n+1)*l);a[n].postMessage({monomerSequencesArray:e,monomersDict:t,alphabet:s,polymerType:r,start:c,end:u}),h[n]=new Promise((e=>{a[n].onmessage=({data:{molfileList:t,molfileWarningList:n}})=>{e({molfileList:t,molfileWarningList:n})}}))}return(await Promise.all(h)).forEach((e=>{c=c.concat(...e.molfileList),u=u.concat(...e.molfileWarningList)})),setTimeout((()=>{a.forEach((e=>{e.terminate()}))}),0),{molfileList:c,molfileWarningList:u}}(g,y,p,f,w);if(A.length>.05*w)throw new Error("Too many errors getting molfiles.");const C=`molfile(${h.name})`,v=e.columns.getUnusedName(C),T=r.Column.fromStrings(v,b);return T.semType=r.SEMTYPE.MOLECULE,T.setTag(r.TAGS.UNITS,r.UNITS.Molecule.MOLBLOCK),{col:T,warnings:A}}function m(e,t,n,s,r,i){if(!e.has(t)){const o=function(e,t,n,s,r){if(t.has(e)){const o=t.get(e),a=function(e){const t=[];for(const n of e){let e=n.capGroupSmiles;e||(e=n.capGroupSMILES),e=e.replace(/(\[|\]|\*|:|\d)/g,""),t.push(e)}return t}(o.rgroups),l=(i=o.molfile).includes("V3000")?function(e){const t=new Map,n=/M V30 (\d+) R#.+RGROUPS=\((\d+) (\d+)\).*/gm;let s;for(;null!==(s=n.exec(e));)s.index===n.lastIndex&&n.lastIndex++,t.set(parseInt(s[1]),parseInt(s[3]));return t}(i):function(e){const t=new Map;let n=e.indexOf(c.V2K_A_LINE,0),s=n;for(;-1!==n;){s=e.indexOf("\n",n);const r=parseInt(e.substring(n,s).replace(/^A\s+/,""));n=e.indexOf("R",s),s=e.indexOf("\n",n);const i=parseInt(e.substring(n,s).replace(/^R/,""));t.set(r,i),n=e.indexOf(c.V2K_A_LINE,s)}for(n=e.indexOf(c.V2K_RGP_LINE,0),s=e.indexOf("\n",n);-1!==n;){n+=c.V2K_RGP_SHIFT,s=e.indexOf("\n",n);const r=e.substring(n,s).replaceAll(/\s+/g," ").split(" ").map((e=>parseInt(e))).slice(1);for(let e=0;e<r.length;e+=2){if(t.has(r[e])&&t.get(r[e])!==r[e+1])throw new Error(`r-group index ${r[e]} has already been added with a different value`);t.set(r[e],r[e+1])}n=e.indexOf(c.V2K_RGP_LINE,s)}return t}(i),u=o.molfile.includes("V3000")?o.molfile:function(e,t){const n=t.get_mol(e),s=n.get_v3Kmolblock();return n.delete(),s}(function(e){let t=e.indexOf(c.V2K_A_LINE,0);-1===t&&(t=e.indexOf(c.V2K_RGP_LINE));const n=e.indexOf(c.V3K_END,t);return e.substring(0,t)+e.substring(n)}(o.molfile),n),d=function(e){let t=(e=e.replaceAll("\r","")).indexOf(c.V3K_BEGIN_COUNTS_LINE)+c.V3K_COUNTS_SHIFT,n=e.indexOf(" ",t+1);const s=parseInt(e.substring(t,n));return t=n+1,n=e.indexOf(" ",t+1),{atomCount:s,bondCount:parseInt(e.substring(t,n))}}(u),m=function(e,t){const n=new Array(t),s=new Float32Array(t),r=new Float32Array(t),i=new Array(t);let o=e.indexOf(c.V3K_BEGIN_ATOM_BLOCK);o=e.indexOf("\n",o);let a=o;for(let l=0;l<t;l++){o=e.indexOf(c.V3K_BEGIN_DATA_LINE,o)+c.V3K_IDX_SHIFT,a=e.indexOf(" ",o),o=a+1,a=e.indexOf(" ",o),n[l]=e.substring(o,a);const t=new Array(2);for(let n=0;n<2;++n)o=a+1,a=e.indexOf(" ",o),t[n]=parseFloat(e.substring(o,a));s[l]=t[0],r[l]=t[1],o=a,a=e.indexOf("\n",o)+1,i[l]=e.slice(o,a),o=a}return{atomTypes:n,x:s,y:r,kwargs:i}}(u,d.atomCount),g=function(e,t){const n=new Uint32Array(t),s=new Array(t),r=new Map,i=new Map;let o=e.indexOf(c.V3K_BEGIN_BOND_BLOCK);o=e.indexOf("\n",o);let a=o;for(let l=0;l<t;++l){const t=new Array(3);o=e.indexOf(c.V3K_BEGIN_DATA_LINE,a)+c.V3K_IDX_SHIFT,a=e.indexOf(" ",o);for(let n=0;n<3;++n)o=a+1,a=Math.min(e.indexOf("\n",o),e.indexOf(" ",o)),t[n]=parseInt(e.slice(o,a));n[l]=t[0],s[l]=t.slice(1);const u=e.indexOf("\n",o);let h=e.slice(a,u),d=h.indexOf(c.V3K_BOND_CONFIG);if(-1!==d){d=h.indexOf("=",d)+1;let e=h.indexOf(" ",d);-1===e&&(e=h.length);const t=parseInt(h.slice(d,e));r.set(l,t);const n=c.V3K_BOND_CONFIG+t.toString();h=h.replace(n,"")}h||i.set(l,h)}return{bondTypes:n,atomPairs:s,bondConfiguration:r,kwargs:i}}(u,d.bondCount),w=function(e,t,n,s){const r={backboneShift:null,branchShift:null,terminalNodes:[],rNodes:[]};return function(e,t,n){for(const[s,r]of n)e.atomTypes[s-1]=t[r-1]}(e,n,s),function(e,t){t.rNodes=Array.from(e.keys());for(let n=0;n<t.rNodes.length;n++)for(const s of[1,2])if(e.get(t.rNodes[n])===s){const e=t.rNodes[s-1];t.rNodes[s-1]=t.rNodes[n],t.rNodes[n]=e}}(s,r),p(t,r),r}(m,g,a,l),T=function(e){let t=[],n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(");for(;-1!==n;){n+=28;const s=e.indexOf(")",n);t=t.concat(e.substring(n,s).split(" ").slice(1).map((e=>parseInt(e)))),n=s,n=e.indexOf("M V30 MDLV30/STEABS ATOMS=(",n)}return t}(u),S={atoms:m,bonds:g,meta:w,stereoAtoms:T};return"PEPTIDE"===s?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,s=e.atoms.x,r=e.atoms.y;v(e,-s[t],-r[t]);const i=b(s[n],r[n]);A(e.atoms,-i),s[e.meta.rNodes[1]-1]<0&&function(e){C(e,!1)}(e);const o=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 s=n[e],r=n[(e+1)%2];t.has(s)?t.get(s)?.push(r):t.set(s,new Array(1).fill(r))}return t}(e);let n=0;const s=e.atoms.atomTypes.length;let r=0;for(;0===n;){const i=t.get(e.meta.terminalNodes[1])[r];if(e.atoms.atomTypes[i-1]===c.OXYGEN&&i!==e.meta.rNodes[1]&&(n=i),r++,r>s)throw new Error(`Search for double-bonded Oxygen in ${e} has exceeded the limit of ${s}`)}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,o),function(e,t){const n=e.atoms.x;n[e.meta.rNodes[1]-1]>n[t-1]&&function(e,t,n){const s=t-1,r=n-1,i=e.atoms.x,o=e.atoms.y,a=i[s],l=o[s];i[s]=i[r],o[s]=o[r],i[r]=a,o[r]=l}(e,t,e.meta.rNodes[1])}(e,o)}(S):e===c.RIBOSE||e===c.DEOXYRIBOSE?function(e,t){const n=e.atoms.x,s=e.atoms.y;let r=e.meta.terminalNodes[0]-1;const i=e.meta.rNodes[1]-1;v(e,-n[r],-s[r]);const o=b(n[i],s[i]);A(e.atoms,3*Math.PI/2-o),t.value=function(e){const t=e.atoms.x,n=e.atoms.y,s=e.meta.rNodes[2]-1,r=e.meta.terminalNodes[2]-1,i=t[s]-t[r],o=n[s]-n[r];return Math.atan(o/i)+Math.PI/2}(e),r=e.meta.terminalNodes[0]-1,v(e,-n[r],-s[r])}(S,r):e===c.PHOSPHATE?function(e){const t=e.meta.terminalNodes[0]-1,n=e.meta.rNodes[0]-1,s=e.atoms.x,r=e.atoms.y;v(e,-s[t],-r[t]);const i=b(s[n],r[n]);A(e.atoms,Math.PI/2-i)}(S):function(e,t){const n=e.atoms.x,s=e.atoms.y,r=e.meta.terminalNodes[0]-1,i=e.meta.rNodes[0]-1;v(e,-n[r],-s[r]);const o=b(n[i],s[i]),a=t.value;if(!a)throw new Error("The value of sugarBranchToOYAngle is null");A(e.atoms,Math.PI-o+a);const l=function(e,t){return h(Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2))}({x:n[e.meta.rNodes[0]-1],y:s[e.meta.rNodes[0]-1]},{x:n[e.meta.terminalNodes[0]-1],y:s[e.meta.terminalNodes[0]-1]});if(1!=l)for(let e=0;e<n.length;++e)n[e]=h(n[e]/l),s[e]=h(s[e]/l)}(S,r),function(e,t,n){"PEPTIDE"===e?(f(t,e),y(t,t.meta.rNodes[1])):n===c.RIBOSE||n===c.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===c.PHOSPHATE&&(t.meta.terminalNodes[0]=t.meta.rNodes[0],v(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]))}(s,S,e),function(e){let t=0;for(;t<e.atoms.atomTypes.length;)e.atoms.atomTypes[t]===c.HYDROGEN&&(y(e,t+1),--t),++t}(S),S}var i;return null}(t,n,s,r,i);if(!o)throw new Error(`Monomer with symbol '${t}' is absent the monomer library`);e.set(t,o)}}function p(e,t){const n=t.rNodes;t.terminalNodes=new Array(n.length).fill(0);const s=t.terminalNodes,r=e.atomPairs;let i=0,o=0;for(;i<r.length&&o<s.length;){for(let e=0;e<s.length;++e)for(let t=0;t<2;++t)r[i][t]===n[e]&&(s[e]=r[i][(t+1)%2],n.length,++o);++i}}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[h(e.atoms.x[t]-e.atoms.x[n]),h(e.atoms.y[t]-e.atoms.y[n])]}function y(e,t){if(void 0!==t){const n=t-1,s=e.atoms,r=e.bonds,i=e.meta;s.atomTypes.splice(n,1),s.x=w(Float32Array,s.x,n,1),s.y=w(Float32Array,s.y,n,1),s.kwargs.splice(n,1);for(let e=0;e<i.terminalNodes.length;++e)i.terminalNodes[e]>t?--i.terminalNodes[e]:i.terminalNodes[e]===t&&(i.terminalNodes[e]=-1);for(let e=0;e<i.rNodes.length;++e)i.rNodes[e]>t?--i.rNodes[e]:i.rNodes[e]===t&&(i.rNodes[e]=-1);let o=0;for(;o<r.atomPairs.length;){const e=r.atomPairs[o][0],n=r.atomPairs[o][1];e===t||n===t?(r.atomPairs.splice(o,1),r.bondTypes=w(Uint32Array,r.bondTypes,o,1),r.bondConfiguration.has(o)&&r.bondConfiguration.delete(o),r.kwargs.has(o)&&r.kwargs.delete(o),--o):(r.atomPairs[o][0]=e>t?e-1:e,r.atomPairs[o][1]=n>t?n-1:n),++o}let a=Array.from(r.bondConfiguration.keys());a.forEach((e=>{if(r.bondConfiguration.has(e)&&e>n){const t=r.bondConfiguration.get(e);r.bondConfiguration.delete(e),r.bondConfiguration.set(e-1,t)}})),a=Array.from(r.kwargs.keys()),a.forEach((e=>{if(r.kwargs.has(e)&&e>n){const t=r.kwargs.get(e);r.kwargs.delete(e),r.kwargs.set(e-1,t)}}))}}function w(e,t,n,s){const r=new e(t.length-s);let i=0,o=0;for(;i<t.length;)i===n&&(i+=s),r[o]=t[i],++o,++i;return r}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 s=t/e,r=Math.atan(s);n=e<0?Math.PI/2+r:-Math.PI/2+r}return n}function A(e,t){if(0!==t){const n=e.x,s=e.y,r=Math.cos(t),i=Math.sin(t);for(let e=0;e<n.length;++e){const t=n[e];n[e]=h(t*r-s[e]*i),s[e]=h(t*i+s[e]*r)}}}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 s=1===t?3:1;n.set(e,s)}}function v(e,t,n){const s=e.atoms.x,r=e.atoms.y;for(let e=0;e<s.length;++e)s[e]=h(s[e]+t),void 0!==n&&(r[e]=h(r[e]+n))}},6137:(e,t,n)=>{"use strict";n.d(t,{J:()=>r,V:()=>i});var s=n(9976);class r extends s.B{static get Chromatogram(){return void 0===this.chromatogram&&(this.chromatogram=new r({A:"green",C:"blue",G:"black",T:"red",U:"red",others:"gray"})),this.chromatogram}}class i{}i.SemType="Nucleotides",i.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",i.Names={A:"Adenine",C:"Cytosine",G:"Guanine",T:"Thymine",U:"Uracil"}},9976:(e,t,n)=>{"use strict";n.d(t,{B:()=>s});class s{static makePalette(e,t=!1,n=s){const r={};return e.forEach((e=>{const n=e[0],s=e[1];n.forEach(((e,n)=>{r[e]=this.colourPalette[s][t?0:n]}))})),new n(r)}constructor(e){this._palette=e}get(e){return this._palette[e]}}s.undefinedColor="rgb(100,100,100)",s.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)"]}},7331:(e,t,n)=>{"use strict";n.d(t,{UE:()=>c,kQ:()=>o});var s=n(976),r=n(9976);class i{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 o{}class a extends o{get(e){return"#666666"}}class l extends o{static buildPalette(){return[].concat(...Object.values(r.B.colourPalette))}get(e){const t=i.hashCode(e)%l.palette.length;return function(e){if(null==e)return"rgb(100,100,100)";const t=s.Color.fromHtml(e),n=s.Color.g(t),r=s.Color.r(t),i=s.Color.b(t),o=Math.sqrt(Math.pow(0-r,2)+Math.pow(0-n,2)+Math.pow(0-i,2));return o>210?`rgb(${r/o*210},${n/o*210},${i/o*210})`:s.Color.toRgb(t)}(l.palette[t])}}l.palette=l.buildPalette();class c extends r.B{static get Gray(){return void 0===this.gray&&(this.gray=new a),this.gray}static get Color(){return void 0===this.color&&(this.color=new l),this.color}}},9713:(e,t,n)=>{"use strict";n.d(t,{N:()=>o,b:()=>a});var s=n(4469),r=n(701),i=n(2997);function o(e){let t=null,n=null;try{n=e.dart?e.gridColumn:null,t=n?n.temp:null}catch{[n,t]=[null,null]}const s=e.cell.column;if(t=t??s.temp,!t)throw new Error("Grid cell renderer back store (GridColumn or Column) not found.");return[n,s,t]}class a{constructor(e,t,n){this.gridCol=e,this.tableCol=t,this.logger=n,this.subs=[],this.destroyed=!1,this.viewerId=++a.viewerCounter,this.errors=[],this._onRendered=new r.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(s.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(s.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,i.zg)(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`)}}a.viewerCounter=-1},9611:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,m:()=>c});var s=n(976),r=n(6414),i=n.n(r),o=n(8607),a=n(9713),l=n(7228);function c(e,t){let n,s=100,r=0,i=e.length-1;for(;r<=i;){if(n=Math.floor((i+r)/2),e[n]<=t&&t<e[n+1])return n;if(t<e[n]?i=n-1:r=n+1,--s<=0)throw new Error(`Get position for pointer x = ${t} searching has not converged on ${JSON.stringify(e)}. `)}return null}class u extends a.b{get updated(){return this._updated}constructor(e,t,n,r){super(e,t,n),this.propsProvider=r,this.colWidth=0,this._monomerLengthList=null,this.separatorWidth=5,this._processedMaxVisibleSeqLength=0,this._updated=!1,this._monomerLengthMap={},this._monomerStructureMap={},this.props=this.propsProvider(),this._processedRows=s.BitSet.create(this.tableCol.length),this.gridCol&&this.subs.push(this.gridCol.grid.onAfterDrawContent.subscribe((()=>{this._onRendered.next()}))),(0,l.JN)().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=s.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),s=new Array(n.length+1);s[0]=5;for(let e=1;e<s.length;e++)s[e]=s[e-1]+n[e-1];return[n,s]}getCellMonomerLengthsForSeq(e){null===this._monomerLengthList&&(this._monomerLengthList=new Array(this.tableCol.length).fill(null),this._updated=!0);const t=this.props.separatorWidth+1*this.props.monomerCharWidth,n=Math.ceil(this.colWidth/t),s=o.g.forColumn(this.tableCol).getSplitted(e).originals,r=Math.min(n,s.length);let i=this._monomerLengthList[e];if(null===i||i.length<r){i=this._monomerLengthList[e]=new Array(s.length);let t=0;for(let e=0;e<r;++e){const n=s[e],r=this.props.monomerToShort(n,this.props.monomerLengthLimit),o=(this.props.seqHandler.isSeparator()?this.separatorWidth:this.props.separatorWidth)+r.length*this.props.monomerCharWidth;if(i[e]=o,t+=o,t>this.colWidth)break}this._updated=!0}return i}getCellMonomerLengthsForSeqMsa(){var e;null===this._monomerLengthList&&(this._monomerLengthList=new Array(1).fill(null),this._updated=!0),(e=this._monomerLengthList)[0]??(e[0]=new Array(0));const t=this._monomerLengthList[0],{startIdx:n,endIdx:s}=(()=>{try{const e=this.gridCol&&this.gridCol.dart?this.gridCol.grid:null;return e&&e.dart?{startIdx:Math.max(Math.floor((e?.vertScroll.min??0)-10),0),endIdx:Math.min(Math.ceil((e?.vertScroll.max??0)+10),this.tableCol.length)}:{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}catch(e){return{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}})(),r=this.props.separatorWidth+1*this.props.monomerCharWidth,i=Math.ceil(this.colWidth/r);for(let e=n;e<s;e++){if(this._processedRows.get(e)&&i<=this._processedMaxVisibleSeqLength)continue;const n=o.g.forColumn(this.tableCol).getSplitted(e,i).originals,s=Math.min(i,n.length);s>t.length&&t.push(...new Array(s-t.length).fill(r));let a=0;for(let e=0;e<s;++e){const s=n[e],r=this.props.monomerToShort(s,this.props.monomerLengthLimit),i=this.props.separatorWidth+r.length*this.props.monomerCharWidth;if(t[e]=Math.max(t[e]??0,i),a+=i,a>=this.colWidth)break}this._updated=!0,this._processedMaxVisibleSeqLength=Math.max(this._processedMaxVisibleSeqLength,i)}return t}getPosition(e,t,n){const[s,r]=this.getCellMonomerLengths(e,n),a=o.g.forColumn(this.tableCol);return 0===i()(a.getSplitted(e).originals).toArray().length?null:c(r,t)}setMonomerLengthLimit(e){this.props.monomerLengthLimit=e,this._updated=!0}setSeparatorWidth(e){this.props.separatorWidth=e,this._updated=!0}isMsa(){return this.props.seqHandler.isMsa()}}},1047:(e,t,n)=>{"use strict";n.d(t,{$3:()=>r,pU:()=>i,rx:()=>s});const s=["symbol","molfile","rgroups","name"],r="p",i=new RegExp(`[rd]\\((\\w)\\)${r}?`,"g")},7945:(e,t,n)=>{"use strict";function s(e){return"string"==typeof e||e instanceof String?e:"StateError"===e.constructor.name?e.message:"StateError"===e.constructor.name&&"$thrownJsError"in e?s(e.$thrownJsError):e instanceof Error?e.message:e.toString()}function r(e){return e instanceof Error?e.stack:"StateError"===e.constructor.name&&"$thrownJsError"in e?r(e.$thrownJsError):void 0}function i(e){return[s(e),r(e)]}n.d(t,{yf:()=>i})},5226:(e,t,n)=>{"use strict";n.d(t,{i:()=>o});var s=n(976),r=n(8607),i=n(1821);class o{get descriptionsArray(){return this._descriptionsArray}get sequencesArray(){return this._sequencesArray}parseMacromolecule(e,t){return this._fileContent.slice(e,t).split(/\s/).join("")}parseColumns(){const e=/^>(.*)$/gm;let t,n=0;for(;t=e.exec(this._fileContent);){const s=this._fileContent.substring(t.index+1,e.lastIndex);this._descriptionsArray.push(s),0!==n&&this._sequencesArray.push(this.parseMacromolecule(n,t.index)),n=e.lastIndex+1}this._sequencesArray.push(this.parseMacromolecule(n,-1))}importFasta(){const e=s.Column.fromStrings("description",this.descriptionsArray),t=s.Column.fromStrings("sequence",this.sequencesArray);return t.semType=s.SEMTYPE.MACROMOLECULE,t.setTag(s.TAGS.UNITS,i.r2.FASTA),r.g.forColumn(t),[s.DataFrame.fromColumns([e,t])]}constructor(e){this._descriptionsArray=[],this._sequencesArray=[],this._fileContent=e,this.parseColumns()}}},706:(e,t,n)=>{"use strict";n.d(t,{Ug:()=>i,io:()=>o});var s=n(976),r=n(8447);function i(){const e=[];return e.push(s.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(s.Column.fromList(s.COLUMN_TYPE.FLOAT,"Activity",new Array(10**6).fill(5.30751))),e}function o(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=s.Column.fromList(s.COLUMN_TYPE.STRING,"MSA",new Array(100).fill(t));n.semType=s.SEMTYPE.MACROMOLECULE,n.setTag(s.TAGS.UNITS,r.r2.SEPARATOR),n.setTag("separator","/"),n.setTag("alphabet","UN"),n.setTag(".alphabetIsMultichar","true");const i=[];return i.push(n),i.push(s.Column.fromList(s.COLUMN_TYPE.FLOAT,"Activity",new Array(100).fill(7.30751))),i}n(6414),n(8607),n(8260)},1821:(e,t,n)=>{"use strict";n.d(t,{BM:()=>o,CI:()=>i,XS:()=>l,r2:()=>s,se:()=>a});var s,r=n(6286);!function(e){e.FASTA="fasta",e.SEPARATOR="separator",e.HELM="helm"}(s||(s={}));const i=", ",o=/(?:\[([A-Za-z0-9_\-,()]+)\])|([A-Za-z\-])/g,a=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"])}}},l=[new r.LA("PT",a.fasta.peptide,.5),new r.LA("DNA",a.fasta.dna,.55),new r.LA("RNA",a.fasta.rna,.55)]},8447:(e,t,n)=>{"use strict";n.d(t,{Ar:()=>r.Ar,CI:()=>s.CI,GU:()=>r.GU,KX:()=>r.KX,XS:()=>s.XS,dQ:()=>r.dQ,gM:()=>r.gM,gP:()=>r.gP,kB:()=>r.kB,py:()=>r.py,r2:()=>s.r2,up:()=>r.up});var s=n(1821),r=n(8260)},6286:(e,t,n)=>{"use strict";n.d(t,{G2:()=>s,LA:()=>r,dJ:()=>i});const s="";class r{constructor(e,t,n){this.name=e,this.alphabet=t,this.cutoff=n}}class i extends r{constructor(e,t,n){super(e.name,e.alphabet,e.cutoff),this.freq=t,this.similarity=n}}},8260:(e,t,n)=>{"use strict";n.d(t,{wx:()=>p,w4:()=>P,gM:()=>_,KX:()=>x,py:()=>N,vU:()=>T,Ar:()=>b,jY:()=>g,GU:()=>E,dQ:()=>$,up:()=>M,kB:()=>y,FJ:()=>w,gP:()=>v});var s=n(976),r=n(6414),i=n.n(r),o=n(6286),a=n(1821),l=n(8607);class c extends Float32Array{}var u=n(850),h=n(2012),d=n(6137),m=n(7331);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)===l.lh[a.r2.FASTA]}getCanonical(e){if(this.length<=e)throw new Error("Index out of bounds");return this.isGap(e)?o.G2: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 s=e.categories;return function(e,t){const n={};let s=!0,r=null;for(const i of e)if(null==r?r=i.length:i.length!==r&&(s=!1),i.length>=t)for(const e of i.canonicals)e in n||(n[e]=0),n[e]+=1;return{freq:n,sameLength:s}}(i().enumerate(e.getRawData()).map((([e,t])=>n(s[e]))),t)}const y=e=>{const t=i()(e.toString().matchAll(a.BM)).map((e=>e[2]??e[1])).toArray();return new p(t,l.lh[a.r2.FASTA])},w=e=>e?new f(e):new p([],l.lh[a.r2.FASTA]);function b(e,t=undefined){return n=>{if(n){let s;const r=new RegExp(String.raw`"-"|'-'|[^${e}]+`,"g");if(void 0!==t){r.lastIndex=0,s=new Array(Math.ceil(t));let e=null,i=0;for(;null!==(e=r.exec(n))&&i<t;)s[i++]=e[0].replace('"-"',"").replace("'-'","");s.splice(i)}else s=n.replaceAll('"-"',"").replaceAll("'-'","").split(e,t);return new p(s,l.lh[a.r2.SEPARATOR])}return new p([],l.lh[a.r2.SEPARATOR])}}const A=/(PEPTIDE1|DNA1|RNA1)\{([^}]+)}/g,C=/\[([^\[\]]+)]/g,v=e=>{A.lastIndex=0;const t=A.exec(e.toString()),n=t?t[2]:null,s=n?n.split("."):[];return new p(s.map((e=>{C.lastIndex=0;const t=C.exec(e);return t&&t.length>=2?t[1]:e})),l.lh[a.r2.HELM])};function T(e,t,n=undefined){if(e.toLowerCase().startsWith(a.r2.FASTA))return y;if(e.toLowerCase().startsWith(a.r2.SEPARATOR))return b(t,n);if(e.toLowerCase().startsWith(a.r2.HELM))return v;throw new Error(`Unexpected units ${e} .`)}const S=/([^\W_]+)/g;function E(e,t){if(e.length<=t)return e;const n=e.match(S),s=e.length>t||(n?.length??0)>1,r=n?.[0]??" ";return s?r.substring(0,t-1)+"…":r}function _(e){switch(e){case"DNA":return a.se.fasta.dna;case"RNA":return a.se.fasta.rna;case"PT":return a.se.fasta.peptide;default:throw new Error(`Unsupported alphabet '${e}'.`)}}function x(e,t,n="-"){const s=new Set([...new Set(Object.keys(e)),...t]);s.delete(n);const r=[],i=[];for(const n of s)r.push(n in e?e[n]:0),i.push(t.has(n)?1:0);const o=new c(r),a=new c(i);return(0,u.MA)(o,a)/((0,u.$G)(o)*(0,u.$G)(a))}function P(e,t,n="-"){const s=t.map((t=>{const s=x(e,t.alphabet,n);return new o.dJ(t,e,s)}));let r;const i=Math.max(...s.map((e=>e.similarity>e.cutoff?e.similarity:-1)));return r=i>0?s.find((e=>e.similarity===i)).name:"UN",r}function $(e,t=5){let n;return n=e.semType==s.SEMTYPE.MACROMOLECULE?l.g.forColumn(e).alphabet:P(g(e,t,y).freq,a.XS),N(n)}function N(e){switch(e){case"PT":return h.f.GrokGroups;case"DNA":case"RNA":return d.J.Chromatogram;default:return m.UE.Color}}function M(e){const t=e.columns.bySemTypeAll(s.SEMTYPE.MACROMOLECULE);let n=t.find((e=>{const t=e.getTag(s.TAGS.UNITS);return!!t&&-1!==t.indexOf("MSA")}))??null;return!n&&t.length>0&&(n=t[0]),n}},8607:(e,t,n)=>{"use strict";n.d(t,{g:()=>p,lh:()=>m});var s=n(976),r=n(6414),i=n.n(r),o=n(8447),a=n(6286),l=n(8260),c=n(708),u=n(7228),h=n(1047);const d=new class{constructor(){this.seqHandler="seq-handler",this.notationProvider="seq-handler.notation-provider"}},m={[o.r2.FASTA]:"-",[o.r2.SEPARATOR]:"",[o.r2.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!==s.TYPE.STRING)throw new Error(`Unexpected column type '${e.type}', must be '${s.TYPE.STRING}'.`);this._column=e;const t=this._column.getTag(s.TAGS.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[o.r2.FASTA]:this.isHelm()?m[o.r2.HELM]:m[o.r2.SEPARATOR],!this.column.tags.has("aligned")||!this.column.tags.has("alphabet")||!this.column.tags.has(".alphabetIsMultichar")&&!this.isHelm()&&"UN"===this.alphabet)if(this.isFasta())p.setUnitsToFastaColumn(this);else if(this.isSeparator()){const t=e.getTag("separator");p.setUnitsToSeparatorColumn(this,t)}else{if(!this.isHelm())throw new Error(`Unexpected units '${this.column.getTag(s.TAGS.UNITS)}'.`);p.setUnitsToHelmColumn(this)}if(!this.column.tags.has(".alphabetIsMultichar"))if(this.isHelm())this.column.setTag(".alphabetIsMultichar","true");else if(["UN"].includes(this.alphabet))throw new Error(`For column '${this.column.name}' of alphabet '${this.alphabet}' tag '.alphabetIsMultichar' is mandatory.`);this.notationProvider=this.column.temp[d.notationProvider]??null,this.columnVersion=this.column.version}static setUnitsToFastaColumn(e){if(e.column.semType!==s.SEMTYPE.MACROMOLECULE||e.column.getTag(s.TAGS.UNITS)!==o.r2.FASTA)throw new Error(`The column of notation '${o.r2.FASTA}' must be '${s.SEMTYPE.MACROMOLECULE}'.`);e.column.setTag(s.TAGS.UNITS,o.r2.FASTA),p.setTags(e)}static setUnitsToSeparatorColumn(e,t){if(e.column.semType!==s.SEMTYPE.MACROMOLECULE||e.column.getTag(s.TAGS.UNITS)!==o.r2.SEPARATOR)throw new Error(`The column of notation '${o.r2.SEPARATOR}' must be '${s.SEMTYPE.MACROMOLECULE}'.`);if(!t)throw new Error(`The column of notation '${o.r2.SEPARATOR}' must have the separator tag.`);e.column.setTag(s.TAGS.UNITS,o.r2.SEPARATOR),e.column.setTag("separator",t),p.setTags(e)}static setUnitsToHelmColumn(e){if(e.column.semType!==s.SEMTYPE.MACROMOLECULE)throw new Error(`The column of notation '${o.r2.HELM}' must be '${s.SEMTYPE.MACROMOLECULE}'`);e.column.setTag(s.TAGS.UNITS,o.r2.HELM),p.setTags(e)}static setTags(e){const t=e.column.getTag(s.TAGS.UNITS);if([o.r2.FASTA,o.r2.SEPARATOR].includes(t)){if(!e.column.getTag("alphabet")&&0===Object.keys(e.stats.freq).length)throw new Error("Alphabet is empty and not annotated.");let t=e.column.getTag("aligned");null===t&&(t=e.stats.sameLength?"SEQ.MSA":"SEQ",e.column.setTag("aligned",t));let n=e.column.getTag("alphabet");if(null===n&&(n=(0,l.w4)(e.stats.freq,o.XS),e.column.setTag("alphabet",n)),"UN"===n){const t=Object.keys(e.stats.freq).length,n=Object.keys(e.stats.freq).some((e=>e.length>1));e.column.setTag(".alphabetSize",t.toString()),e.column.setTag(".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("separator")??void 0;if(this.notation===o.r2.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("aligned");if(!e&&(this.isFasta()||this.isSeparator()))throw new Error("Tag aligned not set");return e}get alphabet(){const e=this.column.getTag("alphabet");if(!e&&(this.isFasta()||this.isSeparator()))throw new Error("Tag alphabet not set");return e}get helmCompatible(){return this.column.getTag(".isHelmCompatible")}getAlphabetSize(){if(this.notation==o.r2.HELM||"UN"==this.alphabet){const e=this.column.getTag(".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"PT":return 20;case"DNA":case"RNA":return 4;case"NT":return console.warn("Unexpected alphabet 'NT'."),4;default:throw new Error(`Unexpected alphabet '${this.alphabet}'.`)}}getAlphabetIsMultichar(){return this.notation===o.r2.HELM||"UN"===this.alphabet&&"true"===this.column.getTag(".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 s=this.column.length;for(let r=0;r<s;++r){const s=this.getSplitted(r);null==n?n=s.length:s.length!==n&&(t=!1);for(const t of s.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(...i().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(".positionNames");this._posList=e?e.split(o.CI).map((e=>e.trim())):i().count(1).take(this.maxLength).map((e=>e.toString())).toArray()}return this._posList}isFasta(){return this.notation===o.r2.FASTA}isSeparator(){return this.notation===o.r2.SEPARATOR}isHelm(){return this.notation===o.r2.HELM}isRna(){return"RNA"===this.alphabet}isDna(){return"DNA"===this.alphabet}isPeptide(){return"PT"===this.alphabet}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(o.r2.FASTA))return o.r2.FASTA;if(this.units.toLowerCase().startsWith(o.r2.SEPARATOR))return o.r2.SEPARATOR;if(this.units.toLowerCase().startsWith(o.r2.HELM))return o.r2.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,r){const i=this.column,a=e.toLowerCase()+"("+i.name+")",l=n??i.dataFrame.columns.getUnusedName(a),c=s.Column.fromList("string",l,r??new Array(this.column.length).fill(""));if(c.semType=s.SEMTYPE.MACROMOLECULE,c.setTag(s.TAGS.UNITS,e),e===o.r2.SEPARATOR){if(!t)throw new Error(`Notation '${o.r2.SEPARATOR}' requires separator value.`);c.setTag("separator",t)}c.setTag(s.TAGS.CELL_RENDERER,"sequence");const u=i.getTag("aligned");u&&c.setTag("aligned",u);let h=i.getTag("alphabet");h||this.notation!==o.r2.HELM||e===o.r2.HELM||(h="UN"),null!=h&&c.setTag("alphabet",h);let d=i.getTag(".alphabetSize");null!=h&&d&&c.setTag(".alphabetSize",d);const m=i.getTag(".alphabetIsMultichar");return null!=h&&void 0!==m&&c.setTag(".alphabetIsMultichar",m),e==o.r2.HELM&&(d=this.getAlphabetSize().toString(),c.setTag(".alphabetSize",d)),c}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(),[o.r2.FASTA,o.r2.SEPARATOR,o.r2.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 r=s.Column.fromList("string",t,new Array(e).fill(""));return r.semType=s.SEMTYPE.MACROMOLECULE,r.setTag(s.TAGS.UNITS,n),r}getSplitter(e){let t=null;if(t=this.notationProvider?this.notationProvider.splitter:null,t)return t;if(this.units.toLowerCase().startsWith(o.r2.FASTA))return null===this.column.getTag("alphabet")||this.getAlphabetIsMultichar()?o.kB:l.FJ;if(this.units.toLowerCase().startsWith(o.r2.SEPARATOR))return(0,o.Ar)(this.separator,e);if(this.units.toLowerCase().startsWith(o.r2.HELM))return o.gP;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");return this.isMsa()?c.U.HAMMING:(this.alphabet,c.U.LEVENSHTEIN)}getDistanceFunction(){return c.o[this.getDistanceFunctionName()]()}async checkHelmCompatibility(){if(this.column.tags.has(".isHelmCompatible"))return"true"===this.column.getTag(".isHelmCompatible");const e=(await(0,u.JN)()).getBioLib().getMonomerSymbolsByType("PEPTIDE"),t=new Set(e),n=((0,o.Ar)(this.separator),new Set),s=this.column.length,r=this.column.getRawData();for(let e=0;e<s;++e){const s=r[e];if(!(s in n)){n.add(s);const r=this.getSplitted(e);for(const e of r.canonicals)if(!t.has(e))return this.column.setTag(".isHelmCompatible","false"),!1}}return this.column.setTag(".isHelmCompatible","true"),!0}get splitter(){return null===this._splitter&&(this._splitter=this.getSplitter()),this._splitter}toFasta(e){return e===o.r2.FASTA}toSeparator(e){return e===o.r2.SEPARATOR}toHelm(e){return e===o.r2.HELM}convertHelmToFastaSeparator(e,t,n,s){s||(s=this.toFasta(t)?m[o.r2.FASTA]:m[o.r2.SEPARATOR]),n||(n=this.toFasta(t)?"":this.separator);const r=e.startsWith("RNA"),i=this.splitter(e),a=[];for(let e=0;e<i.length;++e){let n=i.getOriginal(e);if(r&&(n=n.replace(h.pU,"")),n===m[o.r2.HELM])a.push(s);else if(this.toFasta(t)&&n.length>1){const e="["+n+"]";a.push(e)}else a.push(n)}return a.join(n)}convert(e,t){const n=this.getJoiner({notation:e,separator:t}),s=this.getNewColumn(e,t);return s.init((e=>{const t=this.getSplitted(e);return n(t)})),s}getRegion(e,t,n){const s=this.getNewColumn(this.notation,this.separator);s.name=n;const r=e??0,i=t??this.maxLength-1,a=this.getJoiner(),c=i-r+1,u=m[this.notation];s.init((e=>{const t=this.getSplitted(e),n=new Array(c);for(let e=0;e<c;++e){const s=r+e;n[e]=s<t.length?t.getOriginal(s):u}return a(new l.wx(n,u))}));const h=e=>{const t=e.split(",").map((e=>e.trim())),n=new Array(c);for(let e=0;e<c;++e){const s=r+e;n[e]=s<t.length?t[s]:"?"}return n.join(o.CI)},d=this.column.getTag(".positionNames");d&&s.setTag(".positionNames",h(d));const p=this.column.getTag(".positionLabels");return p&&s.setTag(".positionLabels",h(p)),s}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 s;const r=this;switch(t){case o.r2.FASTA:s=function(e){return r.joinToFasta(e,r.isHelm())};break;case o.r2.SEPARATOR:if(!n)throw new Error(`Separator is mandatory for notation '${t}'.`);s=function(e){return f(e,n,r.isHelm())};break;case o.r2.HELM:{const e="DNA"===r.alphabet||"RNA"===r.alphabet,t=r.getHelmWrappers();s=function(n){return g(n,t,e)};break}default:throw new Error(`Unexpected notation '${t}'.`)}return s}getConverter(e,t=undefined){if(e===o.r2.SEPARATOR&&!t)throw new Error(`Target separator is not specified for target units '${o.r2.SEPARATOR}'.`);const n=this;if(e===o.r2.FASTA)return function(e){return n.convertToFasta(e)};if(e===o.r2.HELM)return function(e){return n.convertToHelm(e)};if(e===o.r2.SEPARATOR)return function(e){return n.convertToSeparator(e,t)};throw new Error}static forColumn(e){let t=e.temp[d.seqHandler];return t&&t.columnVersion===e.version||(t=e.temp[d.seqHandler]=new p(e)),t}joinToFasta(e,t){const n=new Array(e.length);for(let s=0;s<e.length;++s){const r=e.getOriginal(s);let i=e.getOriginal(s);t&&(i=i.replace(h.pU,"$1")),r===a.G2?i=m[o.r2.FASTA]:r===h.$3?i="":i.length>1&&(i="["+i+"]"),n[s]=i}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),s=e.startsWith("DNA"),r=e.startsWith("RNA");for(let e=0;e<t.length;++e){let i=t.getOriginal(e);(s||r)&&(i=i.replace(h.pU,"$1"),i=i===h.$3?null:i),n[e]=i||null}return new l.wx(n.filter((e=>!!e)),m[o.r2.HELM])}}function f(e,t,n){const s=new Array(e.length);for(let t=0;t<e.length;++t){const r=e.getCanonical(t);let i=e.getOriginal(t);n&&(i=i.replace(h.pU,"$1")),r===a.G2?i=m[o.r2.SEPARATOR]:r===h.$3&&(i=""),s[t]=i}return s.join(t)}function g(e,t,n){const[s,r,i,l]=t,c=new Array(e.length);for(let t=0;t<e.length;++t){const s=e.getCanonical(t);let l=e.getOriginal(t);s===a.G2?l=m[o.r2.HELM]:(n&&(l=l.replace(h.pU,"$1")),l=1===l.length?`${r}${l}${i}`:`${r}[${l}]${i}`),c[t]=l}return`${s}${c.join(".")}${l}`}},8457:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});var s=n(976),r=n(8607);function i(e){const t=e=>{const t=o.columns.addNewString((e+1).toString());return n.push(t),t},n=[],i=e.length,o=s.DataFrame.create(i),a=r.g.forColumn(e);for(let e=0;e<i;++e){const s=a.getSplitted(e);for(let r=0;r<s.length;++r){const i=s.getOriginal(r);((n[r]??null)||t(r)).set(e,i,!1)}}return o}},172:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var s,r=n(7945);!function(e){e[e.error=0]="error",e[e.warning=1]="warning",e[e.info=2]="info",e[e.debug=3]="debug"}(s||(s={}));class i{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[s,i]=(0,r.yf)(t);this.logger.error(`${e}, SYNC syncId = ${n}, ERROR:\n${s}`,void 0,i),this.errors.push(t)}))}resetErrors(){const e=this.errors;return this.errors=[],e}}},9298:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>l,DX:()=>s,ES:()=>r,dE:()=>a,iD:()=>o,vS:()=>u,vw:()=>i});var s,r,i,o,a,l,c=n(976);!function(e){e.tooltipWebLogo=".tooltipWebLogo"}(s||(s={})),function(e){e.Entropy="Entropy",e.full="100%"}(r||(r={})),function(e){e.TOP="top",e.MIDDLE="middle",e.BOTTOM="bottom"}(i||(i={})),function(e){e.LEFT="left",e.CENTER="center",e.RIGHT="right"}(o||(o={})),function(e){e.AUTO="auto",e.ON="on",e.OFF="off"}(a||(a={})),function(e){e.Filtered="Filtered",e.Selected="Selected"}(l||(l={}));const u=new class{constructor(){this.sequenceColumnName=null,this.valueAggrType=c.AGG.TOTAL_COUNT,this.valueColumnName="Activity",this.startPositionName=null,this.endPositionName=null,this.skipEmptySequences=!0,this.skipEmptyPositions=!1,this.shrinkEmptyTail=!0,this.backgroundColor=4294967295,this.positionHeight=r.Entropy,this.positionWidth=16,this.verticalAlignment=i.MIDDLE,this.horizontalAlignment=o.CENTER,this.fixWidth=!1,this.fitArea=!0,this.minHeight=50,this.maxHeight=100,this.showPositionLabels=!0,this.positionMarginState=a.AUTO,this.positionMargin=0,this.filterSource=l.Filtered}}},7905:(e,t,n)=>{"use strict";e=n.hmd(e);var s,r=(s="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){var t,n,r=void 0!==e?e:{};r.ready=new Promise((function(e,s){t=e,n=s}));var i,o=Object.assign({},r),a="object"==typeof window,l="function"==typeof importScripts,c=("object"==typeof process&&"object"==typeof process.versions&&process.versions.node,"");(a||l)&&(l?c=self.location.href:"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),s&&(c=s),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"",l&&(i=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)})),r.print||console.log.bind(console);var u,h,d=r.printErr||console.warn.bind(console);Object.assign(r,o),o=null,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.quit&&r.quit,r.wasmBinary&&(u=r.wasmBinary),r.noExitRuntime,"object"!=typeof WebAssembly&&S("no native wasm support detected");var m,p,f,g=!1;function y(){var e=h.buffer;r.HEAP8=m=new Int8Array(e),r.HEAP16=new Int16Array(e),r.HEAP32=new Int32Array(e),r.HEAPU8=p=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=f=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}var w=[],b=[],A=[],C=0,v=null,T=null;function S(e){r.onAbort&&r.onAbort(e),d(e="Aborted("+e+")"),g=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var E,_,x="data:application/octet-stream;base64,";function P(e){return e.startsWith(x)}function $(e){try{if(e==E&&u)return new Uint8Array(u);if(i)return i(e);throw"both async and sync fetching of the wasm failed"}catch(e){S(e)}}function N(e,t,n){return function(e){return u||!a&&!l||"function"!=typeof fetch?Promise.resolve().then((function(){return $(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 $(e)}))}(e).then((function(e){return WebAssembly.instantiate(e,t)})).then((function(e){return e})).then(n,(function(e){d("failed to asynchronously prepare wasm: "+e),S(e)}))}function M(e){for(;e.length>0;)e.shift()(r)}function L(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(W(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=h.buffer;try{return h.grow(e-t.byteLength+65535>>>16),y(),1}catch(e){}}function R(e){return r["_"+e]}P(E="wasmDbscan.wasm")||(_=E,E=r.locateFile?r.locateFile(_,c):c+_);var O="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function F(e,t,n,s,r){var i={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 s=e.charCodeAt(n);s<=127?t++:s<=2047?t+=2:s>=55296&&s<=57343?(t+=4,++n):t+=3}return t}(e)+1,n=H(t);return function(e,t,n){!function(e,t,n,s){if(!(s>0))return 0;for(var r=n+s-1,i=0;i<e.length;++i){var o=e.charCodeAt(i);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),o<=127){if(n>=r)break;t[n++]=o}else if(o<=2047){if(n+1>=r)break;t[n++]=192|o>>6,t[n++]=128|63&o}else if(o<=65535){if(n+2>=r)break;t[n++]=224|o>>12,t[n++]=128|o>>6&63,t[n++]=128|63&o}else{if(n+3>=r)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63,t[n++]=128|o>>6&63,t[n++]=128|63&o}}t[n]=0}(e,p,t,n)}(e,n,t),n}(e)),t},array:e=>{var t,n,s=H(e.length);return t=e,n=s,m.set(t,n),s}},o=R(e),a=[],l=0;if(s)for(var c=0;c<s.length;c++){var u=i[n[c]];u?(0===l&&(l=D()),a[c]=u(s[c])):a[c]=s[c]}var h=o.apply(null,a);return function(e){return 0!==l&&B(l),function(e){return"string"===t?(n=e)?function(e,t,n){for(var s=t+n,r=t;e[r]&&!(r>=s);)++r;if(r-t>16&&e.buffer&&O)return O.decode(e.subarray(t,r));for(var i="";t<r;){var o=e[t++];if(128&o){var a=63&e[t++];if(192!=(224&o)){var l=63&e[t++];if((o=224==(240&o)?(15&o)<<12|a<<6|l:(7&o)<<18|a<<12|l<<6|63&e[t++])<65536)i+=String.fromCharCode(o);else{var c=o-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&o)<<6|a)}else i+=String.fromCharCode(o)}return i}(p,n,s):"":"boolean"===t?Boolean(e):e;var n,s}(e)}(h)}var k,G={__cxa_throw:function(e,t,n){throw new L(e).init(t,n),e},abort:function(){S("")},emscripten_memcpy_big:function(e,t,n){p.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=p.length,s=2147483648;if((e>>>=0)>s)return!1;for(var r=1;r<=4;r*=2){var i=n*(1+.2/r);if(i=Math.min(i,e+100663296),I(Math.min(s,(t=Math.max(e,i))+(65536-t%65536)%65536)))return!0}return!1}},D=(function(){var e,t,s,i,o={env:G,wasi_snapshot_preview1:G};function a(e,t){var n,s=e.exports;return r.asm=s,h=r.asm.memory,y(),r.asm.__indirect_function_table,n=r.asm.__wasm_call_ctors,b.unshift(n),function(e){if(C--,r.monitorRunDependencies&&r.monitorRunDependencies(C),0==C&&(null!==v&&(clearInterval(v),v=null),T)){var t=T;T=null,t()}}(),s}if(C++,r.monitorRunDependencies&&r.monitorRunDependencies(C),r.instantiateWasm)try{return r.instantiateWasm(o,a)}catch(e){d("Module.instantiateWasm callback failed with error: "+e),n(e)}(e=u,t=E,s=o,i=function(e){a(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||P(t)||"function"!=typeof fetch?N(t,s,i):fetch(t,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,s).then(i,(function(e){return d("wasm streaming compile failed: "+e),d("falling back to ArrayBuffer instantiation"),N(t,s,i)}))}))).catch(n)}(),r._dbscan=function(){return(r._dbscan=r.asm.dbscan).apply(null,arguments)},r._malloc=function(){return(r._malloc=r.asm.malloc).apply(null,arguments)},r._free=function(){return(r._free=r.asm.free).apply(null,arguments)},function(){return(D=r.asm.stackSave).apply(null,arguments)}),B=function(){return(B=r.asm.stackRestore).apply(null,arguments)},H=function(){return(H=r.asm.stackAlloc).apply(null,arguments)},W=function(){return(W=r.asm.__cxa_is_pointer_type).apply(null,arguments)};function V(){function e(){k||(k=!0,r.calledRun=!0,g||(M(b),t(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)e=r.postRun.shift(),A.unshift(e);var e;M(A)}()))}C>0||(function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)e=r.preRun.shift(),w.unshift(e);var e;M(w)}(),C>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),e()}),1)):e()))}if(r.ccall=F,r.cwrap=function(e,t,n,s){var r=!n||n.every((e=>"number"===e||"boolean"===e));return"string"!==t&&r&&!s?R(e):function(){return F(e,t,n,arguments)}},T=function e(){k||V(),k||(T=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return V(),e.ready});"object"==typeof exports?e.exports=r:"function"==typeof define&&n.amdO?define([],(function(){return r})):"object"==typeof exports&&(exports.exportCppDbscanLib=r)},5697:(e,t,n)=>{"use strict";n.d(t,{Dz:()=>w,FV:()=>c,Jv:()=>T,KR:()=>l,MI:()=>A,NB:()=>p,UX:()=>m,WI:()=>d,Zd:()=>h,_h:()=>u,aW:()=>g,bX:()=>v,fX:()=>b,kg:()=>o,s:()=>f,yU:()=>y});var s=n(9657),r=n(1040),i=n(708);r.gk.Tanimoto,r.gk.Dice,r.gk.Asymmetric,r.gk.BraunBlanquet,r.gk.Cosine,r.gk.Kulczynski,r.gk.McConnaughey,r.gk.RogotGoldberg,r.gk.Russel,r.gk.Sokal,r.gk.Hamming,r.gk.Euclidean,r.gk.Tanimoto,r.gk.Dice,r.gk.Asymmetric,r.gk.BraunBlanquet,r.gk.Cosine,r.gk.Kulczynski,r.gk.McConnaughey,r.gk.RogotGoldberg,r.gk.Russel,r.gk.Sokal,r.gk.Hamming,r.gk.Euclidean;const o=[r.gk.Tanimoto,r.gk.Dice,r.gk.Cosine];function a(e,t){const n=e.trueCount()+t.trueCount();if(0==n)return 1;const s=e.andWithCountBits(t,!0);return s/(n-s)}function l(e,t){return 1-a(e,t)}function c(e,t){return C(a(new s.Z(e,32*e.length),new s.Z(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 h(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 d(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(),s=e.andWithCountBits(t,!0);return s/(2*n-3*s)}(e,t)}function f(e,t){return C(function(e,t){const n=e.trueCount()+t.trueCount(),s=e.trueCount()*t.trueCount();return 0==s?0:e.andWithCountBits(t,!0)*n/(2*s)}(e,t))}function g(e,t){return C(function(e,t){const n=e.trueCount()+t.trueCount(),s=e.trueCount()*t.trueCount();return 0==s?0:(e.andWithCountBits(t,!0)*n-s)/s}(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),s=e.countBits(!0)+t.countBits(!0),r=e.length,i=r-s+n;return n==r||i==r?1:n/s+i/(2*r-s)}(e,t))}function C(e){return 0===e?3402823e32:1/e-1}function v(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 T(e){const t=function(e){const t=e?.mostCommon??new Set;return(e,n)=>{const s=e.length,r=n.length;let i=0,o=0,a=0;for(;o<s&&a<r;)e[o]===n[a]?(t?.has(e[o])||++i,++o,++a):e[o]<n[a]?++o:++a;return i}}(e);return(e,n)=>0===n.length||0===e.length?1e4:Math.min(e.length,n.length)/(t(e,n)+1e-4)}r.gk.Tanimoto,r.gk.Asymmetric,r.gk.Cosine,r.gk.Sokal,i.U.HAMMING,i.U.LEVENSHTEIN,i.U.MONOMER_CHEMICAL_DISTANCE,i.U.NEEDLEMANN_WUNSCH},3277:(e,t,n)=>{"use strict";n.d(t,{Ec:()=>r,sS:()=>s});const s="bypassLargeDataWarning",r="show-scatterplot-progress"},708:(e,t,n)=>{"use strict";function s(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,s=Math.min(...Object.keys(t).map((e=>e.charCodeAt(0))))+1,r=new Float32Array((n.length+s)*(n.length+s));return Object.entries(t).forEach((([e,s])=>{const i=n[s];Object.entries(t).forEach((([t,s])=>{r[e.charCodeAt(0)*n.length+t.charCodeAt(0)]=i[s]}))})),(e,t)=>1-r[e.charCodeAt(0)*n.length+t.charCodeAt(0)]}(),n=e?.threshold??0;return(e,s)=>{let r=0;const i=e.length,o=s.length,a=Math.ceil(Math.max(i,o)*(1-n));i!==o&&(r=Math.abs(i-o));let l=0;for(let n=0;n<Math.min(i,o);n++)if(e[n]!==s[n]&&(l+=t(e[n],s[n]),l>a))return 1;return l+=r,l/=Math.max(i,o),l}}n.d(t,{U:()=>o,o:()=>a});var r=n(1811);const i={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 o;!function(e){e.HAMMING="Hamming",e.LEVENSHTEIN="Levenshtein",e.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",e.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(o||(o={}));const a={[o.HAMMING]:s,[o.LEVENSHTEIN]:function(){return(e,t)=>(0,r.T)(e,t)/Math.max(e.length,t.length)},[o.NEEDLEMANN_WUNSCH]:function(e){const t=new Uint16Array(65536),{gapOpen:n,gapExtend:s,scoringMatrix:r,alphabetIndexes:o}={...i,...e};Object.entries(o).forEach((([e,n])=>t[e.charCodeAt(0)]=n));const a=[new Float32Array(1e4),new Float32Array(1e4)];return(e,i)=>{const o=new Array(e.length+1).fill(!1),l=new Array(e.length+1).fill(!1);let c=0,u=1;for(let t=1;t<e.length+1;t++)a[0][t]=-n-(t-1)*s,a[1][t]=0;a[0][0]=0;for(let h=1;h<i.length+1;h++){a[u][0]=-n-(h-1)*s;for(let d=1;d<e.length+1;d++){const m=a[c][d-1]+r[t[e.charCodeAt(d-1)]][t[i.charCodeAt(h-1)]],p=a[c][d]-(o[d]?s:n),f=a[u][d-1]-(l[d-1]?s:n);a[u][d]=Math.max(m,f,p),a[u][d]===m?(o[d]=!1,l[d]=!1):a[u][d]===f?(o[d]=!1,l[d]=!0):(o[d]=!0,l[d]=!1)}c=u,u=(u+1)%2}const h=Math.max(e.length,i.length);return(h-a[c][e.length])/h}},[o.MONOMER_CHEMICAL_DISTANCE]:s}},4628:(e,t,n)=>{"use strict";var s;n.d(t,{A:()=>s}),function(e){e.UMAP="UMAP",e.T_SNE="t-SNE"}(s||(s={}))},1040:(e,t,n)=>{"use strict";var s,r,i,o,a,l,c;n.d(t,{CF:()=>r,Qe:()=>a,W:()=>s,Yc:()=>l,gd:()=>o,gj:()=>c,gk:()=>i}),function(e){e.Levenshtein="Levenshtein",e.JaroWinkler="Jaro-Winkler",e.Manhattan="Manhattan",e.Onehot="One-Hot"}(s||(s={})),function(e){e.Euclidean="Euclidean"}(r||(r={})),function(e){e.Tanimoto="Tanimoto",e.Dice="Dice",e.Asymmetric="Asymmetric",e.BraunBlanquet="Braun-Blanquet",e.Cosine="Cosine",e.Kulczynski="Kulczynski",e.McConnaughey="Mc-Connaughey",e.RogotGoldberg="Rogot-Goldberg",e.Russel="Russel",e.Sokal="Sokal",e.Hamming="Hamming",e.Euclidean="Euclidean"}(i||(i={})),function(e){e.TanimotoIntArray="TanimotoIntArray"}(o||(o={})),function(e){e.Vector="Vector",e.String="String",e.BitArray="BitArray",e.MacroMolecule="MacroMolecule",e.Number="Number",e.IntArray="IntArray",e.NumberArray="NumberArray"}(a||(a={})),function(e){e.Difference="Difference"}(l||(l={})),function(e){e.CommonItems="Common Items"}(c||(c={}))},6361:(e,t,n)=>{"use strict";n.d(t,{gk:()=>s.gk});var s=n(1040);n(7861)},7861:(e,t,n)=>{"use strict";var s=n(1811),r=n(3979),i=n(5697),o=n(850),a=n(708),l=n(1040);const c={[l.CF.Euclidean]:o.dP},u={[l.W.Levenshtein]:s.T,[l.W.JaroWinkler]:r.H$,[l.W.Manhattan]:function(e,t){if(e.length!==t.length)return 1;{let n=0;for(let s=1;s<e.length;s++)n+=e[s]==t[s]?0:1;return n/e.length}},[l.W.Onehot]:function(e,t){return e===t?0:1}},h={[l.gk.Tanimoto]:i.KR,[l.gk.Dice]:i._h,[l.gk.Asymmetric]:i.yU,[l.gk.BraunBlanquet]:i.Dz,[l.gk.Cosine]:i.Zd,[l.gk.Kulczynski]:i.s,[l.gk.McConnaughey]:i.aW,[l.gk.RogotGoldberg]:i.MI,[l.gk.Russel]:i.fX,[l.gk.Sokal]:i.NB,[l.gk.Hamming]:i.UX,[l.gk.Euclidean]:i.WI},d={[l.gd.TanimotoIntArray]:i.FV},m={[l.Yc.Difference]:i.bX},p={[l.gj.CommonItems]:i.Jv},f={[l.Qe.Vector]:{[l.CF.Euclidean]:c[l.CF.Euclidean]},[l.Qe.String]:{[l.W.Levenshtein]:u[l.W.Levenshtein],[l.W.JaroWinkler]:u[l.W.JaroWinkler],[l.W.Manhattan]:u[l.W.Manhattan],[l.W.Onehot]:u[l.W.Onehot]},[l.Qe.BitArray]:{[l.gk.Tanimoto]:h[l.gk.Tanimoto],[l.gk.Dice]:h[l.gk.Dice],[l.gk.Asymmetric]:h[l.gk.Asymmetric],[l.gk.BraunBlanquet]:h[l.gk.BraunBlanquet],[l.gk.Cosine]:h[l.gk.Cosine],[l.gk.Kulczynski]:h[l.gk.Kulczynski],[l.gk.McConnaughey]:h[l.gk.McConnaughey],[l.gk.RogotGoldberg]:h[l.gk.RogotGoldberg],[l.gk.Russel]:h[l.gk.Russel],[l.gk.Sokal]:h[l.gk.Sokal]},[l.Qe.MacroMolecule]:{[a.U.HAMMING]:a.o[a.U.HAMMING],[a.U.LEVENSHTEIN]:a.o[a.U.LEVENSHTEIN],[a.U.NEEDLEMANN_WUNSCH]:a.o[a.U.NEEDLEMANN_WUNSCH],[a.U.MONOMER_CHEMICAL_DISTANCE]:a.o[a.U.MONOMER_CHEMICAL_DISTANCE]},[l.Qe.Number]:{[l.Yc.Difference]:m[l.Yc.Difference]},[l.Qe.IntArray]:{[l.gd.TanimotoIntArray]:d[l.gd.TanimotoIntArray]},[l.Qe.NumberArray]:{[l.gj.CommonItems]:p[l.gj.CommonItems]}};Object.keys(f).reduce(((e,t)=>{for(const n of Object.keys(f[t]))e[n]=t;return e}),{})},9657:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});class s{constructor(e,t=!1){if(this._length=0,this._version=0,this._updateLevel=0,this._selectedCount=0,this._selectedCountVersion=-1,this._selectedIndexesVersion=-1,this._versionedName="",this._versionedNameVersion=-1,this.SHRINK_THRESHOLD=256,"number"==typeof e){const n=e,r=s._createBuffer(n);if(t)for(let e=0;e<r.length;e++)r[e]=-1;this._data=r,this._length=n}else{if(!(e instanceof Uint32Array))throw new Error("Invalid constructor");this._data=e,this._length=t}}getRawData(){return this._data}assureGoez(e,t){if(e<0)throw new Error(`${t} should be greater than zero`)}assureInRange(e,t,n,s){if(e<t||e>n)throw new Error(`Argument ${s} (${e}) out of range (${t}, ${n})`)}copy(e,t,n){for(let s=0;s<n;s++)t[s]=e[s]}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 s(e._length);n._length=e._length,n._data=s._createBuffer(n._length),n._version=0;const r=e.lengthInInts;for(let s=0;s<r;s++)n._data[s]=e._data[s]&t._data[s];return n}static _createBuffer(e){return new Uint32Array(Math.floor((e+31)/32))}static fromValues(e){const t=new s(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 s(e);for(let s=0;s<e;++s)n.setBit(s,t(s));return n._version=0,n}static fromString(e){return s.fromSeq(e.length,(t=>"1"==e.charAt(t)))}static fromUint32Array(e,t){const n=new s(e);return n._data=t,n}static fromBytes(e){const t=e.length,n=new s(8*t);n._data=new Uint32Array(Math.floor((t+3)/4)),n._length=8*t;let r=0,i=0;for(;t-i>=4;)n._data[r++]=255&e[i]|(255&e[i+1])<<8|(255&e[i+2])<<16|(255&e[i+3])<<24,i+=4;return t-i==3&&(n._data[r]=(255&e[i+2])<<16),t-i==2&&(n._data[r]|=(255&e[i+1])<<8),t-i==1&&(n._data[r]|=255&e[i]),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 s(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,s=this.lengthInInts;for(let e=0;e<s;e++)this._data[e]=n;this.incrementVersion(t)}setIndexes(e,t=!0,n=!0,s=!0){n&&this.setAll(!t,!1);for(const n of e)this.setFast(n,t);this.incrementVersion(s)}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,s=!0,r=!0){if(n&&r&&this.setAll(!t,!1),r)for(let n=0;n<this._length;n++)e(n)&&this.setFast(n,t);else for(let n=0;n<this._length;n++)this.setFast(n,e(n)?t:!t);this.incrementVersion(s)}getRange(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let s=e;s<t;++s)n.push(this.getBit(s));return s.fromValues(n)}getRangeAsList(e,t){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length,"to");const n=[];for(let s=e;s<t;++s)n.push(this.getBit(s));return n}setRange(e,t,n,s=!0){this.assureInRange(e,0,this._length-1,"from"),this.assureInRange(t,0,this._length-1,"to");const r=Math.min(e,t),i=Math.max(e,t);if(n)for(let e=r;e<=i;e++)this.setTrue(e);else for(let e=r;e<=i;e++)this.setFalse(e);return this.incrementVersion(s),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 s=this._length;this.setLength(this._length+t);for(let n=s-1;n>=e;n--)this.setBit(n+t,this.getBit(n));for(let s=e;s<e+t;s++)this.setBit(s,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 s=-1;-1!=(s=e.findNext(s,!t));)this.setFast(n++,this.getBit(s));this._length=n,this._version++}return this}getBit(e){return 0!=(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+=s._onBitCount[255&e];let n=this._data[t];const r=31&this._length;for(0!=r&&(n&=~(4294967295<<r));0!=n;n>>>=8)this._selectedCount+=s._onBitCount[255&n];this._selectedCountVersion=this._version}return e?this._selectedCount:this._length-this._selectedCount}countWhere(e){let t=0;if(this.trueCount()==this._length)for(let n=0;n<this._length;n++)t+=e(n)?1:0;else for(let n=-1;-1!=(n=this.findNext(n,!0));)t+=e(n)?1:0;return t}andWithCountBits(e,t){if(0==this._length)return 0;let n=0;const r=this.lengthInInts;let i=0;for(;i<r-1;i++)for(let t=this._data[i]&e._data[i];0!=t;t>>>=8)n+=s._onBitCount[255&t];let o=this._data[i]&e._data[i];const a=31&this._length;for(0!=a&&(o&=~(4294967295<<a));0!=o;o>>>=8)n+=s._onBitCount[255&o];return t?n:this._length-n}clear(){this.setLength(0)}contains(e){return this.findNext(-1,e)>=0}get allTrue(){return this.countBits(!0)==this._length}get allFalse(){return this.countBits(!1)==this._length}get anyTrue(){return this.countBits(!0)>0}get anyFalse(){return this.countBits(!1)>0}findNext(e,t=!0){if(this.assureInRange(e,-1,this._length,"index"),e>=this._length-1)return-1;let n=31&(e=e<0?0:e+1);const r=this.lengthInInts;for(let i=Math.floor(e/32);i<r;i++){let r=t?this._data[i]:~this._data[i];if(0!=n)r&=4294967295<<n&4294967295,n=0;else if(!t&&-4294967296==r)continue;for(let t=0;0!=r;t+=8,r>>>=8){const n=s._firstOnBit[255&r];if(n>=0)return(e=n+32*i+t)>=this._length?-1:e}}return-1}findPrev(e,t=!0){if(0==e)return-1;this.assureInRange(e,-1,this._length,"index");let n=1+(e=e<0?this._length-1:e-1)&31;for(let r=Math.floor(e/32);r>=0;r--){let e=t?this._data[r]:~this._data[r];0!=n&&(e&=~(4294967295<<n),n=0);for(let t=24;0!=e;t-=8,e<<=8){const n=s._lastOnBit[e>>>24];if(n>=0)return n+32*r+t}}return-1}}s._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]),s._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]),s._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])},2997:(e,t,n)=>{"use strict";n.d(t,{X5:()=>k,ow:()=>V,bb:()=>F,W3:()=>O,gw:()=>W,l_:()=>M,f6:()=>R,jh:()=>L,Wh:()=>I,ci:()=>D,Bu:()=>N,zg:()=>P,zN:()=>$,AB:()=>j,QK:()=>w});var s=n(4469),r=n(976);n(9133);const i=r.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,,,,,,,,,,,,,,,,,,,,,');i.columns.add(r.Column.fromList(r.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var o=function(e,t,n,s){return new(n||(n=Promise))((function(r,i){function o(e){try{l(s.next(e))}catch(e){i(e)}}function a(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((s=s.apply(e,t||[])).next())}))};function a(e,t,n,s,r,i,a,l,c=!0){return o(this,void 0,void 0,(function*(){let u=null;if(yield $(s,(n=>o(this,void 0,void 0,(function*(){let n=null;for(const s of e.viewers)s.type===t&&(n=s);if(!n)throw Error("Viewer hasn't been added");if(yield Promise.resolve(),i&&(yield i(n)),r){const t=null!=l?l:{};t.tv=e,t.viewer=n,u=yield r(t,c)}n.close()}))),(()=>o(this,void 0,void 0,(function*(){a?e.loadLayout(a):yield function(e,t,n){return o(this,void 0,void 0,(function*(){let s;return n?(s=yield e.dataFrame.plot.fromType(t),e.dockManager.dock(s)):s=e.addViewer(t),s}))}(e,t,n)}))),6e4,"TEST_EVENT_ASYNC"),u)return u}))}function l(e,t=!0){return o(this,void 0,void 0,(function*(){const n=e.tv.dataFrame,s=n.clone();Array.from(n.row(0).cells).forEach((e=>e.value=null));const r=n.rowCount<20?Math.floor(n.rowCount/2):10;n.rows.select((e=>e.idx>=0&&e.idx<r)),t&&(yield W(50));for(let e=r;e<2*r;e++)n.filter.set(e,!1);t&&(yield W(50)),n.currentRowIdx=1,n.columns.names().slice(0,Math.ceil(n.columns.length/2)).forEach((e=>n.columns.remove(e))),t&&(yield W(100)),e.tv.dataFrame=s,yield W(50)}))}function c(e,t=!0){return o(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 s={};return Object.keys(t).filter((e=>"boolean"==typeof t[e])).forEach((e=>s[e]=!t[e])),n.filter((e=>null!==e.choices)).forEach((e=>s[e.name]=e.choices.find((n=>n!==t[e.name])))),e.viewer.setOptions(s),yield W(300),{layout:e.tv.saveLayout(),savedProps:e.viewer.getOptions().look}}))}function u(e,t=!0){return o(this,void 0,void 0,(function*(){M(JSON.stringify(e.viewer.getOptions().look),JSON.stringify(e.savedProps))}))}var h=function(e,t,n,s){return new(n||(n=Promise))((function(r,i){function o(e){try{l(s.next(e))}catch(e){i(e)}}function a(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((s=s.apply(e,t||[])).next())}))};const d=3e4,m=108e5,p=console.log.bind(console),f=console.info.bind(console),g=console.warn.bind(console),y=console.error.bind(console),w={},b="Auto Tests",A="Demo",C="Detectors",v="Core",T={};let S;var E;!function(e){e.notNull=function(e,t){if(null==e)throw new Error(`${null==t?"Value":t} not defined`)}}(E||(E={}));class _{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,s){var r;this.category=e,this.name=t,null!=s||(s={}),null!==(r=s.timeout)&&void 0!==r||(s.timeout=d),this.options=s,this.test=()=>h(this,void 0,void 0,(function*(){return new Promise(((e,t)=>h(this,void 0,void 0,(function*(){let s="";try{s=yield n()}catch(e){t(e)}e(s)}))))}))}}function P(e,t,n,s=0,r="timeout"){return h(this,void 0,void 0,(function*(){return new Promise(((i,o)=>{const a=e.subscribe((e=>{try{t(e),i("OK")}catch(e){o(e)}finally{a.unsubscribe(),clearTimeout(l)}})),l=setTimeout((()=>{a.unsubscribe(),o(r)}),s);n()}))}))}function $(e,t,n,s=0,r="timeout"){return h(this,void 0,void 0,(function*(){return new Promise(((i,o)=>{const a=e.subscribe((e=>{t(e).then((()=>{i("OK")})).catch((e=>{o(e)})).finally((()=>{a.unsubscribe(),clearTimeout(l)}))})),l=setTimeout((()=>{a.unsubscribe(),o(r)}),s);n()}))}))}function N(e,t,n){null==w[S]&&(w[S]={}),null==w[S].tests&&(w[S].tests=[]),w[S].tests.push(new x(S,e,t,n))}function M(e,t=!0,n){if(n=n?`${n}, `:"",e!==t)throw new Error(`${n}Expected "${t}", got "${e}"`)}function L(e,t,n=.001,s){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 r=Math.abs(e-t)<n;if(M(r,!0,`${null!=s?s:""} (tolerance = ${n})`),!r)throw new Error(`Expected ${t}, got ${e} (tolerance = ${n})`)}function I(e,t){for(const[n,s]of Object.entries(t)){if(!e.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const t=e[n];if(t instanceof Array&&s instanceof Array)R(t,s);else if(t instanceof Object&&s instanceof Object)I(t,s);else if(Number.isFinite(t)&&Number.isFinite(s))L(t,s);else if(t!=s)throw new Error(`Expected (${s}) for key '${n}', got (${t})`)}}function R(e,t){const n=e.length,s=t.length;if(n!=s)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${s}`);for(let s=0;s<n;s++)if(e[s]instanceof Array&&t[s]instanceof Array)R(e[s],t[s]);else if(e[s]instanceof Object&&t[s]instanceof Object)I(e[s],t[s]);else if(e[s]!=t[s])throw new Error(`Expected ${t[s]} at position ${s}, got ${e[s]}`)}function O(e,t,n){var s;S=e,t(),w[S]&&(w[S].clear=null===(s=null==n?void 0:n.clear)||void 0===s||s,w[S].timeout=null==n?void 0:n.timeout)}function F(e){null==w[S]&&(w[S]={}),w[S].before=e}function k(e){null==w[S]&&(w[S]={}),w[S].after=e}function G(e,t){return e.replace(new RegExp(t.name,"gi"),t.nqName)}function D(e){var t,n,o,a,l,c,u;return h(this,void 0,void 0,(function*(){const d=null===(n=null===(t=s.functions.getCurrentCall())||void 0===t?void 0:t.func)||void 0===n?void 0:n.package;yield function(e,t){var n;return h(this,void 0,void 0,(function*(){const t=e.id;if(T[t])return;const o=w;if(void 0!==o[b]||void 0!==o[A]||Object.keys(o).find((e=>e.startsWith(b)||e.startsWith(v))))return void(T[t]=!0);if("DevTools"===e.name){const e=r.Func.find({tags:["dartTest"]});for(const t of e){const e=t.name.split(/\s*\|\s*/g),s=null!==(n=e.pop())&&void 0!==n?n:t.name,r=e.length?v+": "+e.join(": "):v;void 0===o[r]&&(o[r]={tests:[],clear:!0}),o[r].tests.push(new x(r,s,(()=>h(this,void 0,void 0,(function*(){return yield t.apply()}))),{isAggregated:t.outputs.length>0,timeout:3e5}))}}const a=[],l=[],c=[],u=yield s.dapi.functions.filter(`package.id = "${t}"`).list(),d=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const e of u){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 r=t[n].matchAll(d),i={};Array.from(r).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 l=new x(b,1===t.length?e.name:`${e.name} ${n+1}`,(()=>h(this,void 0,void 0,(function*(){const r=yield s.functions.eval(G(t[n],e));if(i.wait&&(yield W(i.wait)),"boolean"==typeof r&&!r)throw`Failed: ${t[n]}, expected true, got ${r}`}))),{skipReason:i.skip,timeout:i.timeout});if(i.cat){const e=b+": "+i.cat;l.category=e,void 0===o[e]&&(o[e]={tests:[],clear:!0}),o[e].tests.push(l)}else a.push(l)}if(n){const t=e.options.demoWait?parseInt(e.options.demoWait):void 0,n=new x(A,e.friendlyName,(()=>h(this,void 0,void 0,(function*(){if(s.shell.lastError="",yield e.apply(),yield W(t||2e3),s.shell.lastError)throw new Error(s.shell.lastError)}))),{skipReason:e.options.demoSkip});l.push(n)}if(e.hasTag("semTypeDetector")){const t=new x(C,e.friendlyName,(()=>h(this,void 0,void 0,(function*(){const t=[];for(const n of i.clone().columns){const s=yield e.apply([n]);t.push(s||n.semType)}M(t.filter((e=>e)).length,1)}))),{skipReason:e.options.skipTest});c.push(t)}}T[t]=!0,a.length&&(o[b]={tests:a,clear:!0}),l.length&&(o[A]={tests:l,clear:!0}),c.length&&(o[C]={tests:c,clear:!1})}))}(d);const m=[];console.log("Running tests"),null!=e||(e={}),null!==(o=(u=e).testContext)&&void 0!==o||(u.testContext=new _),s.shell.lastError="";const S=[],E=function(){const e=[];return console.log=(...t)=>{e.push(...t),p(...t)},console.info=(...t)=>{e.push(...t),f(...t)},console.warn=(...t)=>{e.push(...t),g(...t)},console.error=(...t)=>{e.push(...t),y(...t)},e}();try{for(const[t,n]of Object.entries(w)){if((null==e?void 0:e.category)&&!t.toLowerCase().startsWith(null==e?void 0:e.category.toLowerCase())||(null===(a=e.exclude)||void 0===a?void 0:a.some((e=>t.startsWith(e)))))continue;p(`Started ${t} category`),S.push(t);const i=null===(l=n.tests)||void 0===l?void 0:l.every((e=>{var t;return null===(t=e.options)||void 0===t?void 0:t.skipReason}));try{n.before&&!i&&(yield n.before())}catch(e){n.beforeStatus=yield B(e)}const o=null!==(c=n.tests)&&void 0!==c?c:[],u=[];if(n.clear)for(let t=0;t<o.length;t++)u.push(yield H(o[t],null==e?void 0:e.test,E,n.timeout,d.name,e.verbose)),s.shell.closeAll(),r.Balloon.closeAll();else for(let t=0;t<o.length;t++)u.push(yield H(o[t],null==e?void 0:e.test,E,n.timeout,d.name,e.verbose));const h=u.filter((e=>"skipped"!=e.result));try{n.after&&!i&&(yield n.after())}catch(e){n.afterStatus=yield B(e)}n.afterStatus&&h.push({category:t,name:"after",result:n.afterStatus,success:!1,ms:0,skipped:!1}),n.beforeStatus&&h.push({category:t,name:"before",result:n.beforeStatus,success:!1,ms:0,skipped:!1}),m.push(...h)}}finally{console.log=p,console.info=f,console.warn=g,console.error=y}if(e.testContext.catchUnhandled&&(yield W(1e3),s.shell.lastError.length>0&&m.push({category:"Unhandled exceptions",name:"exceptions",result:s.shell.lastError,success:!1,ms:0,skipped:!1})),!e.test&&m.length){const t=m.filter((e=>e.success)).length,n=m.filter((e=>e.skipped)).length,i=m.filter((e=>!e.success)),o=d.name;for(const e of S){const t=m.filter((t=>t.category===e)),n=t.filter((e=>!e.success)).length,r={success:0===n,passed:t.filter((e=>e.success)).length,skipped:t.filter((e=>e.skipped)).length,failed:n,type:"package",packageName:o,category:e};s.log.usage(`${o}: ${e}`,r,`category-package ${o}: ${e}`)}if(!e.category){const e={success:0===i.length,passed:t,skipped:n,failed:i.length,type:"package",packageName:o};s.log.usage(o,e,`package-package ${o}`)}if(e.testContext.report){const e=new r.Logger,s="Package @package tested: @successful successful, @skipped skipped, @failed failed tests",o={successful:t,skipped:n,failed:i.length,package:d};for(const e of i)Object.assign(o,{[`${e.category} | ${e.name}`]:e.result});e.log(s,o,"package-tested")}}return m}))}function B(e){return h(this,void 0,void 0,(function*(){return`${e.toString()}\n${e.stack?yield r.Logger.translateStackTrace(e.stack):""}`}))}function H(e,t,n,i,o,a){var l,c,u,f,g,w;return h(this,void 0,void 0,(function*(){let h;n.length=0;let b="package";const A=null!=t&&e.name.toLowerCase()!==t.toLowerCase(),C=(null===(l=e.options)||void 0===l?void 0:l.skipReason)||A,v=A?"skipped":null===(c=e.options)||void 0===c?void 0:c.skipReason;C||p(`Started ${e.category} ${e.name}`);const T=Date.now();try{if(C)h={success:!0,result:v,ms:0,skipped:!0};else{let t=(null===(u=e.options)||void 0===u?void 0:u.timeout)===d&&i?i:null===(f=e.options)||void 0===f?void 0:f.timeout;t=r.Test.isInBenchmark&&t===d?m:t,h={success:!0,result:null!==(g=yield U(e.test,t))&&void 0!==g?g:"OK",ms:0,skipped:!1}}}catch(e){y(e),h={success:!1,result:yield B(e),ms:0,skipped:!1}}if((null===(w=e.options)||void 0===w?void 0:w.isAggregated)&&h.result.constructor===r.DataFrame){const e=h.result.col("success");if(b="core",e&&(h.success=e.stats.sum===e.length),!a){const e=h.result;e.columns.remove("stack"),e.rows.removeWhere((e=>e.get("success"))),h.result=e}h.result=h.result.toCsv()}if(h.logs=n.join("\n"),h.ms=Date.now()-T,C||p(`Finished ${e.category} ${e.name} for ${h.ms} ms`),h.category=e.category,h.name=e.name,!A){let t={success:h.success,result:h.result,ms:h.ms,skipped:h.skipped,type:b,packageName:o,category:e.category,test: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)}s.log.usage(`${o}: ${e.category}: ${e.name}`,t,`test-${b} ${o}: ${e.category}: ${e.name}`)}return h}))}function W(e){return h(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,e)))}))}function V(e,t="Timeout exceeded",n=500,s=50){return h(this,void 0,void 0,(function*(){return new Promise(((r,i)=>{setTimeout((()=>{clearInterval(o),i(new Error(t))}),n);const o=setInterval((()=>{e()&&(clearInterval(o),r())}),s)}))}))}function U(e,t){return h(this,void 0,void 0,(function*(){let n=null;const s=new Promise(((e,s)=>{n=setTimeout((()=>{s("EXECUTION TIMEOUT")}),t)}));try{return yield Promise.race([e(),s])}finally{n&&clearTimeout(n)}}))}const Y=r.DataFrame.fromColumns([r.Column.fromStrings("col",["val1","val2","val3"])]);function j(e,t,n){var r;return h(this,void 0,void 0,(function*(){const i=null!==(r=null==n?void 0:n.packageName)&&void 0!==r?r:"";(null==n?void 0:n.detectSemanticTypes)&&(yield s.data.detectSemanticTypes(t));const o=s.shell.addTableView(t);try{yield a(o,e,i,s.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield a(o,e,i,s.events.onViewerAdded,void 0,n.awaitViewer)),(null==n?void 0:n.readOnly)||(yield a(o,e,i,s.events.onViewerAdded,l),(null==n?void 0:n.awaitViewer)&&(yield a(o,e,i,s.events.onViewerAdded,l,n.awaitViewer)));let t=null;t=yield a(o,e,i,s.events.onViewerAdded,c),(null==n?void 0:n.awaitViewer)&&(t=yield a(o,e,i,s.events.onViewerAdded,c,n.awaitViewer)),yield a(o,e,i,s.events.onViewLayoutApplied,u,void 0,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps}),(null==n?void 0:n.awaitViewer)&&(yield a(o,e,i,s.events.onViewLayoutApplied,u,n.awaitViewer,null==t?void 0:t.layout,{savedProps:null==t?void 0:t.savedProps})),!1!==(null==n?void 0:n.arbitraryDfTest)&&(o.dataFrame=Y,yield W(50),yield a(o,e,i,s.events.onViewerAdded),(null==n?void 0:n.awaitViewer)&&(yield a(o,e,i,s.events.onViewerAdded,void 0,n.awaitViewer)))}finally{}}))}},850:(e,t,n)=>{"use strict";function s(e=!1,t="Assertion error."){if(!e)throw new Error(t)}function r(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n]*e[n];return Math.sqrt(t)}function i(e,t){if(e.length!=t.length)throw new Error("The dimensionality of the vectors must match");let n=0;for(let s=0;s<e.length;s++)n+=e[s]*t[s];return n}function o(e,t){let n=0;const s=e.length;if(s!==t.length)throw new Error("The dimensionality of the vectors must match");for(let r=0;r<s;++r)n+=Math.pow(e[r]-t[r],2);return Math.sqrt(n)}function a(e){const t=e.length;let n=0,s=0;for(let r=0;r<t;++r)n+=e[r],s+=Math.pow(e[r],2);const r=n/t,i=1/Math.sqrt(s/t-Math.pow(r,2));for(let n=0;n<t;++n)e[n]=(e[n]-r)*i;return e}n.d(t,{$G:()=>r,Fv:()=>a,MA:()=>i,dP:()=>o,hu:()=>s})},3351:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(1581),r=n(3487),i=n(7023),o=n(4815),a=n(4181),l=n(2141),c="errorMessage",u=new s.Name("emUsed"),h={required:"missingProperty",dependencies:"property",dependentRequired:"property"},d=/\$\{[^}]+\}/,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:c,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=r.strConcat(l.default.instancePath,w.errorPath);function C(e,t){return r.and(s._`${e}.keyword !== ${c}`,s._`!${e}.${u}`,s._`${e}.instancePath === ${A}`,s._`${e}.keyword in ${t}`,s._`${e}.schemaPath.indexOf(${w.errSchemaPath}) === 0`,s._`/^\\/[^\\/]*$/.test(${e}.schemaPath.slice(${w.errSchemaPath.length}))`)}function v(e,t){const s=[];for(const n in e){const e=t[n];d.test(e)&&s.push([n,S(e)])}return n.object(...s)}function T(e){return d.test(e)?new i._Code(i.safeStringify(e).replace(m,((e,t)=>`" + JSON.stringify(${o.getData(t,w)}) + "`)).replace(p,"")):s.stringify(e)}function S(e){return s._`function(){return ${T(e)}}`}n.if(s._`${l.default.errors} > 0`,(()=>{if("object"==typeof b){const[i,o]=function(e){let t,n;for(const s in e){if("properties"===s||"items"===s)continue;const r=e[s];if("object"==typeof r){t||(t={});const e=t[s]={};for(const t in r)e[t]=[]}else n||(n={}),n[s]=[]}return[t,n]}(b);o&&function(r){const i=n.const("emErrors",s.stringify(r)),o=n.const("templates",v(r,g));n.forOf("err",l.default.vErrors,(e=>n.if(C(e,i),(()=>n.code(s._`${i}[${e}.keyword].push(${e})`).assign(s._`${e}.${u}`,!0)))));const{singleError:c}=e;if(c){const e=n.let("message",s._`""`),r=n.let("paramsErrors",s._`[]`);h((t=>{n.if(e,(()=>n.code(s._`${e} += ${"string"==typeof c?c:";"}`))),n.code(s._`${e} += ${d(t)}`),n.assign(r,s._`${r}.concat(${i}[${t}])`)})),a.reportError(t,{message:e,params:s._`{errors: ${r}}`})}else h((e=>a.reportError(t,{message:d(e),params:s._`{errors: ${i}[${e}]}`})));function h(e){n.forIn("key",i,(t=>n.if(s._`${i}[${t}].length`,(()=>e(t)))))}function d(e){return s._`${e} in ${o} ? ${o}[${e}]() : ${y}[${e}]`}}(o),i&&function(e){const r=n.const("emErrors",s.stringify(e)),i=[];for(const t in e)i.push([t,v(e[t],g[t])]);const o=n.const("templates",n.object(...i)),c=n.scopeValue("obj",{ref:h,code:s.stringify(h)}),d=n.let("emPropParams"),m=n.let("emParamsErrors");n.forOf("err",l.default.vErrors,(e=>n.if(C(e,r),(()=>{n.assign(d,s._`${c}[${e}.keyword]`),n.assign(m,s._`${r}[${e}.keyword][${e}.params[${d}]]`),n.if(m,(()=>n.code(s._`${m}.push(${e})`).assign(s._`${e}.${u}`,!0)))})))),n.forIn("key",r,(e=>n.forIn("keyProp",s._`${r}[${e}]`,(i=>{n.assign(m,s._`${r}[${e}][${i}]`),n.if(s._`${m}.length`,(()=>{const r=n.const("tmpl",s._`${o}[${e}] && ${o}[${e}][${i}]`);a.reportError(t,{message:s._`${r} ? ${r}() : ${y}[${e}][${i}]`,params:s._`{errors: ${m}}`})}))}))))}(i),function(e){const{props:i,items:o}=e;if(!i&&!o)return;const h=s._`typeof ${f} == "object"`,d=s._`Array.isArray(${f})`,m=n.let("emErrors");let p,w;const b=n.let("templates");function C(e,t){n.assign(m,s.stringify(e)),n.assign(b,v(e,t))}i&&o?(p=n.let("emChildKwd"),n.if(h),n.if(d,(()=>{C(o,g.items),n.assign(p,s.str`items`)}),(()=>{C(i,g.properties),n.assign(p,s.str`properties`)})),w=s._`[${p}]`):o?(n.if(d),C(o,g.items),w=s._`.items`):i&&(n.if(r.and(h,r.not(d))),C(i,g.properties),w=s._`.properties`),n.forOf("err",l.default.vErrors,(e=>function(e,t,i){n.if(r.and(s._`${e}.keyword !== ${c}`,s._`!${e}.${u}`,s._`${e}.instancePath.indexOf(${A}) === 0`),(()=>{const r=n.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:s._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),o=n.const("emMatches",s._`${r}.exec(${e}.instancePath.slice(${A}.length))`),a=n.const("emChild",s._`${o} && ${o}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);n.if(s._`${a} !== undefined && ${a} in ${t}`,(()=>i(a)))}))}(e,m,(t=>n.code(s._`${m}[${t}].push(${e})`).assign(s._`${e}.${u}`,!0))))),n.forIn("key",m,(e=>n.if(s._`${m}[${e}].length`,(()=>{a.reportError(t,{message:s._`${e} in ${b} ? ${b}[${e}]() : ${y}${w}[${e}]`,params:s._`{errors: ${m}[${e}]}`}),n.assign(s._`${l.default.vErrors}[${l.default.errors}-1].instancePath`,s._`${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 i="string"==typeof b?b:b._;i&&function(e){const i=n.const("emErrs",s._`[]`);n.forOf("err",l.default.vErrors,(e=>n.if(function(e){return r.and(s._`${e}.keyword !== ${c}`,s._`!${e}.${u}`,r.or(s._`${e}.instancePath === ${A}`,r.and(s._`${e}.instancePath.indexOf(${A}) === 0`,s._`${e}.instancePath[${A}.length] === "/"`)),s._`${e}.schemaPath.indexOf(${w.errSchemaPath}) === 0`,s._`${e}.schemaPath[${w.errSchemaPath}.length] === "/"`)}(e),(()=>n.code(s._`${i}.push(${e})`).assign(s._`${e}.${u}`,!0))))),n.if(s._`${i}.length`,(()=>a.reportError(t,{message:T(e),params:s._`{errors: ${i}}`})))}(i),e.keepErrors||function(){const e=n.const("emErrs",s._`[]`);n.forOf("err",l.default.vErrors,(t=>n.if(s._`!${t}.${u}`,(()=>n.code(s._`${e}.push(${t})`))))),n.assign(l.default.vErrors,e).assign(l.default.errors,s._`${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},5128:(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=void 0;const s=n(7159),r=n(7299),i=n(1240),o=n(4087),a="https://json-schema.org/draft/2020-12/schema";class l extends s.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;t&&(o.default.call(this,e),this.refs["http://json-schema.org/schema"]=a)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var c=n(4815);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=n(3487);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var h=n(7426);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var d=n(6646);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.default}})},1581:(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=void 0;const s=n(7159),r=n(3924),i=n(1240),o=n(98),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends s.default{_addVocabularies(){super._addVocabularies(),r.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=n(4815);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var h=n(3487);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var d=n(7426);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var m=n(6646);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})},7023:(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 s 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=s;class r extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof s&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function i(e,...t){const n=[e[0]];let s=0;for(;s<t.length;)l(n,t[s]),n.push(e[++s]);return new r(n)}t._Code=r,t.nil=new r(""),t._=i;const o=new r("+");function a(e,...t){const n=[u(e[0])];let s=0;for(;s<t.length;)n.push(o),l(n,t[s]),n.push(o,u(e[++s]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===o){const n=c(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new r(n)}function l(e,t){var n;t instanceof r?e.push(...t._items):t instanceof s?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:u(Array.isArray(n)?n.join(","):n))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof s||'"'!==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 s?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=a,t.addCodeArg=l,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`},t.stringify=function(e){return new r(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new r(`.${e}`):i`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new r(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new r(e.toString())}},3487:(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 s=n(7023),r=n(8490);var i=n(7023);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var o=n(8490);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),t.operators={GT:new s._Code(">"),GTE:new s._Code(">="),LT:new s._Code("<"),LTE:new s._Code("<="),EQ:new s._Code("==="),NEQ:new s._Code("!=="),NOT:new s._Code("!"),OR:new s._Code("||"),AND:new s._Code("&&"),ADD:new s._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?r.varKinds.var:this.varKind,s=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=M(this.rhs,e,t)),this}get names(){return this.rhs instanceof s._CodeOrName?this.rhs.names:{}}}class c extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof s.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=M(this.rhs,e,t),this}get names(){return N(this.lhs instanceof s.Name?{}:{...this.lhs.names},this.rhs)}}class u extends c{constructor(e,t,n,s){super(e,n,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class m extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=M(this.code,e,t),this}get names(){return this.code instanceof s._CodeOrName?this.code.names:{}}}class f extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let s=n.length;for(;s--;){const r=n[s];r.optimizeNames(e,t)||(L(e,r.names),n.splice(s,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(I(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=M(this.condition,e,t),this}get names(){const e=super.names;return N(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=M(this.iteration,e,t),this}get names(){return $(super.names,this.iteration.names)}}class v extends A{constructor(e,t,n,s){super(),this.varKind=e,this.name=t,this.from=n,this.to=s}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${t} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){const e=N(super.names,this.from);return N(e,this.to)}}class T extends A{constructor(e,t,n,s){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=s}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=M(this.iterable,e,t),this}get names(){return $(super.names,this.iterable.names)}}class S 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)}}S.kind="func";class E extends f{render(e){return"return "+super.render(e)}}E.kind="return";class _ extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,s;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(s=this.finally)||void 0===s||s.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&$(e,this.catch.names),this.finally&&$(e,this.finally.names),e}}class x extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}x.kind="catch";class P 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 N(e,t){return t instanceof s._CodeOrName?$(e,t.names):e}function M(e,t,n){return e instanceof s.Name?i(e):(r=e)instanceof s._Code&&r._items.some((e=>e instanceof s.Name&&1===t[e.str]&&void 0!==n[e.str]))?new s._Code(e._items.reduce(((e,t)=>(t instanceof s.Name&&(t=i(t)),t instanceof s._Code?e.push(...t._items):e.push(t),e)),[])):e;var r;function i(e){const s=n[e.str];return void 0===s||1!==t[e.str]?e:(delete t[e.str],s)}}function L(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function I(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:s._`!${k(e)}`}P.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,s){const r=this._scope.toName(t);return void 0!==n&&s&&(this._constants[r.str]=n),this._leafNode(new l(e,r,n)),r}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new c(e,t,n))}add(e,n){return this._leafNode(new u(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==s.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[n,r]of e)t.length>1&&t.push(","),t.push(n),(n!==r||this.opts.es5)&&(t.push(":"),(0,s.addCodeArg)(t,r));return t.push("}"),new s._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,s,i=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const o=this._scope.toName(e);return this._for(new v(i,o,t,n),(()=>s(o)))}forOf(e,t,n,i=r.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof s.Name?t:this.var("_arr",t);return this.forRange("_i",0,s._`${e}.length`,(t=>{this.var(o,s._`${e}[${t}]`),n(o)}))}return this._for(new T("of",i,o,t),(()=>n(o)))}forIn(e,t,n,i=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,s._`Object.keys(${t})`,n);const o=this._scope.toName(e);return this._for(new T("in",i,o,t),(()=>n(o)))}endFor(){return this._endBlockNode(A)}label(e){return this._leafNode(new h(e))}break(e){return this._leafNode(new d(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const s=new _;if(this._blockNode(s),this.code(e),t){const e=this.name("e");this._currNode=s.catch=new x(e),t(e)}return n&&(this._currNode=s.finally=new P,this.code(n)),this._endBlockNode(x,P)}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=s.nil,n,r){return this._blockNode(new S(e,t,n)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof 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=I;const R=F(t.operators.AND);t.and=function(...e){return e.reduce(R)};const O=F(t.operators.OR);function F(e){return(t,n)=>t===s.nil?n:n===s.nil?t:s._`${k(t)} ${e} ${k(n)}`}function k(e){return e instanceof s.Name?e:s._`(${e})`}t.or=function(...e){return e.reduce(O)}},8490:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const s=n(7023);class r extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var i;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(i=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new s.Name("const"),let:new s.Name("let"),var:new s.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof s.Name?e:this.name(e)}name(e){return new s.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=o;class a extends s.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=s._`.${new s.Name(t)}[${n}]`}}t.ValueScopeName=a;const l=s._`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:s.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const s=this.toName(e),{prefix:r}=s,i=null!==(n=t.key)&&void 0!==n?n:t.ref;let o=this._values[r];if(o){const e=o.get(i);if(e)return e}else o=this._values[r]=new Map;o.set(i,s);const a=this._scope[r]||(this._scope[r]=[]),l=a.length;return a[l]=t.ref,s.setValue(t,{property:r,itemIndex:l}),s}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 s._`${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,o={},a){let l=s.nil;for(const c in e){const u=e[c];if(!u)continue;const h=o[c]=o[c]||new Map;u.forEach((e=>{if(h.has(e))return;h.set(e,i.Started);let o=n(e);if(o){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;l=s._`${l}${n} ${e} = ${o};${this.opts._n}`}else{if(!(o=null==a?void 0:a(e)))throw new r(e);l=s._`${l}${o}${this.opts._n}`}h.set(e,i.Completed)}))}return l}}},4181:(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 s=n(3487),r=n(6776),i=n(2141);function o(e,t){const n=e.const("err",t);e.if(s._`${i.default.vErrors} === null`,(()=>e.assign(i.default.vErrors,s._`[${n}]`)),s._`${i.default.vErrors}.push(${n})`),e.code(s._`${i.default.errors}++`)}function a(e,t){const{gen:n,validateName:r,schemaEnv:i}=e;i.$async?n.throw(s._`new ${e.ValidationError}(${t})`):(n.assign(s._`${r}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>s.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?s.str`"${e}" keyword must be ${t} ($data)`:s.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,r,i){const{it:l}=e,{gen:u,compositeRule:h,allErrors:d}=l,m=c(e,n,r);(null!=i?i:h||d)?o(u,m):a(l,s._`[${m}]`)},t.reportExtraError=function(e,n=t.keywordError,s){const{it:r}=e,{gen:l,compositeRule:u,allErrors:h}=r;o(l,c(e,n,s)),u||h||a(r,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(s._`${i.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(s._`${i.default.vErrors}.length`,t)),(()=>e.assign(i.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:r,errsCount:o,it:a}){if(void 0===o)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",o,i.default.errors,(o=>{e.const(l,s._`${i.default.vErrors}[${o}]`),e.if(s._`${l}.instancePath === undefined`,(()=>e.assign(s._`${l}.instancePath`,(0,s.strConcat)(i.default.instancePath,a.errorPath)))),e.assign(s._`${l}.schemaPath`,s.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(s._`${l}.schema`,n),e.assign(s._`${l}.data`,r))}))};const l={keyword:new s.Name("keyword"),schemaPath:new s.Name("schemaPath"),params:new s.Name("params"),propertyName:new s.Name("propertyName"),message:new s.Name("message"),schema:new s.Name("schema"),parentSchema:new s.Name("parentSchema")};function c(e,t,n){const{createErrors:r}=e.it;return!1===r?s._`{}`:function(e,t,n={}){const{gen:r,it:o}=e,a=[u(o,n),h(e,n)];return function(e,{params:t,message:n},r){const{keyword:o,data:a,schemaValue:c,it:u}=e,{opts:h,propertyName:d,topSchemaRef:m,schemaPath:p}=u;r.push([l.keyword,o],[l.params,"function"==typeof t?t(e):t||s._`{}`]),h.messages&&r.push([l.message,"function"==typeof n?n(e):n]),h.verbose&&r.push([l.schema,c],[l.parentSchema,s._`${m}${p}`],[i.default.data,a]),d&&r.push([l.propertyName,d])}(e,t,a),r.object(...a)}(e,t,n)}function u({errorPath:e},{instancePath:t}){const n=t?s.str`${e}${(0,r.getErrorPath)(t,r.Type.Str)}`:e;return[i.default.instancePath,(0,s.strConcat)(i.default.instancePath,n)]}function h({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:i}){let o=i?t:s.str`${t}/${e}`;return n&&(o=s.str`${o}${(0,r.getErrorPath)(n,r.Type.Str)}`),[l.schemaPath,o]}},5173:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const s=n(3487),r=n(7426),i=n(2141),o=n(2531),a=n(6776),l=n(4815);class c{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function u(e){const t=d.call(this,e);if(t)return t;const n=(0,o.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:u}=this.opts,h=new s.CodeGen(this.scope,{es5:a,lines:c,ownProperties:u});let m;e.$async&&(m=h.scopeValue("Error",{ref:r.default,code:s._`require("ajv/dist/runtime/validation_error").default`}));const p=h.scopeName("validate");e.validateName=p;const f={gen:h,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[s.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,s.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:m,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:s.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:s._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,l.validateFunctionCode)(f),h.optimize(this.opts.code.optimize);const t=h.toString();g=`${h.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${i.default.self}`,`${i.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:h._values}),this.opts.unevaluated){const{props:e,items:t}=f;n.evaluated={props:e instanceof s.Name?void 0:e,items:t instanceof s.Name?void 0:t,dynamicProps:e instanceof s.Name,dynamicItems:t instanceof s.Name},n.source&&(n.source.evaluated=(0,s.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 h(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function d(e){for(const s of this._compilations)if(n=e,(t=s).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return s;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),s=(0,o._getFullPath)(this.opts.uriResolver,n);let r=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&s===r)return g.call(this,n,e);const i=(0,o.normalizeId)(s),a=this.refs[i]||this.schemas[i];if("string"==typeof a){const t=p.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||u.call(this,a),i===(0,o.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,s=t[n];return s&&(r=(0,o.resolveUrl)(this.opts.uriResolver,r,s)),new c({schema:t,schemaId:n,root:e,baseId:r})}return g.call(this,n,a)}}t.SchemaEnv=c,t.compileSchema=u,t.resolveRef=function(e,t,n){var s;n=(0,o.resolveUrl)(this.opts.uriResolver,t,n);const r=e.refs[n];if(r)return r;let i=m.call(this,e,n);if(void 0===i){const r=null===(s=e.localRefs)||void 0===s?void 0:s[n],{schemaId:o}=this.opts;r&&(i=new c({schema:r,schemaId:o,root:e,baseId:t}))}return void 0!==i?e.refs[n]=h.call(this,i):void 0},t.getCompilingSchema=d,t.resolveSchema=p;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:n,root:s}){var r;if("/"!==(null===(r=e.fragment)||void 0===r?void 0:r[0]))return;for(const s of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,a.unescapeFragment)(s)];if(void 0===e)return;const r="object"==typeof(n=e)&&n[this.opts.schemaId];!f.has(s)&&r&&(t=(0,o.resolveUrl)(this.opts.uriResolver,t,r))}let i;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,n.$ref);i=p.call(this,s,e)}const{schemaId:l}=this.opts;return i=i||new c({schema:n,schemaId:l,root:s,baseId:t}),i.schema!==i.root.schema?i:void 0}},2141:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(3487),r={data:new s.Name("data"),valCxt:new s.Name("valCxt"),instancePath:new s.Name("instancePath"),parentData:new s.Name("parentData"),parentDataProperty:new s.Name("parentDataProperty"),rootData:new s.Name("rootData"),dynamicAnchors:new s.Name("dynamicAnchors"),vErrors:new s.Name("vErrors"),errors:new s.Name("errors"),this:new s.Name("this"),self:new s.Name("self"),scope:new s.Name("scope"),json:new s.Name("json"),jsonPos:new s.Name("jsonPos"),jsonLen:new s.Name("jsonLen"),jsonPart:new s.Name("jsonPart")};t.default=r},6646:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(2531);class r extends Error{constructor(e,t,n,r){super(r||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,s.resolveUrl)(e,t,n),this.missingSchema=(0,s.normalizeId)((0,s.getFullPath)(e,this.missingRef))}}t.default=r},2531:(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 s=n(6776),r=n(4063),i=n(9461),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!l(e):!!t&&c(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(a.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(l))return!0;if("object"==typeof n&&l(n))return!0}return!1}function c(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!o.has(n)&&("object"==typeof e[n]&&(0,s.eachItem)(e[n],(e=>t+=c(e))),t===1/0))return 1/0}return t}function u(e,t="",n){!1!==n&&(t=m(t));const s=e.parse(t);return h(e,s)}function h(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=h;const d=/#\/?$/;function m(e){return e?e.replace(d,""):""}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:s}=this.opts,o=m(e[n]||t),a={"":o},l=u(s,o,!1),c={},h=new Set;return i(e,{allKeys:!0},((e,t,s,r)=>{if(void 0===r)return;const i=l+t;let o=a[r];function u(t){const n=this.opts.uriResolver.resolve;if(t=m(o?n(o,t):t),h.has(t))throw f(t);h.add(t);let s=this.refs[t];return"string"==typeof s&&(s=this.refs[s]),"object"==typeof s?d(e,s.schema,t):t!==m(i)&&("#"===t[0]?(d(e,c[t],t),c[t]=e):this.refs[t]=i),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]&&(o=u.call(this,e[n])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),a[t]=o})),c;function d(e,t,n){if(void 0!==t&&!r(e,t))throw f(n)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},3141:(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:{}}}},6776:(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 s=n(3487),r=n(7023);function i(e,t=e.schema){const{opts:n,self:s}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const r=s.RULES.keywords;for(const n in t)r[n]||p(e,`unknown keyword: "${n}"`)}function o(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(i,o,a,l)=>{const c=void 0===a?o:a instanceof s.Name?(o instanceof s.Name?e(i,o,a):t(i,o,a),a):o instanceof s.Name?(t(i,a,o),o):n(o,a);return l!==s.Name||c instanceof s.Name?c:r(i,c)}}function u(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",s._`{}`);return void 0!==t&&h(e,n,t),n}function h(e,t,n){Object.keys(n).forEach((n=>e.assign(s._`${t}${(0,s.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||(i(e,t),!o(t,e.self.RULES.all))},t.checkUnknownRules=i,t.schemaHasRules=o,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},n,r,i){if(!i){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return s._`${n}`}return s._`${e}${t}${(0,s.getProperty)(r)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,n)=>e.if(s._`${n} !== true && ${t} !== undefined`,(()=>{e.if(s._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,s._`${n} || {}`).code(s._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(s._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,s._`${n} || {}`),h(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,n)=>e.if(s._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,s._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(s._`${n} !== true`,(()=>e.assign(n,!0===t||s._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=h;const d={};var 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:d[t.code]||(d[t.code]=new r._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(m=t.Type||(t.Type={})),t.getErrorPath=function(e,t,n){if(e instanceof s.Name){const r=t===m.Num;return n?r?s._`"[" + ${e} + "]"`:s._`"['" + ${e} + "']"`:r?s._`"/" + ${e}`:s._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,s.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=p},8876:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>s(e,t)))}function s(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},s){const r=t.RULES.types[s];return r&&!0!==r&&n(e,r)},t.shouldUseGroup=n,t.shouldUseRule=s},5667:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const s=n(4181),r=n(3487),i=n(2141),o={message:"boolean schema is false"};function a(e,t){const{gen:n,data:r}=e,i={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,s.reportError)(i,o,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:s}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(i.default.data):(t.assign(r._`${s}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:s}=e;!1===s?(n.var(t,!1),a(e)):n.var(t,!0)}},453:(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 s=n(3141),r=n(8876),i=n(4181),o=n(3487),a=n(6776);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(s.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(l=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=c(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=c,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:s,opts:i}=e,a=function(e,t){return t?e.filter((e=>u.has(e)||"array"===t&&"array"===e)):[]}(t,i.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,r.schemaHasRulesForType)(e,t[0]));if(c){const r=d(t,s,i.strictNumbers,l.Wrong);n.if(r,(()=>{a.length?function(e,t,n){const{gen:s,data:r,opts:i}=e,a=s.let("dataType",o._`typeof ${r}`),l=s.let("coerced",o._`undefined`);"array"===i.coerceTypes&&s.if(o._`${a} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,(()=>s.assign(r,o._`${r}[0]`).assign(a,o._`typeof ${r}`).if(d(t,r,i.strictNumbers),(()=>s.assign(l,r))))),s.if(o._`${l} !== undefined`);for(const e of n)(u.has(e)||"array"===e&&"array"===i.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void s.elseIf(o._`${a} == "number" || ${a} == "boolean"`).assign(l,o._`"" + ${r}`).elseIf(o._`${r} === null`).assign(l,o._`""`);case"number":return void s.elseIf(o._`${a} == "boolean" || ${r} === null
3
3
  || (${a} == "string" && ${r} && ${r} == +${r})`).assign(l,o._`+${r}`);case"integer":return void s.elseIf(o._`${a} === "boolean" || ${r} === null
4
4
  || (${a} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(l,o._`+${r}`);case"boolean":return void s.elseIf(o._`${r} === "false" || ${r} === 0 || ${r} === null`).assign(l,!1).elseIf(o._`${r} === "true" || ${r} === 1`).assign(l,!0);case"null":return s.elseIf(o._`${r} === "" || ${r} === 0 || ${r} === false`),void s.assign(l,null);case"array":s.elseIf(o._`${a} === "string" || ${a} === "number"
5
5
  || ${a} === "boolean" || ${r} === null`).assign(l,o._`[${r}]`)}}s.else(),p(e),s.endIf(),s.if(o._`${l} !== undefined`,(()=>{s.assign(r,l),function({gen:e,parentData:t,parentDataProperty:n},s){e.if(o._`${t} !== undefined`,(()=>e.assign(o._`${t}[${n}]`,s)))}(e,l)}))}(e,t,a):p(e)}))}return c};const u=new Set(["string","number","integer","boolean","null"]);function h(e,t,n,s=l.Correct){const r=s===l.Correct?o.operators.EQ:o.operators.NEQ;let i;switch(e){case"null":return o._`${t} ${r} null`;case"array":i=o._`Array.isArray(${t})`;break;case"object":i=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return o._`typeof ${t} ${r} ${e}`}return s===l.Correct?i:(0,o.not)(i);function a(e=o.nil){return(0,o.and)(o._`typeof ${t} == "number"`,e,n?o._`isFinite(${t})`:o.nil)}}function d(e,t,n,s){if(1===e.length)return h(e[0],t,n,s);let r;const i=(0,a.toHash)(e);if(i.array&&i.object){const e=o._`typeof ${t} != "object"`;r=i.null?e:o._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else r=o.nil;i.number&&delete i.integer;for(const e in i)r=(0,o.and)(r,h(e,t,n,s));return r}t.checkDataType=h,t.checkDataTypes=d;const m={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function p(e){const t=function(e){const{gen:t,data:n,schema:s}=e,r=(0,a.schemaRefOrVal)(e,s,"type");return{gen:t,keyword:"type",data:n,schema:s.type,schemaCode:r,schemaValue:r,parentSchema:s,params:{},it:e}}(e);(0,i.reportError)(t,m)}t.reportTypeError=p},313:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const s=n(3487),r=n(6776);function i(e,t,n){const{gen:i,compositeRule:o,data:a,opts:l}=e;if(void 0===n)return;const c=s._`${a}${(0,s.getProperty)(t)}`;if(o)return void(0,r.checkStrictMode)(e,`default is ignored for: ${c}`);let u=s._`${c} === undefined`;"empty"===l.useDefaults&&(u=s._`${u} || ${c} === null || ${c} === ""`),i.if(u,s._`${c} = ${(0,s.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:s}=e.schema;if("object"===t&&n)for(const t in n)i(e,t,n[t].default);else"array"===t&&Array.isArray(s)&&s.forEach(((t,n)=>i(e,n,t.default)))}},4815:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const s=n(5667),r=n(453),i=n(8876),o=n(453),a=n(313),l=n(5005),c=n(3099),u=n(3487),h=n(2141),d=n(2531),m=n(6776),p=n(4181);function f({gen:e,validateName:t,schema:n,schemaEnv:s,opts:r},i){r.code.es5?e.func(t,u._`${h.default.data}, ${h.default.valCxt}`,s.$async,(()=>{e.code(u._`"use strict"; ${g(n,r)}`),function(e,t){e.if(h.default.valCxt,(()=>{e.var(h.default.instancePath,u._`${h.default.valCxt}.${h.default.instancePath}`),e.var(h.default.parentData,u._`${h.default.valCxt}.${h.default.parentData}`),e.var(h.default.parentDataProperty,u._`${h.default.valCxt}.${h.default.parentDataProperty}`),e.var(h.default.rootData,u._`${h.default.valCxt}.${h.default.rootData}`),t.dynamicRef&&e.var(h.default.dynamicAnchors,u._`${h.default.valCxt}.${h.default.dynamicAnchors}`)}),(()=>{e.var(h.default.instancePath,u._`""`),e.var(h.default.parentData,u._`undefined`),e.var(h.default.parentDataProperty,u._`undefined`),e.var(h.default.rootData,h.default.data),t.dynamicRef&&e.var(h.default.dynamicAnchors,u._`{}`)}))}(e,r),e.code(i)})):e.func(t,u._`${h.default.data}, ${function(e){return u._`{${h.default.instancePath}="", ${h.default.parentData}, ${h.default.parentDataProperty}, ${h.default.rootData}=${h.default.data}${e.dynamicRef?u._`, ${h.default.dynamicAnchors}={}`:u.nil}}={}`}(r)}`,s.$async,(()=>e.code(g(n,r)).code(i)))}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:s,self:r}=e;t.$ref&&s.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(t,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function A(e,t){if(e.opts.jtd)return v(e,[],!1,t);const n=(0,r.getSchemaTypes)(e.schema);v(e,n,!(0,r.coerceAndCheckDataType)(e,n),t)}function C({gen:e,schemaEnv:t,schema:n,errSchemaPath:s,opts:r}){const i=n.$comment;if(!0===r.$comment)e.code(u._`${h.default.self}.logger.log(${i})`);else if("function"==typeof r.$comment){const n=u.str`${s}/$comment`,r=e.scopeValue("root",{ref:t.root});e.code(u._`${h.default.self}.opts.$comment(${i}, ${n}, ${r}.schema)`)}}function v(e,t,n,s){const{gen:r,schema:a,data:l,allErrors:c,opts:d,self:p}=e,{RULES:f}=p;function g(m){(0,i.shouldUseGroup)(a,m)&&(m.type?(r.if((0,o.checkDataType)(m.type,l,d.strictNumbers)),T(e,m),1===t.length&&t[0]===m.type&&n&&(r.else(),(0,o.reportTypeError)(e)),r.endIf()):T(e,m),c||r.if(u._`${h.default.errors} === ${s||0}`))}!a.$ref||!d.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(a,f)?(d.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{S(e.dataTypes,t)||E(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const n=[];for(const s of e.dataTypes)S(t,s)?n.push(s):t.includes("integer")&&"number"===s&&n.push("integer");e.dataTypes=n}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&E(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const n=e.self.RULES.all;for(const s in n){const r=n[s];if("object"==typeof r&&(0,i.shouldUseRule)(e.schema,r)){const{type:n}=r.definition;n.length&&!n.some((e=>{return s=e,(n=t).includes(s)||"number"===s&&n.includes("integer");var n,s}))&&E(e,`missing type "${n.join(",")}" for keyword "${s}"`)}}}(e,e.dataTypes))}(e,t),r.block((()=>{for(const e of f.rules)g(e);g(f.post)}))):r.block((()=>x(e,"$ref",f.all.$ref.definition)))}function T(e,t){const{gen:n,schema:s,opts:{useDefaults:r}}=e;r&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,i.shouldUseRule)(s,n)&&x(e,n.keyword,n.definition,t.type)}))}function S(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function E(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,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:s}=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),s.let(h.default.vErrors,null),s.let(h.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",u._`${n}.evaluated`),t.if(u._`${e.evaluated}.dynamicProps`,(()=>t.assign(u._`${e.evaluated}.props`,u._`undefined`))),t.if(u._`${e.evaluated}.dynamicItems`,(()=>t.assign(u._`${e.evaluated}.items`,u._`undefined`)))}(e),A(e),function(e){const{gen:t,schemaEnv:n,validateName:s,ValidationError:r,opts:i}=e;n.$async?t.if(u._`${h.default.errors} === 0`,(()=>t.return(h.default.data)),(()=>t.throw(u._`new ${r}(${h.default.vErrors})`))):(t.assign(u._`${s}.errors`,h.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:n,items:s}){n instanceof u.Name&&e.assign(u._`${t}.props`,n),s instanceof u.Name&&e.assign(u._`${t}.items`,s)}(e),t.return(u._`${h.default.errors} === 0`))}(e)}))}(e):f(e,(()=>(0,s.topBoolOrEmptySchema)(e)))};class _{constructor(e,t,n){if((0,l.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,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",N(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",h.default.errors))}result(e,t,n){this.failResult((0,u.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(u._`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?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:s,schemaType:r,def:i}=this;n.if((0,u.or)(u._`${s} === undefined`,t)),e!==u.nil&&n.assign(e,!0),(r.length||i.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:s,it:r}=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,o.checkDataTypes)(e,t,r.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}(),function(){if(s.validateSchema){const n=e.scopeValue("validate$data",{ref:s.validateSchema});return u._`!${n}(${t})`}return u.nil}())}subschema(e,t){const n=(0,c.getSubschema)(this.it,e);(0,c.extendSubschemaData)(n,this.it,e),(0,c.extendSubschemaMode)(n,e);const r={...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:s,opts:r}=e;r.$comment&&n.$comment&&C(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,d.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const i=s.const("_errs",h.default.errors);A(e,i),s.var(t,u._`${i} === ${h.default.errors}`)}(e,t):(0,s.boolOrEmptySchema)(e,t)}(r,t),r}mergeEvaluated(e,t){const{it:n,gen:s}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=m.mergeEvaluated.props(s,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=m.mergeEvaluated.items(s,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return s.if(t,(()=>this.mergeEvaluated(e,u.Name))),!0}}function x(e,t,n,s){const r=new _(e,n,t);"code"in n?n.code(r,s):r.$data&&n.validate?(0,l.funcKeywordCode)(r,n):"macro"in n?(0,l.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,l.funcKeywordCode)(r,n)}t.KeywordCxt=_;const P=/^\/(?:[^~]|~0|~1)*$/,$=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function N(e,{dataLevel:t,dataNames:n,dataPathArr:s}){let r,i;if(""===e)return h.default.rootData;if("/"===e[0]){if(!P.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);r=e,i=h.default.rootData}else{const o=$.exec(e);if(!o)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+o[1];if(r=o[2],"#"===r){if(a>=t)throw new Error(l("property/index",a));return s[t-a]}if(a>t)throw new Error(l("data",a));if(i=n[t-a],!r)return i}let o=i;const a=r.split("/");for(const e of a)e&&(i=u._`${i}${(0,u.getProperty)((0,m.unescapeJsonPointer)(e))}`,o=u._`${o} && ${i}`);return o;function l(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=N},5005:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const s=n(3487),r=n(2141),i=n(412),o=n(4181);function a(e){const{gen:t,data:n,it:r}=e;t.if(r.parentData,(()=>t.assign(n,s._`${r.parentData}[${r.parentDataProperty}]`)))}function l(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,s.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:r,schema:i,parentSchema:o,it:a}=e,c=t.macro.call(a.self,i,o,a),u=l(n,r,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);const h=n.name("valid");e.subschema({schema:c,schemaPath:s.nil,errSchemaPath:`${a.errSchemaPath}/${r}`,topSchemaRef:u,compositeRule:!0},h),e.pass(h,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:c,keyword:u,schema:h,parentSchema:d,$data: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,h,d,p):t.validate,g=l(c,u,f),y=c.let("valid");function w(n=(t.async?s._`await `:s.nil)){const o=p.opts.passContext?r.default.this:r.default.self,a=!("compile"in t&&!m||!1===t.schema);c.assign(y,s._`${n}${(0,i.callValidateCode)(e,g,o,a)}`,t.modifying)}function b(e){var n;c.if((0,s.not)(null!==(n=t.valid)&&void 0!==n?n:y),e)}e.block$data(y,(function(){if(!1===t.errors)w(),t.modifying&&a(e),b((()=>e.error()));else{const n=t.async?function(){const e=c.let("ruleErrs",null);return c.try((()=>w(s._`await `)),(t=>c.assign(y,!1).if(s._`${t} instanceof ${p.ValidationError}`,(()=>c.assign(e,s._`${t}.errors`)),(()=>c.throw(t))))),e}():function(){const e=s._`${g}.errors`;return c.assign(e,null),w(s.nil),e}();t.modifying&&a(e),b((()=>function(e,t){const{gen:n}=e;n.if(s._`Array.isArray(${t})`,(()=>{n.assign(r.default.vErrors,s._`${r.default.vErrors} === null ? ${t} : ${r.default.vErrors}.concat(${t})`).assign(r.default.errors,s._`${r.default.vErrors}.length`),(0,o.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:s},r,i){if(Array.isArray(r.keyword)?!r.keyword.includes(i):r.keyword!==i)throw new Error("ajv implementation error");const o=r.dependencies;if(null==o?void 0:o.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(r.validateSchema&&!r.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${s}": `+n.errorsText(r.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}},3099:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const s=n(3487),r=n(6776);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:i,schemaPath:o,errSchemaPath:a,topSchemaRef:l}){if(void 0!==t&&void 0!==i)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const i=e.schema[t];return void 0===n?{schema:i,schemaPath:s._`${e.schemaPath}${(0,s.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[n],schemaPath:s._`${e.schemaPath}${(0,s.getProperty)(t)}${(0,s.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,r.escapeFragment)(n)}`}}if(void 0!==i){if(void 0===o||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:o,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:i,data:o,dataTypes:a,propertyName:l}){if(void 0!==o&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=t;if(void 0!==n){const{errorPath:o,dataPathArr:a,opts:l}=t;u(c.let("data",s._`${t.data}${(0,s.getProperty)(n)}`,!0)),e.errorPath=s.str`${o}${(0,r.getErrorPath)(n,i,l.jsPropertySyntax)}`,e.parentDataProperty=s._`${n}`,e.dataPathArr=[...a,e.parentDataProperty]}function u(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}void 0!==o&&(u(o instanceof s.Name?o:c.let("data",o,!0)),void 0!==l&&(e.propertyName=l)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:s,createErrors:r,allErrors:i}){void 0!==s&&(e.compositeRule=s),void 0!==r&&(e.createErrors=r),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=n}},7159:(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 s=n(4815);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return s.KeywordCxt}});var r=n(3487);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const i=n(7426),o=n(6646),a=n(3141),l=n(5173),c=n(3487),u=n(2531),h=n(453),d=n(6776),m=n(4775),p=n(3589),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.'},A=200;function C(e){var t,n,s,r,i,o,a,l,c,u,h,d,m,g,y,w,b,C,v,T,S,E,_,x,P;const $=e.strict,N=null===(t=e.code)||void 0===t?void 0:t.optimize,M=!0===N||void 0===N?1:N||0,L=null!==(s=null===(n=e.code)||void 0===n?void 0:n.regExp)&&void 0!==s?s:f,I=null!==(r=e.uriResolver)&&void 0!==r?r:p.default;return{strictSchema:null===(o=null!==(i=e.strictSchema)&&void 0!==i?i:$)||void 0===o||o,strictNumbers:null===(l=null!==(a=e.strictNumbers)&&void 0!==a?a:$)||void 0===l||l,strictTypes:null!==(u=null!==(c=e.strictTypes)&&void 0!==c?c:$)&&void 0!==u?u:"log",strictTuples:null!==(d=null!==(h=e.strictTuples)&&void 0!==h?h:$)&&void 0!==d?d:"log",strictRequired:null!==(g=null!==(m=e.strictRequired)&&void 0!==m?m:$)&&void 0!==g&&g,code:e.code?{...e.code,optimize:M,regExp:L}:{optimize:M,regExp:L},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:A,loopEnum:null!==(w=e.loopEnum)&&void 0!==w?w:A,meta:null===(b=e.meta)||void 0===b||b,messages:null===(C=e.messages)||void 0===C||C,inlineRefs:null===(v=e.inlineRefs)||void 0===v||v,schemaId:null!==(T=e.schemaId)&&void 0!==T?T:"$id",addUsedSchema:null===(S=e.addUsedSchema)||void 0===S||S,validateSchema:null===(E=e.validateSchema)||void 0===E||E,validateFormats:null===(_=e.validateFormats)||void 0===_||_,unicodeRegExp:null===(x=e.unicodeRegExp)||void 0===x||x,int32range:null===(P=e.int32range)||void 0===P||P,uriResolver:I}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...C(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:y,es5:t,lines:n}),this.logger=function(e){if(!1===e)return $;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 s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),T.call(this,w,e,"NOT SUPPORTED"),T.call(this,b,e,"DEPRECATED","warn"),this._metaOpts=P.call(this),e.formats&&_.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&x.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),E.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let s=m;"id"===n&&(s={...m},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[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 s=n(t);return"$async"in n||(this.errors=n.errors),s}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 s.call(this,e,t);async function s(e,t){await r.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||i.call(this,n)}async function r(e){e&&!this.getSchema(e)&&await s.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return a.call(this,t),await l.call(this,t.missingSchema),i.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const n=await c.call(this,e);this.refs[e]||await r.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function c(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,s);return this}let r;if("object"==typeof e){const{schemaId:t}=this.opts;if(r=e[t],void 0!==r&&"string"!=typeof r)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||r),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,s,!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 s=this.validate(n,e);if(!s&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return s}getSchema(e){let t;for(;"string"==typeof(t=S.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,s=new l.SchemaEnv({schema:{},schemaId:n});if(t=l.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=S.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,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,d.eachItem)(n,(e=>L.call(this,e))),this;R.call(this,t);const s={...t,type:(0,h.getJSONTypes)(t.type),schemaType:(0,h.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(n,0===s.type.length?e=>L.call(this,e,s):e=>s.type.forEach((t=>L.call(this,e,s,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 s of t){const t=s.split("/").slice(1);let r=e;for(const e of t)r=r[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:s}=t.definition,i=r[e];s&&i&&(r[e]=F(i))}}return e}_removeAllSchemas(e,t){for(const n in e){const s=e[n];t&&!t.test(n)||("string"==typeof s?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,t,n,s=this.opts.validateSchema,r=this.opts.addUsedSchema){let i;const{schemaId:o}=this.opts;if("object"==typeof e)i=e[o];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;n=(0,u.normalizeId)(i||n);const c=u.getSchemaRefs.call(this,e,n);return a=new l.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:c}),this._cache.set(a.schema,a),r&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=a),s&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}function T(e,t,n,s="error"){for(const r in e){const i=r;i in t&&this.logger[s](`${n}: option ${r}. ${e[i]}`)}}function S(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 _(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function x(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}t.default=v,v.ValidationError=i.default,v.MissingRefError=o.default;const $={log(){},warn(){},error(){}},N=/^[a-z_$][a-z0-9_$:-]*$/i;function M(e,t){const{RULES:n}=this;if((0,d.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!N.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 L(e,t,n){var s;const r=null==t?void 0:t.post;if(n&&r)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:i}=this;let o=r?i.post:i.rules.find((({type:e})=>e===n));if(o||(o={type:n,rules:[]},i.rules.push(o)),i.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,h.getJSONTypes)(t.type),schemaType:(0,h.getJSONTypes)(t.schemaType)}};t.before?I.call(this,o,a,t.before):o.rules.push(a),i.all[e]=a,null===(s=t.implements)||void 0===s||s.forEach((e=>this.addKeyword(e)))}function I(e,t,n){const s=e.rules.findIndex((e=>e.keyword===n));s>=0?e.rules.splice(s,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function R(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=F(t)),e.validateSchema=this.compile(t,!0))}const O={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function F(e){return{anyOf:[e,O]}}},4087:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(2577),r=n(996),i=n(5568),o=n(6795),a=n(235),l=n(2567),c=n(1233),u=n(1968),h=["/properties"];t.default=function(e){return[s,r,i,o,a,t(this,l),c,t(this,u)].forEach((e=>this.addMetaSchema(e,void 0,!1))),this;function t(t,n){return e?t.$dataMetaSchema(n,h):n}}},3510:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(4063);s.code='require("ajv/dist/runtime/equal").default',t.default=s},4499:(e,t)=>{"use strict";function n(e){const t=e.length;let n,s=0,r=0;for(;r<t;)s++,n=e.charCodeAt(r++),n>=55296&&n<=56319&&r<t&&(n=e.charCodeAt(r),56320==(64512&n)&&r++);return s}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.code='require("ajv/dist/runtime/ucs2length").default'},3589:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(540);s.code='require("ajv/dist/runtime/uri").default',t.default=s},7426:(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},4783:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const s=n(3487),r=n(6776),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>s.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>s._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:s}=t;Array.isArray(s)?o(e,s):(0,r.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function o(e,t){const{gen:n,schema:i,data:o,keyword:a,it:l}=e;l.items=!0;const c=n.const("len",s._`${o}.length`);if(!1===i)e.setParams({len:t.length}),e.pass(s._`${c} <= ${t.length}`);else if("object"==typeof i&&!(0,r.alwaysValidSchema)(l,i)){const i=n.var("valid",s._`${c} <= ${t.length}`);n.if((0,s.not)(i),(()=>function(i){n.forRange("i",t.length,c,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:r.Type.Num},i),l.allErrors||n.if((0,s.not)(i),(()=>n.break()))}))}(i))),e.ok(i)}}t.validateAdditionalItems=o,t.default=i},9351:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(412),r=n(3487),i=n(2141),o=n(6776),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>r._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:a,data:l,errsCount:c,it:u}=e;if(!c)throw new Error("ajv implementation error");const{allErrors:h,opts:d}=u;if(u.props=!0,"all"!==d.removeAdditional&&(0,o.alwaysValidSchema)(u,n))return;const m=(0,s.allSchemaProperties)(a.properties),p=(0,s.allSchemaProperties)(a.patternProperties);function f(e){t.code(r._`delete ${l}[${e}]`)}function g(s){if("all"===d.removeAdditional||d.removeAdditional&&!1===n)f(s);else{if(!1===n)return e.setParams({additionalProperty:s}),e.error(),void(h||t.break());if("object"==typeof n&&!(0,o.alwaysValidSchema)(u,n)){const n=t.name("valid");"failing"===d.removeAdditional?(y(s,n,!1),t.if((0,r.not)(n),(()=>{e.reset(),f(s)}))):(y(s,n),h||t.if((0,r.not)(n),(()=>t.break())))}}}function y(t,n,s){const r={keyword:"additionalProperties",dataProp:t,dataPropType:o.Type.Str};!1===s&&Object.assign(r,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(r,n)}t.forIn("key",l,(n=>{m.length||p.length?t.if(function(n){let i;if(m.length>8){const e=(0,o.schemaRefOrVal)(u,a.properties,"properties");i=(0,s.isOwnProperty)(t,e,n)}else i=m.length?(0,r.or)(...m.map((e=>r._`${n} === ${e}`))):r.nil;return p.length&&(i=(0,r.or)(i,...p.map((t=>r._`${(0,s.usePattern)(e,t)}.test(${n})`)))),(0,r.not)(i)}(n),(()=>g(n))):g(n)})),e.ok(r._`${c} === ${i.default.errors}`)}};t.default=a},1125:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(6776),r={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const i=t.name("valid");n.forEach(((t,n)=>{if((0,s.alwaysValidSchema)(r,t))return;const o=e.subschema({keyword:"allOf",schemaProp:n},i);e.ok(i),e.mergeEvaluated(o)}))}};t.default=r},19:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(412).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=s},9864:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(3487),r=n(6776),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?s.str`must contain at least ${e} valid item(s)`:s.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?s._`{minContains: ${e}}`:s._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:i,data:o,it:a}=e;let l,c;const{minContains:u,maxContains:h}=i;a.opts.next?(l=void 0===u?1:u,c=h):l=1;const d=t.const("len",s._`${o}.length`);if(e.setParams({min:l,max:c}),void 0===c&&0===l)return void(0,r.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==c&&l>c)return(0,r.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,r.alwaysValidSchema)(a,n)){let t=s._`${d} >= ${l}`;return void 0!==c&&(t=s._`${t} && ${d} <= ${c}`),void e.pass(t)}a.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(s._`${e}++`),void 0===c?t.if(s._`${e} >= ${l}`,(()=>t.assign(m,!0).break())):(t.if(s._`${e} > ${c}`,(()=>t.assign(m,!1).break())),1===l?t.assign(m,!0):t.if(s._`${e} >= ${l}`,(()=>t.assign(m,!0))))}(n)))))}function f(n,s){t.forRange("i",0,d,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:r.Type.Num,compositeRule:!0},n),s()}))}void 0===c&&1===l?f(m,(()=>t.if(m,(()=>t.break())))):0===l?(t.let(m,!0),void 0!==c&&t.if(s._`${o}.length > 0`,p)):(t.let(m,!1),p()),e.result(m,(()=>e.reset()))}};t.default=i},7772:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const s=n(3487),r=n(6776),i=n(412);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const r=1===t?"property":"properties";return s.str`must have ${r} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:r}})=>s._`{property: ${e},