@datagrok/sequence-translator 1.8.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/package.json +3 -3
- package/src/apps/translator/view/ui.ts +1 -1
- package/src/package-test.ts +1 -1
- package/src/package.ts +7 -0
- package/src/polytool/pt-combine-dialog.ts +131 -0
- package/test-console-output-1.log +82 -104
- package/test-record-1.mp4 +0 -0
package/dist/package-test.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see package-test.js.LICENSE.txt */
|
|
2
|
-
var sequencetranslator_test;(()=>{var t={6717:(t,e,n)=>{"use strict";n.d(e,{j:()=>o});var r=n(6082);async function o(){const t=r.Func.find({package:"Chem",name:"getRdKitModule"});if(0===t.length)throw new Error('Package "Chem" must be installed for getRdKitModule.');return(await t[0].prepare().call()).getOutputParamValue()}},3599:(t,e,n)=>{"use strict";n.d(e,{o:()=>r.o});var r=n(6869)},9124:(t,e,n)=>{"use strict";n.d(e,{b2:()=>i});var r=n(7389),o=n(6082);async function i(){const t="Helm",e=o.Func.find({package:t,name:"getHelmHelper"});if(0===e.length)throw new Error(`Package '${t}' must be installed for HelmHelper.`);return(await e[0].prepare().call()).getOutputParamValue()}o.JsInputBase,Error,r.input.helmAsync=async function(t,e){return(await i()).createHelmInput(t,e)}},8438:(t,e,n)=>{"use strict";function r(t){return t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t}n.d(e,{D:()=>r})},8123:(t,e,n)=>{"use strict";n.d(e,{u:()=>r});const r={V2K_RGP_SHIFT:8,V2K_RGP_LINE:"M RGP",V2K_A_LINE:"A ",V3K_COUNTS_SHIFT:14,V3K_IDX_SHIFT:7,V3K_HEADER_FIRST_LINE:"\nDatagrok macromolecule handler\n\n",V3K_HEADER_SECOND_LINE:" 0 0 0 0 0 0 999 V3000\n",V3K_BEGIN_CTAB_BLOCK:"M V30 BEGIN CTAB\n",V3K_END_CTAB_BLOCK:"M V30 END CTAB\n",V3K_BEGIN_COUNTS_LINE:"M V30 COUNTS ",V3K_COUNTS_LINE_ENDING:" 0 0 0\n",V3K_BEGIN_ATOM_BLOCK:"M V30 BEGIN ATOM\n",V3K_END_ATOM_BLOCK:"M V30 END ATOM\n",V3K_BEGIN_BOND_BLOCK:"M V30 BEGIN BOND\n",V3K_END_BOND_BLOCK:"M V30 END BOND\n",V3K_BOND_CONFIG:" CFG=",V3K_BEGIN_DATA_LINE:"M V30 ",V3K_END:"M END",PRECISION_FACTOR:1e4,DEOXYRIBOSE:{polymerType:"RNA",symbol:"d"},RIBOSE:{polymerType:"RNA",symbol:"r"},PHOSPHATE:{polymerType:"RNA",symbol:"p"},OXYGEN:"O",HYDROGEN:"H"}},2890:(t,e,n)=>{"use strict";n.d(e,{pj:()=>d});var r,o,i,s,a,l,u,c=n(6082);n(4328);class f{constructor(t,e=!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 t){const n=t,r=f._createBuffer(n);if(e)for(let t=0;t<r.length;t++)r[t]=-1;this._data=r,this._length=n}else{if(!(t instanceof Uint32Array))throw new Error("Invalid constructor");this._data=t,this._length=e}}getRawData(){return this._data}assureGoez(t,e){if(t<0)throw new Error(`${e} should be greater than zero`)}assureInRange(t,e,n,r){if(t<e||t>n)throw new Error(`Argument ${r} (${t}) out of range (${e}, ${n})`)}copy(t,e,n){for(let r=0;r<n;r++)e[r]=t[r]}copyFrom(t){if(this._length!=t._length)throw new Error(`Lengths differ (${this._length} != ${t._length})`);this.copy(t._data,this._data,this.lengthInInts),this._version++}get length(){return this._length}get buffer(){return this._data}set buffer(t){this._data=t,this._version++}get version(){return this._version}set version(t){this._version=t}incrementVersion(t=!0){this._version++}get lengthInInts(){return Math.floor((this._length+31)/32)}get versionedName(){return this._version==this._versionedNameVersion?this._versionedName:""}set versionedName(t){this._versionedName=t,this._versionedNameVersion=this._version}get self(){return this}setLength(t){if(t<0)throw new Error("should be >= 0");if(t==this._length)return;const e=Math.floor((t+31)/32);if(e>this._data.length||e+this.SHRINK_THRESHOLD<this._data.length){const t=new Uint32Array(e);this.copy(this._data,t,e>this._data.length?this._data.length:e),this._data=t}t>this._length&&(this._length%32>0&&(this._data[this.lengthInInts-1]&=(1<<(this._length%32&31))-1),this._data.fill(0,this.lengthInInts,e)),this._length=t,this._version++}static fromAnd(t,e){if(t._length!=e._length)throw new Error(`Lengths differ (${t._length} != ${e._length})`);const n=new f(t._length);n._length=t._length,n._data=f._createBuffer(n._length),n._version=0;const r=t.lengthInInts;for(let o=0;o<r;o++)n._data[o]=t._data[o]&e._data[o];return n}static _createBuffer(t){return new Uint32Array(Math.floor((t+31)/32))}static fromValues(t){const e=new f(t.length);e._version=0;for(let n=0;n<e._length;n++)t[n]&&(e._data[Math.floor(n/32)]|=1<<(n%32&31));return e}static fromSeq(t,e){const n=new f(t);for(let r=0;r<t;++r)n.setBit(r,e(r));return n._version=0,n}static fromString(t){return f.fromSeq(t.length,(e=>"1"==t.charAt(e)))}static fromUint32Array(t,e){const n=new f(t);return n._data=e,n}static fromBytes(t){const e=t.length,n=new f(8*e);n._data=new Uint32Array(Math.floor((e+3)/4)),n._length=8*e;let r=0,o=0;for(;e-o>=4;)n._data[r++]=255&t[o]|(255&t[o+1])<<8|(255&t[o+2])<<16|(255&t[o+3])<<24,o+=4;return e-o==3&&(n._data[r]=(255&t[o+2])<<16),e-o==2&&(n._data[r]|=(255&t[o+1])<<8),e-o==1&&(n._data[r]|=255&t[o]),n._version=0,n}toString(){return`${this._length} bits, ${this.countBits(!0)} set`}equals(t){if(this==t)return!0;if(null==t)return!1;if(this._length!=t._length)return!1;if(0==this._length)return!0;for(let e=0;e<this._data.length-1;e++)if(this._data[e]!=t._data[e])return!1;for(let e=8*(this._data.length-1);e<this._length;e++)if(this.getBit(e)!=t.getBit(e))return!1;return!0}clone(){const t=new f(0,!1);return t._data=Uint32Array.from(this._data),t._length=this._length,t._version=this._version,t}init(t,e){this.setAll(!1,!1);for(let e=0;e<this._length;e++)t(e)&&(this._data[Math.floor(e/32)]|=1<<(e%32&31));return this.incrementVersion(e),this}invert(t=!0){for(let t=0;t<this._data.length;t++)this._data[t]^=-1;this.incrementVersion(t)}setAll(t,e=!1){const n=t?-1:0,r=this.lengthInInts;for(let t=0;t<r;t++)this._data[t]=n;this.incrementVersion(e)}setIndexes(t,e=!0,n=!0,r=!0){n&&this.setAll(!e,!1);for(const n of t)this.setFast(n,e);this.incrementVersion(r)}everyIndex(t,e=!0){for(const n of t)if(this.getBit(n)!=e)return!1;return!0}anyIndex(t,e=!0){for(const n of t)if(this.getBit(n)==e)return!0;return!1}setWhere(t,e=!0,n=!0,r=!0,o=!0){if(n&&o&&this.setAll(!e,!1),o)for(let n=0;n<this._length;n++)t(n)&&this.setFast(n,e);else for(let n=0;n<this._length;n++)this.setFast(n,t(n)?e:!e);this.incrementVersion(r)}getRange(t,e){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length,"to");const n=[];for(let r=t;r<e;++r)n.push(this.getBit(r));return f.fromValues(n)}getRangeAsList(t,e){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length,"to");const n=[];for(let r=t;r<e;++r)n.push(this.getBit(r));return n}setRange(t,e,n,r=!0){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length-1,"to");const o=Math.min(t,e),i=Math.max(t,e);if(n)for(let t=o;t<=i;t++)this.setTrue(t);else for(let t=o;t<=i;t++)this.setFalse(t);return this.incrementVersion(r),this}setRandom(t,e,n=!0){if(t<0||t>this._length)throw new Error("n must be >= 0 && <= Count");t>this._length/2&&this.setRandom(this._length-t,!e),this.setAll(!e);for(let n=0;n<t;){const t=Math.floor(Math.random()*this._length);this.getBit(t)!=e&&(this.setFast(t,e),n++)}this.incrementVersion(n)}and(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]&=t._data[e];return this.incrementVersion(e),this}andNot(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");const n=this.lengthInInts;for(let e=0;e<n;e++)this._data[e]&=~t._data[e];return this.incrementVersion(e),this}notAnd(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]=~this._data[e]&t._data[e];return this.incrementVersion(e),this}not(t=!0){for(let t=0,e=this.lengthInInts;t<e;t++)this._data[t]=~this._data[t];return this.incrementVersion(t),this}or(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]|=t._data[e];return this.incrementVersion(e),this}xor(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]^=t._data[e];return this.incrementVersion(e),this}insertAt(t,e,n=!1){if(this.assureInRange(t,0,this._length,"pos"),0==e)return;const r=this._length;this.setLength(this._length+e);for(let n=r-1;n>=t;n--)this.setBit(n+e,this.getBit(n));for(let r=t;r<t+e;r++)this.setBit(r,n)}removeAt(t,e=1){if(e<0)throw new Error("n cannot be negative");if(this.assureInRange(t,0,this._length-e,"pos"),this.contains(!0))for(let n=t;n<this._length-e;n++)this.setBit(n,this.getBit(n+e));this.setLength(this._length-e)}removeByMask(t,e=!0){if(this._length!=t.length)throw new Error("length != mask.length");if(t==this)this.setLength(t.countBits(!e)),this.setAll(!e);else{let n=0;for(let r=-1;-1!=(r=t.findNext(r,!e));)this.setFast(n++,this.getBit(r));this._length=n,this._version++}return this}getBit(t){return!!(this._data[Math.floor(t/32)]&1<<(31&t))}setBit(t,e,n=!0){this.setFast(t,e),this._version++}setFast(t,e){e?this._data[Math.floor(t/32)]|=1<<(31&t):this._data[Math.floor(t/32)]&=~(1<<(31&t))}setTrue(t){this._data[Math.floor(t/32)]|=1<<(31&t)}setFalse(t){this._data[Math.floor(t/32)]&=~(1<<(31&t))}trueCount(){return this.countBits(!0)}falseCount(){return this.countBits(!1)}countBits(t){if(0==this._length)return 0;if(this._selectedCountVersion!=this._version){this._selectedCount=0;const t=this.lengthInInts;let e=0;for(;e<t-1;e++)for(let t=this._data[e];0!=t;t>>>=8)this._selectedCount+=f._onBitCount[255&t];let n=this._data[e];const r=31&this._length;for(0!=r&&(n&=~(4294967295<<r));0!=n;n>>>=8)this._selectedCount+=f._onBitCount[255&n];this._selectedCountVersion=this._version}return t?this._selectedCount:this._length-this._selectedCount}countWhere(t){let e=0;if(this.trueCount()==this._length)for(let n=0;n<this._length;n++)e+=t(n)?1:0;else for(let n=-1;-1!=(n=this.findNext(n,!0));)e+=t(n)?1:0;return e}andWithCountBits(t,e){if(0==this._length)return 0;let n=0;const r=this.lengthInInts;let o=0;for(;o<r-1;o++)for(let e=this._data[o]&t._data[o];0!=e;e>>>=8)n+=f._onBitCount[255&e];let i=this._data[o]&t._data[o];const s=31&this._length;for(0!=s&&(i&=~(4294967295<<s));0!=i;i>>>=8)n+=f._onBitCount[255&i];return e?n:this._length-n}clear(){this.setLength(0)}contains(t){return this.findNext(-1,t)>=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(t,e=!0){if(this.assureInRange(t,-1,this._length,"index"),t>=this._length-1)return-1;let n=31&(t=t<0?0:t+1);const r=this.lengthInInts;for(let o=Math.floor(t/32);o<r;o++){let r=e?this._data[o]:~this._data[o];if(0!=n)r&=4294967295<<n&4294967295,n=0;else if(!e&&-4294967296==r)continue;for(let e=0;0!=r;e+=8,r>>>=8){const n=f._firstOnBit[255&r];if(n>=0)return(t=n+32*o+e)>=this._length?-1:t}}return-1}findPrev(t,e=!0){if(0==t)return-1;this.assureInRange(t,-1,this._length,"index");let n=1+(t=t<0?this._length-1:t-1)&31;for(let r=Math.floor(t/32);r>=0;r--){let t=e?this._data[r]:~this._data[r];0!=n&&(t&=~(4294967295<<n),n=0);for(let e=24;0!=t;e-=8,t<<=8){const n=f._lastOnBit[t>>>24];if(n>=0)return n+32*r+e}}return-1}}f._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]),f._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]),f._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]),function(t){t.Levenshtein="Levenshtein",t.JaroWinkler="Jaro-Winkler",t.Manhattan="Manhattan",t.Onehot="One-Hot"}(r||(r={})),function(t){t.Euclidean="Euclidean"}(o||(o={})),function(t){t.Tanimoto="Tanimoto",t.Dice="Dice",t.Asymmetric="Asymmetric",t.BraunBlanquet="Braun-Blanquet",t.Cosine="Cosine",t.Kulczynski="Kulczynski",t.McConnaughey="Mc-Connaughey",t.RogotGoldberg="Rogot-Goldberg",t.Russel="Russel",t.Sokal="Sokal",t.Hamming="Hamming",t.Euclidean="Euclidean"}(i||(i={})),function(t){t.TanimotoIntArray="TanimotoIntArray"}(s||(s={})),function(t){t.Vector="Vector",t.String="String",t.BitArray="BitArray",t.MacroMolecule="MacroMolecule",t.Number="Number",t.IntArray="IntArray",t.NumberArray="NumberArray"}(a||(a={})),function(t){t.Difference="Difference"}(l||(l={})),function(t){t.CommonItems="Common Items"}(u||(u={}));new Uint32Array(65536);var h;async function d(){const t=c.Func.find({package:"Bio",name:"getMonomerLibHelper"});if(0===t.length)throw new Error('Package "Bio" must be installed for MonomerLibHelper.');return(await t[0].prepare().call()).getOutputParamValue()}!function(t){t.HAMMING="Hamming",t.LEVENSHTEIN="Levenshtein",t.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",t.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(h||(h={})),h.HAMMING,h.LEVENSHTEIN,h.NEEDLEMANN_WUNSCH,h.MONOMER_CHEMICAL_DISTANCE,i.Tanimoto,i.Dice,i.Asymmetric,i.BraunBlanquet,i.Cosine,i.Kulczynski,i.McConnaughey,i.RogotGoldberg,i.Russel,i.Sokal,i.Hamming,i.Euclidean,i.Tanimoto,i.Dice,i.Asymmetric,i.BraunBlanquet,i.Cosine,i.Kulczynski,i.McConnaughey,i.RogotGoldberg,i.Russel,i.Sokal,i.Hamming,i.Euclidean,i.Tanimoto,i.Dice,i.Cosine,i.Tanimoto,i.Asymmetric,i.Cosine,i.Sokal,h.HAMMING,h.LEVENSHTEIN,h.MONOMER_CHEMICAL_DISTANCE,h.NEEDLEMANN_WUNSCH,n(3151),n(439)},6197:(t,e,n)=>{"use strict";n(3599)},9235:(t,e,n)=>{"use strict";n.d(e,{R:()=>l});var r=n(6082),o=n(1991),i=n.n(o),s=n(330),a=n(3599);async function l(t,e,o,l,u,c,f){const h=t.length,d=t.dataFrame,p=Math.max(navigator.hardwareConcurrency-2,1),g=new Array(p).fill(null).map((()=>new Worker(new URL(n.p+n.u(455),n.b)))),m=h/p,y=new Array(p),v=c.getSeqHandler(t),b="RNA"==l?a.o.NUCLEOTIDE:a.o.AA,C=i().count(0).take(t.length).map((t=>{const e=v.getSplitted(t);return i().count(0).take(e.length).map((t=>({position:t,symbol:e.getCanonical(t),biotype:b}))).toArray()})).toArray();for(let t=0;t<p;t++){const n=g[t],r=Math.floor(t*m),i=t===p-1?h:Math.floor((t+1)*m);y[t]=new Promise((t=>{n.onmessage=e=>{t(e.data)}})),n.postMessage({seqList:C,monomersDict:e,alphabet:o,polymerType:l,start:r,end:i})}const A=[],w=[];await Promise.all(y).then((t=>{for(const e of t)A.push(...e.molfiles),w.push(...e.warnings)})),setTimeout((()=>{g.forEach((t=>{t.terminate()}))}),0);const E=(0,s.qj)(d,t.name),_=r.Column.fromType(r.COLUMN_TYPE.STRING,E,t.length).init((t=>A[t]?.molfile));return _.semType=r.SEMTYPE.MOLECULE,_.meta.units=r.UNITS.Molecule.MOLBLOCK,_.setTag(".sequence-src-col",t.name),{molCol:_,warnings:w}}},3561:(t,e,n)=>{"use strict";n.d(e,{Hb:()=>s,YN:()=>a});var r=n(8123),o=(n(294),n(3151)),i=n(439);function s(t,e,n){const s=new Map;for(const a of t.getMonomerSymbolsByType(e)){const l=t.getMonomer(e,a);if("RNA"===e&&("Branch"===l.monomerType||n===i.YI.DNA&&l.symbol===r.u.DEOXYRIBOSE.symbol||n===i.YI.RNA&&l.symbol===r.u.RIBOSE.symbol||l.symbol===r.u.PHOSPHATE.symbol)||"PEPTIDE"===e&&"Branch"!==l.monomerType){const t={};o.f6.forEach((e=>{t[e]=l[e]})),s.set(l.symbol,t)}}return s}function a(t){return Math.round(r.u.PRECISION_FACTOR*t)/r.u.PRECISION_FACTOR}n(6197)},6077:(t,e,n)=>{"use strict";n.d(e,{C4:()=>p});var r=n(4328),o=n(6082),i=n(1991),s=n.n(i),a=n(439),l=n(3561),u=n(9235),c=n(294),f=n(9192),h=n(330),d=n(8123);async function p(t,e,n,i,c){if(e.semType!==o.SEMTYPE.MACROMOLECULE)return{molCol:null,warnings:[`Only the ${o.SEMTYPE.MACROMOLECULE} columns can be converted to atomic level, the chosen column has semType '${e.semType}'`]};let p=e;const m=i.getSeqHandler(e);let y,v;m.notation!==a.Hi.SEPARATOR&&(p=m.convert(a.Hi.SEPARATOR,"."),p.name=e.name);try{v=i.getSeqHandler(p).alphabet,y=(0,h.pz)(v)}catch(t){const[e,n]=(0,f.AP)(t);return{molCol:null,warnings:[e]}}const b=function(t,e){const n=t.length,o=new Array(n),i=e.getSeqHandler(t);let a=!1;const l=i.defaultBiotype;for(let t=0;t<n;++t){const e=i.getSplitted(t);a||(a=0===e.length),o[t]=s().count(0).take(e.length).filter((t=>!e.isGap(t))).map((t=>({position:t,biotype:l,symbol:e.getCanonical(t)}))).toArray()}return a&&r.shell.warning(`Some values in the "${t.name}" column are empty`),o}(p,i),C=function(t,e,n,r,o){const i=(0,l.Hb)(r,e,n),s={},u={value:null};if("RNA"===e){const t=n===a.YI.RNA?[d.u.RIBOSE,d.u.PHOSPHATE]:[d.u.DEOXYRIBOSE,d.u.PHOSPHATE];for(const n of t)g(s,n.symbol,i,o,e,u)}for(let n=0;n<t.length;++n){const r=t[n];for(const t of r){const n=t.symbol;if(""!==n)try{if("RNA"===e&&3===n.split(/\(|\)/).filter((t=>!!t)).length){const t=n.split(/\(|\)/)[1];g(s,t,i,o,e,u),s[e]?.[t]&&(s[e][n]=s[e][t])}else g(s,n,i,o,e,u)}catch(t){const e=t instanceof Error?t.message:t.toString(),r=t instanceof Error?t.stack:void 0;throw console.error(`bio lib: getMonomersDictFromLib() sym='${n}', error:\n${e}\n${r}`),new Error(`Can't get monomer '${n}' from library: ${e}`)}}}return s}(b,y,v,n,c),A=p.length,w=await(0,u.R)(p,C,v,y,n,i,c);return w.warnings.length>.05*A&&r.shell.warning(`Molfile conversion resulted in ${w.warnings.length} errors`),w}function g(t,e,n,r,o,i){const s={polymerType:o,symbol:e};if(!(0,c.bq)(t,s)){const a=function(t,e,n,r,o){if(e.has(t)){const s=e.get(t),a=function(t){const e=[];for(const n of t){let t=n.capGroupSmiles;t||(t=n.capGroupSMILES),t=t.replace(/(\[|\]|\*|:|\d)/g,""),e.push(t)}return e}(s.rgroups),u=(i=s.molfile).includes("V3000")?function(t){const e=new Map,n=/M V30 (\d+) R#.+RGROUPS=\((\d+) (\d+)\).*/gm;let r;for(;null!==(r=n.exec(t));)r.index===n.lastIndex&&n.lastIndex++,e.set(parseInt(r[1]),parseInt(r[3]));return e}(i):function(t){const e=new Map;let n=t.indexOf(d.u.V2K_A_LINE,0),r=n;for(;-1!==n;){r=t.indexOf("\n",n);const o=parseInt(t.substring(n,r).replace(/^A\s+/,""));n=t.indexOf("R",r),r=t.indexOf("\n",n);const i=parseInt(t.substring(n,r).replace(/^R/,""));e.set(o,i),n=t.indexOf(d.u.V2K_A_LINE,r)}for(n=t.indexOf(d.u.V2K_RGP_LINE,0),r=t.indexOf("\n",n);-1!==n;){n+=d.u.V2K_RGP_SHIFT,r=t.indexOf("\n",n);const o=t.substring(n,r).replaceAll(/\s+/g," ").split(" ").map((t=>parseInt(t))).slice(1);for(let t=0;t<o.length;t+=2){if(e.has(o[t])&&e.get(o[t])!==o[t+1])throw new Error(`r-group index ${o[t]} has already been added with a different value`);e.set(o[t],o[t+1])}n=t.indexOf(d.u.V2K_RGP_LINE,r)}return e}(i),c=s.molfile.includes("V3000")?s.molfile:function(t,e){const n=e.get_mol(t),r=n.get_v3Kmolblock();return n.delete(),r}(function(t){let e=t.indexOf(d.u.V2K_A_LINE,0);-1===e&&(e=t.indexOf(d.u.V2K_RGP_LINE));const n=t.indexOf(d.u.V3K_END,e);return t.substring(0,e)+t.substring(n)}(s.molfile),n),f=function(t){let e=(t=t.replaceAll("\r","")).indexOf(d.u.V3K_BEGIN_COUNTS_LINE)+d.u.V3K_COUNTS_SHIFT,n=t.indexOf(" ",e+1);const r=parseInt(t.substring(e,n));return e=n+1,n=t.indexOf(" ",e+1),{atomCount:r,bondCount:parseInt(t.substring(e,n))}}(c),h=function(t,e){const n=new Array(e),r=new Float32Array(e),o=new Float32Array(e),i=new Array(e);let s=t.indexOf(d.u.V3K_BEGIN_ATOM_BLOCK);s=t.indexOf("\n",s);let a=s;for(let l=0;l<e;l++){s=t.indexOf(d.u.V3K_BEGIN_DATA_LINE,s)+d.u.V3K_IDX_SHIFT,a=t.indexOf(" ",s),s=a+1,a=t.indexOf(" ",s),n[l]=t.substring(s,a);const e=new Array(2);for(let n=0;n<2;++n)s=a+1,a=t.indexOf(" ",s),e[n]=parseFloat(t.substring(s,a));r[l]=e[0],o[l]=e[1],s=a,a=t.indexOf("\n",s)+1,i[l]=t.slice(s,a),s=a}return{atomTypes:n,x:r,y:o,kwargs:i}}(c,f.atomCount),p=function(t,e){const n=new Uint32Array(e),r=new Array(e),o=new Map,i=new Map;let s=t.indexOf(d.u.V3K_BEGIN_BOND_BLOCK);s=t.indexOf("\n",s);let a=s;for(let l=0;l<e;++l){const e=new Array(3);s=t.indexOf(d.u.V3K_BEGIN_DATA_LINE,a)+d.u.V3K_IDX_SHIFT,a=t.indexOf(" ",s);for(let n=0;n<3;++n)s=a+1,a=Math.min(t.indexOf("\n",s),t.indexOf(" ",s)),e[n]=parseInt(t.slice(s,a));n[l]=e[0],r[l]=e.slice(1);const u=t.indexOf("\n",s);let c=t.slice(a,u),f=c.indexOf(d.u.V3K_BOND_CONFIG);if(-1!==f){f=c.indexOf("=",f)+1;let t=c.indexOf(" ",f);-1===t&&(t=c.length);const e=parseInt(c.slice(f,t));o.set(l,e);const n=d.u.V3K_BOND_CONFIG+e.toString();c=c.replace(n,"")}c||i.set(l,c)}return{bondTypes:n,atomPairs:r,bondConfiguration:o,kwargs:i}}(c,f.bondCount),g=function(t,e,n,r){const o={backboneShift:null,branchShift:null,terminalNodes:[],rNodes:[]};return function(t,e,n){for(const[r,o]of n)t.atomTypes[r-1]=e[o-1]}(t,n,r),function(t,e){e.rNodes=Array.from(t.keys());for(let n=0;n<e.rNodes.length;n++)for(const r of[1,2])if(t.get(e.rNodes[n])===r){const t=e.rNodes[r-1];e.rNodes[r-1]=e.rNodes[n],e.rNodes[n]=t}}(r,o),m(e,o),o}(h,p,a,u),v=function(t){let e=[],n=t.indexOf("M V30 MDLV30/STEABS ATOMS=(");for(;-1!==n;){n+=28;const r=t.indexOf(")",n);e=e.concat(t.substring(n,r).split(" ").slice(1).map((t=>parseInt(t)))),n=r,n=t.indexOf("M V30 MDLV30/STEABS ATOMS=(",n)}return e}(c),C={atoms:h,bonds:p,meta:g,stereoAtoms:v};return"PEPTIDE"===r?function(t){const e=t.meta.terminalNodes[0]-1,n=t.meta.rNodes[0]-1,r=t.atoms.x,o=t.atoms.y;x(t,-r[e],-o[e]);const i=A(r[n],o[n]);w(t.atoms,-i),r[t.meta.rNodes[1]-1]<0&&E(t);const s=function(t){const e=function(t){const e=new Map;for(const n of t.bonds.atomPairs)for(let t=0;t<2;t++){const r=n[t],o=n[(t+1)%2];e.has(r)?e.get(r)?.push(o):e.set(r,new Array(1).fill(o))}return e}(t);let n=0;const r=t.atoms.atomTypes.length;let o=0;if(t.meta.terminalNodes.length<2)return null;for(;0===n;){const i=e.get(t.meta.terminalNodes[1])[o];if(t.atoms.atomTypes[i-1]===d.u.OXYGEN&&i!==t.meta.rNodes[1]&&(n=i),o++,o>r)return null}return n}(t);null!=s&&(function(t,e){t.atoms.y[t.meta.rNodes[1]-1]<0&&t.atoms.y[e-1]<0&&(function(t){_(t,!0)}(t),w(t.atoms,-function(t,e){return A(t,e)+Math.PI/2}(t.atoms.x[t.meta.terminalNodes[1]-1],t.atoms.y[t.meta.terminalNodes[1]-1])))}(t,s),function(t,e){const n=t.atoms.x;n[t.meta.rNodes[1]-1]>n[e-1]&&function(t,e,n){const r=e-1,o=n-1,i=t.atoms.x,s=t.atoms.y,a=i[r],l=s[r];i[r]=i[o],s[r]=s[o],i[o]=a,s[o]=l}(t,e,t.meta.rNodes[1])}(t,s))}(C):t===d.u.RIBOSE.symbol||t===d.u.DEOXYRIBOSE.symbol?function(t,e){const n=t.atoms.x,r=t.atoms.y;let o=t.meta.terminalNodes[0]-1;const i=t.meta.rNodes[1]-1;x(t,-n[o],-r[o]);const s=A(n[t.meta.rNodes[2]-1],r[t.meta.rNodes[2]-1]);w(t.atoms,-s),n[t.meta.rNodes[0]-1]>n[t.meta.rNodes[1]-1]&&E(t);const a=A(n[i],r[i]);w(t.atoms,3*Math.PI/2-a),e.value=function(t){const e=t.atoms.x,n=t.atoms.y,r=t.meta.rNodes[2]-1,o=t.meta.terminalNodes[2]-1,i=e[r]-e[o],s=n[r]-n[o];return Math.atan2(i,s)}(t),o=t.meta.terminalNodes[0]-1,x(t,-n[o],-r[o])}(C,o):t===d.u.PHOSPHATE.symbol?function(t){const e=t.meta.rNodes[1]-1,n=t.meta.rNodes[0]-1,r=t.atoms.x,o=t.atoms.y;x(t,-r[e],-o[e]);const i=A(r[n],o[n]);w(t.atoms,Math.PI/2-i)}(C):function(t,e){const n=t.atoms.x,r=t.atoms.y,o=t.meta.terminalNodes[0]-1,i=t.meta.rNodes[0]-1;x(t,-n[o],-r[o]);const s=A(n[i],r[i]),a=e.value;if(!a)throw new Error("The value of sugarBranchToOYAngle is null");w(t.atoms,Math.PI-s+a);const u=function(t,e){return(0,l.YN)(Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2))}({x:n[t.meta.rNodes[0]-1],y:r[t.meta.rNodes[0]-1]},{x:n[t.meta.terminalNodes[0]-1],y:r[t.meta.terminalNodes[0]-1]});if(1!=u)for(let t=0;t<n.length;++t)n[t]=(0,l.YN)(n[t]/u),r[t]=(0,l.YN)(r[t]/u)}(C,o),function(t,e,n){"PEPTIDE"===t?(y(e,t),b(e,e.meta.rNodes[1])):n===d.u.RIBOSE.symbol||n===d.u.DEOXYRIBOSE.symbol?(b(e,e.meta.rNodes[1]),e.meta.rNodes[1]=e.meta.terminalNodes[1],m(e.bonds,e.meta),y(e,t),b(e,e.meta.rNodes[1]),b(e,e.meta.rNodes[0]),b(e,e.meta.rNodes[2])):n===d.u.PHOSPHATE.symbol&&(e.meta.terminalNodes[0]=e.meta.rNodes[0],x(e,-e.atoms.x[e.meta.terminalNodes[0]-1],-e.atoms.y[e.meta.terminalNodes[0]-1]),y(e,t),b(e,e.meta.rNodes[1]))}(r,C,t),function(t){let e=0;for(;e<t.atoms.atomTypes.length;)t.atoms.atomTypes[e]===d.u.HYDROGEN&&(b(t,e+1),--e),++e}(C),function(t){const e=" RGROUPS=(1 1)";for(let n=0;n<(t.atoms.kwargs?.length??0);n++){const r=t.atoms.kwargs[n];r&&r.includes(e)&&(t.atoms.kwargs[n]=r.replace(e,""))}}(C),C}var i;return null}(e,n,r,o,i);if(!a)throw new Error(`Monomer with symbol '${e}' is absent the monomer library`);(0,c.LQ)(t,s,a)}}function m(t,e){const n=e.rNodes;e.terminalNodes=new Array(n.length).fill(0);const r=e.terminalNodes,o=t.atomPairs;let i=0,s=0;for(;i<o.length&&s<r.length;){for(let t=0;t<r.length;++t)for(let e=0;e<2;++e)o[i][e]===n[t]&&(r[t]=o[i][(e+1)%2],n.length,++s);++i}}function y(t,e){t.meta.rNodes.length>1&&(t.meta.backboneShift=v(t,t.meta.rNodes[1]-1,t.meta.terminalNodes[0]-1)),"RNA"===e&&t.meta.rNodes.length>2&&(t.meta.branchShift=v(t,t.meta.rNodes[2]-1,t.meta.terminalNodes[0]-1))}function v(t,e,n){return[(0,l.YN)(t.atoms.x[e]-t.atoms.x[n]),(0,l.YN)(t.atoms.y[e]-t.atoms.y[n])]}function b(t,e){if(void 0!==e){const n=e-1,r=t.atoms,o=t.bonds,i=t.meta;r.atomTypes.splice(n,1),r.x=C(Float32Array,r.x,n,1),r.y=C(Float32Array,r.y,n,1),r.kwargs.splice(n,1);for(let t=0;t<i.terminalNodes.length;++t)i.terminalNodes[t]>e?--i.terminalNodes[t]:i.terminalNodes[t]===e&&(i.terminalNodes[t]=-1);for(let t=0;t<i.rNodes.length;++t)i.rNodes[t]>e?--i.rNodes[t]:i.rNodes[t]===e&&(i.rNodes[t]=-1);let s=0;for(;s<o.atomPairs.length;){const t=o.atomPairs[s][0],n=o.atomPairs[s][1];t===e||n===e?(o.atomPairs.splice(s,1),o.bondTypes=C(Uint32Array,o.bondTypes,s,1),o.bondConfiguration.has(s)&&o.bondConfiguration.delete(s),o.kwargs.has(s)&&o.kwargs.delete(s),--s):(o.atomPairs[s][0]=t>e?t-1:t,o.atomPairs[s][1]=n>e?n-1:n),++s}let a=Array.from(o.bondConfiguration.keys());a.forEach((t=>{if(o.bondConfiguration.has(t)&&t>n){const e=o.bondConfiguration.get(t);o.bondConfiguration.delete(t),o.bondConfiguration.set(t-1,e)}})),a=Array.from(o.kwargs.keys()),a.forEach((t=>{if(o.kwargs.has(t)&&t>n){const e=o.kwargs.get(t);o.kwargs.delete(t),o.kwargs.set(t-1,e)}}))}}function C(t,e,n,r){const o=new t(e.length-r);let i=0,s=0;for(;i<e.length;)i===n&&(i+=r),o[s]=e[i],++s,++i;return o}function A(t,e){let n;if(0===t)n=e>0?0:Math.PI;else if(0===e)n=t>0?-Math.PI/2:Math.PI/2;else{const r=e/t,o=Math.atan(r);n=t<0?Math.PI/2+o:-Math.PI/2+o}return n}function w(t,e){if(0!==e){const n=t.x,r=t.y,o=Math.cos(e),i=Math.sin(e);for(let t=0;t<n.length;++t){const e=n[t];n[t]=(0,l.YN)(e*o-r[t]*i),r[t]=(0,l.YN)(e*i+r[t]*o)}}}function E(t){_(t,!1)}function _(t,e){if(e){const e=t.atoms.y;for(let t=0;t<e.length;t++)e[t]=-e[t]}else{const e=t.atoms.x;for(let t=0;t<e.length;t++)e[t]=-e[t]}const n=t.bonds.bondConfiguration;for(const[t,e]of n){const r=1===e?3:1;n.set(t,r)}}function x(t,e,n){const r=t.atoms.x,o=t.atoms.y;for(let t=0;t<r.length;++t)r[t]=(0,l.YN)(r[t]+e),void 0!==n&&(o[t]=(0,l.YN)(o[t]+n))}},294:(t,e,n)=>{"use strict";function r(t,e){return!!t[e.polymerType]?.[e.symbol]}function o(t,e,n){let r=t[e.polymerType];r||(r=t[e.polymerType]={}),r[e.symbol]=n}n.d(e,{LQ:()=>o,bq:()=>r}),Map},330:(t,e,n)=>{"use strict";n.d(e,{pz:()=>i,qj:()=>o});var r=n(2003);function o(t,e){return function(t,e){return t?t.columns.getUnusedName(e):e}(t,`molfile(${e})`)}function i(t){let e;if(t===r.YI.PT||t===r.YI.UN)e="PEPTIDE";else{if(t!==r.YI.RNA&&t!==r.YI.DNA)throw new Error(`Unexpected alphabet '${t}'.`);e="RNA"}return e}},3151:(t,e,n)=>{"use strict";n.d(e,{f6:()=>r});const r=["symbol","molfile","rgroups","name"];new RegExp("[rd]\\((\\w)\\)p?","g")},9192:(t,e,n)=>{"use strict";function r(t){return"string"==typeof t||t instanceof String?t:"StateError"===t.constructor.name?t.message:"StateError"===t.constructor.name&&"$thrownJsError"in t?r(t.$thrownJsError):t instanceof Error?t.message:t.toString()}function o(t){return t instanceof Error?t.stack:"StateError"===t.constructor.name&&"$thrownJsError"in t?o(t.$thrownJsError):void 0}function i(t){return[r(t),o(t)]}n.d(e,{AP:()=>i})},439:(t,e,n)=>{"use strict";n.d(e,{Hi:()=>r,YI:()=>o,_S:()=>l,b9:()=>u,gp:()=>i});var r,o,i,s=n(2738);!function(t){t.FASTA="fasta",t.SEPARATOR="separator",t.HELM="helm",t.CUSTOM="custom"}(r||(r={})),function(t){t.DNA="DNA",t.RNA="RNA",t.PT="PT",t.UN="UN"}(o||(o={})),function(t){t.aligned="aligned",t.alphabet="alphabet",t.alphabetSize=".alphabetSize",t.alphabetIsMultichar=".alphabetIsMultichar",t.separator="separator",t.isHelmCompatible=".isHelmCompatible",t.positionNames=".positionNames",t.positionLabels=".positionLabels",t.regions=".regions"}(i||(i={}));const 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 s.a(o.PT,a.fasta.peptide,.5),new s.a(o.DNA,a.fasta.dna,.55),new s.a(o.RNA,a.fasta.rna,.55),""),u={[r.FASTA]:"-",[r.SEPARATOR]:"",[r.HELM]:"*"}},2003:(t,e,n)=>{"use strict";n.d(e,{Hi:()=>r.Hi,YI:()=>r.YI,dh:()=>o.dh,gp:()=>r.gp,zS:()=>o.zS});var r=n(439),o=n(7291)},2738:(t,e,n)=>{"use strict";n.d(e,{a:()=>r});class r{constructor(t,e,n){this.name=t,this.alphabet=e,this.cutoff=n}}},7291:(t,e,n)=>{"use strict";n.d(e,{Mu:()=>y,dh:()=>v,zS:()=>A,qp:()=>b});var r=n(6082),o=n(1991),i=n.n(o),s=(n(2738),n(439));class a{static makePalette(t,e=!1,n=a){const r={};return t.forEach((t=>{const n=t[0],o=t[1];n.forEach(((t,n)=>{r[t]=this.colourPalette[o][e?0:n]}))})),new n(r)}constructor(t){this._palette=t}get(t,e){return this._palette[t]}}a.undefinedColor="rgb(100,100,100)",a.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)"]};class l extends a{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,l)),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,l)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new l({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(t){const e=t in l.aaSynonyms?l.aaSynonyms[t]:t;return super.get(e)}}l.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class u{static getPalette(t="grok"){switch(t){case"grok":return l.GrokGroups;case"lesk":return l.Lesk;default:throw new Error(`ChemPalette: scheme \`${t}\` does not exist`)}}static getInnerOuter(t){let e=0,n="",r="";for(const o of t)"("==o?e++:")"==o?e--:e?n+=o:r+=o;return isNaN(parseInt(n))?[r,n]:[r,""]}static getColorAAPivot(t="",e="grok"){const n=this.getPalette(e);let[r,o]=this.getInnerOuter(t);if(r=r.length>6?`${r.slice(0,3)}...`:r,o=o.length>6?`${o.slice(0,3)}...`:o,1==t.length||"("==t[1]){const e=t[0]?.toUpperCase();return e in n?[n.get(e),e,o,1]:[this.undefinedColor,r,o,1]}if("d"==t[0]&&t[1]in n&&(2==t.length||"("==t[2])){const e=t[1]?.toUpperCase();return e in n?[n.get(e),e,o,2]:[this.undefinedColor,r,o,2]}if(t.substring(0,3)in this.AAFullNames&&(3==t.length||"("==t[3])){const e=this.AAFullNames[t.substring(0,3)];return e in n?[n.get(e),e,o,3]:[this.undefinedColor,r,o,3]}if(t[0]?.toLowerCase()==t[0]&&t.substring(1,3)in this.AAFullNames&&(4==t.length||"("==t[4])){const e=this.AAFullNames[t.substring(1,3)];return e in n?[n.get(e),e,o,4]:[this.undefinedColor,r,o,4]}return[this.undefinedColor,r,o,0]}}u.SemType="Aminoacids",u.SemTypeMultipleAlignment="AminoacidsMultipleAlignment",u.undefinedColor="rgb(100,100,100)",u.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"},u.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"},u.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(*)*"},u.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"};class c{}c.SemType="Nucleotides",c.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",c.Names={A:"Adenine",C:"Cytosine",G:"Guanine",T:"Thymine",U:"Uracil"};var f=n(2890);function h(t,e=!0){if(null==t)return"rgb(100,100,100)";const n=r.Color.fromHtml(t);if(e){const t=r.Color.g(n),e=r.Color.r(n),o=r.Color.b(n),i=Math.sqrt(Math.pow(0-e,2)+Math.pow(0-t,2)+Math.pow(0-o,2));if(i>210)return`rgb(${e/i*210},${t/i*210},${o/i*210})`}return r.Color.toRgb(n)}class d{static hashCode(t){let e=0;if(0===t.length)return e;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e}}class p{}class g extends p{static get palette(){return g._pallete||(g._pallete=g.buildPalette()),g._pallete}static buildPalette(){return(0,f.pj)().then((t=>{t.awaitLoaded(1/0).then((()=>{const e=t.getMonomerLib();e.onChanged.subscribe((()=>{g.customMonomerColors={},g.polymerTypes=e.getPolymerTypes();for(const t of this.polymerTypes){const n=e.getMonomerSymbolsByType(t);for(const r of n){const n=e.getMonomer(t,r);n?.meta?.colors?.default?.background&&(this.customMonomerColors[r]||(this.customMonomerColors[r]={}),this.customMonomerColors[r][t]=h(n.meta.colors.default.background))}}}))}))})),[].concat(...Object.values(a.colourPalette))}get(t,e){const n=g.palette.length,r=g.customMonomerColors[t],o=e??"PEPTIDE";if(r&&r[o])return r[o];const i=d.hashCode(t)%n;return h(g.palette[i])}}g._pallete=null,g.customMonomerColors={},g.polymerTypes=[];var m=n(8438);class y{get length(){return this.mList.length}isGap(t){return this.getOriginal(t)===this.gapOriginalMonomer}getCanonical(t){if(this.length<=t)throw new Error("Index out of bounds");const e=this.mList[t];return e!==this.gapOriginalMonomer?e:s._S}getOriginal(t){if(this.length<=t)throw new Error("Index out of bounds");return this.mList[t]}constructor(t,e){this.mList=t,this.gapOriginalMonomer=e}}function v(t,e=void 0){return n=>{if(n){let r;const o=new RegExp(`(?<=^|\\${t})("-"|'-'|[^\\${t}]*)(?=\\${t}|$)`,"g");return void 0!==e?(o.lastIndex=0,r=i()(n.matchAll(o)).take(e).map((t=>t[0])).toArray()):r=n.replaceAll('"-"',"").replaceAll("'-'","").split(t,e),new y(r,s.b9[s.Hi.SEPARATOR])}return new y([],s.b9[s.Hi.SEPARATOR])}}const b=t=>{const e=t.split("$")[0].split("|"),n=i()(e.map((t=>(t.match(/(?<=\{).+(?=})/)?.[0]?.split(".")??[]).map((t=>(0,m.D)(t)))))).flatten().toArray();return new y(n,s.b9[s.Hi.HELM])},C=/([^\W_]+)/g;function A(t,e){if(t.length<=e)return t;const n=t.match(C),r=t.length>e||(n?.length??0)>1,o=n?.[0]??" ";return r?o.substring(0,e-1)+"…":o}},8312:(t,e,n)=>{"use strict";n.d(e,{Q:()=>o});var r=n(6082);async function o(){const t=r.Func.find({package:"Bio",name:"getSeqHelper"});if(0===t.length)throw new Error("Package 'Bio' must be installed for SeqHelper.");return(await t[0].prepare().call()).getOutputParamValue()}},6869:(t,e,n)=>{"use strict";var r;n.d(e,{o:()=>r}),function(t){t.BASE="HELM_BASE",t.SUGAR="HELM_SUGAR",t.LINKER="HELM_LINKER",t.AA="HELM_AA",t.CHEM="HELM_CHEM",t.BLOB="HELM_BLOB",t.NUCLEOTIDE="HELM_NUCLETIDE"}(r||(r={}))},8070:(t,e,n)=>{"use strict";n.d(e,{Pl:()=>P,gM:()=>L,L1:()=>S,E3:()=>x,J6:()=>N,Xk:()=>I,Xb:()=>M,N$:()=>R,t6:()=>_,PE:()=>E,CN:()=>d});var r=n(4328),o=n(6082);n(9982);const i=o.DataFrame.fromCsv('countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,Questions,empty_number,empty_string\nBelgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,1,1,1QBS,1,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.497360340644872, 1.7058694986686864, 5.278052678195135, 0.16000320889028383],""points"":[{""x"":0.10000000149011612,""y"":2.374499797821045},{""x"":0.6000000238418579,""y"":2.6242473125457764},{""x"":1.100000023841858,""y"":2.367267608642578},{""x"":1.600000023841858,""y"":2.6723148822784424},{""x"":2.0999999046325684,""y"":2.6537344455718994},{""x"":2.5999999046325684,""y"":2.3651671409606934},{""x"":3.0999999046325684,""y"":2.5654284954071045},{""x"":3.5999999046325684,""y"":2.4160959720611572},{""x"":4.099999904632568,""y"":2.286726713180542},{""x"":4.599999904632568,""y"":2.5100042819976807},{""x"":5.099999904632568,""y"":1.6676985025405884},{""x"":5.599999904632568,""y"":0.680136501789093},{""x"":6.099999904632568,""y"":0.3391543924808502},{""x"":6.599999904632568,""y"":0.09038983285427094},{""x"":7.099999904632568,""y"":0.19802775979042053}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[7.525235855508179, 1.3186911876809984, 5.335672608564294, 0.7860743343958098],""points"":[{""x"":0.10000000149011612,""y"":7.988070487976074},{""x"":0.6000000238418579,""y"":7.018453121185303},{""x"":1.100000023841858,""y"":8.115279197692871},{""x"":1.600000023841858,""y"":7.486658096313477},{""x"":2.0999999046325684,""y"":7.396438121795654},{""x"":2.5999999046325684,""y"":7.477052211761475},{""x"":3.0999999046325684,""y"":6.913095474243164},{""x"":3.5999999046325684,""y"":8.01385498046875},{""x"":4.099999904632568,""y"":6.985900402069092},{""x"":4.599999904632568,""y"":6.970335960388184},{""x"":5.099999904632568,""y"":5.448817253112793},{""x"":5.599999904632568,""y"":2.5534818172454834},{""x"":6.099999904632568,""y"":1.893947958946228},{""x"":6.599999904632568,""y"":0.6340042352676392},{""x"":7.099999904632568,""y"":0.8403874039649963}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,100,abc\nBurundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,2,2,1ZP8,2,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.431460753103398, 2.1691498799246745, 5.266445597102774, 0.7825762827017926],""points"":[{""x"":0.10000000149011612,""y"":4.751083850860596},{""x"":0.6000000238418579,""y"":4.203000068664551},{""x"":1.100000023841858,""y"":4.415858745574951},{""x"":1.600000023841858,""y"":4.68414306640625},{""x"":2.0999999046325684,""y"":4.198400974273682},{""x"":2.5999999046325684,""y"":4.179222106933594},{""x"":3.0999999046325684,""y"":4.638473987579346},{""x"":3.5999999046325684,""y"":4.708553314208984},{""x"":4.099999904632568,""y"":4.291589260101318},{""x"":4.599999904632568,""y"":4.038082599639893},{""x"":5.099999904632568,""y"":3.4349939823150635},{""x"":5.599999904632568,""y"":1.2194708585739136},{""x"":6.099999904632568,""y"":1.1920831203460693},{""x"":6.599999904632568,""y"":0.5352635979652405},{""x"":7.099999904632568,""y"":0.3346920311450958}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.339458017970126, -1.0734184310171178, 4.746332950550934, 0.2482416857595658],""points"":[{""x"":0.10000000149011612,""y"":0.2139337658882141},{""x"":0.6000000238418579,""y"":0.4269562065601349},{""x"":1.100000023841858,""y"":0.2441573292016983},{""x"":1.600000023841858,""y"":0.146635964512825},{""x"":2.0999999046325684,""y"":0.08818462491035461},{""x"":2.5999999046325684,""y"":0.2560656666755676},{""x"":3.0999999046325684,""y"":0.42434045672416687},{""x"":3.5999999046325684,""y"":0.37111231684684753},{""x"":4.099999904632568,""y"":0.5581737160682678},{""x"":4.599999904632568,""y"":1.183590054512024},{""x"":5.099999904632568,""y"":1.5629843473434448},{""x"":5.599999904632568,""y"":2.3211288452148438},{""x"":6.099999904632568,""y"":2.229961633682251},{""x"":6.599999904632568,""y"":2.2560226917266846},{""x"":7.099999904632568,""y"":2.2142398357391357}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,3,3,2BDJ,3,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.6760652578642325, 0.9046956320756703, 5.651408971856738, 0.07738846012184185],""points"":[{""x"":0.10000000149011612,""y"":4.32425594329834},{""x"":0.6000000238418579,""y"":4.668442249298096},{""x"":1.100000023841858,""y"":4.379785060882568},{""x"":1.600000023841858,""y"":5.0345139503479},{""x"":2.0999999046325684,""y"":4.878653526306152},{""x"":2.5999999046325684,""y"":4.3451313972473145},{""x"":3.0999999046325684,""y"":4.336992263793945},{""x"":3.5999999046325684,""y"":5.037430286407471},{""x"":4.099999904632568,""y"":5.0092692375183105},{""x"":4.599999904632568,""y"":4.151902675628662},{""x"":5.099999904632568,""y"":3.4066951274871826},{""x"":5.599999904632568,""y"":2.3732759952545166},{""x"":6.099999904632568,""y"":1.673728108406067},{""x"":6.599999904632568,""y"":0.48574790358543396},{""x"":7.099999904632568,""y"":0.2783052325248718}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.938395863010111, -1.4658480661392117, 5.462702751996584, 0.3473139023615039],""points"":[{""x"":0.10000000149011612,""y"":0.4941710829734802},{""x"":0.6000000238418579,""y"":0.15323974192142487},{""x"":1.100000023841858,""y"":0.46373432874679565},{""x"":1.600000023841858,""y"":0.3370431363582611},{""x"":2.0999999046325684,""y"":0.5179030299186707},{""x"":2.5999999046325684,""y"":0.27899765968322754},{""x"":3.0999999046325684,""y"":0.22075064480304718},{""x"":3.5999999046325684,""y"":0.5789918899536133},{""x"":4.099999904632568,""y"":0.21169911324977875},{""x"":4.599999904632568,""y"":0.27857646346092224},{""x"":5.099999904632568,""y"":1.0906332731246948},{""x"":5.599999904632568,""y"":1.8520300388336182},{""x"":6.099999904632568,""y"":2.7177059650421143},{""x"":6.599999904632568,""y"":2.8680918216705322},{""x"":7.099999904632568,""y"":3.2413077354431152}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCanada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,4,4,1IAN,4,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[0.8597390975430008, 1.0957625732481946, 5.260537067987958, 0.07974187998177736],""points"":[{""x"":0.10000000149011612,""y"":0.8190152645111084},{""x"":0.6000000238418579,""y"":0.8421689867973328},{""x"":1.100000023841858,""y"":0.8740922212600708},{""x"":1.600000023841858,""y"":0.8924275040626526},{""x"":2.0999999046325684,""y"":0.8249067664146423},{""x"":2.5999999046325684,""y"":0.9327669143676758},{""x"":3.0999999046325684,""y"":0.8522974252700806},{""x"":3.5999999046325684,""y"":0.8174492716789246},{""x"":4.099999904632568,""y"":0.8394647240638733},{""x"":4.599999904632568,""y"":0.7139387726783752},{""x"":5.099999904632568,""y"":0.5561167597770691},{""x"":5.599999904632568,""y"":0.3276226818561554},{""x"":6.099999904632568,""y"":0.12479474395513535},{""x"":6.599999904632568,""y"":0.13006797432899475},{""x"":7.099999904632568,""y"":0.059702079743146896}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.760930219582546, 1.6591793293833013, 4.667155929720851, 0.7858109544121652],""points"":[{""x"":0.10000000149011612,""y"":6.156993389129639},{""x"":0.6000000238418579,""y"":5.236701965332031},{""x"":1.100000023841858,""y"":6.010560512542725},{""x"":1.600000023841858,""y"":5.495512962341309},{""x"":2.0999999046325684,""y"":6.087770462036133},{""x"":2.5999999046325684,""y"":5.79986572265625},{""x"":3.0999999046325684,""y"":5.597546577453613},{""x"":3.5999999046325684,""y"":5.520902156829834},{""x"":4.099999904632568,""y"":5.360654354095459},{""x"":4.599999904632568,""y"":3.5539746284484863},{""x"":5.099999904632568,""y"":1.577236294746399},{""x"":5.599999904632568,""y"":1.0001264810562134},{""x"":6.099999904632568,""y"":0.9305797815322876},{""x"":6.599999904632568,""y"":0.6033638715744019},{""x"":7.099999904632568,""y"":0.4203685522079468}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nColombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,5,5,4UJ1,5,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[6.4995088314153655, 2.4270351004539914, 5.178659535348579, 0.625653346241577],""points"":[{""x"":0.10000000149011612,""y"":6.496231555938721},{""x"":0.6000000238418579,""y"":6.42543363571167},{""x"":1.100000023841858,""y"":7.040063858032227},{""x"":1.600000023841858,""y"":6.1115403175354},{""x"":2.0999999046325684,""y"":6.680728435516357},{""x"":2.5999999046325684,""y"":6.406774520874023},{""x"":3.0999999046325684,""y"":6.611269474029541},{""x"":3.5999999046325684,""y"":5.889094352722168},{""x"":4.099999904632568,""y"":6.75344705581665},{""x"":4.599999904632568,""y"":6.361435890197754},{""x"":5.099999904632568,""y"":4.1666975021362305},{""x"":5.599999904632568,""y"":1.172118902206421},{""x"":6.099999904632568,""y"":0.801048994064331},{""x"":6.599999904632568,""y"":0.4640021026134491},{""x"":7.099999904632568,""y"":0.0010357667924836278}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[1.4734381347446401, 1.1649805188074196, 4.82958608866421, 0.09500545496710007],""points"":[{""x"":0.10000000149011612,""y"":1.5279096364974976},{""x"":0.6000000238418579,""y"":1.3559974431991577},{""x"":1.100000023841858,""y"":1.5246378183364868},{""x"":1.600000023841858,""y"":1.5567657947540283},{""x"":2.0999999046325684,""y"":1.4114240407943726},{""x"":2.5999999046325684,""y"":1.4045010805130005},{""x"":3.0999999046325684,""y"":1.4769829511642456},{""x"":3.5999999046325684,""y"":1.4875500202178955},{""x"":4.099999904632568,""y"":1.2991987466812134},{""x"":4.599999904632568,""y"":0.922961413860321},{""x"":5.099999904632568,""y"":0.6520044803619385},{""x"":5.599999904632568,""y"":0.15350978076457977},{""x"":6.099999904632568,""y"":0.1078903079032898},{""x"":6.599999904632568,""y"":0.17276449501514435},{""x"":7.099999904632568,""y"":0.14066608250141144}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCosta Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,6,6,2BPW,6,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.4833641843311227, -1.8945978742090062, 4.671127708092568, 0.24159861311815153],""points"":[{""x"":0.10000000149011612,""y"":0.0969524160027504},{""x"":0.6000000238418579,""y"":0.028483040630817413},{""x"":1.100000023841858,""y"":0.22087176144123077},{""x"":1.600000023841858,""y"":0.0068915546871721745},{""x"":2.0999999046325684,""y"":0.4305879771709442},{""x"":2.5999999046325684,""y"":0.44774115085601807},{""x"":3.0999999046325684,""y"":0.45346319675445557},{""x"":3.5999999046325684,""y"":0.2370593100786209},{""x"":4.099999904632568,""y"":0.4657953977584839},{""x"":4.599999904632568,""y"":1.155200719833374},{""x"":5.099999904632568,""y"":2.2294070720672607},{""x"":5.599999904632568,""y"":2.4311530590057373},{""x"":6.099999904632568,""y"":2.33846116065979},{""x"":6.599999904632568,""y"":2.608201026916504},{""x"":7.099999904632568,""y"":2.8136143684387207}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.224573521642033, 1.4454033924198528, 5.6014197746076535, 0.2823216054197577],""points"":[{""x"":0.10000000149011612,""y"":4.95027494430542},{""x"":0.6000000238418579,""y"":5.1754679679870605},{""x"":1.100000023841858,""y"":5.276752948760986},{""x"":1.600000023841858,""y"":5.589294910430908},{""x"":2.0999999046325684,""y"":5.616994857788086},{""x"":2.5999999046325684,""y"":5.120813846588135},{""x"":3.0999999046325684,""y"":5.340766906738281},{""x"":3.5999999046325684,""y"":4.876471042633057},{""x"":4.099999904632568,""y"":4.94999361038208},{""x"":4.599999904632568,""y"":5.162564754486084},{""x"":5.099999904632568,""y"":4.399557590484619},{""x"":5.599999904632568,""y"":2.7977969646453857},{""x"":6.099999904632568,""y"":1.0229872465133667},{""x"":6.599999904632568,""y"":0.48275601863861084},{""x"":7.099999904632568,""y"":0.10408931970596313}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,7,7,1QBS,7,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.320838679713925, -1.2421619987316728, 4.831325425225256, 0.3236011098403072],""points"":[{""x"":0.10000000149011612,""y"":0.3727470338344574},{""x"":0.6000000238418579,""y"":0.12365014106035233},{""x"":1.100000023841858,""y"":0.48422467708587646},{""x"":1.600000023841858,""y"":0.2264465093612671},{""x"":2.0999999046325684,""y"":0.16821794211864471},{""x"":2.5999999046325684,""y"":0.3879014551639557},{""x"":3.0999999046325684,""y"":0.5470244884490967},{""x"":3.5999999046325684,""y"":0.3419053554534912},{""x"":4.099999904632568,""y"":0.7655120491981506},{""x"":4.599999904632568,""y"":1.2346516847610474},{""x"":5.099999904632568,""y"":2.453336715698242},{""x"":5.599999904632568,""y"":2.9565491676330566},{""x"":6.099999904632568,""y"":3.335299491882324},{""x"":6.599999904632568,""y"":3.240290880203247},{""x"":7.099999904632568,""y"":3.1107218265533447}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.6401853521511094, 1.26211588875013, 5.399028074402744, 0.5089580830068091],""points"":[{""x"":0.10000000149011612,""y"":3.8585598468780518},{""x"":0.6000000238418579,""y"":3.6077206134796143},{""x"":1.100000023841858,""y"":3.855252265930176},{""x"":1.600000023841858,""y"":3.619039297103882},{""x"":2.0999999046325684,""y"":3.839388370513916},{""x"":2.5999999046325684,""y"":3.335283041000366},{""x"":3.0999999046325684,""y"":3.571141481399536},{""x"":3.5999999046325684,""y"":3.4155046939849854},{""x"":4.099999904632568,""y"":3.7316646575927734},{""x"":4.599999904632568,""y"":3.0680155754089355},{""x"":5.099999904632568,""y"":2.891066551208496},{""x"":5.599999904632568,""y"":1.6022753715515137},{""x"":6.099999904632568,""y"":0.7652576565742493},{""x"":6.599999904632568,""y"":0.6875326037406921},{""x"":7.099999904632568,""y"":0.5828871726989746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nItaly,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,8,8,1ZP8,8,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.293592105923809, 1.3781586549141835, 5.1025898038676605, 0.03493851245291291],""points"":[{""x"":0.10000000149011612,""y"":2.1287283897399902},{""x"":0.6000000238418579,""y"":2.267972230911255},{""x"":1.100000023841858,""y"":2.398442506790161},{""x"":1.600000023841858,""y"":2.5130622386932373},{""x"":2.0999999046325684,""y"":2.3255116939544678},{""x"":2.5999999046325684,""y"":2.127340793609619},{""x"":3.0999999046325684,""y"":2.47259783744812},{""x"":3.5999999046325684,""y"":2.131181478500366},{""x"":4.099999904632568,""y"":2.090421438217163},{""x"":4.599999904632568,""y"":2.02299165725708},{""x"":5.099999904632568,""y"":1.1105059385299683},{""x"":5.599999904632568,""y"":0.4494485855102539},{""x"":6.099999904632568,""y"":0.1375635862350464},{""x"":6.599999904632568,""y"":0.036351121962070465},{""x"":7.099999904632568,""y"":0.1619771122932434}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.953125499439879, 1.2528620255306528, 5.187637440149802, 0.3110348753260886],""points"":[{""x"":0.10000000149011612,""y"":5.6585283279418945},{""x"":0.6000000238418579,""y"":5.911152362823486},{""x"":1.100000023841858,""y"":5.924920082092285},{""x"":1.600000023841858,""y"":5.8469438552856445},{""x"":2.0999999046325684,""y"":5.929472923278809},{""x"":2.5999999046325684,""y"":6.190037727355957},{""x"":3.0999999046325684,""y"":6.236179828643799},{""x"":3.5999999046325684,""y"":6.141019344329834},{""x"":4.099999904632568,""y"":5.295210838317871},{""x"":4.599999904632568,""y"":5.265801906585693},{""x"":5.099999904632568,""y"":3.3722851276397705},{""x"":5.599999904632568,""y"":1.8299226760864258},{""x"":6.099999904632568,""y"":0.32690900564193726},{""x"":6.599999904632568,""y"":0.6274543404579163},{""x"":7.099999904632568,""y"":0.8441857099533081}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nRwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,9,2BDJ,9,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.8209972202654474, 1.3779216716448506, 5.299882228439686, 0.06040645519069608],""points"":[{""x"":0.10000000149011612,""y"":3.7821109294891357},{""x"":0.6000000238418579,""y"":3.542433023452759},{""x"":1.100000023841858,""y"":3.7008674144744873},{""x"":1.600000023841858,""y"":3.717301607131958},{""x"":2.0999999046325684,""y"":4.024452209472656},{""x"":2.5999999046325684,""y"":4.013899326324463},{""x"":3.0999999046325684,""y"":3.945094347000122},{""x"":3.5999999046325684,""y"":3.866621971130371},{""x"":4.099999904632568,""y"":3.7461626529693604},{""x"":4.599999904632568,""y"":3.3454740047454834},{""x"":5.099999904632568,""y"":2.61944317817688},{""x"":5.599999904632568,""y"":0.999405026435852},{""x"":6.099999904632568,""y"":0.46259793639183044},{""x"":6.599999904632568,""y"":0.054134611040353775},{""x"":7.099999904632568,""y"":0.05711187422275543}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.6318079657726035, 1.8495493770000595, 5.391793312471116, 0.17060707587348442],""points"":[{""x"":0.10000000149011612,""y"":5.458079814910889},{""x"":0.6000000238418579,""y"":5.554427146911621},{""x"":1.100000023841858,""y"":5.799983024597168},{""x"":1.600000023841858,""y"":5.364140033721924},{""x"":2.0999999046325684,""y"":5.864485740661621},{""x"":2.5999999046325684,""y"":5.4509806632995605},{""x"":3.0999999046325684,""y"":5.702574729919434},{""x"":3.5999999046325684,""y"":5.7314534187316895},{""x"":4.099999904632568,""y"":5.5123443603515625},{""x"":4.599999904632568,""y"":5.724395751953125},{""x"":5.099999904632568,""y"":4.354506969451904},{""x"":5.599999904632568,""y"":1.7307666540145874},{""x"":6.099999904632568,""y"":0.6305936574935913},{""x"":6.599999904632568,""y"":0.035183437168598175},{""x"":7.099999904632568,""y"":0.7575169205665588}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nSwitzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,10,1IAN,10,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[1.1190255865097471, 2.3163895161544437, 5.4968866182279195, 0.2035204047289052],""points"":[{""x"":0.10000000149011612,""y"":1.1057683229446411},{""x"":0.6000000238418579,""y"":1.1019697189331055},{""x"":1.100000023841858,""y"":1.0818607807159424},{""x"":1.600000023841858,""y"":1.062997817993164},{""x"":2.0999999046325684,""y"":1.046447515487671},{""x"":2.5999999046325684,""y"":1.1217249631881714},{""x"":3.0999999046325684,""y"":1.2166996002197266},{""x"":3.5999999046325684,""y"":1.215477705001831},{""x"":4.099999904632568,""y"":1.0581893920898438},{""x"":4.599999904632568,""y"":1.1747995615005493},{""x"":5.099999904632568,""y"":1.0181127786636353},{""x"":5.599999904632568,""y"":0.5344523191452026},{""x"":6.099999904632568,""y"":0.2569526433944702},{""x"":6.599999904632568,""y"":0.1912207305431366},{""x"":7.099999904632568,""y"":0.15060538053512573}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.1038581025805785, 2.0032224204185245, 5.087602825989163, 0.13277988512492753],""points"":[{""x"":0.10000000149011612,""y"":3.0498509407043457},{""x"":0.6000000238418579,""y"":2.805217742919922},{""x"":1.100000023841858,""y"":3.3415253162384033},{""x"":1.600000023841858,""y"":3.0549843311309814},{""x"":2.0999999046325684,""y"":3.250074863433838},{""x"":2.5999999046325684,""y"":3.0432586669921875},{""x"":3.0999999046325684,""y"":3.265852451324463},{""x"":3.5999999046325684,""y"":2.9475724697113037},{""x"":4.099999904632568,""y"":3.1929898262023926},{""x"":4.599999904632568,""y"":2.7460060119628906},{""x"":5.099999904632568,""y"":1.6175861358642578},{""x"":5.599999904632568,""y"":0.3006608486175537},{""x"":6.099999904632568,""y"":0.3444803059101105},{""x"":6.599999904632568,""y"":0.015537971630692482},{""x"":7.099999904632568,""y"":0.5527358055114746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\n,,,,,,,,,,,,,,,,,,,,,');i.columns.add(o.Column.fromList(o.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var s=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};const a=3e4,l=108e5,u=console.log.bind(console),c=console.info.bind(console),f=console.warn.bind(console),h=console.error.bind(console),d={},p="Auto Tests",g="Demo",m="Detectors",y="Core",v={};let b;var C;!function(t){t.notNull=function(t,e){if(null==t)throw new Error(`${null==e?"Value":e} not defined`)}}(C||(C={}));class A{constructor(t,e){this.catchUnhandled=!0,this.report=!1,void 0!==t&&(this.catchUnhandled=t),void 0!==e&&(this.report=e)}}class w{constructor(t,e,n,r){var o;this.category=t,this.name=e,null!=r||(r={}),null!==(o=r.timeout)&&void 0!==o||(r.timeout=a),this.options=r,this.test=()=>s(this,void 0,void 0,(function*(){return new Promise(((t,e)=>s(this,void 0,void 0,(function*(){let r="";try{r=yield n()}catch(t){e(t)}t(r)}))))}))}}function E(t,e,n,r=0,o="timeout"){return s(this,void 0,void 0,(function*(){return new Promise(((i,s)=>{const a=t.subscribe((t=>{try{e(t),i("OK")}catch(t){s(t)}finally{a.unsubscribe(),clearTimeout(l)}})),l=setTimeout((()=>{a.unsubscribe(),s(o)}),r);n()}))}))}function _(t,e,n){null==d[b]&&(d[b]={}),null==d[b].tests&&(d[b].tests=[]),d[b].tests.push(new w(b,t,e,n))}function x(t,e=!0,n){if(n=n?`${n}, `:"",t!==e)throw new Error(`${n}Expected "${e}", got "${t}"`)}function T(t,e,n=.001,r){if(t===Number.POSITIVE_INFINITY&&e===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY&&e===Number.NEGATIVE_INFINITY||t===Number.NaN&&e===Number.NaN||isNaN(t)&&isNaN(e))return;const o=Math.abs(t-e)<n;if(x(o,!0,`${null!=r?r:""} (tolerance = ${n})`),!o)throw new Error(`Expected ${e}, got ${t} (tolerance = ${n})`)}function I(t,e){for(const[n,r]of Object.entries(e)){if(!t.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const e=t[n];if(e instanceof Array&&r instanceof Array)N(e,r);else if(e instanceof Object&&r instanceof Object)I(e,r);else if(Number.isFinite(e)&&Number.isFinite(r))T(e,r);else if(e!=r)throw new Error(`Expected (${r}) for key '${n}', got (${e})`)}}function N(t,e){const n=t.length,r=e.length;if(n!=r)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${r}`);for(let r=0;r<n;r++)if(t[r]instanceof Array&&e[r]instanceof Array)N(t[r],e[r]);else if(t[r]instanceof Object&&e[r]instanceof Object)I(t[r],e[r]);else if(t[r]!=e[r])throw new Error(`Expected ${e[r]} at position ${r}, got ${t[r]}`)}function S(t,e,n){var r;b=t,e(),d[b]&&(d[b].clear=null===(r=null==n?void 0:n.clear)||void 0===r||r,d[b].timeout=null==n?void 0:n.timeout,d[b].benchmarks=null==n?void 0:n.benchmarks,d[b].stressTests=null==n?void 0:n.stressTests,d[b].owner=null==n?void 0:n.owner)}function L(t){null==d[b]&&(d[b]={}),d[b].before=t}function P(t){null==d[b]&&(d[b]={}),d[b].after=t}function O(t,e){return t.replace(new RegExp(e.name,"gi"),e.nqName)}function M(t,e){var n,u,c,f,h,b,C;return s(this,void 0,void 0,(function*(){const A=t.id;if(v[A])return;const E=e?e.tests:d;if(void 0!==E[p]||void 0!==E[g]||Object.keys(E).find((t=>t.startsWith(p)||t.startsWith(y))))return void(v[A]=!0);if("DevTools"===t.name||e&&"DevTools"===e._package.name)for(const t of window.dartTests){const e=t.name.split(/\s*\|\s*!/g);let r=null!==(n=e.pop())&&void 0!==n?n:t.name,o=e.length?y+": "+e.join(": "):y,i=r.split(" | ");r=i[i.length-1],i.unshift(o),i.pop(),o=i.join(": "),void 0===E[o]&&(E[o]={tests:[],clear:!0}),E[o].tests.push(new w(o,r,t.test,{isAggregated:!1,timeout:null!==(c=null===(u=t.options)||void 0===u?void 0:u.timeout)&&void 0!==c?c:a,skipReason:null===(f=t.options)||void 0===f?void 0:f.skipReason,owner:null===(h=t.options)||void 0===h?void 0:h.owner}))}const _=[],T=[],I=[],N=yield r.dapi.functions.filter(`package.id = "${A}"`).list(),S=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const e of N){const n=e.options.test,u=e.options.demoPath;if(n&&Array.isArray(n)&&n.length)for(let t=0;t<n.length;t++){const i=n[t].matchAll(S),u={};Array.from(i).forEach((t=>{t[0].startsWith("skip")?u.skip=t[1]:t[0].startsWith("wait")?u.wait=parseInt(t[2]):t[0].startsWith("cat")?u.cat=t[3]:t[0].startsWith("timeout")&&(u.timeout=parseInt(t[4]))}));const c=new w(p,1===n.length?e.name:`${e.name} ${t+1}`,(()=>s(this,void 0,void 0,(function*(){const o=yield r.functions.eval(O(n[t],e));if(u.wait&&(yield H(u.wait)),"boolean"==typeof o&&!o)throw`Failed: ${n[t]}, expected true, got ${o}`}))),{skipReason:u.skip,timeout:o.Test.isInBenchmark?null!==(b=u.benchmarkTimeout)&&void 0!==b?b:l:null!==(C=u.timeout)&&void 0!==C?C:a});if(u.cat){const t=p+": "+u.cat;c.category=t,void 0===E[t]&&(E[t]={tests:[],clear:!0}),E[t].tests.push(c)}else _.push(c)}if(u){const t=e.options.demoWait?parseInt(e.options.demoWait):void 0,n=new w(g,e.friendlyName,(()=>s(this,void 0,void 0,(function*(){r.shell.isInDemo=!0,void 0===r.shell.view(o.View.BROWSE)&&(r.shell.v=o.View.createByType(o.View.BROWSE)),yield H(300),r.shell.clearLastError(),yield e.apply(),yield H(t||2e3);const n=yield r.shell.lastError;if(n)throw new Error(n);r.shell.isInDemo=!1}))),{skipReason:e.options.demoSkip});T.push(n)}if(e.hasTag("semTypeDetector")){let n=i;e.options.testData&&(n=yield r.data.files.openTable(`System:AppData/${t.nqName}/${e.options.testData}`));const o=new w(m,e.friendlyName,(()=>s(this,void 0,void 0,(function*(){const r=[];console.log(`System:AppData/${t.nqName}/${e.options.testData}`);for(const t of n.clone().columns){const n=yield e.apply([t]);r.push(n||t.semType)}const o=r.filter((t=>t));x(o.length,1),e.options.testDataColumnName&&x(o[0],e.options.testDataColumnName)}))),{skipReason:e.options.skipTest});I.push(o)}}v[A]=!0,_.length>0&&(E[p]={tests:_,clear:!0}),T.length>0&&(E[g]={tests:T,clear:!0}),I.length>0&&(E[m]={tests:I,clear:!1})}))}function R(t){var e,n,i,p;return s(this,void 0,void 0,(function*(){const g=null===(n=null===(e=r.functions.getCurrentCall())||void 0===e?void 0:e.func)||void 0===n?void 0:n.package;yield M(g);const m=[];console.log("Running tests"),null!=t||(t={}),null!==(i=(p=t).testContext)&&void 0!==i||(p.testContext=new A),r.shell.clearLastError();const y=function(){const t=[];return console.log=(...e)=>{t.push(...e),u(...e)},console.info=(...e)=>{t.push(...e),c(...e)},console.warn=(...e)=>{t.push(...e),f(...e)},console.error=(...e)=>{t.push(...e),h(...e)},t}();yield function(t,e){var n,i,d,p,b,C,A,w,E,_,x,T,I,N,S,L,P,O,M,R;return s(this,void 0,void 0,(function*(){try{for(const[s,c]of Object.entries(t)){if((null==e?void 0:e.category)&&!s.toLowerCase().startsWith(null==e?void 0:e.category.toLowerCase())||(null===(n=e.exclude)||void 0===n?void 0:n.some((t=>s.startsWith(t)))))continue;u(`Started ${s} category`);const t=null===(i=c.tests)||void 0===i?void 0:i.every((t=>{var e;return null===(e=t.options)||void 0===e?void 0:e.skipReason}));t||(c.beforeStatus=yield v(c.before,null!==(d=e.category)&&void 0!==d?d:""));let f=null!==(p=c.tests)&&void 0!==p?p:[];e.stressTest&&(f=f.filter((t=>{var e;return null===(e=t.options)||void 0===e?void 0:e.stressTest})),f=B(f)),(null!==(C=null===(b=e.tags)||void 0===b?void 0:b.length)&&void 0!==C?C:0)>0&&(f=f.filter((t=>{var n,r;return null===(r=null===(n=t.options)||void 0===n?void 0:n.tags)||void 0===r?void 0:r.some((t=>{var n;return(null!==(n=null==e?void 0:e.tags)&&void 0!==n?n:[]).includes(t)}))})));const h=[];if(c.clear)for(let t=0;t<f.length;t++){f[t].options&&void 0===(null===(A=f[t].options)||void 0===A?void 0:A.benchmark)&&(f[t].options||(f[t].options={}),f[t].options.benchmark=null!==(w=c.benchmarks)&&void 0!==w&&w);let n=f[t];(null==n?void 0:n.options)&&(n.options.owner=null!==(_=null===(E=f[t].options)||void 0===E?void 0:E.owner)&&void 0!==_?_:null==c?void 0:c.owner);let i=yield D(n,null==e?void 0:e.test,y,o.Test.isInBenchmark?null!==(T=null===(x=f[t].options)||void 0===x?void 0:x.benchmarkTimeout)&&void 0!==T?T:l:null!==(N=null===(I=f[t].options)||void 0===I?void 0:I.timeout)&&void 0!==N?N:a,g.name,e.verbose);i&&h.push(i),r.shell.closeAll(),o.Balloon.closeAll()}else for(let t=0;t<f.length;t++){let n=f[t];(null==n?void 0:n.options)&&(n.options.owner=null!==(L=null===(S=f[t].options)||void 0===S?void 0:S.owner)&&void 0!==L?L:null==c?void 0:c.owner);let r=yield D(n,null==e?void 0:e.test,y,o.Test.isInBenchmark?null!==(O=null===(P=f[t].options)||void 0===P?void 0:P.benchmarkTimeout)&&void 0!==O?O:l:null===(M=f[t].options)||void 0===M?void 0:M.timeout,g.name,e.verbose);r&&h.push(r)}const $=h.filter((t=>"skipped"!=t.result));t||(c.afterStatus=yield v(c.after,null!==(R=e.category)&&void 0!==R?R:"")),c.afterStatus&&$.push({date:(new Date).toISOString(),logs:"",category:s,name:"after",result:c.afterStatus,success:!1,ms:0,skipped:!1}),c.beforeStatus&&$.push({date:(new Date).toISOString(),logs:"",category:s,name:"before",result:c.beforeStatus,success:!1,ms:0,skipped:!1}),m.push(...$)}}finally{console.log=u,console.info=c,console.warn=f,console.error=h}if(e.testContext.catchUnhandled&&!o.Test.isInBenchmark){yield H(1e3);const t=yield r.shell.lastError,e={logs:"",date:(new Date).toISOString(),category:"Unhandled exceptions",name:"Exception",result:null!=t?t:"",success:!t,ms:0,skipped:!1,flaking:o.Test.isReproducing&&!t};m.push(e),e.package=g.name,null!=r.shell.reportTest?yield r.shell.reportTest("package",e):yield fetch(`${r.dapi.root}/log/tests/package`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(e)})}}))}(d,t);for(let t of m)t.result=t.result.toString().replace(/"/g,"'"),null!=t.logs&&(t.logs=t.logs.toString().replace(/"/g,"'"));return m;function v(t,e){return s(this,void 0,void 0,(function*(){var n=void 0;try{void 0!==t&&(yield F((()=>s(this,void 0,void 0,(function*(){yield t()}))),1e5,`before ${e}: timeout error`))}catch(t){n=yield $(t)}return n}))}}))}function $(t){return s(this,void 0,void 0,(function*(){return`${t.toString()}\n${t.stack?yield o.Logger.translateStackTrace(t.stack):""}`}))}function D(t,e,n,i,l,c){var f,d,p,g,m,y,v,b,C,A;return s(this,void 0,void 0,(function*(){let s;n.length=0;let w="package";const E=null!=e&&t.name.toLowerCase()!==e.toLowerCase();let _=(null===(f=t.options)||void 0===f?void 0:f.skipReason)||E,x=E?"skipped":null===(d=t.options)||void 0===d?void 0:d.skipReason;if(o.Test.isInBenchmark&&!(null===(p=t.options)||void 0===p?void 0:p.benchmark))return void u(`SKIPPED: ${t.category} ${t.name} doesnt available in benchmark mode`);_||u(`Started ${t.category} ${t.name}`);const T=Date.now();try{if(_)s={date:(new Date).toISOString(),success:!0,result:x,ms:0,skipped:!0};else{let e=null!=i?i:a;s={date:(new Date).toISOString(),success:!0,result:null!==(g=yield F(t.test,e))&&void 0!==g?g:"OK",ms:0,skipped:!1}}}catch(t){h(t),s={date:(new Date).toISOString(),success:!1,result:yield $(t),ms:0,skipped:!1}}if((null===(m=t.options)||void 0===m?void 0:m.isAggregated)&&s.result.constructor===o.DataFrame){const t=s.result.col("success");if(t&&(s.success=t.stats.sum===t.length),!c){const t=s.result;t.columns.remove("stack"),t.rows.removeWhere((t=>t.get("success"))),s.result=t}s.result=s.result.toCsv()}if(s.logs=n.join("\n"),s.ms=Date.now()-T,_||u(`Finished ${t.category} ${t.name} for ${s.ms} ms`),s.category=t.category,s.name=t.name,s.owner=null!==(v=null===(y=t.options)||void 0===y?void 0:y.owner)&&void 0!==v?v:"",!E){let e={success:s.success,result:s.result,ms:s.ms,date:s.date,skipped:s.skipped,package:l,category:t.category,name:t.name,logs:s.logs,owner:s.owner,flaking:o.Test.isReproducing&&s.success,timeoutWarning:o.Test.isInBenchmark&&(null===(b=t.options)||void 0===b?void 0:b.benchmarkWarnTimeout)&&s.ms>(null===(C=t.options)||void 0===C?void 0:C.benchmarkWarnTimeout)};if(s.result.constructor==Object){const t=Object.keys(s.result).reduce(((t,e)=>Object.assign(Object.assign({},t),{["result."+e]:s.result[e]})),{});e=Object.assign(Object.assign({},e),t)}e.result instanceof o.DataFrame&&(e.result=JSON.stringify(null===(A=e.result)||void 0===A?void 0:A.toJson())||""),null!=r.shell.reportTest?yield r.shell.reportTest(w,e):yield fetch(`${r.dapi.root}/log/tests/${w}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(e)})}return s}))}function B(t){const e=t.slice();return e.sort((()=>Math.random()-.5)),e}function H(t){return s(this,void 0,void 0,(function*(){yield new Promise((e=>setTimeout(e,t)))}))}function F(t,e,n="EXECUTION TIMEOUT"){return s(this,void 0,void 0,(function*(){let r=null;const o=new Promise(((t,o)=>{r=setTimeout((()=>{o(n)}),e)}));try{return yield Promise.race([t(),o])}finally{r&&clearTimeout(r)}}))}o.DataFrame.fromColumns([o.Column.fromStrings("col",["val1","val2","val3"])])},2074:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(1354),o=n.n(r),i=n(6314),s=n.n(i)()(o());s.push([t.id,".st-colored-text-input > textarea {\n width: 100%;\n -webkit-text-fill-color: transparent;\n background-color: transparent;\n position: relative;\n z-index: 1;\n resize: none;\n height: 22px; /* Fine tuned value to avoid \"jumping\" of the textarea upon autoresize */\n}\n\n.st-colored-text-input > div {\n /* The values here are fine tuned to those of the ui.input textarea in order\n * to achieve precise overlap */\n overflow: auto;\n position: absolute;\n pointer-events: none;\n cursor: text;\n z-index: 0;\n max-width: 100%;\n padding: 2px;\n line-height: normal;\n font-family: 'Roboto', 'Roboto Local', sans-serif;\n font-size: 13px;\n padding-top: 6px !important;\n color: transparent;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n","",{version:3,sources:["webpack://./src/apps/common/view/components/colored-input/style.css"],names:[],mappings:"AAAA;EACE,WAAW;EACX,oCAAoC;EACpC,6BAA6B;EAC7B,kBAAkB;EAClB,UAAU;EACV,YAAY;EACZ,YAAY,EAAE,wEAAwE;AACxF;;AAEA;EACE;iCAC+B;EAC/B,cAAc;EACd,kBAAkB;EAClB,oBAAoB;EACpB,YAAY;EACZ,UAAU;EACV,eAAe;EACf,YAAY;EACZ,mBAAmB;EACnB,iDAAiD;EACjD,eAAe;EACf,2BAA2B;EAC3B,kBAAkB;EAClB,qBAAqB;EACrB,qBAAqB;AACvB",sourcesContent:[".st-colored-text-input > textarea {\n width: 100%;\n -webkit-text-fill-color: transparent;\n background-color: transparent;\n position: relative;\n z-index: 1;\n resize: none;\n height: 22px; /* Fine tuned value to avoid \"jumping\" of the textarea upon autoresize */\n}\n\n.st-colored-text-input > div {\n /* The values here are fine tuned to those of the ui.input textarea in order\n * to achieve precise overlap */\n overflow: auto;\n position: absolute;\n pointer-events: none;\n cursor: text;\n z-index: 0;\n max-width: 100%;\n padding: 2px;\n line-height: normal;\n font-family: 'Roboto', 'Roboto Local', sans-serif;\n font-size: 13px;\n padding-top: 6px !important;\n color: transparent;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n"],sourceRoot:""}]);const a=s},9252:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(1354),o=n.n(r),i=n(6314),s=n.n(i)()(o());s.push([t.id,"/* Naming convention: class names should begin with st and app name to avoid naming collitions */\n\n.st-pattern-text-input > textarea {\n resize: none;\n}\n","",{version:3,sources:["webpack://./src/apps/pattern/view/style.css"],names:[],mappings:"AAAA,gGAAgG;;AAEhG;EACE,YAAY;AACd",sourcesContent:["/* Naming convention: class names should begin with st and app name to avoid naming collitions */\n\n.st-pattern-text-input > textarea {\n resize: none;\n}\n"],sourceRoot:""}]);const a=s},8507:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(1354),o=n.n(r),i=n(6314),s=n.n(i)()(o());s.push([t.id,"/* Naming convention: class names should begin with st and app name to avoid naming collitions */\n\n.st-structure-body {\n padding-right: 20px;\n}\n\n.st-structure-mol-img {\n margin-right: 30px;\n float: right;\n}\n\n.st-structure-bool-button-block {\n justify-content: right;\n margin-bottom: 10px;\n}\n\n.st-structure-bottom {\n flex-direction: row-reverse;\n padding-top: 20px;\n}\n\n.st-structure-clear-buttons {\n justify-content: space-between;\n padding: 13px 10px 13px 10px;\n}\n\n.st-direction-inputs {\n align-items: end;\n}\n\n.st-structure-inputs {\n flex-grow: 2;\n padding-left: 10px;\n}","",{version:3,sources:["webpack://./src/apps/structure/view/style.css"],names:[],mappings:"AAAA,gGAAgG;;AAEhG;EACE,mBAAmB;AACrB;;AAEA;EACE,kBAAkB;EAClB,YAAY;AACd;;AAEA;EACE,sBAAsB;EACtB,mBAAmB;AACrB;;AAEA;EACE,2BAA2B;EAC3B,iBAAiB;AACnB;;AAEA;EACE,8BAA8B;EAC9B,4BAA4B;AAC9B;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,YAAY;EACZ,kBAAkB;AACpB",sourcesContent:["/* Naming convention: class names should begin with st and app name to avoid naming collitions */\n\n.st-structure-body {\n padding-right: 20px;\n}\n\n.st-structure-mol-img {\n margin-right: 30px;\n float: right;\n}\n\n.st-structure-bool-button-block {\n justify-content: right;\n margin-bottom: 10px;\n}\n\n.st-structure-bottom {\n flex-direction: row-reverse;\n padding-top: 20px;\n}\n\n.st-structure-clear-buttons {\n justify-content: space-between;\n padding: 13px 10px 13px 10px;\n}\n\n.st-direction-inputs {\n align-items: end;\n}\n\n.st-structure-inputs {\n flex-grow: 2;\n padding-left: 10px;\n}"],sourceRoot:""}]);const a=s},5254:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(1354),o=n.n(r),i=n(6314),s=n.n(i)()(o());s.push([t.id,"/* Naming convention: class names should begin with st and app name to avoid naming collitions */\n.st-translator-input-table {\n /* width: 100%; */\n margin-right: 20px;\n}\n\n.st-translator-input-table td:has(textarea) {\n width: 100%;\n}\n\n.st-translator-input-table td:has(select) {\n min-width: 120px;\n vertical-align: top;\n}\n\n.st-translator-output-table {\n margin-top: 20px;\n margin-right: 20px;\n margin-bottom: 10px;\n}\n\n.st-translator-output-table table {\n width: 100%;\n table-layout: fixed;\n}\n\n.st-translator-output-table td {\n padding-top: 6px;\n padding-bottom: 6px;\n}\n.st-translator-output-table tr:nth-child(even) {\n background-color: var(--grey-1);\n}\n\n.st-translator-output-table td:nth-child(odd) {\n width: 120px;\n vertical-align: top;\n}\n\n.st-translator-output-table td a {\n overflow-wrap: break-word;\n}\n","",{version:3,sources:["webpack://./src/apps/translator/view/style.css"],names:[],mappings:"AAAA,gGAAgG;AAChG;EACE,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,mBAAmB;AACrB;;AAEA;EACE,WAAW;EACX,mBAAmB;AACrB;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;AACA;EACE,+BAA+B;AACjC;;AAEA;EACE,YAAY;EACZ,mBAAmB;AACrB;;AAEA;EACE,yBAAyB;AAC3B",sourcesContent:["/* Naming convention: class names should begin with st and app name to avoid naming collitions */\n.st-translator-input-table {\n /* width: 100%; */\n margin-right: 20px;\n}\n\n.st-translator-input-table td:has(textarea) {\n width: 100%;\n}\n\n.st-translator-input-table td:has(select) {\n min-width: 120px;\n vertical-align: top;\n}\n\n.st-translator-output-table {\n margin-top: 20px;\n margin-right: 20px;\n margin-bottom: 10px;\n}\n\n.st-translator-output-table table {\n width: 100%;\n table-layout: fixed;\n}\n\n.st-translator-output-table td {\n padding-top: 6px;\n padding-bottom: 6px;\n}\n.st-translator-output-table tr:nth-child(even) {\n background-color: var(--grey-1);\n}\n\n.st-translator-output-table td:nth-child(odd) {\n width: 120px;\n vertical-align: top;\n}\n\n.st-translator-output-table td a {\n overflow-wrap: break-word;\n}\n"],sourceRoot:""}]);const a=s},890:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(1354),o=n.n(r),i=n(6314),s=n.n(i)()(o());s.push([t.id,".monomer-card-rule-root {\n border: 2px solid var(--grey-2);\n border-radius: 5px;\n padding: 5px;\n margin: 5px;\n overflow: hidden;\n align-items: center;\n cursor: pointer;\n width: 200px;\n height: 210px;\n min-width: 200px;\n min-height: 210px;\n}\n\n.monomer-card-info-rules {\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 10px;\n}\n\n.monomer-card-info-rules > div:nth-child(2) {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.monomer-card-info-rules > div:nth-child(1) {\n font-weight: bold;\n margin-right: 5px;\n text-wrap: nowrap;\n}\n","",{version:3,sources:["webpack://./src/polytool/conversion/style.css"],names:[],mappings:"AAAA;IACI,+BAA+B;IAC/B,kBAAkB;IAClB,YAAY;IACZ,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,eAAe;IACf,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,iBAAiB;AACrB;;AAEA;IACI,WAAW;IACX,gBAAgB;IAChB,uBAAuB;IACvB,mBAAmB;AACvB;;AAEA;IACI,mBAAmB;IACnB,gBAAgB;IAChB,uBAAuB;AAC3B;;AAEA;IACI,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;AACrB",sourcesContent:[".monomer-card-rule-root {\n border: 2px solid var(--grey-2);\n border-radius: 5px;\n padding: 5px;\n margin: 5px;\n overflow: hidden;\n align-items: center;\n cursor: pointer;\n width: 200px;\n height: 210px;\n min-width: 200px;\n min-height: 210px;\n}\n\n.monomer-card-info-rules {\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 10px;\n}\n\n.monomer-card-info-rules > div:nth-child(2) {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.monomer-card-info-rules > div:nth-child(1) {\n font-weight: bold;\n margin-right: 5px;\n text-wrap: nowrap;\n}\n"],sourceRoot:""}]);const a=s},6314:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var u=0;u<t.length;u++){var c=[].concat(t[u]);r&&s[c[0]]||(void 0!==i&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),e.push(c))}},e}},1354:t=>{"use strict";t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),i="/*# ".concat(o," */");return[e].concat([i]).join("\n")}return[e].join("\n")}},9982:function(t,e,n){var r;!function(){var e={};!function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(t,n,r,o,i){for(var s,a,l,u,c,f,h,d,p,g,m,y,v;i>=64;){for(s=n[0],a=n[1],l=n[2],u=n[3],c=n[4],f=n[5],h=n[6],d=n[7],g=0;g<16;g++)m=o+4*g,t[g]=(255&r[m])<<24|(255&r[m+1])<<16|(255&r[m+2])<<8|255&r[m+3];for(g=16;g<64;g++)y=((p=t[g-2])>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,v=((p=t[g-15])>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,t[g]=(y+t[g-7]|0)+(v+t[g-16]|0);for(g=0;g<64;g++)y=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&f^~c&h)|0)+(d+(e[g]+t[g]|0)|0)|0,v=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&a^s&l^a&l)|0,d=h,h=f,f=c,c=u+y|0,u=l,l=a,a=s,s=y+v|0;n[0]+=s,n[1]+=a,n[2]+=l,n[3]+=u,n[4]+=c,n[5]+=f,n[6]+=h,n[7]+=d,o+=64,i-=64}return o}var r=function(){function e(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return e.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},e.prototype.clean=function(){for(var t=0;t<this.buffer.length;t++)this.buffer[t]=0;for(t=0;t<this.temp.length;t++)this.temp[t]=0;this.reset()},e.prototype.update=function(t,e){if(void 0===e&&(e=t.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this.bytesHashed+=e,this.bufferLength>0){for(;this.bufferLength<64&&e>0;)this.buffer[this.bufferLength++]=t[r++],e--;64===this.bufferLength&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(e>=64&&(r=n(this.temp,this.state,t,r,e),e%=64);e>0;)this.buffer[this.bufferLength++]=t[r++],e--;return this},e.prototype.finish=function(t){if(!this.finished){var e=this.bytesHashed,r=this.bufferLength,o=e/536870912|0,i=e<<3,s=e%64<56?64:128;this.buffer[r]=128;for(var a=r+1;a<s-8;a++)this.buffer[a]=0;this.buffer[s-8]=o>>>24&255,this.buffer[s-7]=o>>>16&255,this.buffer[s-6]=o>>>8&255,this.buffer[s-5]=o>>>0&255,this.buffer[s-4]=i>>>24&255,this.buffer[s-3]=i>>>16&255,this.buffer[s-2]=i>>>8&255,this.buffer[s-1]=i>>>0&255,n(this.temp,this.state,this.buffer,0,s),this.finished=!0}for(a=0;a<8;a++)t[4*a+0]=this.state[a]>>>24&255,t[4*a+1]=this.state[a]>>>16&255,t[4*a+2]=this.state[a]>>>8&255,t[4*a+3]=this.state[a]>>>0&255;return this},e.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},e.prototype._saveState=function(t){for(var e=0;e<this.state.length;e++)t[e]=this.state[e]},e.prototype._restoreState=function(t,e){for(var n=0;n<this.state.length;n++)this.state[n]=t[n];this.bytesHashed=e,this.finished=!1,this.bufferLength=0},e}();t.Hash=r;var o=function(){function t(t){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var e=new Uint8Array(this.blockSize);if(t.length>this.blockSize)(new r).update(t).finish(e).clean();else for(var n=0;n<t.length;n++)e[n]=t[n];for(n=0;n<e.length;n++)e[n]^=54;for(this.inner.update(e),n=0;n<e.length;n++)e[n]^=106;for(this.outer.update(e),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate),n=0;n<e.length;n++)e[n]=0}return t.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},t.prototype.clean=function(){for(var t=0;t<this.istate.length;t++)this.ostate[t]=this.istate[t]=0;this.inner.clean(),this.outer.clean()},t.prototype.update=function(t){return this.inner.update(t),this},t.prototype.finish=function(t){return this.outer.finished?this.outer.finish(t):(this.inner.finish(t),this.outer.update(t,this.digestLength).finish(t)),this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t}();function i(t){var e=(new r).update(t),n=e.digest();return e.clean(),n}function s(t,e){var n=new o(t).update(e),r=n.digest();return n.clean(),r}function a(t,e,n,r){var o=r[0];if(0===o)throw new Error("hkdf: cannot expand more");e.reset(),o>1&&e.update(t),n&&e.update(n),e.update(r),e.finish(t),r[0]++}t.HMAC=o,t.hash=i,t.default=i,t.hmac=s;var l=new Uint8Array(t.digestLength);t.hkdf=function(t,e,n,r){void 0===e&&(e=l),void 0===r&&(r=32);for(var i=new Uint8Array([1]),u=s(e,t),c=new o(u),f=new Uint8Array(c.digestLength),h=f.length,d=new Uint8Array(r),p=0;p<r;p++)h===f.length&&(a(f,c,n,i),h=0),d[p]=f[h++];return c.clean(),f.fill(0),i.fill(0),d},t.pbkdf2=function(t,e,n,r){for(var i=new o(t),s=i.digestLength,a=new Uint8Array(4),l=new Uint8Array(s),u=new Uint8Array(s),c=new Uint8Array(r),f=0;f*s<r;f++){var h=f+1;a[0]=h>>>24&255,a[1]=h>>>16&255,a[2]=h>>>8&255,a[3]=h>>>0&255,i.reset(),i.update(e),i.update(a),i.finish(u);for(var d=0;d<s;d++)l[d]=u[d];for(d=2;d<=n;d++){i.reset(),i.update(u).finish(u);for(var p=0;p<s;p++)l[p]^=u[p]}for(d=0;d<s&&f*s+d<r;d++)c[f*s+d]=l[d]}for(f=0;f<s;f++)l[f]=u[f]=0;for(f=0;f<4;f++)a[f]=0;return i.clean(),c}}(e);var o=e.default;for(var i in e)o[i]=e[i];"object"==typeof t.exports?t.exports=o:void 0===(r=function(){return o}.call(e,n,e,t))||(t.exports=r)}()},2543:function(t,e,n){var r;t=n.nmd(t),function(){var o,i="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",l=32,u=128,c=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],g="[object Arguments]",m="[object Array]",y="[object Boolean]",v="[object Date]",b="[object Error]",C="[object Function]",A="[object GeneratorFunction]",w="[object Map]",E="[object Number]",_="[object Object]",x="[object Promise]",T="[object RegExp]",I="[object Set]",N="[object String]",S="[object Symbol]",L="[object WeakMap]",P="[object ArrayBuffer]",O="[object DataView]",M="[object Float32Array]",R="[object Float64Array]",$="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",H="[object Uint8Array]",F="[object Uint8ClampedArray]",k="[object Uint16Array]",G="[object Uint32Array]",U=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,q=RegExp(W.source),K=RegExp(Y.source),z=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,ot=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ut=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,vt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,Ct=/['\n\r\u2028\u2029\\]/g,At="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Et="\\u2700-\\u27bf",_t="a-z\\xdf-\\xf6\\xf8-\\xff",xt="A-Z\\xc0-\\xd6\\xd8-\\xde",Tt="\\ufe0e\\ufe0f",It="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Nt="["+At+"]",St="["+It+"]",Lt="["+wt+"]",Pt="\\d+",Ot="["+Et+"]",Mt="["+_t+"]",Rt="[^"+At+It+Pt+Et+_t+xt+"]",$t="\\ud83c[\\udffb-\\udfff]",Dt="[^"+At+"]",Bt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ht="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+xt+"]",kt="\\u200d",Gt="(?:"+Mt+"|"+Rt+")",Ut="(?:"+Ft+"|"+Rt+")",jt="(?:['’](?:d|ll|m|re|s|t|ve))?",Vt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Wt="(?:"+Lt+"|"+$t+")?",Yt="["+Tt+"]?",qt=Yt+Wt+"(?:"+kt+"(?:"+[Dt,Bt,Ht].join("|")+")"+Yt+Wt+")*",Kt="(?:"+[Ot,Bt,Ht].join("|")+")"+qt,zt="(?:"+[Dt+Lt+"?",Lt,Bt,Ht,Nt].join("|")+")",Jt=RegExp("['’]","g"),Qt=RegExp(Lt,"g"),Xt=RegExp($t+"(?="+$t+")|"+zt+qt,"g"),Zt=RegExp([Ft+"?"+Mt+"+"+jt+"(?="+[St,Ft,"$"].join("|")+")",Ut+"+"+Vt+"(?="+[St,Ft+Gt,"$"].join("|")+")",Ft+"?"+Gt+"+"+jt,Ft+"+"+Vt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pt,Kt].join("|"),"g"),te=RegExp("["+kt+At+wt+Tt+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,oe={};oe[M]=oe[R]=oe[$]=oe[D]=oe[B]=oe[H]=oe[F]=oe[k]=oe[G]=!0,oe[g]=oe[m]=oe[P]=oe[y]=oe[O]=oe[v]=oe[b]=oe[C]=oe[w]=oe[E]=oe[_]=oe[T]=oe[I]=oe[N]=oe[L]=!1;var ie={};ie[g]=ie[m]=ie[P]=ie[O]=ie[y]=ie[v]=ie[M]=ie[R]=ie[$]=ie[D]=ie[B]=ie[w]=ie[E]=ie[_]=ie[T]=ie[I]=ie[N]=ie[S]=ie[H]=ie[F]=ie[k]=ie[G]=!0,ie[b]=ie[C]=ie[L]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ae=parseFloat,le=parseInt,ue="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ce="object"==typeof self&&self&&self.Object===Object&&self,fe=ue||ce||Function("return this")(),he=e&&!e.nodeType&&e,de=he&&t&&!t.nodeType&&t,pe=de&&de.exports===he,ge=pe&&ue.process,me=function(){try{return de&&de.require&&de.require("util").types||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),ye=me&&me.isArrayBuffer,ve=me&&me.isDate,be=me&&me.isMap,Ce=me&&me.isRegExp,Ae=me&&me.isSet,we=me&&me.isTypedArray;function Ee(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function _e(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var s=t[o];e(r,s,n(s),t)}return r}function xe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Te(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ie(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ne(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}function Se(t,e){return!(null==t||!t.length)&&Fe(t,e,0)>-1}function Le(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}function Pe(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function Oe(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function Me(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function Re(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}function $e(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var De=je("length");function Be(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}function He(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Fe(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):He(t,Ge,n)}function ke(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function Ge(t){return t!=t}function Ue(t,e){var n=null==t?0:t.length;return n?Ye(t,e)/n:h}function je(t){return function(e){return null==e?o:e[t]}}function Ve(t){return function(e){return null==t?o:t[e]}}function We(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function Ye(t,e){for(var n,r=-1,i=t.length;++r<i;){var s=e(t[r]);s!==o&&(n=n===o?s:n+s)}return n}function qe(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ke(t){return t?t.slice(0,hn(t)+1).replace(rt,""):t}function ze(t){return function(e){return t(e)}}function Je(t,e){return Pe(e,(function(e){return t[e]}))}function Qe(t,e){return t.has(e)}function Xe(t,e){for(var n=-1,r=t.length;++n<r&&Fe(e,t[n],0)>-1;);return n}function Ze(t,e){for(var n=t.length;n--&&Fe(e,t[n],0)>-1;);return n}var tn=Ve({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),en=Ve({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(t){return"\\"+se[t]}function rn(t){return te.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function an(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var s=t[n];s!==e&&s!==a||(t[n]=a,i[o++]=n)}return i}function ln(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function cn(t){return rn(t)?function(t){for(var e=Xt.lastIndex=0;Xt.test(t);)++e;return e}(t):De(t)}function fn(t){return rn(t)?function(t){return t.match(Xt)||[]}(t):function(t){return t.split("")}(t)}function hn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var dn=Ve({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pn=function t(e){var n,r=(e=null==e?fe:pn.defaults(fe.Object(),e,pn.pick(fe,ne))).Array,ot=e.Date,At=e.Error,wt=e.Function,Et=e.Math,_t=e.Object,xt=e.RegExp,Tt=e.String,It=e.TypeError,Nt=r.prototype,St=wt.prototype,Lt=_t.prototype,Pt=e["__core-js_shared__"],Ot=St.toString,Mt=Lt.hasOwnProperty,Rt=0,$t=(n=/[^.]+$/.exec(Pt&&Pt.keys&&Pt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Dt=Lt.toString,Bt=Ot.call(_t),Ht=fe._,Ft=xt("^"+Ot.call(Mt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kt=pe?e.Buffer:o,Gt=e.Symbol,Ut=e.Uint8Array,jt=kt?kt.allocUnsafe:o,Vt=sn(_t.getPrototypeOf,_t),Wt=_t.create,Yt=Lt.propertyIsEnumerable,qt=Nt.splice,Kt=Gt?Gt.isConcatSpreadable:o,zt=Gt?Gt.iterator:o,Xt=Gt?Gt.toStringTag:o,te=function(){try{var t=ui(_t,"defineProperty");return t({},"",{}),t}catch(t){}}(),se=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,ue=ot&&ot.now!==fe.Date.now&&ot.now,ce=e.setTimeout!==fe.setTimeout&&e.setTimeout,he=Et.ceil,de=Et.floor,ge=_t.getOwnPropertySymbols,me=kt?kt.isBuffer:o,De=e.isFinite,Ve=Nt.join,gn=sn(_t.keys,_t),mn=Et.max,yn=Et.min,vn=ot.now,bn=e.parseInt,Cn=Et.random,An=Nt.reverse,wn=ui(e,"DataView"),En=ui(e,"Map"),_n=ui(e,"Promise"),xn=ui(e,"Set"),Tn=ui(e,"WeakMap"),In=ui(_t,"create"),Nn=Tn&&new Tn,Sn={},Ln=Bi(wn),Pn=Bi(En),On=Bi(_n),Mn=Bi(xn),Rn=Bi(Tn),$n=Gt?Gt.prototype:o,Dn=$n?$n.valueOf:o,Bn=$n?$n.toString:o;function Hn(t){if(ta(t)&&!js(t)&&!(t instanceof Un)){if(t instanceof Gn)return t;if(Mt.call(t,"__wrapped__"))return Hi(t)}return new Gn(t)}var Fn=function(){function t(){}return function(e){if(!Zs(e))return{};if(Wt)return Wt(e);t.prototype=e;var n=new t;return t.prototype=o,n}}();function kn(){}function Gn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function Un(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function jn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Yn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Wn;++e<n;)this.add(t[e])}function qn(t){var e=this.__data__=new Vn(t);this.size=e.size}function Kn(t,e){var n=js(t),r=!n&&Us(t),o=!n&&!r&&qs(t),i=!n&&!r&&!o&&la(t),s=n||r||o||i,a=s?qe(t.length,Tt):[],l=a.length;for(var u in t)!e&&!Mt.call(t,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||mi(u,l))||a.push(u);return a}function zn(t){var e=t.length;return e?t[Wr(0,e-1)]:o}function Jn(t,e){return Oi(Io(t),ir(e,0,t.length))}function Qn(t){return Oi(Io(t))}function Xn(t,e,n){(n!==o&&!Fs(t[e],n)||n===o&&!(e in t))&&rr(t,e,n)}function Zn(t,e,n){var r=t[e];Mt.call(t,e)&&Fs(r,n)&&(n!==o||e in t)||rr(t,e,n)}function tr(t,e){for(var n=t.length;n--;)if(Fs(t[n][0],e))return n;return-1}function er(t,e,n,r){return cr(t,(function(t,o,i){e(r,t,n(t),i)})),r}function nr(t,e){return t&&No(e,La(e),t)}function rr(t,e,n){"__proto__"==e&&te?te(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function or(t,e){for(var n=-1,i=e.length,s=r(i),a=null==t;++n<i;)s[n]=a?o:xa(t,e[n]);return s}function ir(t,e,n){return t==t&&(n!==o&&(t=t<=n?t:n),e!==o&&(t=t>=e?t:e)),t}function sr(t,e,n,r,i,s){var a,l=1&e,u=2&e,c=4&e;if(n&&(a=i?n(t,r,i,s):n(t)),a!==o)return a;if(!Zs(t))return t;var f=js(t);if(f){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Mt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return Io(t,a)}else{var h=hi(t),d=h==C||h==A;if(qs(t))return Ao(t,l);if(h==_||h==g||d&&!i){if(a=u||d?{}:pi(t),!l)return u?function(t,e){return No(t,fi(t),e)}(t,function(t,e){return t&&No(e,Pa(e),t)}(a,t)):function(t,e){return No(t,ci(t),e)}(t,nr(a,t))}else{if(!ie[h])return i?t:{};a=function(t,e,n){var r,o=t.constructor;switch(e){case P:return wo(t);case y:case v:return new o(+t);case O:return function(t,e){var n=e?wo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case M:case R:case $:case D:case B:case H:case F:case k:case G:return Eo(t,n);case w:return new o;case E:case N:return new o(t);case T:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case I:return new o;case S:return r=t,Dn?_t(Dn.call(r)):{}}}(t,h,l)}}s||(s=new qn);var p=s.get(t);if(p)return p;s.set(t,a),ia(t)?t.forEach((function(r){a.add(sr(r,e,n,r,t,s))})):ea(t)&&t.forEach((function(r,o){a.set(o,sr(r,e,n,o,t,s))}));var m=f?o:(c?u?ni:ei:u?Pa:La)(t);return xe(m||t,(function(r,o){m&&(r=t[o=r]),Zn(a,o,sr(r,e,n,o,t,s))})),a}function ar(t,e,n){var r=n.length;if(null==t)return!r;for(t=_t(t);r--;){var i=n[r],s=e[i],a=t[i];if(a===o&&!(i in t)||!s(a))return!1}return!0}function lr(t,e,n){if("function"!=typeof t)throw new It(i);return Ni((function(){t.apply(o,n)}),e)}function ur(t,e,n,r){var o=-1,i=Se,s=!0,a=t.length,l=[],u=e.length;if(!a)return l;n&&(e=Pe(e,ze(n))),r?(i=Le,s=!1):e.length>=200&&(i=Qe,s=!1,e=new Yn(e));t:for(;++o<a;){var c=t[o],f=null==n?c:n(c);if(c=r||0!==c?c:0,s&&f==f){for(var h=u;h--;)if(e[h]===f)continue t;l.push(c)}else i(e,f,r)||l.push(c)}return l}Hn.templateSettings={escape:z,evaluate:J,interpolate:Q,variable:"",imports:{_:Hn}},Hn.prototype=kn.prototype,Hn.prototype.constructor=Hn,Gn.prototype=Fn(kn.prototype),Gn.prototype.constructor=Gn,Un.prototype=Fn(kn.prototype),Un.prototype.constructor=Un,jn.prototype.clear=function(){this.__data__=In?In(null):{},this.size=0},jn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},jn.prototype.get=function(t){var e=this.__data__;if(In){var n=e[t];return n===s?o:n}return Mt.call(e,t)?e[t]:o},jn.prototype.has=function(t){var e=this.__data__;return In?e[t]!==o:Mt.call(e,t)},jn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=In&&e===o?s:e,this},Vn.prototype.clear=function(){this.__data__=[],this.size=0},Vn.prototype.delete=function(t){var e=this.__data__,n=tr(e,t);return!(n<0||(n==e.length-1?e.pop():qt.call(e,n,1),--this.size,0))},Vn.prototype.get=function(t){var e=this.__data__,n=tr(e,t);return n<0?o:e[n][1]},Vn.prototype.has=function(t){return tr(this.__data__,t)>-1},Vn.prototype.set=function(t,e){var n=this.__data__,r=tr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new jn,map:new(En||Vn),string:new jn}},Wn.prototype.delete=function(t){var e=ai(this,t).delete(t);return this.size-=e?1:0,e},Wn.prototype.get=function(t){return ai(this,t).get(t)},Wn.prototype.has=function(t){return ai(this,t).has(t)},Wn.prototype.set=function(t,e){var n=ai(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Yn.prototype.add=Yn.prototype.push=function(t){return this.__data__.set(t,s),this},Yn.prototype.has=function(t){return this.__data__.has(t)},qn.prototype.clear=function(){this.__data__=new Vn,this.size=0},qn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},qn.prototype.get=function(t){return this.__data__.get(t)},qn.prototype.has=function(t){return this.__data__.has(t)},qn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Vn){var r=n.__data__;if(!En||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(t,e),this.size=n.size,this};var cr=Po(vr),fr=Po(br,!0);function hr(t,e){var n=!0;return cr(t,(function(t,r,o){return n=!!e(t,r,o)})),n}function dr(t,e,n){for(var r=-1,i=t.length;++r<i;){var s=t[r],a=e(s);if(null!=a&&(l===o?a==a&&!aa(a):n(a,l)))var l=a,u=s}return u}function pr(t,e){var n=[];return cr(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function gr(t,e,n,r,o){var i=-1,s=t.length;for(n||(n=gi),o||(o=[]);++i<s;){var a=t[i];e>0&&n(a)?e>1?gr(a,e-1,n,r,o):Oe(o,a):r||(o[o.length]=a)}return o}var mr=Oo(),yr=Oo(!0);function vr(t,e){return t&&mr(t,e,La)}function br(t,e){return t&&yr(t,e,La)}function Cr(t,e){return Ne(e,(function(e){return Js(t[e])}))}function Ar(t,e){for(var n=0,r=(e=yo(e,t)).length;null!=t&&n<r;)t=t[Di(e[n++])];return n&&n==r?t:o}function wr(t,e,n){var r=e(t);return js(t)?r:Oe(r,n(t))}function Er(t){return null==t?t===o?"[object Undefined]":"[object Null]":Xt&&Xt in _t(t)?function(t){var e=Mt.call(t,Xt),n=t[Xt];try{t[Xt]=o;var r=!0}catch(t){}var i=Dt.call(t);return r&&(e?t[Xt]=n:delete t[Xt]),i}(t):function(t){return Dt.call(t)}(t)}function _r(t,e){return t>e}function xr(t,e){return null!=t&&Mt.call(t,e)}function Tr(t,e){return null!=t&&e in _t(t)}function Ir(t,e,n){for(var i=n?Le:Se,s=t[0].length,a=t.length,l=a,u=r(a),c=1/0,f=[];l--;){var h=t[l];l&&e&&(h=Pe(h,ze(e))),c=yn(h.length,c),u[l]=!n&&(e||s>=120&&h.length>=120)?new Yn(l&&h):o}h=t[0];var d=-1,p=u[0];t:for(;++d<s&&f.length<c;){var g=h[d],m=e?e(g):g;if(g=n||0!==g?g:0,!(p?Qe(p,m):i(f,m,n))){for(l=a;--l;){var y=u[l];if(!(y?Qe(y,m):i(t[l],m,n)))continue t}p&&p.push(m),f.push(g)}}return f}function Nr(t,e,n){var r=null==(t=xi(t,e=yo(e,t)))?t:t[Di(zi(e))];return null==r?o:Ee(r,t,n)}function Sr(t){return ta(t)&&Er(t)==g}function Lr(t,e,n,r,i){return t===e||(null==t||null==e||!ta(t)&&!ta(e)?t!=t&&e!=e:function(t,e,n,r,i,s){var a=js(t),l=js(e),u=a?m:hi(t),c=l?m:hi(e),f=(u=u==g?_:u)==_,h=(c=c==g?_:c)==_,d=u==c;if(d&&qs(t)){if(!qs(e))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new qn),a||la(t)?Zo(t,e,n,r,i,s):function(t,e,n,r,o,i,s){switch(n){case O:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case P:return!(t.byteLength!=e.byteLength||!i(new Ut(t),new Ut(e)));case y:case v:case E:return Fs(+t,+e);case b:return t.name==e.name&&t.message==e.message;case T:case N:return t==e+"";case w:var a=on;case I:var l=1&r;if(a||(a=ln),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;r|=2,s.set(t,e);var c=Zo(a(t),a(e),r,o,i,s);return s.delete(t),c;case S:if(Dn)return Dn.call(t)==Dn.call(e)}return!1}(t,e,u,n,r,i,s);if(!(1&n)){var p=f&&Mt.call(t,"__wrapped__"),C=h&&Mt.call(e,"__wrapped__");if(p||C){var A=p?t.value():t,x=C?e.value():e;return s||(s=new qn),i(A,x,n,r,s)}}return!!d&&(s||(s=new qn),function(t,e,n,r,i,s){var a=1&n,l=ei(t),u=l.length;if(u!=ei(e).length&&!a)return!1;for(var c=u;c--;){var f=l[c];if(!(a?f in e:Mt.call(e,f)))return!1}var h=s.get(t),d=s.get(e);if(h&&d)return h==e&&d==t;var p=!0;s.set(t,e),s.set(e,t);for(var g=a;++c<u;){var m=t[f=l[c]],y=e[f];if(r)var v=a?r(y,m,f,e,t,s):r(m,y,f,t,e,s);if(!(v===o?m===y||i(m,y,n,r,s):v)){p=!1;break}g||(g="constructor"==f)}if(p&&!g){var b=t.constructor,C=e.constructor;b==C||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof C&&C instanceof C||(p=!1)}return s.delete(t),s.delete(e),p}(t,e,n,r,i,s))}(t,e,n,r,Lr,i))}function Pr(t,e,n,r){var i=n.length,s=i,a=!r;if(null==t)return!s;for(t=_t(t);i--;){var l=n[i];if(a&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++i<s;){var u=(l=n[i])[0],c=t[u],f=l[1];if(a&&l[2]){if(c===o&&!(u in t))return!1}else{var h=new qn;if(r)var d=r(c,f,u,t,e,h);if(!(d===o?Lr(f,c,3,r,h):d))return!1}}return!0}function Or(t){return!(!Zs(t)||(e=t,$t&&$t in e))&&(Js(t)?Ft:gt).test(Bi(t));var e}function Mr(t){return"function"==typeof t?t:null==t?nl:"object"==typeof t?js(t)?Hr(t[0],t[1]):Br(t):fl(t)}function Rr(t){if(!Ai(t))return gn(t);var e=[];for(var n in _t(t))Mt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function $r(t,e){return t<e}function Dr(t,e){var n=-1,o=Ws(t)?r(t.length):[];return cr(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}function Br(t){var e=li(t);return 1==e.length&&e[0][2]?Ei(e[0][0],e[0][1]):function(n){return n===t||Pr(n,t,e)}}function Hr(t,e){return vi(t)&&wi(e)?Ei(Di(t),e):function(n){var r=xa(n,t);return r===o&&r===e?Ta(n,t):Lr(e,r,3)}}function Fr(t,e,n,r,i){t!==e&&mr(e,(function(s,a){if(i||(i=new qn),Zs(s))!function(t,e,n,r,i,s,a){var l=Ti(t,n),u=Ti(e,n),c=a.get(u);if(c)Xn(t,n,c);else{var f=s?s(l,u,n+"",t,e,a):o,h=f===o;if(h){var d=js(u),p=!d&&qs(u),g=!d&&!p&&la(u);f=u,d||p||g?js(l)?f=l:Ys(l)?f=Io(l):p?(h=!1,f=Ao(u,!0)):g?(h=!1,f=Eo(u,!0)):f=[]:ra(u)||Us(u)?(f=l,Us(l)?f=ma(l):Zs(l)&&!Js(l)||(f=pi(u))):h=!1}h&&(a.set(u,f),i(f,u,r,s,a),a.delete(u)),Xn(t,n,f)}}(t,e,a,n,Fr,r,i);else{var l=r?r(Ti(t,a),s,a+"",t,e,i):o;l===o&&(l=s),Xn(t,a,l)}}),Pa)}function kr(t,e){var n=t.length;if(n)return mi(e+=e<0?n:0,n)?t[e]:o}function Gr(t,e,n){e=e.length?Pe(e,(function(t){return js(t)?function(e){return Ar(e,1===t.length?t[0]:t)}:t})):[nl];var r=-1;e=Pe(e,ze(si()));var o=Dr(t,(function(t,n,o){var i=Pe(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t){var e=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,s=o.length,a=n.length;++r<s;){var l=_o(o[r],i[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}));e--;)t[e]=t[e].value;return t}(o)}function Ur(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var s=e[r],a=Ar(t,s);n(a,s)&&Jr(i,yo(s,t),a)}return i}function jr(t,e,n,r){var o=r?ke:Fe,i=-1,s=e.length,a=t;for(t===e&&(e=Io(e)),n&&(a=Pe(t,ze(n)));++i<s;)for(var l=0,u=e[i],c=n?n(u):u;(l=o(a,c,l,r))>-1;)a!==t&&qt.call(a,l,1),qt.call(t,l,1);return t}function Vr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;mi(o)?qt.call(t,o,1):lo(t,o)}}return t}function Wr(t,e){return t+de(Cn()*(e-t+1))}function Yr(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=de(e/2))&&(t+=t)}while(e);return n}function qr(t,e){return Si(_i(t,e,nl),t+"")}function Kr(t){return zn(Fa(t))}function zr(t,e){var n=Fa(t);return Oi(n,ir(e,0,n.length))}function Jr(t,e,n,r){if(!Zs(t))return t;for(var i=-1,s=(e=yo(e,t)).length,a=s-1,l=t;null!=l&&++i<s;){var u=Di(e[i]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(i!=a){var f=l[u];(c=r?r(f,u,l):o)===o&&(c=Zs(f)?f:mi(e[i+1])?[]:{})}Zn(l,u,c),l=l[u]}return t}var Qr=Nn?function(t,e){return Nn.set(t,e),t}:nl,Xr=te?function(t,e){return te(t,"toString",{configurable:!0,enumerable:!1,value:Za(e),writable:!0})}:nl;function Zr(t){return Oi(Fa(t))}function to(t,e,n){var o=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=r(i);++o<i;)s[o]=t[o+e];return s}function eo(t,e){var n;return cr(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}function no(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,s=t[i];null!==s&&!aa(s)&&(n?s<=e:s<e)?r=i+1:o=i}return o}return ro(t,e,nl,n)}function ro(t,e,n,r){var i=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(e=n(e))!=e,l=null===e,u=aa(e),c=e===o;i<s;){var f=de((i+s)/2),h=n(t[f]),d=h!==o,p=null===h,g=h==h,m=aa(h);if(a)var y=r||g;else y=c?g&&(r||d):l?g&&d&&(r||!p):u?g&&d&&!p&&(r||!m):!p&&!m&&(r?h<=e:h<e);y?i=f+1:s=f}return yn(s,4294967294)}function oo(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Fs(a,l)){var l=a;i[o++]=0===s?0:s}}return i}function io(t){return"number"==typeof t?t:aa(t)?h:+t}function so(t){if("string"==typeof t)return t;if(js(t))return Pe(t,so)+"";if(aa(t))return Bn?Bn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ao(t,e,n){var r=-1,o=Se,i=t.length,s=!0,a=[],l=a;if(n)s=!1,o=Le;else if(i>=200){var u=e?null:qo(t);if(u)return ln(u);s=!1,o=Qe,l=new Yn}else l=e?[]:a;t:for(;++r<i;){var c=t[r],f=e?e(c):c;if(c=n||0!==c?c:0,s&&f==f){for(var h=l.length;h--;)if(l[h]===f)continue t;e&&l.push(f),a.push(c)}else o(l,f,n)||(l!==a&&l.push(f),a.push(c))}return a}function lo(t,e){return null==(t=xi(t,e=yo(e,t)))||delete t[Di(zi(e))]}function uo(t,e,n,r){return Jr(t,e,n(Ar(t,e)),r)}function co(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?to(t,r?0:i,r?i+1:o):to(t,r?i+1:0,r?o:i)}function fo(t,e){var n=t;return n instanceof Un&&(n=n.value()),Me(e,(function(t,e){return e.func.apply(e.thisArg,Oe([t],e.args))}),n)}function ho(t,e,n){var o=t.length;if(o<2)return o?ao(t[0]):[];for(var i=-1,s=r(o);++i<o;)for(var a=t[i],l=-1;++l<o;)l!=i&&(s[i]=ur(s[i]||a,t[l],e,n));return ao(gr(s,1),e,n)}function po(t,e,n){for(var r=-1,i=t.length,s=e.length,a={};++r<i;){var l=r<s?e[r]:o;n(a,t[r],l)}return a}function go(t){return Ys(t)?t:[]}function mo(t){return"function"==typeof t?t:nl}function yo(t,e){return js(t)?t:vi(t,e)?[t]:$i(ya(t))}var vo=qr;function bo(t,e,n){var r=t.length;return n=n===o?r:n,!e&&n>=r?t:to(t,e,n)}var Co=se||function(t){return fe.clearTimeout(t)};function Ao(t,e){if(e)return t.slice();var n=t.length,r=jt?jt(n):new t.constructor(n);return t.copy(r),r}function wo(t){var e=new t.constructor(t.byteLength);return new Ut(e).set(new Ut(t)),e}function Eo(t,e){var n=e?wo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function _o(t,e){if(t!==e){var n=t!==o,r=null===t,i=t==t,s=aa(t),a=e!==o,l=null===e,u=e==e,c=aa(e);if(!l&&!c&&!s&&t>e||s&&a&&u&&!l&&!c||r&&a&&u||!n&&u||!i)return 1;if(!r&&!s&&!c&&t<e||c&&n&&i&&!r&&!s||l&&n&&i||!a&&i||!u)return-1}return 0}function xo(t,e,n,o){for(var i=-1,s=t.length,a=n.length,l=-1,u=e.length,c=mn(s-a,0),f=r(u+c),h=!o;++l<u;)f[l]=e[l];for(;++i<a;)(h||i<s)&&(f[n[i]]=t[i]);for(;c--;)f[l++]=t[i++];return f}function To(t,e,n,o){for(var i=-1,s=t.length,a=-1,l=n.length,u=-1,c=e.length,f=mn(s-l,0),h=r(f+c),d=!o;++i<f;)h[i]=t[i];for(var p=i;++u<c;)h[p+u]=e[u];for(;++a<l;)(d||i<s)&&(h[p+n[a]]=t[i++]);return h}function Io(t,e){var n=-1,o=t.length;for(e||(e=r(o));++n<o;)e[n]=t[n];return e}function No(t,e,n,r){var i=!n;n||(n={});for(var s=-1,a=e.length;++s<a;){var l=e[s],u=r?r(n[l],t[l],l,n,t):o;u===o&&(u=t[l]),i?rr(n,l,u):Zn(n,l,u)}return n}function So(t,e){return function(n,r){var o=js(n)?_e:er,i=e?e():{};return o(n,t,si(r,2),i)}}function Lo(t){return qr((function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:o,a=i>2?n[2]:o;for(s=t.length>3&&"function"==typeof s?(i--,s):o,a&&yi(n[0],n[1],a)&&(s=i<3?o:s,i=1),e=_t(e);++r<i;){var l=n[r];l&&t(e,l,r,s)}return e}))}function Po(t,e){return function(n,r){if(null==n)return n;if(!Ws(n))return t(n,r);for(var o=n.length,i=e?o:-1,s=_t(n);(e?i--:++i<o)&&!1!==r(s[i],i,s););return n}}function Oo(t){return function(e,n,r){for(var o=-1,i=_t(e),s=r(e),a=s.length;a--;){var l=s[t?a:++o];if(!1===n(i[l],l,i))break}return e}}function Mo(t){return function(e){var n=rn(e=ya(e))?fn(e):o,r=n?n[0]:e.charAt(0),i=n?bo(n,1).join(""):e.slice(1);return r[t]()+i}}function Ro(t){return function(e){return Me(Ja(Ua(e).replace(Jt,"")),t,"")}}function $o(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Fn(t.prototype),r=t.apply(n,e);return Zs(r)?r:n}}function Do(t){return function(e,n,r){var i=_t(e);if(!Ws(e)){var s=si(n,3);e=La(e),n=function(t){return s(i[t],t,i)}}var a=t(e,n,r);return a>-1?i[s?e[a]:a]:o}}function Bo(t){return ti((function(e){var n=e.length,r=n,s=Gn.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new It(i);if(s&&!l&&"wrapper"==oi(a))var l=new Gn([],!0)}for(r=l?r:n;++r<n;){var u=oi(a=e[r]),c="wrapper"==u?ri(a):o;l=c&&bi(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[oi(c[0])].apply(l,c[3]):1==a.length&&bi(a)?l[u]():l.thru(a)}return function(){var t=arguments,r=t[0];if(l&&1==t.length&&js(r))return l.plant(r).value();for(var o=0,i=n?e[o].apply(this,t):r;++o<n;)i=e[o].call(this,i);return i}}))}function Ho(t,e,n,i,s,a,l,c,f,h){var d=e&u,p=1&e,g=2&e,m=24&e,y=512&e,v=g?o:$o(t);return function u(){for(var b=arguments.length,C=r(b),A=b;A--;)C[A]=arguments[A];if(m)var w=ii(u),E=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(C,w);if(i&&(C=xo(C,i,s,m)),a&&(C=To(C,a,l,m)),b-=E,m&&b<h){var _=an(C,w);return Wo(t,e,Ho,u.placeholder,n,C,_,c,f,h-b)}var x=p?n:this,T=g?x[t]:t;return b=C.length,c?C=function(t,e){for(var n=t.length,r=yn(e.length,n),i=Io(t);r--;){var s=e[r];t[r]=mi(s,n)?i[s]:o}return t}(C,c):y&&b>1&&C.reverse(),d&&f<b&&(C.length=f),this&&this!==fe&&this instanceof u&&(T=v||$o(T)),T.apply(x,C)}}function Fo(t,e){return function(n,r){return function(t,e,n,r){return vr(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}function ko(t,e){return function(n,r){var i;if(n===o&&r===o)return e;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=so(n),r=so(r)):(n=io(n),r=io(r)),i=t(n,r)}return i}}function Go(t){return ti((function(e){return e=Pe(e,ze(si())),qr((function(n){var r=this;return t(e,(function(t){return Ee(t,r,n)}))}))}))}function Uo(t,e){var n=(e=e===o?" ":so(e)).length;if(n<2)return n?Yr(e,t):e;var r=Yr(e,he(t/cn(e)));return rn(e)?bo(fn(r),0,t).join(""):r.slice(0,t)}function jo(t){return function(e,n,i){return i&&"number"!=typeof i&&yi(e,n,i)&&(n=i=o),e=ha(e),n===o?(n=e,e=0):n=ha(n),function(t,e,n,o){for(var i=-1,s=mn(he((e-t)/(n||1)),0),a=r(s);s--;)a[o?s:++i]=t,t+=n;return a}(e,n,i=i===o?e<n?1:-1:ha(i),t)}}function Vo(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ga(e),n=ga(n)),t(e,n)}}function Wo(t,e,n,r,i,s,a,u,c,f){var h=8&e;e|=h?l:64,4&(e&=~(h?64:l))||(e&=-4);var d=[t,e,i,h?s:o,h?a:o,h?o:s,h?o:a,u,c,f],p=n.apply(o,d);return bi(t)&&Ii(p,d),p.placeholder=r,Li(p,t,e)}function Yo(t){var e=Et[t];return function(t,n){if(t=ga(t),(n=null==n?0:yn(da(n),292))&&De(t)){var r=(ya(t)+"e").split("e");return+((r=(ya(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var qo=xn&&1/ln(new xn([,-0]))[1]==c?function(t){return new xn(t)}:al;function Ko(t){return function(e){var n=hi(e);return n==w?on(e):n==I?un(e):function(t,e){return Pe(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function zo(t,e,n,s,c,f,h,d){var p=2&e;if(!p&&"function"!=typeof t)throw new It(i);var g=s?s.length:0;if(g||(e&=-97,s=c=o),h=h===o?h:mn(da(h),0),d=d===o?d:da(d),g-=c?c.length:0,64&e){var m=s,y=c;s=c=o}var v=p?o:ri(t),b=[t,e,n,s,c,m,y,f,h,d];if(v&&function(t,e){var n=t[1],r=e[1],o=n|r,i=o<131,s=r==u&&8==n||r==u&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!i&&!s)return t;1&r&&(t[2]=e[2],o|=1&n?0:4);var l=e[3];if(l){var c=t[3];t[3]=c?xo(c,l,e[4]):l,t[4]=c?an(t[3],a):e[4]}(l=e[5])&&(c=t[5],t[5]=c?To(c,l,e[6]):l,t[6]=c?an(t[5],a):e[6]),(l=e[7])&&(t[7]=l),r&u&&(t[8]=null==t[8]?e[8]:yn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(b,v),t=b[0],e=b[1],n=b[2],s=b[3],c=b[4],!(d=b[9]=b[9]===o?p?0:t.length:mn(b[9]-g,0))&&24&e&&(e&=-25),e&&1!=e)C=8==e||16==e?function(t,e,n){var i=$o(t);return function s(){for(var a=arguments.length,l=r(a),u=a,c=ii(s);u--;)l[u]=arguments[u];var f=a<3&&l[0]!==c&&l[a-1]!==c?[]:an(l,c);return(a-=f.length)<n?Wo(t,e,Ho,s.placeholder,o,l,f,o,o,n-a):Ee(this&&this!==fe&&this instanceof s?i:t,this,l)}}(t,e,d):e!=l&&33!=e||c.length?Ho.apply(o,b):function(t,e,n,o){var i=1&e,s=$o(t);return function e(){for(var a=-1,l=arguments.length,u=-1,c=o.length,f=r(c+l),h=this&&this!==fe&&this instanceof e?s:t;++u<c;)f[u]=o[u];for(;l--;)f[u++]=arguments[++a];return Ee(h,i?n:this,f)}}(t,e,n,s);else var C=function(t,e,n){var r=1&e,o=$o(t);return function e(){return(this&&this!==fe&&this instanceof e?o:t).apply(r?n:this,arguments)}}(t,e,n);return Li((v?Qr:Ii)(C,b),t,e)}function Jo(t,e,n,r){return t===o||Fs(t,Lt[n])&&!Mt.call(r,n)?e:t}function Qo(t,e,n,r,i,s){return Zs(t)&&Zs(e)&&(s.set(e,t),Fr(t,e,o,Qo,s),s.delete(e)),t}function Xo(t){return ra(t)?o:t}function Zo(t,e,n,r,i,s){var a=1&n,l=t.length,u=e.length;if(l!=u&&!(a&&u>l))return!1;var c=s.get(t),f=s.get(e);if(c&&f)return c==e&&f==t;var h=-1,d=!0,p=2&n?new Yn:o;for(s.set(t,e),s.set(e,t);++h<l;){var g=t[h],m=e[h];if(r)var y=a?r(m,g,h,e,t,s):r(g,m,h,t,e,s);if(y!==o){if(y)continue;d=!1;break}if(p){if(!$e(e,(function(t,e){if(!Qe(p,e)&&(g===t||i(g,t,n,r,s)))return p.push(e)}))){d=!1;break}}else if(g!==m&&!i(g,m,n,r,s)){d=!1;break}}return s.delete(t),s.delete(e),d}function ti(t){return Si(_i(t,o,Vi),t+"")}function ei(t){return wr(t,La,ci)}function ni(t){return wr(t,Pa,fi)}var ri=Nn?function(t){return Nn.get(t)}:al;function oi(t){for(var e=t.name+"",n=Sn[e],r=Mt.call(Sn,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function ii(t){return(Mt.call(Hn,"placeholder")?Hn:t).placeholder}function si(){var t=Hn.iteratee||rl;return t=t===rl?Mr:t,arguments.length?t(arguments[0],arguments[1]):t}function ai(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function li(t){for(var e=La(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,wi(o)]}return e}function ui(t,e){var n=function(t,e){return null==t?o:t[e]}(t,e);return Or(n)?n:o}var ci=ge?function(t){return null==t?[]:(t=_t(t),Ne(ge(t),(function(e){return Yt.call(t,e)})))}:pl,fi=ge?function(t){for(var e=[];t;)Oe(e,ci(t)),t=Vt(t);return e}:pl,hi=Er;function di(t,e,n){for(var r=-1,o=(e=yo(e,t)).length,i=!1;++r<o;){var s=Di(e[r]);if(!(i=null!=t&&n(t,s)))break;t=t[s]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&Xs(o)&&mi(s,o)&&(js(t)||Us(t))}function pi(t){return"function"!=typeof t.constructor||Ai(t)?{}:Fn(Vt(t))}function gi(t){return js(t)||Us(t)||!!(Kt&&t&&t[Kt])}function mi(t,e){var n=typeof t;return!!(e=null==e?f:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e}function yi(t,e,n){if(!Zs(n))return!1;var r=typeof e;return!!("number"==r?Ws(n)&&mi(e,n.length):"string"==r&&e in n)&&Fs(n[e],t)}function vi(t,e){if(js(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!aa(t))||Z.test(t)||!X.test(t)||null!=e&&t in _t(e)}function bi(t){var e=oi(t),n=Hn[e];if("function"!=typeof n||!(e in Un.prototype))return!1;if(t===n)return!0;var r=ri(n);return!!r&&t===r[0]}(wn&&hi(new wn(new ArrayBuffer(1)))!=O||En&&hi(new En)!=w||_n&&hi(_n.resolve())!=x||xn&&hi(new xn)!=I||Tn&&hi(new Tn)!=L)&&(hi=function(t){var e=Er(t),n=e==_?t.constructor:o,r=n?Bi(n):"";if(r)switch(r){case Ln:return O;case Pn:return w;case On:return x;case Mn:return I;case Rn:return L}return e});var Ci=Pt?Js:gl;function Ai(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Lt)}function wi(t){return t==t&&!Zs(t)}function Ei(t,e){return function(n){return null!=n&&n[t]===e&&(e!==o||t in _t(n))}}function _i(t,e,n){return e=mn(e===o?t.length-1:e,0),function(){for(var o=arguments,i=-1,s=mn(o.length-e,0),a=r(s);++i<s;)a[i]=o[e+i];i=-1;for(var l=r(e+1);++i<e;)l[i]=o[i];return l[e]=n(a),Ee(t,this,l)}}function xi(t,e){return e.length<2?t:Ar(t,to(e,0,-1))}function Ti(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ii=Pi(Qr),Ni=ce||function(t,e){return fe.setTimeout(t,e)},Si=Pi(Xr);function Li(t,e,n){var r=e+"";return Si(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return xe(p,(function(n){var r="_."+n[0];e&n[1]&&!Se(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(at):[]}(r),n)))}function Pi(t){var e=0,n=0;return function(){var r=vn(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(o,arguments)}}function Oi(t,e){var n=-1,r=t.length,i=r-1;for(e=e===o?r:e;++n<e;){var s=Wr(n,i),a=t[s];t[s]=t[n],t[n]=a}return t.length=e,t}var Mi,Ri,$i=(Mi=Ms((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,o){e.push(r?o.replace(ct,"$1"):n||t)})),e}),(function(t){return 500===Ri.size&&Ri.clear(),t})),Ri=Mi.cache,Mi);function Di(t){if("string"==typeof t||aa(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Bi(t){if(null!=t){try{return Ot.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Hi(t){if(t instanceof Un)return t.clone();var e=new Gn(t.__wrapped__,t.__chain__);return e.__actions__=Io(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Fi=qr((function(t,e){return Ys(t)?ur(t,gr(e,1,Ys,!0)):[]})),ki=qr((function(t,e){var n=zi(e);return Ys(n)&&(n=o),Ys(t)?ur(t,gr(e,1,Ys,!0),si(n,2)):[]})),Gi=qr((function(t,e){var n=zi(e);return Ys(n)&&(n=o),Ys(t)?ur(t,gr(e,1,Ys,!0),o,n):[]}));function Ui(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:da(n);return o<0&&(o=mn(r+o,0)),He(t,si(e,3),o)}function ji(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return n!==o&&(i=da(n),i=n<0?mn(r+i,0):yn(i,r-1)),He(t,si(e,3),i,!0)}function Vi(t){return null!=t&&t.length?gr(t,1):[]}function Wi(t){return t&&t.length?t[0]:o}var Yi=qr((function(t){var e=Pe(t,go);return e.length&&e[0]===t[0]?Ir(e):[]})),qi=qr((function(t){var e=zi(t),n=Pe(t,go);return e===zi(n)?e=o:n.pop(),n.length&&n[0]===t[0]?Ir(n,si(e,2)):[]})),Ki=qr((function(t){var e=zi(t),n=Pe(t,go);return(e="function"==typeof e?e:o)&&n.pop(),n.length&&n[0]===t[0]?Ir(n,o,e):[]}));function zi(t){var e=null==t?0:t.length;return e?t[e-1]:o}var Ji=qr(Qi);function Qi(t,e){return t&&t.length&&e&&e.length?jr(t,e):t}var Xi=ti((function(t,e){var n=null==t?0:t.length,r=or(t,e);return Vr(t,Pe(e,(function(t){return mi(t,n)?+t:t})).sort(_o)),r}));function Zi(t){return null==t?t:An.call(t)}var ts=qr((function(t){return ao(gr(t,1,Ys,!0))})),es=qr((function(t){var e=zi(t);return Ys(e)&&(e=o),ao(gr(t,1,Ys,!0),si(e,2))})),ns=qr((function(t){var e=zi(t);return e="function"==typeof e?e:o,ao(gr(t,1,Ys,!0),o,e)}));function rs(t){if(!t||!t.length)return[];var e=0;return t=Ne(t,(function(t){if(Ys(t))return e=mn(t.length,e),!0})),qe(e,(function(e){return Pe(t,je(e))}))}function os(t,e){if(!t||!t.length)return[];var n=rs(t);return null==e?n:Pe(n,(function(t){return Ee(e,o,t)}))}var is=qr((function(t,e){return Ys(t)?ur(t,e):[]})),ss=qr((function(t){return ho(Ne(t,Ys))})),as=qr((function(t){var e=zi(t);return Ys(e)&&(e=o),ho(Ne(t,Ys),si(e,2))})),ls=qr((function(t){var e=zi(t);return e="function"==typeof e?e:o,ho(Ne(t,Ys),o,e)})),us=qr(rs),cs=qr((function(t){var e=t.length,n=e>1?t[e-1]:o;return n="function"==typeof n?(t.pop(),n):o,os(t,n)}));function fs(t){var e=Hn(t);return e.__chain__=!0,e}function hs(t,e){return e(t)}var ds=ti((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return or(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Un&&mi(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:hs,args:[i],thisArg:o}),new Gn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(o),t}))):this.thru(i)})),ps=So((function(t,e,n){Mt.call(t,n)?++t[n]:rr(t,n,1)})),gs=Do(Ui),ms=Do(ji);function ys(t,e){return(js(t)?xe:cr)(t,si(e,3))}function vs(t,e){return(js(t)?Te:fr)(t,si(e,3))}var bs=So((function(t,e,n){Mt.call(t,n)?t[n].push(e):rr(t,n,[e])})),Cs=qr((function(t,e,n){var o=-1,i="function"==typeof e,s=Ws(t)?r(t.length):[];return cr(t,(function(t){s[++o]=i?Ee(e,t,n):Nr(t,e,n)})),s})),As=So((function(t,e,n){rr(t,n,e)}));function ws(t,e){return(js(t)?Pe:Dr)(t,si(e,3))}var Es=So((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),_s=qr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&yi(t,e[0],e[1])?e=[]:n>2&&yi(e[0],e[1],e[2])&&(e=[e[0]]),Gr(t,gr(e,1),[])})),xs=ue||function(){return fe.Date.now()};function Ts(t,e,n){return e=n?o:e,e=t&&null==e?t.length:e,zo(t,u,o,o,o,o,e)}function Is(t,e){var n;if("function"!=typeof e)throw new It(i);return t=da(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=o),n}}var Ns=qr((function(t,e,n){var r=1;if(n.length){var o=an(n,ii(Ns));r|=l}return zo(t,r,e,n,o)})),Ss=qr((function(t,e,n){var r=3;if(n.length){var o=an(n,ii(Ss));r|=l}return zo(e,r,t,n,o)}));function Ls(t,e,n){var r,s,a,l,u,c,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new It(i);function g(e){var n=r,i=s;return r=s=o,f=e,l=t.apply(i,n)}function m(t){var n=t-c;return c===o||n>=e||n<0||d&&t-f>=a}function y(){var t=xs();if(m(t))return v(t);u=Ni(y,function(t){var n=e-(t-c);return d?yn(n,a-(t-f)):n}(t))}function v(t){return u=o,p&&r?g(t):(r=s=o,l)}function b(){var t=xs(),n=m(t);if(r=arguments,s=this,c=t,n){if(u===o)return function(t){return f=t,u=Ni(y,e),h?g(t):l}(c);if(d)return Co(u),u=Ni(y,e),g(c)}return u===o&&(u=Ni(y,e)),l}return e=ga(e)||0,Zs(n)&&(h=!!n.leading,a=(d="maxWait"in n)?mn(ga(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),b.cancel=function(){u!==o&&Co(u),f=0,r=c=s=u=o},b.flush=function(){return u===o?l:v(xs())},b}var Ps=qr((function(t,e){return lr(t,1,e)})),Os=qr((function(t,e,n){return lr(t,ga(e)||0,n)}));function Ms(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new It(i);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Ms.Cache||Wn),n}function Rs(t){if("function"!=typeof t)throw new It(i);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ms.Cache=Wn;var $s=vo((function(t,e){var n=(e=1==e.length&&js(e[0])?Pe(e[0],ze(si())):Pe(gr(e,1),ze(si()))).length;return qr((function(r){for(var o=-1,i=yn(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return Ee(t,this,r)}))})),Ds=qr((function(t,e){var n=an(e,ii(Ds));return zo(t,l,o,e,n)})),Bs=qr((function(t,e){var n=an(e,ii(Bs));return zo(t,64,o,e,n)})),Hs=ti((function(t,e){return zo(t,256,o,o,o,e)}));function Fs(t,e){return t===e||t!=t&&e!=e}var ks=Vo(_r),Gs=Vo((function(t,e){return t>=e})),Us=Sr(function(){return arguments}())?Sr:function(t){return ta(t)&&Mt.call(t,"callee")&&!Yt.call(t,"callee")},js=r.isArray,Vs=ye?ze(ye):function(t){return ta(t)&&Er(t)==P};function Ws(t){return null!=t&&Xs(t.length)&&!Js(t)}function Ys(t){return ta(t)&&Ws(t)}var qs=me||gl,Ks=ve?ze(ve):function(t){return ta(t)&&Er(t)==v};function zs(t){if(!ta(t))return!1;var e=Er(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ra(t)}function Js(t){if(!Zs(t))return!1;var e=Er(t);return e==C||e==A||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Qs(t){return"number"==typeof t&&t==da(t)}function Xs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function Zs(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ta(t){return null!=t&&"object"==typeof t}var ea=be?ze(be):function(t){return ta(t)&&hi(t)==w};function na(t){return"number"==typeof t||ta(t)&&Er(t)==E}function ra(t){if(!ta(t)||Er(t)!=_)return!1;var e=Vt(t);if(null===e)return!0;var n=Mt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ot.call(n)==Bt}var oa=Ce?ze(Ce):function(t){return ta(t)&&Er(t)==T},ia=Ae?ze(Ae):function(t){return ta(t)&&hi(t)==I};function sa(t){return"string"==typeof t||!js(t)&&ta(t)&&Er(t)==N}function aa(t){return"symbol"==typeof t||ta(t)&&Er(t)==S}var la=we?ze(we):function(t){return ta(t)&&Xs(t.length)&&!!oe[Er(t)]},ua=Vo($r),ca=Vo((function(t,e){return t<=e}));function fa(t){if(!t)return[];if(Ws(t))return sa(t)?fn(t):Io(t);if(zt&&t[zt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[zt]());var e=hi(t);return(e==w?on:e==I?ln:Fa)(t)}function ha(t){return t?(t=ga(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function da(t){var e=ha(t),n=e%1;return e==e?n?e-n:e:0}function pa(t){return t?ir(da(t),0,d):0}function ga(t){if("number"==typeof t)return t;if(aa(t))return h;if(Zs(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Zs(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ke(t);var n=pt.test(t);return n||mt.test(t)?le(t.slice(2),n?2:8):dt.test(t)?h:+t}function ma(t){return No(t,Pa(t))}function ya(t){return null==t?"":so(t)}var va=Lo((function(t,e){if(Ai(e)||Ws(e))No(e,La(e),t);else for(var n in e)Mt.call(e,n)&&Zn(t,n,e[n])})),ba=Lo((function(t,e){No(e,Pa(e),t)})),Ca=Lo((function(t,e,n,r){No(e,Pa(e),t,r)})),Aa=Lo((function(t,e,n,r){No(e,La(e),t,r)})),wa=ti(or),Ea=qr((function(t,e){t=_t(t);var n=-1,r=e.length,i=r>2?e[2]:o;for(i&&yi(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],a=Pa(s),l=-1,u=a.length;++l<u;){var c=a[l],f=t[c];(f===o||Fs(f,Lt[c])&&!Mt.call(t,c))&&(t[c]=s[c])}return t})),_a=qr((function(t){return t.push(o,Qo),Ee(Ma,o,t)}));function xa(t,e,n){var r=null==t?o:Ar(t,e);return r===o?n:r}function Ta(t,e){return null!=t&&di(t,e,Tr)}var Ia=Fo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Dt.call(e)),t[e]=n}),Za(nl)),Na=Fo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Dt.call(e)),Mt.call(t,e)?t[e].push(n):t[e]=[n]}),si),Sa=qr(Nr);function La(t){return Ws(t)?Kn(t):Rr(t)}function Pa(t){return Ws(t)?Kn(t,!0):function(t){if(!Zs(t))return function(t){var e=[];if(null!=t)for(var n in _t(t))e.push(n);return e}(t);var e=Ai(t),n=[];for(var r in t)("constructor"!=r||!e&&Mt.call(t,r))&&n.push(r);return n}(t)}var Oa=Lo((function(t,e,n){Fr(t,e,n)})),Ma=Lo((function(t,e,n,r){Fr(t,e,n,r)})),Ra=ti((function(t,e){var n={};if(null==t)return n;var r=!1;e=Pe(e,(function(e){return e=yo(e,t),r||(r=e.length>1),e})),No(t,ni(t),n),r&&(n=sr(n,7,Xo));for(var o=e.length;o--;)lo(n,e[o]);return n})),$a=ti((function(t,e){return null==t?{}:function(t,e){return Ur(t,e,(function(e,n){return Ta(t,n)}))}(t,e)}));function Da(t,e){if(null==t)return{};var n=Pe(ni(t),(function(t){return[t]}));return e=si(e),Ur(t,n,(function(t,n){return e(t,n[0])}))}var Ba=Ko(La),Ha=Ko(Pa);function Fa(t){return null==t?[]:Je(t,La(t))}var ka=Ro((function(t,e,n){return e=e.toLowerCase(),t+(n?Ga(e):e)}));function Ga(t){return za(ya(t).toLowerCase())}function Ua(t){return(t=ya(t))&&t.replace(vt,tn).replace(Qt,"")}var ja=Ro((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Va=Ro((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Wa=Mo("toLowerCase"),Ya=Ro((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),qa=Ro((function(t,e,n){return t+(n?" ":"")+za(e)})),Ka=Ro((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),za=Mo("toUpperCase");function Ja(t,e,n){return t=ya(t),(e=n?o:e)===o?function(t){return ee.test(t)}(t)?function(t){return t.match(Zt)||[]}(t):function(t){return t.match(lt)||[]}(t):t.match(e)||[]}var Qa=qr((function(t,e){try{return Ee(t,o,e)}catch(t){return zs(t)?t:new At(t)}})),Xa=ti((function(t,e){return xe(e,(function(e){e=Di(e),rr(t,e,Ns(t[e],t))})),t}));function Za(t){return function(){return t}}var tl=Bo(),el=Bo(!0);function nl(t){return t}function rl(t){return Mr("function"==typeof t?t:sr(t,1))}var ol=qr((function(t,e){return function(n){return Nr(n,t,e)}})),il=qr((function(t,e){return function(n){return Nr(t,n,e)}}));function sl(t,e,n){var r=La(e),o=Cr(e,r);null!=n||Zs(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=Cr(e,La(e)));var i=!(Zs(n)&&"chain"in n&&!n.chain),s=Js(t);return xe(o,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__);return(n.__actions__=Io(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Oe([this.value()],arguments))})})),t}function al(){}var ll=Go(Pe),ul=Go(Ie),cl=Go($e);function fl(t){return vi(t)?je(Di(t)):function(t){return function(e){return Ar(e,t)}}(t)}var hl=jo(),dl=jo(!0);function pl(){return[]}function gl(){return!1}var ml,yl=ko((function(t,e){return t+e}),0),vl=Yo("ceil"),bl=ko((function(t,e){return t/e}),1),Cl=Yo("floor"),Al=ko((function(t,e){return t*e}),1),wl=Yo("round"),El=ko((function(t,e){return t-e}),0);return Hn.after=function(t,e){if("function"!=typeof e)throw new It(i);return t=da(t),function(){if(--t<1)return e.apply(this,arguments)}},Hn.ary=Ts,Hn.assign=va,Hn.assignIn=ba,Hn.assignInWith=Ca,Hn.assignWith=Aa,Hn.at=wa,Hn.before=Is,Hn.bind=Ns,Hn.bindAll=Xa,Hn.bindKey=Ss,Hn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return js(t)?t:[t]},Hn.chain=fs,Hn.chunk=function(t,e,n){e=(n?yi(t,e,n):e===o)?1:mn(da(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var s=0,a=0,l=r(he(i/e));s<i;)l[a++]=to(t,s,s+=e);return l},Hn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},Hn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],o=t;o--;)e[o-1]=arguments[o];return Oe(js(n)?Io(n):[n],gr(e,1))},Hn.cond=function(t){var e=null==t?0:t.length,n=si();return t=e?Pe(t,(function(t){if("function"!=typeof t[1])throw new It(i);return[n(t[0]),t[1]]})):[],qr((function(n){for(var r=-1;++r<e;){var o=t[r];if(Ee(o[0],this,n))return Ee(o[1],this,n)}}))},Hn.conforms=function(t){return function(t){var e=La(t);return function(n){return ar(n,t,e)}}(sr(t,1))},Hn.constant=Za,Hn.countBy=ps,Hn.create=function(t,e){var n=Fn(t);return null==e?n:nr(n,e)},Hn.curry=function t(e,n,r){var i=zo(e,8,o,o,o,o,o,n=r?o:n);return i.placeholder=t.placeholder,i},Hn.curryRight=function t(e,n,r){var i=zo(e,16,o,o,o,o,o,n=r?o:n);return i.placeholder=t.placeholder,i},Hn.debounce=Ls,Hn.defaults=Ea,Hn.defaultsDeep=_a,Hn.defer=Ps,Hn.delay=Os,Hn.difference=Fi,Hn.differenceBy=ki,Hn.differenceWith=Gi,Hn.drop=function(t,e,n){var r=null==t?0:t.length;return r?to(t,(e=n||e===o?1:da(e))<0?0:e,r):[]},Hn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?to(t,0,(e=r-(e=n||e===o?1:da(e)))<0?0:e):[]},Hn.dropRightWhile=function(t,e){return t&&t.length?co(t,si(e,3),!0,!0):[]},Hn.dropWhile=function(t,e){return t&&t.length?co(t,si(e,3),!0):[]},Hn.fill=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&yi(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=da(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:da(r))<0&&(r+=i),r=n>r?0:pa(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Hn.filter=function(t,e){return(js(t)?Ne:pr)(t,si(e,3))},Hn.flatMap=function(t,e){return gr(ws(t,e),1)},Hn.flatMapDeep=function(t,e){return gr(ws(t,e),c)},Hn.flatMapDepth=function(t,e,n){return n=n===o?1:da(n),gr(ws(t,e),n)},Hn.flatten=Vi,Hn.flattenDeep=function(t){return null!=t&&t.length?gr(t,c):[]},Hn.flattenDepth=function(t,e){return null!=t&&t.length?gr(t,e=e===o?1:da(e)):[]},Hn.flip=function(t){return zo(t,512)},Hn.flow=tl,Hn.flowRight=el,Hn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},Hn.functions=function(t){return null==t?[]:Cr(t,La(t))},Hn.functionsIn=function(t){return null==t?[]:Cr(t,Pa(t))},Hn.groupBy=bs,Hn.initial=function(t){return null!=t&&t.length?to(t,0,-1):[]},Hn.intersection=Yi,Hn.intersectionBy=qi,Hn.intersectionWith=Ki,Hn.invert=Ia,Hn.invertBy=Na,Hn.invokeMap=Cs,Hn.iteratee=rl,Hn.keyBy=As,Hn.keys=La,Hn.keysIn=Pa,Hn.map=ws,Hn.mapKeys=function(t,e){var n={};return e=si(e,3),vr(t,(function(t,r,o){rr(n,e(t,r,o),t)})),n},Hn.mapValues=function(t,e){var n={};return e=si(e,3),vr(t,(function(t,r,o){rr(n,r,e(t,r,o))})),n},Hn.matches=function(t){return Br(sr(t,1))},Hn.matchesProperty=function(t,e){return Hr(t,sr(e,1))},Hn.memoize=Ms,Hn.merge=Oa,Hn.mergeWith=Ma,Hn.method=ol,Hn.methodOf=il,Hn.mixin=sl,Hn.negate=Rs,Hn.nthArg=function(t){return t=da(t),qr((function(e){return kr(e,t)}))},Hn.omit=Ra,Hn.omitBy=function(t,e){return Da(t,Rs(si(e)))},Hn.once=function(t){return Is(2,t)},Hn.orderBy=function(t,e,n,r){return null==t?[]:(js(e)||(e=null==e?[]:[e]),js(n=r?o:n)||(n=null==n?[]:[n]),Gr(t,e,n))},Hn.over=ll,Hn.overArgs=$s,Hn.overEvery=ul,Hn.overSome=cl,Hn.partial=Ds,Hn.partialRight=Bs,Hn.partition=Es,Hn.pick=$a,Hn.pickBy=Da,Hn.property=fl,Hn.propertyOf=function(t){return function(e){return null==t?o:Ar(t,e)}},Hn.pull=Ji,Hn.pullAll=Qi,Hn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?jr(t,e,si(n,2)):t},Hn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?jr(t,e,o,n):t},Hn.pullAt=Xi,Hn.range=hl,Hn.rangeRight=dl,Hn.rearg=Hs,Hn.reject=function(t,e){return(js(t)?Ne:pr)(t,Rs(si(e,3)))},Hn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=si(e,3);++r<i;){var s=t[r];e(s,r,t)&&(n.push(s),o.push(r))}return Vr(t,o),n},Hn.rest=function(t,e){if("function"!=typeof t)throw new It(i);return qr(t,e=e===o?e:da(e))},Hn.reverse=Zi,Hn.sampleSize=function(t,e,n){return e=(n?yi(t,e,n):e===o)?1:da(e),(js(t)?Jn:zr)(t,e)},Hn.set=function(t,e,n){return null==t?t:Jr(t,e,n)},Hn.setWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:Jr(t,e,n,r)},Hn.shuffle=function(t){return(js(t)?Qn:Zr)(t)},Hn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&yi(t,e,n)?(e=0,n=r):(e=null==e?0:da(e),n=n===o?r:da(n)),to(t,e,n)):[]},Hn.sortBy=_s,Hn.sortedUniq=function(t){return t&&t.length?oo(t):[]},Hn.sortedUniqBy=function(t,e){return t&&t.length?oo(t,si(e,2)):[]},Hn.split=function(t,e,n){return n&&"number"!=typeof n&&yi(t,e,n)&&(e=n=o),(n=n===o?d:n>>>0)?(t=ya(t))&&("string"==typeof e||null!=e&&!oa(e))&&!(e=so(e))&&rn(t)?bo(fn(t),0,n):t.split(e,n):[]},Hn.spread=function(t,e){if("function"!=typeof t)throw new It(i);return e=null==e?0:mn(da(e),0),qr((function(n){var r=n[e],o=bo(n,0,e);return r&&Oe(o,r),Ee(t,this,o)}))},Hn.tail=function(t){var e=null==t?0:t.length;return e?to(t,1,e):[]},Hn.take=function(t,e,n){return t&&t.length?to(t,0,(e=n||e===o?1:da(e))<0?0:e):[]},Hn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?to(t,(e=r-(e=n||e===o?1:da(e)))<0?0:e,r):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?co(t,si(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?co(t,si(e,3)):[]},Hn.tap=function(t,e){return e(t),t},Hn.throttle=function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new It(i);return Zs(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Ls(t,e,{leading:r,maxWait:e,trailing:o})},Hn.thru=hs,Hn.toArray=fa,Hn.toPairs=Ba,Hn.toPairsIn=Ha,Hn.toPath=function(t){return js(t)?Pe(t,Di):aa(t)?[t]:Io($i(ya(t)))},Hn.toPlainObject=ma,Hn.transform=function(t,e,n){var r=js(t),o=r||qs(t)||la(t);if(e=si(e,4),null==n){var i=t&&t.constructor;n=o?r?new i:[]:Zs(t)&&Js(i)?Fn(Vt(t)):{}}return(o?xe:vr)(t,(function(t,r,o){return e(n,t,r,o)})),n},Hn.unary=function(t){return Ts(t,1)},Hn.union=ts,Hn.unionBy=es,Hn.unionWith=ns,Hn.uniq=function(t){return t&&t.length?ao(t):[]},Hn.uniqBy=function(t,e){return t&&t.length?ao(t,si(e,2)):[]},Hn.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?ao(t,o,e):[]},Hn.unset=function(t,e){return null==t||lo(t,e)},Hn.unzip=rs,Hn.unzipWith=os,Hn.update=function(t,e,n){return null==t?t:uo(t,e,mo(n))},Hn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:uo(t,e,mo(n),r)},Hn.values=Fa,Hn.valuesIn=function(t){return null==t?[]:Je(t,Pa(t))},Hn.without=is,Hn.words=Ja,Hn.wrap=function(t,e){return Ds(mo(e),t)},Hn.xor=ss,Hn.xorBy=as,Hn.xorWith=ls,Hn.zip=us,Hn.zipObject=function(t,e){return po(t||[],e||[],Zn)},Hn.zipObjectDeep=function(t,e){return po(t||[],e||[],Jr)},Hn.zipWith=cs,Hn.entries=Ba,Hn.entriesIn=Ha,Hn.extend=ba,Hn.extendWith=Ca,sl(Hn,Hn),Hn.add=yl,Hn.attempt=Qa,Hn.camelCase=ka,Hn.capitalize=Ga,Hn.ceil=vl,Hn.clamp=function(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=(n=ga(n))==n?n:0),e!==o&&(e=(e=ga(e))==e?e:0),ir(ga(t),e,n)},Hn.clone=function(t){return sr(t,4)},Hn.cloneDeep=function(t){return sr(t,5)},Hn.cloneDeepWith=function(t,e){return sr(t,5,e="function"==typeof e?e:o)},Hn.cloneWith=function(t,e){return sr(t,4,e="function"==typeof e?e:o)},Hn.conformsTo=function(t,e){return null==e||ar(t,e,La(e))},Hn.deburr=Ua,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=bl,Hn.endsWith=function(t,e,n){t=ya(t),e=so(e);var r=t.length,i=n=n===o?r:ir(da(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},Hn.eq=Fs,Hn.escape=function(t){return(t=ya(t))&&K.test(t)?t.replace(Y,en):t},Hn.escapeRegExp=function(t){return(t=ya(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Hn.every=function(t,e,n){var r=js(t)?Ie:hr;return n&&yi(t,e,n)&&(e=o),r(t,si(e,3))},Hn.find=gs,Hn.findIndex=Ui,Hn.findKey=function(t,e){return Be(t,si(e,3),vr)},Hn.findLast=ms,Hn.findLastIndex=ji,Hn.findLastKey=function(t,e){return Be(t,si(e,3),br)},Hn.floor=Cl,Hn.forEach=ys,Hn.forEachRight=vs,Hn.forIn=function(t,e){return null==t?t:mr(t,si(e,3),Pa)},Hn.forInRight=function(t,e){return null==t?t:yr(t,si(e,3),Pa)},Hn.forOwn=function(t,e){return t&&vr(t,si(e,3))},Hn.forOwnRight=function(t,e){return t&&br(t,si(e,3))},Hn.get=xa,Hn.gt=ks,Hn.gte=Gs,Hn.has=function(t,e){return null!=t&&di(t,e,xr)},Hn.hasIn=Ta,Hn.head=Wi,Hn.identity=nl,Hn.includes=function(t,e,n,r){t=Ws(t)?t:Fa(t),n=n&&!r?da(n):0;var o=t.length;return n<0&&(n=mn(o+n,0)),sa(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&Fe(t,e,n)>-1},Hn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:da(n);return o<0&&(o=mn(r+o,0)),Fe(t,e,o)},Hn.inRange=function(t,e,n){return e=ha(e),n===o?(n=e,e=0):n=ha(n),function(t,e,n){return t>=yn(e,n)&&t<mn(e,n)}(t=ga(t),e,n)},Hn.invoke=Sa,Hn.isArguments=Us,Hn.isArray=js,Hn.isArrayBuffer=Vs,Hn.isArrayLike=Ws,Hn.isArrayLikeObject=Ys,Hn.isBoolean=function(t){return!0===t||!1===t||ta(t)&&Er(t)==y},Hn.isBuffer=qs,Hn.isDate=Ks,Hn.isElement=function(t){return ta(t)&&1===t.nodeType&&!ra(t)},Hn.isEmpty=function(t){if(null==t)return!0;if(Ws(t)&&(js(t)||"string"==typeof t||"function"==typeof t.splice||qs(t)||la(t)||Us(t)))return!t.length;var e=hi(t);if(e==w||e==I)return!t.size;if(Ai(t))return!Rr(t).length;for(var n in t)if(Mt.call(t,n))return!1;return!0},Hn.isEqual=function(t,e){return Lr(t,e)},Hn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:o)?n(t,e):o;return r===o?Lr(t,e,o,n):!!r},Hn.isError=zs,Hn.isFinite=function(t){return"number"==typeof t&&De(t)},Hn.isFunction=Js,Hn.isInteger=Qs,Hn.isLength=Xs,Hn.isMap=ea,Hn.isMatch=function(t,e){return t===e||Pr(t,e,li(e))},Hn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:o,Pr(t,e,li(e),n)},Hn.isNaN=function(t){return na(t)&&t!=+t},Hn.isNative=function(t){if(Ci(t))throw new At("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Or(t)},Hn.isNil=function(t){return null==t},Hn.isNull=function(t){return null===t},Hn.isNumber=na,Hn.isObject=Zs,Hn.isObjectLike=ta,Hn.isPlainObject=ra,Hn.isRegExp=oa,Hn.isSafeInteger=function(t){return Qs(t)&&t>=-9007199254740991&&t<=f},Hn.isSet=ia,Hn.isString=sa,Hn.isSymbol=aa,Hn.isTypedArray=la,Hn.isUndefined=function(t){return t===o},Hn.isWeakMap=function(t){return ta(t)&&hi(t)==L},Hn.isWeakSet=function(t){return ta(t)&&"[object WeakSet]"==Er(t)},Hn.join=function(t,e){return null==t?"":Ve.call(t,e)},Hn.kebabCase=ja,Hn.last=zi,Hn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=da(n))<0?mn(r+i,0):yn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):He(t,Ge,i,!0)},Hn.lowerCase=Va,Hn.lowerFirst=Wa,Hn.lt=ua,Hn.lte=ca,Hn.max=function(t){return t&&t.length?dr(t,nl,_r):o},Hn.maxBy=function(t,e){return t&&t.length?dr(t,si(e,2),_r):o},Hn.mean=function(t){return Ue(t,nl)},Hn.meanBy=function(t,e){return Ue(t,si(e,2))},Hn.min=function(t){return t&&t.length?dr(t,nl,$r):o},Hn.minBy=function(t,e){return t&&t.length?dr(t,si(e,2),$r):o},Hn.stubArray=pl,Hn.stubFalse=gl,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=Al,Hn.nth=function(t,e){return t&&t.length?kr(t,da(e)):o},Hn.noConflict=function(){return fe._===this&&(fe._=Ht),this},Hn.noop=al,Hn.now=xs,Hn.pad=function(t,e,n){t=ya(t);var r=(e=da(e))?cn(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return Uo(de(o),n)+t+Uo(he(o),n)},Hn.padEnd=function(t,e,n){t=ya(t);var r=(e=da(e))?cn(t):0;return e&&r<e?t+Uo(e-r,n):t},Hn.padStart=function(t,e,n){t=ya(t);var r=(e=da(e))?cn(t):0;return e&&r<e?Uo(e-r,n)+t:t},Hn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),bn(ya(t).replace(rt,""),e||0)},Hn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&yi(t,e,n)&&(e=n=o),n===o&&("boolean"==typeof e?(n=e,e=o):"boolean"==typeof t&&(n=t,t=o)),t===o&&e===o?(t=0,e=1):(t=ha(t),e===o?(e=t,t=0):e=ha(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Cn();return yn(t+i*(e-t+ae("1e-"+((i+"").length-1))),e)}return Wr(t,e)},Hn.reduce=function(t,e,n){var r=js(t)?Me:We,o=arguments.length<3;return r(t,si(e,4),n,o,cr)},Hn.reduceRight=function(t,e,n){var r=js(t)?Re:We,o=arguments.length<3;return r(t,si(e,4),n,o,fr)},Hn.repeat=function(t,e,n){return e=(n?yi(t,e,n):e===o)?1:da(e),Yr(ya(t),e)},Hn.replace=function(){var t=arguments,e=ya(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(t,e,n){var r=-1,i=(e=yo(e,t)).length;for(i||(i=1,t=o);++r<i;){var s=null==t?o:t[Di(e[r])];s===o&&(r=i,s=n),t=Js(s)?s.call(t):s}return t},Hn.round=wl,Hn.runInContext=t,Hn.sample=function(t){return(js(t)?zn:Kr)(t)},Hn.size=function(t){if(null==t)return 0;if(Ws(t))return sa(t)?cn(t):t.length;var e=hi(t);return e==w||e==I?t.size:Rr(t).length},Hn.snakeCase=Ya,Hn.some=function(t,e,n){var r=js(t)?$e:eo;return n&&yi(t,e,n)&&(e=o),r(t,si(e,3))},Hn.sortedIndex=function(t,e){return no(t,e)},Hn.sortedIndexBy=function(t,e,n){return ro(t,e,si(n,2))},Hn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=no(t,e);if(r<n&&Fs(t[r],e))return r}return-1},Hn.sortedLastIndex=function(t,e){return no(t,e,!0)},Hn.sortedLastIndexBy=function(t,e,n){return ro(t,e,si(n,2),!0)},Hn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=no(t,e,!0)-1;if(Fs(t[n],e))return n}return-1},Hn.startCase=qa,Hn.startsWith=function(t,e,n){return t=ya(t),n=null==n?0:ir(da(n),0,t.length),e=so(e),t.slice(n,n+e.length)==e},Hn.subtract=El,Hn.sum=function(t){return t&&t.length?Ye(t,nl):0},Hn.sumBy=function(t,e){return t&&t.length?Ye(t,si(e,2)):0},Hn.template=function(t,e,n){var r=Hn.templateSettings;n&&yi(t,e,n)&&(e=o),t=ya(t),e=Ca({},e,r,Jo);var i,s,a=Ca({},e.imports,r.imports,Jo),l=La(a),u=Je(a,l),c=0,f=e.interpolate||bt,h="__p += '",d=xt((e.escape||bt).source+"|"+f.source+"|"+(f===Q?ft:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(Mt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++re+"]")+"\n";t.replace(d,(function(e,n,r,o,a,l){return r||(r=o),h+=t.slice(c,l).replace(Ct,nn),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=l+e.length,e})),h+="';\n";var g=Mt.call(e,"variable")&&e.variable;if(g){if(ut.test(g))throw new At("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(U,""):h).replace(j,"$1").replace(V,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Qa((function(){return wt(l,p+"return "+h).apply(o,u)}));if(m.source=h,zs(m))throw m;return m},Hn.times=function(t,e){if((t=da(t))<1||t>f)return[];var n=d,r=yn(t,d);e=si(e),t-=d;for(var o=qe(r,e);++n<t;)e(n);return o},Hn.toFinite=ha,Hn.toInteger=da,Hn.toLength=pa,Hn.toLower=function(t){return ya(t).toLowerCase()},Hn.toNumber=ga,Hn.toSafeInteger=function(t){return t?ir(da(t),-9007199254740991,f):0===t?t:0},Hn.toString=ya,Hn.toUpper=function(t){return ya(t).toUpperCase()},Hn.trim=function(t,e,n){if((t=ya(t))&&(n||e===o))return Ke(t);if(!t||!(e=so(e)))return t;var r=fn(t),i=fn(e);return bo(r,Xe(r,i),Ze(r,i)+1).join("")},Hn.trimEnd=function(t,e,n){if((t=ya(t))&&(n||e===o))return t.slice(0,hn(t)+1);if(!t||!(e=so(e)))return t;var r=fn(t);return bo(r,0,Ze(r,fn(e))+1).join("")},Hn.trimStart=function(t,e,n){if((t=ya(t))&&(n||e===o))return t.replace(rt,"");if(!t||!(e=so(e)))return t;var r=fn(t);return bo(r,Xe(r,fn(e))).join("")},Hn.truncate=function(t,e){var n=30,r="...";if(Zs(e)){var i="separator"in e?e.separator:i;n="length"in e?da(e.length):n,r="omission"in e?so(e.omission):r}var s=(t=ya(t)).length;if(rn(t)){var a=fn(t);s=a.length}if(n>=s)return t;var l=n-cn(r);if(l<1)return r;var u=a?bo(a,0,l).join(""):t.slice(0,l);if(i===o)return u+r;if(a&&(l+=u.length-l),oa(i)){if(t.slice(l).search(i)){var c,f=u;for(i.global||(i=xt(i.source,ya(ht.exec(i))+"g")),i.lastIndex=0;c=i.exec(f);)var h=c.index;u=u.slice(0,h===o?l:h)}}else if(t.indexOf(so(i),l)!=l){var d=u.lastIndexOf(i);d>-1&&(u=u.slice(0,d))}return u+r},Hn.unescape=function(t){return(t=ya(t))&&q.test(t)?t.replace(W,dn):t},Hn.uniqueId=function(t){var e=++Rt;return ya(t)+e},Hn.upperCase=Ka,Hn.upperFirst=za,Hn.each=ys,Hn.eachRight=vs,Hn.first=Wi,sl(Hn,(ml={},vr(Hn,(function(t,e){Mt.call(Hn.prototype,e)||(ml[e]=t)})),ml),{chain:!1}),Hn.VERSION="4.17.21",xe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hn[t].placeholder=Hn})),xe(["drop","take"],(function(t,e){Un.prototype[t]=function(n){n=n===o?1:mn(da(n),0);var r=this.__filtered__&&!e?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Un.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),xe(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Un.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:si(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),xe(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Un.prototype[t]=function(){return this[n](1).value()[0]}})),xe(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Un.prototype[t]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(nl)},Un.prototype.find=function(t){return this.filter(t).head()},Un.prototype.findLast=function(t){return this.reverse().find(t)},Un.prototype.invokeMap=qr((function(t,e){return"function"==typeof t?new Un(this):this.map((function(n){return Nr(n,t,e)}))})),Un.prototype.reject=function(t){return this.filter(Rs(si(t)))},Un.prototype.slice=function(t,e){t=da(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Un(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==o&&(n=(e=da(e))<0?n.dropRight(-e):n.take(e-t)),n)},Un.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Un.prototype.toArray=function(){return this.take(d)},vr(Un.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=Hn[r?"take"+("last"==e?"Right":""):e],s=r||/^find/.test(e);i&&(Hn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,l=e instanceof Un,u=a[0],c=l||js(e),f=function(t){var e=i.apply(Hn,Oe([t],a));return r&&h?e[0]:e};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,g=l&&!d;if(!s&&c){e=g?e:new Un(this);var m=t.apply(e,a);return m.__actions__.push({func:hs,args:[f],thisArg:o}),new Gn(m,h)}return p&&g?t.apply(this,a):(m=this.thru(f),p?r?m.value()[0]:m.value():m)})})),xe(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Nt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Hn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(js(o)?o:[],t)}return this[n]((function(n){return e.apply(js(n)?n:[],t)}))}})),vr(Un.prototype,(function(t,e){var n=Hn[e];if(n){var r=n.name+"";Mt.call(Sn,r)||(Sn[r]=[]),Sn[r].push({name:e,func:n})}})),Sn[Ho(o,2).name]=[{name:"wrapper",func:o}],Un.prototype.clone=function(){var t=new Un(this.__wrapped__);return t.__actions__=Io(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Io(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Io(this.__views__),t},Un.prototype.reverse=function(){if(this.__filtered__){var t=new Un(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Un.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=js(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],s=i.size;switch(i.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=yn(e,t+s);break;case"takeRight":t=mn(t,e-s)}}return{start:t,end:e}}(0,o,this.__views__),s=i.start,a=i.end,l=a-s,u=r?a:s-1,c=this.__iteratees__,f=c.length,h=0,d=yn(l,this.__takeCount__);if(!n||!r&&o==l&&d==l)return fo(t,this.__actions__);var p=[];t:for(;l--&&h<d;){for(var g=-1,m=t[u+=e];++g<f;){var y=c[g],v=y.iteratee,b=y.type,C=v(m);if(2==b)m=C;else if(!C){if(1==b)continue t;break t}}p[h++]=m}return p},Hn.prototype.at=ds,Hn.prototype.chain=function(){return fs(this)},Hn.prototype.commit=function(){return new Gn(this.value(),this.__chain__)},Hn.prototype.next=function(){this.__values__===o&&(this.__values__=fa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},Hn.prototype.plant=function(t){for(var e,n=this;n instanceof kn;){var r=Hi(n);r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},Hn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Un){var e=t;return this.__actions__.length&&(e=new Un(this)),(e=e.reverse()).__actions__.push({func:hs,args:[Zi],thisArg:o}),new Gn(e,this.__chain__)}return this.thru(Zi)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return fo(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,zt&&(Hn.prototype[zt]=function(){return this}),Hn}();fe._=pn,(r=function(){return pn}.call(e,n,e,t))===o||(t.exports=r)}.call(this)},4802:t=>{t.exports=function t(e,n,r){function o(s,a){if(!n[s]){if(!e[s]){if(i)return i(s,!0);throw new Error("Cannot find module '"+s+"'")}a=n[s]={exports:{}},e[s][0].call(a.exports,(function(t){return o(e[s][1][t]||t)}),a,a.exports,t,e,n,r)}return n[s].exports}for(var i=void 0,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(t,e,n){(function(r,o,i,s,a,l,u,c,f){"use strict";var h=t("crypto");function d(t,e){var n;return void 0===(n="passthrough"!==(e=m(t,e)).algorithm?h.createHash(e.algorithm):new b).write&&(n.write=n.update,n.end=n.update),v(e,n).dispatch(t),n.update||n.end(""),n.digest?n.digest("buffer"===e.encoding?void 0:e.encoding):(t=n.read(),"buffer"!==e.encoding?t.toString(e.encoding):t)}(n=e.exports=d).sha1=function(t){return d(t)},n.keys=function(t){return d(t,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},n.MD5=function(t){return d(t,{algorithm:"md5",encoding:"hex"})},n.keysMD5=function(t){return d(t,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var p=h.getHashes?h.getHashes().slice():["sha1","md5"],g=(p.push("passthrough"),["buffer","hex","binary","base64"]);function m(t,e){var n={};if(n.algorithm=(e=e||{}).algorithm||"sha1",n.encoding=e.encoding||"hex",n.excludeValues=!!e.excludeValues,n.algorithm=n.algorithm.toLowerCase(),n.encoding=n.encoding.toLowerCase(),n.ignoreUnknown=!0===e.ignoreUnknown,n.respectType=!1!==e.respectType,n.respectFunctionNames=!1!==e.respectFunctionNames,n.respectFunctionProperties=!1!==e.respectFunctionProperties,n.unorderedArrays=!0===e.unorderedArrays,n.unorderedSets=!1!==e.unorderedSets,n.unorderedObjects=!1!==e.unorderedObjects,n.replacer=e.replacer||void 0,n.excludeKeys=e.excludeKeys||void 0,void 0===t)throw new Error("Object argument required.");for(var r=0;r<p.length;++r)p[r].toLowerCase()===n.algorithm.toLowerCase()&&(n.algorithm=p[r]);if(-1===p.indexOf(n.algorithm))throw new Error('Algorithm "'+n.algorithm+'" not supported. supported values: '+p.join(", "));if(-1===g.indexOf(n.encoding)&&"passthrough"!==n.algorithm)throw new Error('Encoding "'+n.encoding+'" not supported. supported values: '+g.join(", "));return n}function y(t){if("function"==typeof t)return null!=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(t))}function v(t,e,n){function r(t){return e.update?e.update(t,"utf8"):e.write(t,"utf8")}return n=n||[],{dispatch:function(e){return this["_"+(null===(e=t.replacer?t.replacer(e):e)?"null":typeof e)](e)},_object:function(e){var o,s=Object.prototype.toString.call(e),a=/\[object (.*)\]/i.exec(s);if(a=(a=a?a[1]:"unknown:["+s+"]").toLowerCase(),0<=(s=n.indexOf(e)))return this.dispatch("[CIRCULAR:"+s+"]");if(n.push(e),void 0!==i&&i.isBuffer&&i.isBuffer(e))return r("buffer:"),r(e);if("object"===a||"function"===a||"asyncfunction"===a)return s=Object.keys(e),t.unorderedObjects&&(s=s.sort()),!1===t.respectType||y(e)||s.splice(0,0,"prototype","__proto__","constructor"),t.excludeKeys&&(s=s.filter((function(e){return!t.excludeKeys(e)}))),r("object:"+s.length+":"),o=this,s.forEach((function(n){o.dispatch(n),r(":"),t.excludeValues||o.dispatch(e[n]),r(",")}));if(!this["_"+a]){if(t.ignoreUnknown)return r("["+a+"]");throw new Error('Unknown object type "'+a+'"')}this["_"+a](e)},_array:function(e,o){o=void 0!==o?o:!1!==t.unorderedArrays;var i=this;if(r("array:"+e.length+":"),!o||e.length<=1)return e.forEach((function(t){return i.dispatch(t)}));var s=[];return o=e.map((function(e){var r=new b,o=n.slice();return v(t,r,o).dispatch(e),s=s.concat(o.slice(n.length)),r.read().toString()})),n=n.concat(s),o.sort(),this._array(o,!1)},_date:function(t){return r("date:"+t.toJSON())},_symbol:function(t){return r("symbol:"+t.toString())},_error:function(t){return r("error:"+t.toString())},_boolean:function(t){return r("bool:"+t.toString())},_string:function(t){r("string:"+t.length+":"),r(t.toString())},_function:function(e){r("fn:"),y(e)?this.dispatch("[native]"):this.dispatch(e.toString()),!1!==t.respectFunctionNames&&this.dispatch("function-name:"+String(e.name)),t.respectFunctionProperties&&this._object(e)},_number:function(t){return r("number:"+t.toString())},_xml:function(t){return r("xml:"+t.toString())},_null:function(){return r("Null")},_undefined:function(){return r("Undefined")},_regexp:function(t){return r("regex:"+t.toString())},_uint8array:function(t){return r("uint8array:"),this.dispatch(Array.prototype.slice.call(t))},_uint8clampedarray:function(t){return r("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(t))},_int8array:function(t){return r("int8array:"),this.dispatch(Array.prototype.slice.call(t))},_uint16array:function(t){return r("uint16array:"),this.dispatch(Array.prototype.slice.call(t))},_int16array:function(t){return r("int16array:"),this.dispatch(Array.prototype.slice.call(t))},_uint32array:function(t){return r("uint32array:"),this.dispatch(Array.prototype.slice.call(t))},_int32array:function(t){return r("int32array:"),this.dispatch(Array.prototype.slice.call(t))},_float32array:function(t){return r("float32array:"),this.dispatch(Array.prototype.slice.call(t))},_float64array:function(t){return r("float64array:"),this.dispatch(Array.prototype.slice.call(t))},_arraybuffer:function(t){return r("arraybuffer:"),this.dispatch(new Uint8Array(t))},_url:function(t){return r("url:"+t.toString())},_map:function(e){return r("map:"),e=Array.from(e),this._array(e,!1!==t.unorderedSets)},_set:function(e){return r("set:"),e=Array.from(e),this._array(e,!1!==t.unorderedSets)},_file:function(t){return r("file:"),this.dispatch([t.name,t.size,t.type,t.lastModfied])},_blob:function(){if(t.ignoreUnknown)return r("[blob]");throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n')},_domwindow:function(){return r("domwindow")},_bigint:function(t){return r("bigint:"+t.toString())},_process:function(){return r("process")},_timer:function(){return r("timer")},_pipe:function(){return r("pipe")},_tcp:function(){return r("tcp")},_udp:function(){return r("udp")},_tty:function(){return r("tty")},_statwatcher:function(){return r("statwatcher")},_securecontext:function(){return r("securecontext")},_connection:function(){return r("connection")},_zlib:function(){return r("zlib")},_context:function(){return r("context")},_nodescript:function(){return r("nodescript")},_httpparser:function(){return r("httpparser")},_dataview:function(){return r("dataview")},_signal:function(){return r("signal")},_fsevent:function(){return r("fsevent")},_tlswrap:function(){return r("tlswrap")}}}function b(){return{buf:"",write:function(t){this.buf+=t},end:function(t){this.buf+=t},read:function(){return this.buf}}}n.writeToStream=function(t,e,n){return void 0===n&&(n=e,e={}),v(e=m(t,e),n).dispatch(t)}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(t,e,n){(function(t,e,r,o,i,s,a,l,u){!function(t){"use strict";var e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="+".charCodeAt(0),r="/".charCodeAt(0),o="0".charCodeAt(0),i="a".charCodeAt(0),s="A".charCodeAt(0),a="-".charCodeAt(0),l="_".charCodeAt(0);function u(t){return(t=t.charCodeAt(0))===n||t===a?62:t===r||t===l?63:t<o?-1:t<o+10?t-o+26+26:t<s+26?t-s:t<i+26?t-i+26:void 0}t.toByteArray=function(t){var n,r;if(0<t.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var o=t.length,i=(o="="===t.charAt(o-2)?2:"="===t.charAt(o-1)?1:0,new e(3*t.length/4-o)),s=0<o?t.length-4:t.length,a=0;function l(t){i[a++]=t}for(n=0;n<s;n+=4,0)l((16711680&(r=u(t.charAt(n))<<18|u(t.charAt(n+1))<<12|u(t.charAt(n+2))<<6|u(t.charAt(n+3))))>>16),l((65280&r)>>8),l(255&r);return 2==o?l(255&(r=u(t.charAt(n))<<2|u(t.charAt(n+1))>>4)):1==o&&(l((r=u(t.charAt(n))<<10|u(t.charAt(n+1))<<4|u(t.charAt(n+2))>>2)>>8&255),l(255&r)),i},t.fromByteArray=function(t){var e,n,r,o,i=t.length%3,s="";function a(t){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)}for(e=0,r=t.length-i;e<r;e+=3)s+=a((o=n=(t[e]<<16)+(t[e+1]<<8)+t[e+2])>>18&63)+a(o>>12&63)+a(o>>6&63)+a(63&o);switch(i){case 1:s=(s+=a((n=t[t.length-1])>>2))+a(n<<4&63)+"==";break;case 2:s=(s=(s+=a((n=(t[t.length-2]<<8)+t[t.length-1])>>10))+a(n>>4&63))+a(n<<2&63)+"="}return s}}(void 0===n?this.base64js={}:n)}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(t,e,n){(function(e,r,o,i,s,a,l,u,c){var f=t("base64-js"),h=t("ieee754");function o(t,e,n){if(!(this instanceof o))return new o(t,e,n);var r,i,s,a,l=typeof t;if("base64"===e&&"string"==l)for(t=(a=t).trim?a.trim():a.replace(/^\s+|\s+$/g,"");t.length%4!=0;)t+="=";if("number"==l)r=I(t);else if("string"==l)r=o.byteLength(t,e);else{if("object"!=l)throw new Error("First argument needs to be a number, array or string.");r=I(t.length)}if(o._useTypedArrays?i=o._augment(new Uint8Array(r)):((i=this).length=r,i._isBuffer=!0),o._useTypedArrays&&"number"==typeof t.byteLength)i._set(t);else if(N(a=t)||o.isBuffer(a)||a&&"object"==typeof a&&"number"==typeof a.length)for(s=0;s<r;s++)o.isBuffer(t)?i[s]=t.readUInt8(s):i[s]=t[s];else if("string"==l)i.write(t,0,e);else if("number"==l&&!o._useTypedArrays&&!n)for(s=0;s<r;s++)i[s]=0;return i}function d(t,e,n,r){var o;if(r||(B("boolean"==typeof n,"missing or invalid endian"),B(null!=e,"missing offset"),B(e+1<t.length,"Trying to read beyond buffer length")),!((r=t.length)<=e))return n?(o=t[e],e+1<r&&(o|=t[e+1]<<8)):(o=t[e]<<8,e+1<r&&(o|=t[e+1])),o}function p(t,e,n,r){var o;if(r||(B("boolean"==typeof n,"missing or invalid endian"),B(null!=e,"missing offset"),B(e+3<t.length,"Trying to read beyond buffer length")),!((r=t.length)<=e))return n?(e+2<r&&(o=t[e+2]<<16),e+1<r&&(o|=t[e+1]<<8),o|=t[e],e+3<r&&(o+=t[e+3]<<24>>>0)):(e+1<r&&(o=t[e+1]<<16),e+2<r&&(o|=t[e+2]<<8),e+3<r&&(o|=t[e+3]),o+=t[e]<<24>>>0),o}function g(t,e,n,r){if(r||(B("boolean"==typeof n,"missing or invalid endian"),B(null!=e,"missing offset"),B(e+1<t.length,"Trying to read beyond buffer length")),!(t.length<=e))return 32768&(r=d(t,e,n,!0))?-1*(65535-r+1):r}function m(t,e,n,r){if(r||(B("boolean"==typeof n,"missing or invalid endian"),B(null!=e,"missing offset"),B(e+3<t.length,"Trying to read beyond buffer length")),!(t.length<=e))return 2147483648&(r=p(t,e,n,!0))?-1*(4294967295-r+1):r}function y(t,e,n,r){return r||(B("boolean"==typeof n,"missing or invalid endian"),B(e+3<t.length,"Trying to read beyond buffer length")),h.read(t,e,n,23,4)}function v(t,e,n,r){return r||(B("boolean"==typeof n,"missing or invalid endian"),B(e+7<t.length,"Trying to read beyond buffer length")),h.read(t,e,n,52,8)}function b(t,e,n,r,o){if(o||(B(null!=e,"missing value"),B("boolean"==typeof r,"missing or invalid endian"),B(null!=n,"missing offset"),B(n+1<t.length,"trying to write beyond buffer length"),R(e,65535)),!((o=t.length)<=n))for(var i=0,s=Math.min(o-n,2);i<s;i++)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function C(t,e,n,r,o){if(o||(B(null!=e,"missing value"),B("boolean"==typeof r,"missing or invalid endian"),B(null!=n,"missing offset"),B(n+3<t.length,"trying to write beyond buffer length"),R(e,4294967295)),!((o=t.length)<=n))for(var i=0,s=Math.min(o-n,4);i<s;i++)t[n+i]=e>>>8*(r?i:3-i)&255}function A(t,e,n,r,o){o||(B(null!=e,"missing value"),B("boolean"==typeof r,"missing or invalid endian"),B(null!=n,"missing offset"),B(n+1<t.length,"Trying to write beyond buffer length"),$(e,32767,-32768)),t.length<=n||b(t,0<=e?e:65535+e+1,n,r,o)}function w(t,e,n,r,o){o||(B(null!=e,"missing value"),B("boolean"==typeof r,"missing or invalid endian"),B(null!=n,"missing offset"),B(n+3<t.length,"Trying to write beyond buffer length"),$(e,2147483647,-2147483648)),t.length<=n||C(t,0<=e?e:4294967295+e+1,n,r,o)}function E(t,e,n,r,o){o||(B(null!=e,"missing value"),B("boolean"==typeof r,"missing or invalid endian"),B(null!=n,"missing offset"),B(n+3<t.length,"Trying to write beyond buffer length"),D(e,34028234663852886e22,-34028234663852886e22)),t.length<=n||h.write(t,e,n,r,23,4)}function _(t,e,n,r,o){o||(B(null!=e,"missing value"),B("boolean"==typeof r,"missing or invalid endian"),B(null!=n,"missing offset"),B(n+7<t.length,"Trying to write beyond buffer length"),D(e,17976931348623157e292,-17976931348623157e292)),t.length<=n||h.write(t,e,n,r,52,8)}n.Buffer=o,n.SlowBuffer=o,n.INSPECT_MAX_BYTES=50,o.poolSize=8192,o._useTypedArrays=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray}catch(t){return!1}}(),o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.byteLength=function(t,e){var n;switch(t+="",e||"utf8"){case"hex":n=t.length/2;break;case"utf8":case"utf-8":n=L(t).length;break;case"ascii":case"binary":case"raw":n=t.length;break;case"base64":n=P(t).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*t.length;break;default:throw new Error("Unknown encoding")}return n},o.concat=function(t,e){if(B(N(t),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===t.length)return new o(0);if(1===t.length)return t[0];if("number"!=typeof e)for(i=e=0;i<t.length;i++)e+=t[i].length;for(var n=new o(e),r=0,i=0;i<t.length;i++){var s=t[i];s.copy(n,r),r+=s.length}return n},o.prototype.write=function(t,e,n,r){isFinite(e)?isFinite(n)||(r=n,n=void 0):(u=r,r=e,e=n,n=u),e=Number(e)||0;var i,s,a,l,u=this.length-e;switch((!n||u<(n=Number(n)))&&(n=u),r=String(r||"utf8").toLowerCase()){case"hex":i=function(t,e,n,r){n=Number(n)||0;var i=t.length-n;(!r||i<(r=Number(r)))&&(r=i),B((i=e.length)%2==0,"Invalid hex string"),i/2<r&&(r=i/2);for(var s=0;s<r;s++){var a=parseInt(e.substr(2*s,2),16);B(!isNaN(a),"Invalid hex string"),t[n+s]=a}return o._charsWritten=2*s,s}(this,t,e,n);break;case"utf8":case"utf-8":s=this,a=e,l=n,i=o._charsWritten=O(L(t),s,a,l);break;case"ascii":case"binary":i=function(t,e,n,r){return o._charsWritten=O(function(t){for(var e=[],n=0;n<t.length;n++)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}(this,t,e,n);break;case"base64":s=this,a=e,l=n,i=o._charsWritten=O(P(t),s,a,l);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=function(t,e,n,r){return o._charsWritten=O(function(t){for(var e,n,r=[],o=0;o<t.length;o++)e=(n=t.charCodeAt(o))>>8,n%=256,r.push(n),r.push(e);return r}(e),t,n,r)}(this,t,e,n);break;default:throw new Error("Unknown encoding")}return i},o.prototype.toString=function(t,e,n){var r,o,i,s,a=this;if(t=String(t||"utf8").toLowerCase(),e=Number(e)||0,(n=void 0!==n?Number(n):a.length)===e)return"";switch(t){case"hex":r=function(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||r<n)&&(n=r);for(var o="",i=e;i<n;i++)o+=S(t[i]);return o}(a,e,n);break;case"utf8":case"utf-8":r=function(t,e,n){var r="",o="";n=Math.min(t.length,n);for(var i=e;i<n;i++)t[i]<=127?(r+=M(o)+String.fromCharCode(t[i]),o=""):o+="%"+t[i].toString(16);return r+M(o)}(a,e,n);break;case"ascii":case"binary":r=function(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;o++)r+=String.fromCharCode(t[o]);return r}(a,e,n);break;case"base64":o=a,s=n,r=0===(i=e)&&s===o.length?f.fromByteArray(o):f.fromByteArray(o.slice(i,s));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=function(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}(a,e,n);break;default:throw new Error("Unknown encoding")}return r},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.copy=function(t,e,n,r){if(e=e||0,(r=r||0===r?r:this.length)!==(n=n||0)&&0!==t.length&&0!==this.length){B(n<=r,"sourceEnd < sourceStart"),B(0<=e&&e<t.length,"targetStart out of bounds"),B(0<=n&&n<this.length,"sourceStart out of bounds"),B(0<=r&&r<=this.length,"sourceEnd out of bounds"),r>this.length&&(r=this.length);var i=(r=t.length-e<r-n?t.length-e+n:r)-n;if(i<100||!o._useTypedArrays)for(var s=0;s<i;s++)t[s+e]=this[s+n];else t._set(this.subarray(n,n+i),e)}},o.prototype.slice=function(t,e){var n=this.length;if(t=T(t,n,0),e=T(e,n,n),o._useTypedArrays)return o._augment(this.subarray(t,e));for(var r=e-t,i=new o(r,void 0,!0),s=0;s<r;s++)i[s]=this[s+t];return i},o.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},o.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},o.prototype.readUInt8=function(t,e){if(e||(B(null!=t,"missing offset"),B(t<this.length,"Trying to read beyond buffer length")),!(t>=this.length))return this[t]},o.prototype.readUInt16LE=function(t,e){return d(this,t,!0,e)},o.prototype.readUInt16BE=function(t,e){return d(this,t,!1,e)},o.prototype.readUInt32LE=function(t,e){return p(this,t,!0,e)},o.prototype.readUInt32BE=function(t,e){return p(this,t,!1,e)},o.prototype.readInt8=function(t,e){if(e||(B(null!=t,"missing offset"),B(t<this.length,"Trying to read beyond buffer length")),!(t>=this.length))return 128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){return g(this,t,!0,e)},o.prototype.readInt16BE=function(t,e){return g(this,t,!1,e)},o.prototype.readInt32LE=function(t,e){return m(this,t,!0,e)},o.prototype.readInt32BE=function(t,e){return m(this,t,!1,e)},o.prototype.readFloatLE=function(t,e){return y(this,t,!0,e)},o.prototype.readFloatBE=function(t,e){return y(this,t,!1,e)},o.prototype.readDoubleLE=function(t,e){return v(this,t,!0,e)},o.prototype.readDoubleBE=function(t,e){return v(this,t,!1,e)},o.prototype.writeUInt8=function(t,e,n){n||(B(null!=t,"missing value"),B(null!=e,"missing offset"),B(e<this.length,"trying to write beyond buffer length"),R(t,255)),e>=this.length||(this[e]=t)},o.prototype.writeUInt16LE=function(t,e,n){b(this,t,e,!0,n)},o.prototype.writeUInt16BE=function(t,e,n){b(this,t,e,!1,n)},o.prototype.writeUInt32LE=function(t,e,n){C(this,t,e,!0,n)},o.prototype.writeUInt32BE=function(t,e,n){C(this,t,e,!1,n)},o.prototype.writeInt8=function(t,e,n){n||(B(null!=t,"missing value"),B(null!=e,"missing offset"),B(e<this.length,"Trying to write beyond buffer length"),$(t,127,-128)),e>=this.length||(0<=t?this.writeUInt8(t,e,n):this.writeUInt8(255+t+1,e,n))},o.prototype.writeInt16LE=function(t,e,n){A(this,t,e,!0,n)},o.prototype.writeInt16BE=function(t,e,n){A(this,t,e,!1,n)},o.prototype.writeInt32LE=function(t,e,n){w(this,t,e,!0,n)},o.prototype.writeInt32BE=function(t,e,n){w(this,t,e,!1,n)},o.prototype.writeFloatLE=function(t,e,n){E(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){E(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){_(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){_(this,t,e,!1,n)},o.prototype.fill=function(t,e,n){if(e=e||0,n=n||this.length,B("number"==typeof(t="string"==typeof(t=t||0)?t.charCodeAt(0):t)&&!isNaN(t),"value is not a number"),B(e<=n,"end < start"),n!==e&&0!==this.length){B(0<=e&&e<this.length,"start out of bounds"),B(0<=n&&n<=this.length,"end out of bounds");for(var r=e;r<n;r++)this[r]=t}},o.prototype.inspect=function(){for(var t=[],e=this.length,r=0;r<e;r++)if(t[r]=S(this[r]),r===n.INSPECT_MAX_BYTES){t[r+1]="...";break}return"<Buffer "+t.join(" ")+">"},o.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(o._useTypedArrays)return new o(this).buffer;for(var t=new Uint8Array(this.length),e=0,n=t.length;e<n;e+=1)t[e]=this[e];return t.buffer};var x=o.prototype;function T(t,e,n){return"number"!=typeof t?n:e<=(t=~~t)?e:0<=t||0<=(t+=e)?t:0}function I(t){return(t=~~Math.ceil(+t))<0?0:t}function N(t){return(Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)})(t)}function S(t){return t<16?"0"+t.toString(16):t.toString(16)}function L(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r<=127)e.push(t.charCodeAt(n));else for(var o=n,i=(55296<=r&&r<=57343&&n++,encodeURIComponent(t.slice(o,n+1)).substr(1).split("%")),s=0;s<i.length;s++)e.push(parseInt(i[s],16))}return e}function P(t){return f.toByteArray(t)}function O(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);o++)e[o+n]=t[o];return o}function M(t){try{return decodeURIComponent(t)}catch(t){return String.fromCharCode(65533)}}function R(t,e){B("number"==typeof t,"cannot write a non-number as a number"),B(0<=t,"specified a negative value for writing an unsigned value"),B(t<=e,"value is larger than maximum value for type"),B(Math.floor(t)===t,"value has a fractional component")}function $(t,e,n){B("number"==typeof t,"cannot write a non-number as a number"),B(t<=e,"value larger than maximum allowed value"),B(n<=t,"value smaller than minimum allowed value"),B(Math.floor(t)===t,"value has a fractional component")}function D(t,e,n){B("number"==typeof t,"cannot write a non-number as a number"),B(t<=e,"value larger than maximum allowed value"),B(n<=t,"value smaller than minimum allowed value")}function B(t,e){if(!t)throw new Error(e||"Failed assertion")}o._augment=function(t){return t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=x.get,t.set=x.set,t.write=x.write,t.toString=x.toString,t.toLocaleString=x.toString,t.toJSON=x.toJSON,t.copy=x.copy,t.slice=x.slice,t.readUInt8=x.readUInt8,t.readUInt16LE=x.readUInt16LE,t.readUInt16BE=x.readUInt16BE,t.readUInt32LE=x.readUInt32LE,t.readUInt32BE=x.readUInt32BE,t.readInt8=x.readInt8,t.readInt16LE=x.readInt16LE,t.readInt16BE=x.readInt16BE,t.readInt32LE=x.readInt32LE,t.readInt32BE=x.readInt32BE,t.readFloatLE=x.readFloatLE,t.readFloatBE=x.readFloatBE,t.readDoubleLE=x.readDoubleLE,t.readDoubleBE=x.readDoubleBE,t.writeUInt8=x.writeUInt8,t.writeUInt16LE=x.writeUInt16LE,t.writeUInt16BE=x.writeUInt16BE,t.writeUInt32LE=x.writeUInt32LE,t.writeUInt32BE=x.writeUInt32BE,t.writeInt8=x.writeInt8,t.writeInt16LE=x.writeInt16LE,t.writeInt16BE=x.writeInt16BE,t.writeInt32LE=x.writeInt32LE,t.writeInt32BE=x.writeInt32BE,t.writeFloatLE=x.writeFloatLE,t.writeFloatBE=x.writeFloatBE,t.writeDoubleLE=x.writeDoubleLE,t.writeDoubleBE=x.writeDoubleBE,t.fill=x.fill,t.inspect=x.inspect,t.toArrayBuffer=x.toArrayBuffer,t}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(t,e,n){(function(n,r,o,i,s,a,l,u,c){o=t("buffer").Buffer;var f=new o(4);f.fill(0),e.exports={hash:function(t,e,n,r){for(var i=e(function(t,e){t.length%4!=0&&(n=t.length+(4-t.length%4),t=o.concat([t,f],n));for(var n,r=[],i=e?t.readInt32BE:t.readInt32LE,s=0;s<t.length;s+=4)r.push(i.call(t,s));return r}(t=o.isBuffer(t)?t:new o(t),r),8*t.length),s=(e=r,new o(n)),a=e?s.writeInt32BE:s.writeInt32LE,l=0;l<i.length;l++)a.call(s,i[l],4*l,!0);return s}}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(t,e,n){(function(e,r,o,i,s,a,l,u,c){o=t("buffer").Buffer;var f=t("./sha"),h=t("./sha256"),d=t("./rng"),p={sha1:f,sha256:h,md5:t("./md5")},g=64,m=new o(g);function y(t,e){var n=p[t=t||"sha1"],r=[];return n||v("algorithm:",t,"is not yet supported"),{update:function(t){return o.isBuffer(t)||(t=new o(t)),r.push(t),t.length,this},digest:function(t){var i=o.concat(r);return i=e?function(t,e,n){o.isBuffer(e)||(e=new o(e)),o.isBuffer(n)||(n=new o(n)),e.length>g?e=t(e):e.length<g&&(e=o.concat([e,m],g));for(var r=new o(g),i=new o(g),s=0;s<g;s++)r[s]=54^e[s],i[s]=92^e[s];return n=t(o.concat([r,n])),t(o.concat([i,n]))}(n,e,i):n(i),r=null,t?i.toString(t):i}}}function v(){var t=[].slice.call(arguments).join(" ");throw new Error([t,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}m.fill(0),n.createHash=function(t){return y(t)},n.createHmac=y,n.randomBytes=function(t,e){if(!e||!e.call)return new o(d(t));try{e.call(this,void 0,new o(d(t)))}catch(t){e(t)}};var b,C=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],A=function(t){n[t]=function(){v("sorry,",t,"is not implemented yet")}};for(b in C)A(C[b])}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(t,e,n){(function(n,r,o,i,s,a,l,u,c){var f=t("./helpers");function h(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,s=0;s<t.length;s+=16){var a=n,l=r,u=o,c=i;n=p(n,r,o,i,t[s+0],7,-680876936),i=p(i,n,r,o,t[s+1],12,-389564586),o=p(o,i,n,r,t[s+2],17,606105819),r=p(r,o,i,n,t[s+3],22,-1044525330),n=p(n,r,o,i,t[s+4],7,-176418897),i=p(i,n,r,o,t[s+5],12,1200080426),o=p(o,i,n,r,t[s+6],17,-1473231341),r=p(r,o,i,n,t[s+7],22,-45705983),n=p(n,r,o,i,t[s+8],7,1770035416),i=p(i,n,r,o,t[s+9],12,-1958414417),o=p(o,i,n,r,t[s+10],17,-42063),r=p(r,o,i,n,t[s+11],22,-1990404162),n=p(n,r,o,i,t[s+12],7,1804603682),i=p(i,n,r,o,t[s+13],12,-40341101),o=p(o,i,n,r,t[s+14],17,-1502002290),n=g(n,r=p(r,o,i,n,t[s+15],22,1236535329),o,i,t[s+1],5,-165796510),i=g(i,n,r,o,t[s+6],9,-1069501632),o=g(o,i,n,r,t[s+11],14,643717713),r=g(r,o,i,n,t[s+0],20,-373897302),n=g(n,r,o,i,t[s+5],5,-701558691),i=g(i,n,r,o,t[s+10],9,38016083),o=g(o,i,n,r,t[s+15],14,-660478335),r=g(r,o,i,n,t[s+4],20,-405537848),n=g(n,r,o,i,t[s+9],5,568446438),i=g(i,n,r,o,t[s+14],9,-1019803690),o=g(o,i,n,r,t[s+3],14,-187363961),r=g(r,o,i,n,t[s+8],20,1163531501),n=g(n,r,o,i,t[s+13],5,-1444681467),i=g(i,n,r,o,t[s+2],9,-51403784),o=g(o,i,n,r,t[s+7],14,1735328473),n=m(n,r=g(r,o,i,n,t[s+12],20,-1926607734),o,i,t[s+5],4,-378558),i=m(i,n,r,o,t[s+8],11,-2022574463),o=m(o,i,n,r,t[s+11],16,1839030562),r=m(r,o,i,n,t[s+14],23,-35309556),n=m(n,r,o,i,t[s+1],4,-1530992060),i=m(i,n,r,o,t[s+4],11,1272893353),o=m(o,i,n,r,t[s+7],16,-155497632),r=m(r,o,i,n,t[s+10],23,-1094730640),n=m(n,r,o,i,t[s+13],4,681279174),i=m(i,n,r,o,t[s+0],11,-358537222),o=m(o,i,n,r,t[s+3],16,-722521979),r=m(r,o,i,n,t[s+6],23,76029189),n=m(n,r,o,i,t[s+9],4,-640364487),i=m(i,n,r,o,t[s+12],11,-421815835),o=m(o,i,n,r,t[s+15],16,530742520),n=y(n,r=m(r,o,i,n,t[s+2],23,-995338651),o,i,t[s+0],6,-198630844),i=y(i,n,r,o,t[s+7],10,1126891415),o=y(o,i,n,r,t[s+14],15,-1416354905),r=y(r,o,i,n,t[s+5],21,-57434055),n=y(n,r,o,i,t[s+12],6,1700485571),i=y(i,n,r,o,t[s+3],10,-1894986606),o=y(o,i,n,r,t[s+10],15,-1051523),r=y(r,o,i,n,t[s+1],21,-2054922799),n=y(n,r,o,i,t[s+8],6,1873313359),i=y(i,n,r,o,t[s+15],10,-30611744),o=y(o,i,n,r,t[s+6],15,-1560198380),r=y(r,o,i,n,t[s+13],21,1309151649),n=y(n,r,o,i,t[s+4],6,-145523070),i=y(i,n,r,o,t[s+11],10,-1120210379),o=y(o,i,n,r,t[s+2],15,718787259),r=y(r,o,i,n,t[s+9],21,-343485551),n=v(n,a),r=v(r,l),o=v(o,u),i=v(i,c)}return Array(n,r,o,i)}function d(t,e,n,r,o,i){return v((e=v(v(e,t),v(r,i)))<<o|e>>>32-o,n)}function p(t,e,n,r,o,i,s){return d(e&n|~e&r,t,e,o,i,s)}function g(t,e,n,r,o,i,s){return d(e&r|n&~r,t,e,o,i,s)}function m(t,e,n,r,o,i,s){return d(e^n^r,t,e,o,i,s)}function y(t,e,n,r,o,i,s){return d(n^(e|~r),t,e,o,i,s)}function v(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}e.exports=function(t){return f.hash(t,h,16)}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(t,e,n){(function(t,n,r,o,i,s,a,l,u){e.exports=function(t){for(var e,n=new Array(t),r=0;r<t;r++)!(3&r)&&(e=4294967296*Math.random()),n[r]=e>>>((3&r)<<3)&255;return n}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(t,e,n){(function(n,r,o,i,s,a,l,u,c){var f=t("./helpers");function h(t,e){t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e;for(var n,r,o,i=Array(80),s=1732584193,a=-271733879,l=-1732584194,u=271733878,c=-1009589776,f=0;f<t.length;f+=16){for(var h=s,g=a,m=l,y=u,v=c,b=0;b<80;b++){i[b]=b<16?t[f+b]:p(i[b-3]^i[b-8]^i[b-14]^i[b-16],1);var C=d(d(p(s,5),(C=a,r=l,o=u,(n=b)<20?C&r|~C&o:!(n<40)&&n<60?C&r|C&o|r&o:C^r^o)),d(d(c,i[b]),(n=b)<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514));c=u,u=l,l=p(a,30),a=s,s=C}s=d(s,h),a=d(a,g),l=d(l,m),u=d(u,y),c=d(c,v)}return Array(s,a,l,u,c)}function d(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function p(t,e){return t<<e|t>>>32-e}e.exports=function(t){return f.hash(t,h,20,!0)}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(t,e,n){(function(n,r,o,i,s,a,l,u,c){function f(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function h(t,e){var n,r=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),o=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),i=new Array(64);t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e;for(var s,a,l=0;l<t.length;l+=16){for(var u=o[0],c=o[1],h=o[2],d=o[3],m=o[4],y=o[5],v=o[6],b=o[7],C=0;C<64;C++)i[C]=C<16?t[C+l]:f(f(f((a=i[C-2],p(a,17)^p(a,19)^g(a,10)),i[C-7]),(a=i[C-15],p(a,7)^p(a,18)^g(a,3))),i[C-16]),n=f(f(f(f(b,p(a=m,6)^p(a,11)^p(a,25)),m&y^~m&v),r[C]),i[C]),s=f(p(s=u,2)^p(s,13)^p(s,22),u&c^u&h^c&h),b=v,v=y,y=m,m=f(d,n),d=h,h=c,c=u,u=f(n,s);o[0]=f(u,o[0]),o[1]=f(c,o[1]),o[2]=f(h,o[2]),o[3]=f(d,o[3]),o[4]=f(m,o[4]),o[5]=f(y,o[5]),o[6]=f(v,o[6]),o[7]=f(b,o[7])}return o}var d=t("./helpers"),p=function(t,e){return t>>>e|t<<32-e},g=function(t,e){return t>>>e};e.exports=function(t){return d.hash(t,h,32,!0)}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(t,e,n){(function(t,e,r,o,i,s,a,l,u){n.read=function(t,e,n,r,o){var i,s,a=8*o-r-1,l=(1<<a)-1,u=l>>1,c=-7,f=n?o-1:0,h=n?-1:1;for(o=t[e+f],f+=h,i=o&(1<<-c)-1,o>>=-c,c+=a;0<c;i=256*i+t[e+f],f+=h,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=r;0<c;s=256*s+t[e+f],f+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return s?NaN:1/0*(o?-1:1);s+=Math.pow(2,r),i-=u}return(o?-1:1)*s*Math.pow(2,i-r)},n.write=function(t,e,n,r,o,i){var s,a,l=8*i-o-1,u=(1<<l)-1,c=u>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1;for(i=e<0||0===e&&1/e<0?1:0,e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(r=Math.pow(2,-s))<1&&(s--,r*=2),2<=(e+=1<=s+c?f/r:f*Math.pow(2,1-c))*r&&(s++,r/=2),u<=s+c?(a=0,s=u):1<=s+c?(a=(e*r-1)*Math.pow(2,o),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,o),s=0));8<=o;t[n+h]=255&a,h+=d,a/=256,o-=8);for(s=s<<o|a,l+=o;0<l;t[n+h]=255&s,h+=d,s/=256,l-=8);t[n+h-d]|=128*i}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(t,e,n){(function(t,n,r,o,i,s,a,l,u){var c,f,h;function d(){}(t=e.exports={}).nextTick=(f="undefined"!=typeof window&&window.setImmediate,h="undefined"!=typeof window&&window.postMessage&&window.addEventListener,f?function(t){return window.setImmediate(t)}:h?(c=[],window.addEventListener("message",(function(t){var e=t.source;e!==window&&null!==e||"process-tick"!==t.data||(t.stopPropagation(),0<c.length&&c.shift()())}),!0),function(t){c.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}),t.title="browser",t.browser=!0,t.env={},t.argv=[],t.on=d,t.addListener=d,t.once=d,t.off=d,t.removeListener=d,t.removeAllListeners=d,t.emit=d,t.binding=function(t){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(t){throw new Error("process.chdir is not supported")}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)},9146:(t,e)=>{"use strict";var n;!function(){var r=e||{}||this||window;void 0===(n=function(){return r}.apply(e,[]))||(t.exports=n),r.default=r;var o="http://www.w3.org/2000/xmlns/",i="http://www.w3.org/2000/svg",s=/url\(["']?(.+?)["']?\)/,a={woff2:"font/woff2",woff:"font/woff",otf:"application/x-font-opentype",ttf:"application/x-font-ttf",eot:"application/vnd.ms-fontobject",sfnt:"application/font-sfnt",svg:"image/svg+xml"},l=function(t){return t instanceof HTMLElement||t instanceof SVGElement},u=function(t){if(!l(t))throw new Error("an HTMLElement or SVGElement is required; got "+t)},c=function(t){return new Promise((function(e,n){l(t)?e(t):n(new Error("an HTMLElement or SVGElement is required; got "+t))}))},f=function(t,e,n){var r=t.viewBox&&t.viewBox.baseVal&&t.viewBox.baseVal[n]||null!==e.getAttribute(n)&&!e.getAttribute(n).match(/%$/)&&parseInt(e.getAttribute(n))||t.getBoundingClientRect()[n]||parseInt(e.style[n])||parseInt(window.getComputedStyle(t).getPropertyValue(n));return null==r||isNaN(parseFloat(r))?0:r},h=function(t){for(var e=window.atob(t.split(",")[1]),n=t.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(e.length),o=new Uint8Array(r),i=0;i<e.length;i++)o[i]=e.charCodeAt(i);return new Blob([r],{type:n})},d={},p=null,g=function(t,e){var n=e||{},r=n.selectorRemap,o=n.modifyStyle,i=n.modifyCss,l=n.fonts,u=n.excludeUnusedCss,c=i||function(t,e){return(r?r(t):t)+"{"+(o?o(e):e)+"}\n"},f=[],h=void 0===l,g=l||[];return(p||(p=Array.from(document.styleSheets).map((function(t){try{return{rules:t.cssRules,href:t.href}}catch(e){return console.warn("Stylesheet could not be loaded: "+t.href,e),{}}})))).forEach((function(e){var n=e.rules,r=e.href;n&&Array.from(n).forEach((function(e){if(void 0!==e.style)if(function(t,e){if(e)try{return t.querySelector(e)||t.parentNode&&t.parentNode.querySelector(e)}catch(t){console.warn('Invalid CSS selector "'+e+'"',t)}}(t,e.selectorText))f.push(c(e.selectorText,e.style.cssText));else if(h&&e.cssText.match(/^@font-face/)){var n=function(t,e){var n=t.cssText.match(s),r=n&&n[1]||"";if(r&&!r.match(/^data:/)&&"about:blank"!==r){var o,i,l=r.startsWith("../")?e+"/../"+r:r.startsWith("./")?e+"/."+r:r;return{text:t.cssText,format:(o=l,i=Object.keys(a).filter((function(t){return o.indexOf("."+t)>0})).map((function(t){return a[t]})),i?i[0]:(console.error("Unknown font format for "+o+". Fonts may not be working correctly."),"application/octet-stream")),url:l}}}(e,r);n&&g.push(n)}else u||f.push(e.cssText)}))})),function(t){return Promise.all(t.map((function(t){return new Promise((function(e,n){if(d[t.url])return e(d[t.url]);var r=new XMLHttpRequest;r.addEventListener("load",(function(){var n=function(t){for(var e="",n=new Uint8Array(t),r=0;r<n.byteLength;r++)e+=String.fromCharCode(n[r]);return window.btoa(e)}(r.response),o=t.text.replace(s,'url("data:'+t.format+";base64,"+n+'")')+"\n";d[t.url]=o,e(o)})),r.addEventListener("error",(function(n){console.warn("Failed to load font from: "+t.url,n),d[t.url]=null,e(null)})),r.addEventListener("abort",(function(n){console.warn("Aborted loading font from: "+t.url,n),e(null)})),r.open("GET",t.url),r.responseType="arraybuffer",r.send()}))}))).then((function(t){return t.filter((function(t){return t})).join("")}))}(g).then((function(t){return f.join("\n")+t}))},m=function(){if(!navigator.msSaveOrOpenBlob&&!("download"in document.createElement("a")))return{popup:window.open()}};r.prepareSvg=function(t,e,n){u(t);var r=e||{},s=r.left,a=void 0===s?0:s,l=r.top,c=void 0===l?0:l,h=r.width,d=r.height,p=r.scale,m=void 0===p?1:p,y=r.responsive,v=void 0!==y&&y,b=r.excludeCss,C=void 0!==b&&b;return function(t){return Promise.all(Array.from(t.querySelectorAll("image")).map((function(t){var e,n=t.getAttributeNS("http://www.w3.org/1999/xlink","href")||t.getAttribute("href");return n?((e=n)&&0===e.lastIndexOf("http",0)&&-1===e.lastIndexOf(window.location.host)&&(n+=(-1===n.indexOf("?")?"?":"&")+"t="+(new Date).valueOf()),new Promise((function(e,r){var o=document.createElement("canvas"),i=new Image;i.crossOrigin="anonymous",i.src=n,i.onerror=function(){return r(new Error("Could not load "+n))},i.onload=function(){o.width=i.width,o.height=i.height,o.getContext("2d").drawImage(i,0,0),t.setAttributeNS("http://www.w3.org/1999/xlink","href",o.toDataURL("image/png")),e(!0)}}))):Promise.resolve(null)})))}(t).then((function(){var r=t.cloneNode(!0);r.style.backgroundColor=(e||{}).backgroundColor||t.style.backgroundColor;var s=function(t,e,n,r){if("svg"===t.tagName)return{width:n||f(t,e,"width"),height:r||f(t,e,"height")};if(t.getBBox){var o=t.getBBox(),i=o.x,s=o.y;return{width:i+o.width,height:s+o.height}}}(t,r,h,d),l=s.width,u=s.height;if("svg"!==t.tagName){if(!t.getBBox)return void console.error("Attempted to render non-SVG element",t);null!=r.getAttribute("transform")&&r.setAttribute("transform",r.getAttribute("transform").replace(/translate\(.*?\)/,""));var p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.appendChild(r),r=p}if(r.setAttribute("version","1.1"),r.setAttribute("viewBox",[a,c,l,u].join(" ")),r.getAttribute("xmlns")||r.setAttributeNS(o,"xmlns",i),r.getAttribute("xmlns:xlink")||r.setAttributeNS(o,"xmlns:xlink","http://www.w3.org/1999/xlink"),v?(r.removeAttribute("width"),r.removeAttribute("height"),r.setAttribute("preserveAspectRatio","xMinYMin meet")):(r.setAttribute("width",l*m),r.setAttribute("height",u*m)),Array.from(r.querySelectorAll("foreignObject > *")).forEach((function(t){t.setAttributeNS(o,"xmlns","svg"===t.tagName?i:"http://www.w3.org/1999/xhtml")})),!C)return g(t,e).then((function(t){var e=document.createElement("style");e.setAttribute("type","text/css"),e.innerHTML="<![CDATA[\n"+t+"\n]]>";var o=document.createElement("defs");o.appendChild(e),r.insertBefore(o,r.firstChild);var i=document.createElement("div");i.appendChild(r);var s=i.innerHTML.replace(/NS\d+:href/gi,'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href');if("function"!=typeof n)return{src:s,width:l,height:u};n(s,l,u)}));var y=document.createElement("div");y.appendChild(r);var b=y.innerHTML;if("function"!=typeof n)return{src:b,width:l,height:u};n(b,l,u)}))},r.svgAsDataUri=function(t,e,n){return u(t),r.prepareSvg(t,e).then((function(t){var e=t.src,r=t.width,o=t.height,i="data:image/svg+xml;base64,"+window.btoa(decodeURIComponent(encodeURIComponent('<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [<!ENTITY nbsp " ">]>'+e).replace(/%([0-9A-F]{2})/g,(function(t,e){var n=String.fromCharCode("0x"+e);return"%"===n?"%25":n}))));return"function"==typeof n&&n(i,r,o),i}))},r.svgAsPngUri=function(t,e,n){u(t);var o=e||{},i=o.encoderType,s=void 0===i?"image/png":i,a=o.encoderOptions,l=void 0===a?.8:a,c=o.canvg,f=function(t){var e=t.src,r=t.width,o=t.height,i=document.createElement("canvas"),a=i.getContext("2d"),u=window.devicePixelRatio||1;i.width=r*u,i.height=o*u,i.style.width=i.width+"px",i.style.height=i.height+"px",a.setTransform(u,0,0,u,0,0),c?c(i,e):a.drawImage(e,0,0);var f=void 0;try{f=i.toDataURL(s,l)}catch(t){if("undefined"!=typeof SecurityError&&t instanceof SecurityError||"SecurityError"===t.name)return void console.error("Rendered SVG images cannot be downloaded in this browser.");throw t}return"function"==typeof n&&n(f,i.width,i.height),Promise.resolve(f)};return c?r.prepareSvg(t,e).then(f):r.svgAsDataUri(t,e).then((function(t){return new Promise((function(e,n){var r=new Image;r.onload=function(){return e(f({src:r,width:r.width,height:r.height}))},r.onerror=function(){n("There was an error loading the data URI as an image on the following SVG\n"+window.atob(t.slice(26))+"Open the following link to see browser's diagnosis\n"+t)},r.src=t}))}))},r.download=function(t,e,n){if(navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(h(e),t);else{var r=document.createElement("a");if("download"in r){r.download=t,r.style.display="none",document.body.appendChild(r);try{var o=h(e),i=URL.createObjectURL(o);r.href=i,r.onclick=function(){return requestAnimationFrame((function(){return URL.revokeObjectURL(i)}))}}catch(t){console.error(t),console.warn("Error while getting object URL. Falling back to string URL."),r.href=e}r.click(),document.body.removeChild(r)}else n&&n.popup&&(n.popup.document.title=t,n.popup.location.replace(e))}},r.saveSvg=function(t,e,n){var o=m();return c(t).then((function(t){return r.svgAsDataUri(t,n||{})})).then((function(t){return r.download(e,t,o)}))},r.saveSvgAsPng=function(t,e,n){var o=m();return c(t).then((function(t){return r.svgAsPngUri(t,n||{})})).then((function(t){return r.download(e,t,o)}))}}()},5072:t=>{"use strict";var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var i={},s=[],a=0;a<t.length;a++){var l=t[a],u=r.base?l[0]+r.base:l[0],c=i[u]||0,f="".concat(u," ").concat(c);i[u]=c+1;var h=n(f),d={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==h)e[h].references++,e[h].updater(d);else{var p=o(d,r);r.byIndex=a,e.splice(a,0,{identifier:f,updater:p,references:1})}s.push(f)}return s}function o(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,o){var i=r(t=t||[],o=o||{});return function(t){t=t||[];for(var s=0;s<i.length;s++){var a=n(i[s]);e[a].references--}for(var l=r(t,o),u=0;u<i.length;u++){var c=n(i[u]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}i=l}}},7659:t=>{"use strict";var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},5056:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},1113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},6686:(t,e,n)=>{"use strict";n.d(e,{AL:()=>r,NO:()=>o});const r=["A","G","C","U"];var o;!function(t){t.HELM="HELM",t.AXOLABS="Axolabs"}(o||(o={}))},5670:(t,e,n)=>{"use strict";function r(t,e=!0){let n="\n Datagrok macromolecule handler\n\n";n+=" 0 0 0 0 0 0 999 V3000\n",n+="M V30 BEGIN CTAB\n";let r="",a="",l="";const u=[];let c=0,f=0,h=0;if(t.antiStrands.length>0)for(let e=0;e<t.antiStrands.length;e++)t.antiStrands[e]=o(t.antiStrands[e]);let d=!1;const p=t.senseStrands.concat(t.antiStrands);let g=0;for(let e=0;e<p.length;e++){p[e]=p[e].replaceAll("(-\nM V30 ","(").replaceAll("-\nM V30 ","").replaceAll(" )",")");const n=i(p[e]),o=s(p[e]);if(e>=t.senseStrands.length?!1===d&&(d=!0,h=0):g=Math.min(g,Math.min(...o.y.filter((t=>t<0)))),d){const t=Math.min(...o.x)-h,e=Math.max(...o.y)+5;for(let e=0;e<o.x.length;e++)o.x[e]-=t;for(let t=0;t<o.y.length;t++)o.y[t]-=e-g}let l=p[e].indexOf("M V30 BEGIN ATOM");l=p[e].indexOf("\n",l);let m=l,y=l;for(let t=0;t<n.natom;t++){m=p[e].indexOf("V30",m)+4,y=p[e].indexOf(" ",m);const n=parseInt(p[e].substring(m,y))+c;p[e]=p[e].slice(0,m)+n+p[e].slice(y),m=p[e].indexOf(" ",m)+1,m=p[e].indexOf(" ",m)+1,y=p[e].indexOf(" ",m);let r=Math.round(1e4*o.x[t])/1e4;p[e]=p[e].slice(0,m)+r+p[e].slice(y),m=p[e].indexOf(" ",m)+1,y=p[e].indexOf(" ",m),r=Math.round(1e4*o.y[t])/1e4,p[e]=p[e].slice(0,m)+r+p[e].slice(y),m=p[e].indexOf("\n",m)+1}const v=p[e].indexOf("M V30 END ATOM");r+=p[e].substring(l+1,v);let b=p[e].indexOf("M V30 BEGIN BOND");b=p[e].indexOf("\n",b),m=b,y=b;for(let t=0;t<n.nbond;t++){m=p[e].indexOf("V30",m)+4,y=p[e].indexOf(" ",m);const t=parseInt(p[e].substring(m,y))+f;p[e]=p[e].slice(0,m)+t+p[e].slice(y),m=p[e].indexOf(" ",m)+1,m=p[e].indexOf(" ",m)+1,y=p[e].indexOf(" ",m);let n=parseInt(p[e].substring(m,y))+c;p[e]=p[e].slice(0,m)+n+p[e].slice(y),m=p[e].indexOf(" ",m)+1,y=Math.min(p[e].indexOf("\n",m),p[e].indexOf(" ",m)),n=parseInt(p[e].substring(m,y))+c,p[e]=p[e].slice(0,m)+n+p[e].slice(y),m=p[e].indexOf("\n",m)+1}const C=p[e].indexOf("M V30 END BOND");a+=p[e].substring(b+1,C);let A=p[e].indexOf("M V30 MDLV30/STEABS ATOMS=(");for(;-1!==A;){A+=28;const t=p[e].indexOf(")",A);p[e].substring(A,t).split(" ").slice(1).forEach((t=>{u.push(parseInt(t)+c)})),A=t,A=p[e].indexOf("M V30 MDLV30/STEABS ATOMS=(",A)}c+=n.natom,f+=n.nbond,h+=Math.max(...o.x)+5}const m=Math.ceil(u.length/4);l+="M V30 MDLV30/STEABS ATOMS=("+u.length+" -\n";for(let t=0;t<m;t++){l+="M V30 ";const e=t+1===m?u.length-4*(m-1):4;for(let n=0;n<e;n++)l+=n+1===e?t===m-1?u[4*t+n]+")\n":u[4*t+n]+" -\n":u[4*t+n]+" "}return n+="M V30 COUNTS "+c+" "+f+" 0 0 0\n",n+="M V30 BEGIN ATOM\n",n+=r,n+="M V30 END ATOM\n",n+="M V30 BEGIN BOND\n",n+=a,n+="M V30 END BOND\n",e&&u.length>0?(n+="M V30 BEGIN COLLECTION\n",n+=l,n+="M V30 END COLLECTION\n"):n=n.replace(/ CFG=\d/g," "),n+="M V30 END CTAB\n",n+="M END",n}function o(t){const e=s(t),n=e.atomIndex.length,r=(Math.max(...e.x)+Math.min(...e.x))/2,o=(Math.max(...e.y)+Math.min(...e.y))/2;for(let t=0;t<n;t++)e.x[t]-=r,e.y[t]-=o;const i=Math.PI,a=Math.cos(i),l=Math.sin(i);for(let t=0;t<n;t++){const n=e.x[t];e.x[t]=n*a-e.y[t]*l,e.y[t]=n*l+e.y[t]*a}const u=Math.max(...e.y);for(let t=0;t<n;t++)e.x[t]+=r,e.y[t]-=u;let c=t.indexOf("M V30 BEGIN ATOM");c=t.indexOf("\n",c);let f=c;for(let r=0;r<n;r++)c=t.indexOf("V30",c)+4,c=t.indexOf(" ",c)+1,c=t.indexOf(" ",c)+1,f=t.indexOf(" ",c)+1,f=t.indexOf(" ",f),c=(t=t.slice(0,c)+e.x[r]+" "+e.y[r]+t.slice(f)).indexOf("\n",c)+1;return t}function i(t){let e=(t=t.replaceAll("\r","")).indexOf("COUNTS")+7,n=t.indexOf(" ",e);const r=parseInt(t.substring(e,n));return e=n+1,n=t.indexOf(" ",e),{natom:r,nbond:parseInt(t.substring(e,n))}}function s(t){const e=i(t);let n=t.indexOf("M V30 BEGIN ATOM");n=t.indexOf("\n",n);let r=n;const o=Array(e.natom),s=Array(e.natom),a=Array(e.natom),l=Array(e.natom);for(let i=0;i<e.natom;i++)n=t.indexOf("V30",n)+4,r=t.indexOf(" ",n),o[i]=parseInt(t.substring(n,r)),n=r+1,r=t.indexOf(" ",n),s[i]=t.substring(n,r),n=r+1,r=t.indexOf(" ",n),a[i]=parseFloat(t.substring(n,r)),n=r+1,r=t.indexOf(" ",n),l[i]=parseFloat(t.substring(n,r)),n=t.indexOf("\n",n)+1;return{atomIndex:o,atomType:s,x:a,y:l}}n.d(e,{cx:()=>s,vS:()=>r})},9537:(t,e,n)=>{"use strict";n.d(e,{iL:()=>i,q7:()=>o,ti:()=>r});const r={NUCLEOSIDE:"nucleoside",LINKAGE:"phosphateBackbone"},o="p",i="<?>"},3480:(t,e,n)=>{"use strict";n.d(e,{C6:()=>l,Hs:()=>a,OT:()=>u,bD:()=>s});var r=n(6686),o=n(5067),i=n(9537);function s(t,e,n,o){const i=Object.keys(o.jsonData.codesToHelmDict).concat([r.NO.HELM]);if(!t||-1!==e&&n!==r.NO.HELM)return{};if(!i.includes(n))throw new Error(`${n} format is not supported by SequenceTranslator`);const s=i.filter((t=>t!=n)).sort(((t,e)=>t.localeCompare(e))),l=o.createFormatConverter(t,n),u=Object.fromEntries(s.map((t=>{let e;try{e=l.convertTo(t)}catch{e=null}return[t,e]})).filter((([t,e])=>e))),c=a(n===r.NO.HELM?t:u[r.NO.HELM],o.monomerLibWrapper);return c&&(u.Nucleotides=c),u}function a(t,e){const n=new RegExp("\\([^()]*\\)","g"),o=t.match(n);return o?o.map((t=>{const n=t.replace(/[\[\]()]/g,"");return r.AL.includes(n)?n:e.getNaturalAnalogBySymbol(n)})).map((t=>t||i.iL)).join(""):null}function l(t,e,n,i){const s=i.createFormatConverter(t,e);return n===o.qP?a(s.convertTo(r.NO.HELM),i.monomerLibWrapper):s.convertTo(n)}function u(t){return Object.keys(t.jsonData.codesToHelmDict).concat([r.NO.HELM,o.qP]).sort()}},5067:(t,e,n)=>{"use strict";n.d(e,{U_:()=>o,n_:()=>r,qP:()=>i});const r="Copied",o="Copy sequence",i="Nucleotides"},8742:(t,e,n)=>{"use strict";n.d(e,{_package:()=>Wt,applyNotationProviderForCyclized:()=>Yt});var r=n(4328),o=n(6082),i=n(439),s=n(7291);const a=new class{constructor(){this.seqHandler="seq-handler",this.notationProvider="seq-handler.notation-provider"}};o.SemanticValue;var l=n(2890);class u{constructor(t,e,n=""){this.target=t,this.debugEnabled=e,this.prefix=n}error(t,e,n){return this.target.error(this.prefix+t,e,n)}warning(t,e){return this.target.warning(this.prefix+t,e)}info(t,e){return this.target.info(this.prefix+t,e)}debug(t,e){if(this.debugEnabled)return this.target.debug(this.prefix+t,e)}}const c="System:AppData/SequenceTranslator/monomers-sample",f="pattern-app-data.json",h="formats-to-helm.json",d="codes-to-symbols.json",p="linkers.json";var g=n(6686);function m(t){return t.sort(((t,e)=>e.length-t.length))}class y{constructor(t,e){this.sequence=t,this.th=e,this.libWrapper=this.th.monomerLibWrapper}getInvalidCodeIndex(t){if(t===g.NO.HELM)return this.sequence.length;const e=["r","d"],n=m(this.libWrapper.getCodesByFormat(t));let r=0;for(;r<this.sequence.length;){const t=n.find((t=>t===this.sequence.substring(r,r+t.length)));if(!t)break;if(r>1&&g.AL.includes(this.sequence[r])&&e.includes(this.sequence[r-2]))break;if(e.includes(this.sequence[r+1])&&g.AL.includes(this.sequence[r])){r++;break}r+=t.length}return r===this.sequence.length&&(r=-1),r}isValidSequence(t){return-1===this.getInvalidCodeIndex(t)}}class v{constructor(t,e,n,r){this.patternAppData=t,this.codesToHelmDict=e,this.codesToSymbolsDict=n,this.monomersWithPhosphate=r}}async function b(t){const e=await Promise.all([f,h,d,p].map((e=>async function(t,e){const n=t.endsWith("/")?`${t}${e}`:`${t}/${e}`;try{const t=await r.dapi.files.readAsText(n);return JSON.parse(t)}catch(t){console.error(`Error loading json from '${n}':`,t)}}(t,e))));return new v(e[0],e[1],e[2],e[3])}class C{constructor(t,e){if(this.lib=t,this.jsonData=e,null===this.lib)throw new Error("SequenceTranslator: monomer library is null");this.allMonomers=this.getAllMonomers()}formatMonomerForViewer(t){const e={};return e.name=t.symbol,e.symbol=t.symbol,e.molfile=t.molfile,this.getAllFormats().forEach((n=>{if(n===g.NO.HELM)return;const r=this.jsonData.codesToSymbolsDict[n],o=Object.keys(r).filter((e=>r[e]===t.symbol));e[n]=o.join(", ")})),e}getAllMonomers(){const t=this.lib.getPolymerTypes();let e=[];for(const n of t){const t=this.lib.getMonomerSymbolsByType(n).map((t=>this.lib.getMonomer(n,t))).filter((t=>null!==t));e=e.concat(t)}return e}getMonomer(t){const e=this.lib.getMonomer("RNA",t);if(void 0===e)throw new Error(`SequenceTranslator: no monomer with symbol ${t}`);return e}getMolfileBySymbol(t){return this.getMonomer(t).molfile}getNaturalAnalogBySymbol(t){const e=this.getMonomer(t).naturalAnalog;if(!e)throw new Error(`ST: no natural analog for ${t}`);return e}isModification(t){return!!this.getMolfileBySymbol(t).includes("MODIFICATION")}getCodeToSymbolMap(t){return new Map(Object.entries(this.jsonData.codesToSymbolsDict[t]))}getCodesByFormat(t){return Object.keys(this.jsonData.codesToSymbolsDict[t])}getAllFormats(){return Object.keys(this.jsonData.codesToSymbolsDict)}getTableForViewer(){const t=this.allMonomers.map((t=>this.formatMonomerForViewer(t)));return o.DataFrame.fromObjects(t)}getCodesToWeightsMap(){const t=new Map;return Object.entries(this.jsonData.codesToSymbolsDict).forEach((([e,n])=>{Object.entries(n).forEach((([e,n])=>{const r=this.getMonomer(n),o=r.meta?.molecularWeight;t.set(e,o)}))})),t}}var A=n(9537);const w=(t,e)=>e.length-t.length;class E{constructor(t){this.th=t,this.formats=this.getFormats()}getFormatNames(){return this.formats.sort()}getCodesByFormat(t){if(this.validateFormat(t),this.isHelm(t))throw new Error("Codes cannot be obtained for HELM");return this.getFormatCodes(t)}getHelmToFormatDict(t){return this.validateFormat(t),function(t){const e={};return Object.values(t).forEach((t=>{Object.entries(t).forEach((([t,n])=>{const r=n.replace(/\)p/g,")").replace(/\]p/g,"]");void 0===e[r]?e[r]=[t]:e[r].push(t)}))})),Object.entries(e).forEach((([t,n])=>{const r=n.sort(w);e[t]=r[0]})),e}(this.th.jsonData.codesToHelmDict[t])}getFormatToHelmDict(t){this.validateFormat(t);const e=this.th.jsonData.codesToHelmDict[t];return Object.assign({},...Object.values(e))}getTargetFormatHelmCodes(t){this.validateFormat(t);const e=this.getHelmToFormatDict(t);return Object.keys(e).sort(w)}getTargetFormatHelmCodesRegExp(t){this.validateFormat(t);const e=this.getTargetFormatHelmCodes(t);return new RegExp(_(e)+"|.","g")}getFormatRegExp(t){if(this.validateFormat(t),this.isHelm(t))throw new Error("Helm RegExp can be built for non-HELM target formats");return this.getNonHelmFormatRegExp(t)}getPhosphateHelmCodesRegExp(t){this.validateFormat(t);const e=this.th.jsonData.codesToHelmDict[t],n=_(Array.from(new Set(Object.values(e[A.ti.LINKAGE]))).sort(w));return new RegExp(`${A.q7}.(${n})`,"g")}isValidFormat(t){return this.formats.includes(t)}getFormats(){return Object.keys(this.th.jsonData.codesToHelmDict)}validateFormat(t){if(!this.isValidFormat(t))throw new Error(`Invalid format: ${t}`)}isHelm(t){return t===g.NO.HELM}getFormatCodes(t){const e=this.getFormatToHelmDict(t);return Object.keys(e).sort(w)}getNonHelmFormatRegExp(t){const e=this.getCodesByFormat(t);return new RegExp(_(e)+"|\\([^()]*\\)|.","g")}}function _(t){return t.map((t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))).map((t=>t.includes("(")||t.includes(")")?t:`(?<!\\([^()]*)${t}(?![^()]*\\))`)).join("|")}const x={LEFT:"RNA1{",RIGHT:"}$$$$"};class T{constructor(t,e,n){this.sequence=t,this.sourceFormat=e,this.th=n,this.formats=new E(this.th)}convertTo(t){const e=this.formats.getFormatNames();if(this.sourceFormat===g.NO.HELM&&e.includes(t))return this.helmToFormat(this.sequence,t);if(e.includes(this.sourceFormat)&&t===g.NO.HELM)return this.formatToHelm(this.sequence,this.sourceFormat);if([this.sourceFormat,t].every((t=>e.includes(t)))){const e=this.formatToHelm(this.sequence,this.sourceFormat);return this.helmToFormat(e,t)}throw new Error(`ST: unsupported translation direction ${this.sourceFormat} -> ${t}`)}helmToFormat(t,e){const n=new RegExp(_(Object.values(x)),"g");let r=t.replace(n,"");const o=this.formats.getHelmToFormatDict(e),i=this.formats.getTargetFormatHelmCodes(e),s=this.formats.getTargetFormatHelmCodesRegExp(e);return r=r.replace(s,(t=>i.includes(t)?o[t]:"p"===t||"."===t?t:"?")).replace(/\?+/g,A.iL).replace(/p\.|\./g,""),r=r.replace(/<empty>/g,""),r=r.replace(/\/\//g,"/"),r}formatToHelm(t,e){const n=this.formats.getFormatToHelmDict(e),r=this.formats.getCodesByFormat(e),o=this.formats.getFormatRegExp(e),i=this.formats.getPhosphateHelmCodesRegExp(e);let s=t?t.replace(o,(t=>r.includes(t)?n[t]+".":"?")):"";return s=s.replace(/\?+/g,`${A.iL}.`),s=s.slice(0,-1),s[s.length-1]===A.q7&&(s=s.slice(0,-1)),s=s.replace(i,((t,e)=>e)),s=s.replace(/<empty>/g,""),`${x.LEFT+s+x.RIGHT}`}}class I{constructor(t,e){this.sequence=t,this.th=e,this.libWrapper=this.th.monomerLibWrapper,this.formats=Object.keys(this.th.jsonData.codesToHelmDict)}getFormat(){if(this.sequence.startsWith("RNA"))return g.NO.HELM;const t=this.getListOfPossibleSynthesizersByFirstMatchedCode();if(0===t.length)return null;const e=this.th.createSequenceValidator(this.sequence),n=Array(t.length).fill(0);for(let r=0;r<t.length;++r){const o=t[r];n[r]=e.getInvalidCodeIndex(o)}const r=n.some((t=>-1===t))?-1:Math.max(...n);return t[n.indexOf(r)]}getListOfPossibleSynthesizersByFirstMatchedCode(){const t=this.sequence,e=[];for(const n of this.formats){const r=m(this.libWrapper.getCodesByFormat(n));let o=0;for(let e=0;e<t.length;e++)if(")"===t[e]&&e!==t.length-1){o=e+1;break}r.some((e=>e===t.slice(o,o+e.length)))&&e.push(n)}return e}}var N=n(7389);const S=$;var L=n.n(S);class P extends o.Package{get helmHelper(){if(!this._helmHelper)throw new Error("Package SequenceTranslator .helmHelper is not initialized");return this._helmHelper}get seqHelper(){return this._helmHelper.seqHelper}get monomerLib(){if(!this._monomerLib)throw new Error("Monomer lib not loaded");return this._monomerLib}get jsonData(){if(!this._jsonData)throw new Error("Json data not loaded");return this._jsonData}get monomerLibWrapper(){if(!this._monomerLibWrapper)throw new Error("Monomer lib wrapper not loaded");return this._monomerLibWrapper}get initPromise(){return this._initPromise}constructor(t={debug:!1}){super(),this.highlightInvalidSubsequence=t=>function(t,e){let n=0;const r=e.createFormatDetector(t).getFormat();null!==r&&(n=new y(t,e).getInvalidCodeIndex(r));const o=n<0||""===t,i=N.span([]);L()(i).css("-webkit-text-fill-color","var(--grey-6)");const s=N.span([]);return L()(s).css("-webkit-text-fill-color","red"),o?i.innerHTML=t:(i.innerHTML=t.slice(0,n),s.innerHTML=t.slice(n)),[i,s]}(t,this),super._logger=new u(super.logger,t.debug)}startInit(t){this._initPromise=t}completeInit(t){this._helmHelper=t}async initLibData(){return this.initLibDataPromise||(this.initLibDataPromise=(async()=>{const t=await this.getSettings();let e=t instanceof Map?t.get("MonomersPath"):t.MonomersPath;e&&await r.dapi.files.exists(e)||(this.logger.warning(`Monomers path '${e}' not found. Fallback to monomers sample path '${c}'.`),e=c),[this._jsonData,this._monomerLib]=await Promise.all([b(e),O(e)]),this._monomerLibWrapper=new C(this.monomerLib,this.jsonData)})()),this.initLibDataPromise}async getTranslationHelper(){return await r.functions.call(`${this.name}:getTranslationHelper`)}createSequenceValidator(t){return new y(t,this)}createFormatConverter(t,e){return new T(t,e,this)}createFormatDetector(t){return new I(t,this)}}async function O(t){const e=o.TaskBarProgressIndicator.create("Initializing Oligo Toolkit monomer library ...");try{const e=await(0,l.pj)();return await e.readLibrary(t,"monomer-lib.json")}finally{e.close()}}const M=["SS","AS"],R={SS:"Sense strand",AS:"Anti sense"},D=["3'","5'"];var B,H,F,k;!function(t){t.IS_ANTISENSE_STRAND_INCLUDED="isAntisenseStrandIncluded",t.NUCLEOTIDE_SEQUENCES="nucleotideSequences",t.PHOSPHOROTHIOATE_LINKAGE_FLAGS="phosphorothioateLinkageFlags",t.STRAND_TERMINUS_MODIFICATIONS="strandTerminusModifications"}(B||(B={})),function(t){t.PATTERN_NAME="patternName",t.PATTERN_COMMENT="patternComment",t.NUCLEOTIDES_WITH_NUMERIC_LABELS="nucleotidesWithNumericLabels"}(H||(H={})),function(t){t.PATTERN_CONFIG="patternConfig",t.AUTHOR_ID="authorID",t.DATE="date"}(F||(F={})),function(t){t.CREATE="create",t.MODIFY="modify"}(k||(k={})),B.IS_ANTISENSE_STRAND_INCLUDED,B.NUCLEOTIDE_SEQUENCES,B.PHOSPHOROTHIOATE_LINKAGE_FLAGS,B.STRAND_TERMINUS_MODIFICATIONS,H.PATTERN_NAME,H.PATTERN_COMMENT,H.NUCLEOTIDES_WITH_NUMERIC_LABELS,Error,Error,n(4802);const G=rxjs;var U;rxjs.operators,function(t){t.getTruncatedStrandData=function(t,e,n){return{nucleotides:t.slice(0,n),ptoFlags:e.slice(0,n+1)}},t.getExtendedStrandData=function(t,e,n,r){const o=n-t.length,i=t.concat(new Array(n-t.length).fill(r)),s=0===t.length?n+1:o;return{nucleotides:i,ptoFlags:e.concat(new Array(s).fill(!0))}}}(U||(U={}));var j=n(2543),V=n.n(j),W=n(5072),Y=n.n(W),q=n(7825),K=n.n(q),z=n(7659),J=n.n(z),Q=n(5056),X=n.n(Q),Z=n(540),tt=n.n(Z),et=n(1113),nt=n.n(et),rt=n(9252),ot={};ot.styleTagTransform=nt(),ot.setAttributes=X(),ot.insert=J().bind(null,"head"),ot.domAPI=K(),ot.insertStyleElement=tt(),Y()(rt.A,ot),rt.A&&rt.A.locals&&rt.A.locals;class it{constructor(t,e,n){this.eventBus=t,this.initialPatternConfig=e,this.subscriptions=n}create(){return N.divV([N.h1("PTO"),N.divH([this.createAllPtoActivationInput().root,...this.createFirstPtoInputs().map((t=>t.root))],{style:{gap:"12px"}})])}areAllPtoLinkagesSet(t){return M.map((e=>t[e].filter((t=>t)).length)).reduce(((t,e)=>t+e),0)===M.map((t=>this.initialPatternConfig.nucleotideSequences[t].length)).reduce(((t,e)=>t+e),0)+M.filter((e=>t[e].length)).length}createAllPtoActivationInput(){const t=this.initialPatternConfig.phosphorothioateLinkageFlags,e=this.areAllPtoLinkagesSet(t),n=N.input.bool("All PTO",{value:e});n.onInput.subscribe((()=>{const t=n.value;this.eventBus.setAllPTOLinkages(t)}));const r=this.eventBus.phosphorothioateLingeFlagsChanged$.subscribe((()=>{const t=this.eventBus.getPatternConfig().phosphorothioateLinkageFlags,e=this.areAllPtoLinkagesSet(t);n.value=e}));return this.subscriptions.add(r),this.addStyleToPtoInput(n),N.tooltip.bind(n.captionLabel,"Activate all phosphothioates"),n}addStyleToPtoInput(t){const e=t.captionLabel;e.classList.add("ui-label-right"),Object.assign(e.style,{textAlign:"left",maxWidth:"100px",minWidth:"40px",width:"auto"})}createFirstPtoInputs(){return M.map((t=>{if(!this.eventBus.isAntisenseStrandActive()&&"AS"===t)return;const e=this.isFirstPtoActive(t),n=N.input.bool(`First ${t} PTO`,{value:e});n.onInput.subscribe((()=>{const e=n.value;this.eventBus.setPhosphorothioateLinkageFlag(t,0,e)}));const r=this.eventBus.phosphorothioateLingeFlagsChanged$.subscribe((e=>{const r=e[t][0];n.value=r}));return this.subscriptions.add(r),this.addStyleToPtoInput(n),N.tooltip.bind(n.captionLabel,`Activate first phosphothioate in ${t}`),n})).filter((t=>void 0!==t))}isFirstPtoActive(t){return this.initialPatternConfig.phosphorothioateLinkageFlags[t][0]}}class st{constructor(t,e,n){this.eventBus=t,this.dataManager=e,this.subscriptions=n;const r=this.eventBus.nucleotideSequencesChanged$.subscribe((()=>{this.displayedInputLabels=this.computeDisplayedInputLabels()}));this.subscriptions.add(r)}create(){const t=M.map((t=>this.constructControlsPanel(t)));return N.divH(t,{style:{gap:"24px"}})}constructControlsPanel(t){if(!this.eventBus.isAntisenseStrandActive()&&"AS"===t)return N.div([]);const e=this.constructHeader(),n=this.createControls(t);return N.block([N.h1(`${R[t]}`),e,n],{style:{paddingTop:"12px"}})}constructHeader(){return N.divH([N.div([N.divText("#")],{style:{width:"20px"}}),N.block75([N.divText("Modification")]),N.div([N.divText("PTO")])])}createControls(t){const e=this.createNucleobaseInputs(t),n=this.createLabelDivs(t),r=this.createPTOFlagInputs(t);return N.div(e.map(((t,e)=>N.divH([n[e],N.block75([t.root]),r[e].root],{style:{alignItems:"center"}}))))}createNucleobaseInputs(t){const e=this.dataManager.fetchAvailableNucleotideBases().sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase())));return this.eventBus.getNucleotideSequences()[t].map(((n,r)=>{const o=N.input.choice("",{value:n,items:e});return o.onInput.subscribe((()=>{const e=o.value;this.eventBus.setNucleotide(t,r,e)})),o}))}createPTOFlagInputs(t){return this.eventBus.getPhosphorothioateLinkageFlags()[t].slice(1).map(((e,n)=>{const r=N.input.bool("",{value:e});r.onInput.subscribe((()=>{const e=r.value;this.eventBus.setPhosphorothioateLinkageFlag(t,n+1,e)}));const o=this.eventBus.phosphorothioateLingeFlagsChanged$.subscribe((e=>{const o=e[t][n+1];r.value=o}));return this.subscriptions.add(o),r}))}computeDisplayedInputLabels(){const t=this.eventBus.getNucleotideSequences(),e=new Map;return M.forEach((n=>{let r=1;const o=t[n].map((t=>{if(function(t){return t.endsWith("(o)")}(t))return"";const e=String(r);return r++,e}));e.set(n,o)})),e}createLabelDivs(t){const e=this.createLabels(t).map((t=>N.div([t],{style:{width:"20px"}}))),n=this.eventBus.nucleotideSequencesChanged$.subscribe((()=>{this.createLabels(t).forEach(((t,n)=>{L()(e[n]).empty(),L()(e[n]).append(t)}))}));return this.subscriptions.add(n),e}createLabels(t){return this.eventBus.getNucleotideSequences()[t].map(((e,n)=>{const r=this.displayedInputLabels.get(t)[n];return N.label(r)}))}}class at{constructor(){this.rxjsSubscriptions=[],this.dgSubscriptions=[]}add(t){t instanceof G.Subscription?this.rxjsSubscriptions.push(t):this.dgSubscriptions.push(t)}unsubscribeAll(){for(const t of[this.rxjsSubscriptions,this.dgSubscriptions])t.forEach((t=>t.unsubscribe())),t.length=0}}class lt{constructor(t,e){this.eventBus=t,this.dataManager=e,this.subscriptions=new at}static open(t,e){lt.isDialogOpen||(lt.instance||(lt.instance=new lt(t,e)),lt.instance.openDialog())}openDialog(){this.initialPatternConfig=V().cloneDeep(this.eventBus.getPatternConfig()),lt.isDialogOpen=!0,this.createDialog().show()}createDialog(){const t=N.divV([]);this.subscriptions.add(this.eventBus.strandsUpdated$.subscribe((()=>this.onStrandsUpdated(t))));const e=N.dialog("Edit strands").add(t).onOK((()=>{})).onCancel((()=>this.resetToInitialState()));return this.subscriptions.add(e.onClose.subscribe((()=>{lt.isDialogOpen=!1,this.subscriptions.unsubscribeAll()}))),e}onStrandsUpdated(t){const e=new it(this.eventBus,this.initialPatternConfig,this.subscriptions).create(),n=new st(this.eventBus,this.dataManager,this.subscriptions).create();L()(t).empty(),L()(t).append(e,n)}resetToInitialState(){this.eventBus.setPatternConfig(this.initialPatternConfig)}}lt.isDialogOpen=!1;class ut{constructor(t){this.eventBus=t,this.subscriptions=new at}static open(t){ut.isDialogOpen||(ut.instance||(ut.instance=new ut(t)),ut.instance.openDialog())}openDialog(){this.initialPatternConfig=V().cloneDeep(this.eventBus.getPatternConfig()),ut.isDialogOpen=!0,this.createDialog().show()}createDialog(){const t=N.divV([]);this.subscriptions.add(this.eventBus.strandsUpdated$.subscribe((()=>this.onStrandsUpdated(t))));const e=N.dialog("Edit terminal modifications").add(t).onOK((()=>{})).onCancel((()=>this.resetToInitialState()));return this.subscriptions.add(e.onClose.subscribe((()=>{ut.isDialogOpen=!1,this.subscriptions.unsubscribeAll()}))),e}onStrandsUpdated(t){const e=new ct(this.eventBus).create();L()(t).empty(),L()(t).append(e)}resetToInitialState(){this.eventBus.setPatternConfig(this.initialPatternConfig)}}ut.isDialogOpen=!1;class ct{constructor(t){this.eventBus=t}create(){const t=M.map((t=>this.constructControlsPanel(t)));return N.divH(t,{style:{gap:"24px"}})}constructControlsPanel(t){if(!this.eventBus.isAntisenseStrandActive()&&"AS"===t)return N.div([]);const e=this.createInputs(t);return N.block([N.h1(`${R[t]}`),e],{style:{paddingTop:"12px"}})}createInputs(t){const e=("SS"===t?[...D].reverse():D).map((e=>this.createInputForTerminus(t,e)));return N.form(e)}createInputForTerminus(t,e){const n=this.eventBus.getTerminalModifications()[t][e],r=N.input.textArea(e,{value:n});return this.applyStylingToInput(r),r.onInput.subscribe((()=>{const n=r.value;null!==n&&this.eventBus.updateTerminusModification(t,e,n)})),r}applyStylingToInput(t){const e=t.root.getElementsByTagName("textarea")[0];L()(e).css("resize","none")}}n(9146);var ft=n(8507),ht={};ht.styleTagTransform=nt(),ht.setAttributes=X(),ht.insert=J().bind(null,"head"),ht.domAPI=K(),ht.insertStyleElement=tt(),Y()(ft.A,ht),ft.A&&ft.A.locals&&ft.A.locals;var dt,pt=n(2074),gt={};gt.styleTagTransform=nt(),gt.setAttributes=X(),gt.insert=J().bind(null,"head"),gt.domAPI=K(),gt.insertStyleElement=tt(),Y()(pt.A,gt),pt.A&&pt.A.locals&&pt.A.locals,function(t){t.TYPE="V2000",t[t.NUM_OF_HEADER_LINES=3]="NUM_OF_HEADER_LINES",t[t.NUM_OF_COUNTS_DIGITS=3]="NUM_OF_COUNTS_DIGITS",t[t.ATOM_TYPE_COL=4]="ATOM_TYPE_COL",t[t.FIRST_BONDED_ATOM_COL=1]="FIRST_BONDED_ATOM_COL",t[t.BOND_TYPE_COL=3]="BOND_TYPE_COL",t[t.RGP_SHIFT=8]="RGP_SHIFT",t[t.MAX_ATOM_COUNT=999]="MAX_ATOM_COUNT",t.RGP_LINE_START="M RGP",t.ATOM_ALIAS_LINE_START="A ",t.END="M END"}(dt||(dt={})),Error,Error,n(5670);var mt=n(2003);n(3480),n(5067);var yt=n(5254),vt={};vt.styleTagTransform=nt(),vt.setAttributes=X(),vt.insert=J().bind(null,"head"),vt.domAPI=K(),vt.insertStyleElement=tt(),Y()(yt.A,vt),yt.A&&yt.A.locals&&yt.A.locals;var bt=n(8070);n(9124);var Ct=n(8312),At=n(1991),wt=n.n(At);"object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,new Set;const Et="object"==typeof process&&process?process:{};let _t=globalThis.AbortController,xt=globalThis.AbortSignal;if(void 0===_t){xt=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},_t=class{constructor(){e()}signal=new xt;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==Et.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{var n,r,o,i;t&&(t=!1,n="AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.",r="NO_ABORT_CONTROLLER",o="ENOTSUP",i=e,"function"==typeof Et.emitWarning?Et.emitWarning(n,r,o,i):console.error(`[${o}] ${r}: ${n}`))}}Symbol("type"),Symbol.iterator,Symbol.toStringTag,n(6077),n(3561),n(9235);function Tt(t,e){try{const n=t.tableColumn;if(!n)return;const r=function(t){return t.temp.MonomerHoverLinks??[]}(n);for(let n=r.length-1;n>=0;--n){const o=r[n],i=t.grid.col(o.targetCol.name);if(i&&!o.handler(t,e,i))break}}catch(t){console.error(t)}}n(6717),n(100),n(4229),n(5174),n(5412),n(6197);class It extends o.InputBase{constructor(t,e){super(N.input.column(t,e).dart,e?.onValueChanged),this.options=e}setColumnInputTable(t){N.input.setColumnInputTable(this,t,this.options?.filter)}}N.input.column2=function(t,e){return new It(t,e)},n(1296),n(3820),o.JsInputBase,o.JsInputBase;var Nt,St=n(6307);n(3151),function(t){t.table="table",t.seqCol="seqCol",t.generateHelm="generateHelm",t.chiralityEngine="chiralityEngine",t.rules="rules"}(Nt||(Nt={}));class Lt{onKeyDown(t,e){}onKeyPress(t,e){}onMouseEnter(t,e){}onMouseLeave(t,e){}onMouseDown(t,e){}onMouseUp(t,e){}onMouseMove(t,e){}onClick(t,e){}onDoubleClick(t,e){}}class Pt extends Lt{constructor(t,e,n){super(),this.gridCol=t,this.tableCol=e,this.logger=n,this.subs=[],this.dirty=!0,this.destroyed=!1,this.viewerId=++Pt.viewerCounter,this.errors=[],this._onRendered=new G.Subject,this.tableCol&&this.tableCol.dataFrame&&(this.subs.push(this.tableCol.dataFrame.onDataChanged.subscribe((()=>{this.dirty=!0}))),this.subs.push(this.tableCol.dataFrame.onColumnsRemoved.subscribe((t=>{try{this.destroyed||!this.tableCol||this.tableCol.dataFrame||this.destroy()}catch(t){this.logger.error(t)}})))),this.tableCol&&this.subs.push(r.events.onTableRemoved.subscribe((t=>{try{const e=t.args.dataFrame;this.tableCol?.dataFrame.id!==e.id||this.destroyed||this.destroy()}catch(t){this.logger.error(t)}}))),this.gridCol&&this.subs.push(r.events.onViewRemoving.subscribe((t=>{try{const e=t.args.view;this.gridCol?.dart&&this.gridCol.grid&&this.gridCol?.grid?.dart&&this.gridCol?.grid?.view?.id===e.id&&!this.destroyed&&this.destroy()}catch(t){this.logger.error(t)}})))}toLog(){return`${this.constructor.name}<${this.viewerId}>`}destroy(){for(const t of this.subs)t.unsubscribe();this.destroyed=!0}invalidateGrid(){this.gridCol&&this.gridCol.dart&&this.gridCol.grid?.invalidate()}reset(){this.dirty=!1}get onRendered(){return this._onRendered}invalidate(t){this.invalidateGrid()}async awaitRendered(t=1e4,e=`${t} timeout`){const n=`${this.toLog()}.awaitRendered()`;if(this.logger.debug(`${n}, start, testEvent before`),await(0,bt.PE)(this._onRendered,(()=>{}),(()=>{this.invalidate()}),t,`${n}, ${e}`),this.errors.length>0){const t=this.errors[0];throw this.errors=[],t}this.logger.debug(`${n}, end`)}}Pt.viewerCounter=-1;var Ot=n(9192);const Mt=s.zS;var Rt,$t,Dt;!function(t){t.maxMonomerLength=".mm.cellRenderer.maxMonomerLength"}(Rt||(Rt={})),function(t){t.applyToBackground=".m.cellRenderer.applyToBackground"}($t||($t={})),function(t){t.MSA="MSA",t.classic="classic"}(Dt||(Dt={}));const Bt=new class{constructor(){this.color="rgb(100,100,100)",this.pivot=0,this.left=!1,this.transparencyRate=1,this.separator="",this.last=!1,this.drawStyle=Dt.classic,this.maxWord=[],this.wordIdx=0,this.gridCell=null,this.referenceSequence=null,this.maxLengthOfMonomer=null,this.monomerTextSizeMap={},this.logger=void 0}};function Ht(t,e,n,r,o,i,s){var a,l,u;const c=Object.assign(Object.assign({},Bt),s);s.logger?.debug("Bio: printLeftOrCentered(), start"),t.textAlign="start";let f=e.substring(0),h=c.last?"":c.separator;c.drawStyle===Dt.MSA&&(h="");let d=!0,p=!0,g="difference";if(null!=c.gridCell&&null!=c.gridCell.cell.column&&(d=c.gridCell.cell.column.temp["color-code"]??!0,p=c.gridCell.cell.column.temp["compare-with-current"]??!0,g=c.gridCell.cell.column.temp["highlight-difference"]??"difference"),c.referenceSequence){const t=c.referenceSequence[c.wordIdx];p&&c.referenceSequence.length>0&&"difference"===g&&(c.transparencyRate=f==t?.3:c.transparencyRate),p&&c.referenceSequence.length>0&&"equal"===g&&(c.transparencyRate=f!=t?.3:c.transparencyRate)}null!=c.maxLengthOfMonomer&&(f=Mt(f,c.maxLengthOfMonomer));const m=f+h;(a=c.monomerTextSizeMap)[m]??(a[m]=t.measureText(m));let y=c.monomerTextSizeMap[m];(l=c.monomerTextSizeMap)[f]??(l[f]=t.measureText(f));let v=c.monomerTextSizeMap[f].width;const b=i/2-(y.fontBoundingBoxAscent+y.fontBoundingBoxDescent)/2+1;(u=c.monomerTextSizeMap)[h]??(u[h]=t.measureText(h));const C=c.monomerTextSizeMap[h].width;function A(e,o){const i=d?c.color:"rgb(0,0,0)";t.fillStyle=i,t.globalAlpha=c.transparencyRate,c.drawStyle===Dt.classic&&(t.fillText(f,n+e,r+b),t.fillStyle="#808080",t.fillText(h,n+o,r+b)),c.drawStyle===Dt.MSA&&t.fillText(f,n+e,r+b)}y=y.width,c.drawStyle===Dt.MSA&&(v=c.maxWord[c.wordIdx],y=c.maxWord[c.wordIdx]);const w=(c.maxWord[c.wordIdx]??0)-(c.maxWord[0]??0);if(c.left||y>o)return A(w,w+v),n+w+v+C;{const t=(o-y)/2;return A(t,t+v),n+w+t+v}}var Ft=n(3599);const kt="rgb(100,100,100)";class Gt extends Pt{get separatorWidth(){return this.props?.fontCharWidth?this.props?.fontCharWidth:5}constructor(t,e,n,r,i){super(t,e,n),this.monomerLengthLimit=r,this.propsProvider=i,this.colWidth=0,this._monomerLengthList=null,this._processedMaxVisibleSeqLength=0,this._monomerLengthMap={},this._monomerStructureMap={},this.sysMonomerLib=null,this.padding=5,this.props=this.propsProvider(),this._processedRows=o.BitSet.create(this.tableCol.length),this.gridCol&&this.subs.push(this.gridCol.grid.onAfterDrawContent.subscribe((()=>{this._onRendered.next()}))),this.tableCol&&this.gridCol&&this.subs.push(this.tableCol.dataFrame.onCurrentRowChanged.subscribe((()=>{const t=this.tableCol.dataFrame;this.gridCol.grid,-1===t.currentRowIdx&&(this.tableCol.temp["reference-sequence"]=null,this.tableCol.temp["current-word"]=null,this.invalidateGrid())})))}async init(){await Promise.all([(async()=>{this.seqHelper=await(0,Ct.Q)(),this.invalidateGrid()})(),(async()=>{const t=await(0,l.pj)();this.sysMonomerLib=t.getMonomerLib()})()]),this.subs.push(this.sysMonomerLib.onChanged.subscribe((()=>{this.reset()}))),this.reset()}static getFontSettings(t){let e=12;return t&&t.temp[".mm.cellRenderer.fontSize"]&&"number"==typeof t.temp[".mm.cellRenderer.fontSize"]&&!isNaN(t.temp[".mm.cellRenderer.fontSize"])&&(e=Math.max(t.temp[".mm.cellRenderer.fontSize"],1)),{font:`${e}px monospace`,fontWidth:.6*e}}toLog(){return`MonomerPlacer<${this.viewerId}>`}getMonomerLib(){return this.tableCol.temp[".mm.cellRenderer.overriddenLibrary"]??this.sysMonomerLib}reset(){this.propsProvider&&(this.props=this.propsProvider()),this._processedRows=o.BitSet.create(this.tableCol.length),this._monomerLengthList=null,this._monomerLengthMap={},this._monomerStructureMap={},super.reset(),this.invalidateGrid()}invalidateGrid(){this.gridCol&&this.gridCol.dart&&this.gridCol.grid?.invalidate()}getCellMonomerLengths(t,e){const n=this.seqHelper.getSeqHandler(this.tableCol);if(this.colWidth<e&&(this.colWidth=e,this.dirty=!0),this.dirty)try{this.reset()}catch(t){const[e,n]=(0,Ot.AP)(t);this.logger.error(e,void 0,n)}const r=n.isMsa()?this.getCellMonomerLengthsForSeqMsa():this.getCellMonomerLengthsForSeq(t);return[r,this.getSummedMonomerLengths(r)]}getSummedMonomerLengths(t){const e=new Array(t.length+1);e[0]=5;for(let n=1;n<e.length;n++)e[n]=e[n-1]+t[n-1];let n=e[0];for(let t=1;t<e.length;t++)e[t]?n=e[t]:e[t]=n;return e}getCellMonomerLengthsForSeq(t){this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(this.tableCol.length).fill(null));const e=this.seqHelper.getSeqHandler(this.tableCol),n=this.props.separatorWidth+1*this.props.fontCharWidth,r=Math.ceil(this.colWidth/n),o=e.getSplitted(t),i=Math.min(r,o.length);let s=this._monomerLengthList[t];if(null===s||s.length<i){s=this._monomerLengthList[t]=new Array(o.length);let n=0;for(let t=0;t<i;++t){const r=o.getOriginal(t),i=this.props.monomerToShort(r,this.monomerLengthLimit),a=(e.isSeparator()?this.separatorWidth:this.props.separatorWidth)+i.length*this.props.fontCharWidth;if(s[t]=a,n+=a,n>this.colWidth)break}}return s}getCellMonomerLengthsForSeqValue(t,e){const n=this.seqHelper.getSeqHandler(this.tableCol),r=this.props.separatorWidth+1*this.props.fontCharWidth,o=Math.ceil(e/r),i=n.splitter(t),s=Math.min(o,i.length),a=new Array(s);let l=0;for(let t=0;t<s;++t){const r=i.getOriginal(t),o=this.props.monomerToShort(r,this.monomerLengthLimit),s=(n.isSeparator()?this.separatorWidth:this.props.separatorWidth)+o.length*this.props.fontCharWidth;if(a[t]=s,l+=s,l>e)break}return a}getCellMonomerLengthsForSeqMsa(){var t;this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(1).fill(null)),(t=this._monomerLengthList)[0]??(t[0]=new Array(0));const e=this._monomerLengthList[0],{startIdx:n,endIdx:r}=(()=>{try{const t=this.gridCol&&this.gridCol.dart?this.gridCol.grid:null;return t&&t.dart?{startIdx:Math.max(Math.floor((t?.vertScroll.min??0)-10),0),endIdx:Math.min(Math.ceil((t?.vertScroll.max??0)+10),this.tableCol.length)}:{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}catch(t){return{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}})(),o=this.props.separatorWidth+1*this.props.fontCharWidth,i=Math.ceil(this.colWidth/o);for(let t=n;t<r;t++){if(this._processedRows.get(t)&&i<=this._processedMaxVisibleSeqLength)continue;const n=this.seqHelper.getSeqHandler(this.tableCol).getSplitted(t,i),r=Math.min(i,n.length);r>e.length&&e.push(...new Array(r-e.length).fill(o));let s=0;for(let t=0;t<r;++t){const r=n.getOriginal(t),o=this.props.monomerToShort(r,this.monomerLengthLimit),i=this.props.separatorWidth+o.length*this.props.fontCharWidth;if(e[t]=Math.max(e[t]??0,i),s+=i,s>=this.colWidth)break}this._processedMaxVisibleSeqLength=Math.max(this._processedMaxVisibleSeqLength,i)}return e}getPosition(t,e,n){const[r,o]=this.getCellMonomerLengths(t,n);return 0===this.seqHelper.getSeqHandler(this.tableCol).getSplitted(t).length?null:function(t,e){let n,r=100,o=0,i=t.length-1;for(;o<=i;){if(n=Math.floor((i+o)/2),t[n]<=e&&e<t[n+1])return n;if(e<t[n]?i=n-1:o=n+1,--r<=0)throw new Error(`Get position for pointer x = ${e} searching has not converged on ${JSON.stringify(t)}. `)}return null}(o,e)}setMonomerLengthLimit(t){this.monomerLengthLimit!=t&&(this.monomerLengthLimit=t,this.dirty=!0)}setSeparatorWidth(t){this.separatorWidth!=t&&(this.props.separatorWidth=t,this.dirty=!0)}render(t,e,n,r,o,i,s){const a=i.grid?.canvas===t.canvas;if(!this.seqHelper)return;const l=this.gridCol,u=this.tableCol,c=window.devicePixelRatio,f=`${this.toLog()}.render()`;this.logger.debug(`${f}, start`);let h=this.monomerLengthLimit;if(Rt.maxMonomerLength in u.tags){const t=parseInt(u.getTag(Rt.maxMonomerLength));h=!isNaN(t)&&t?t:50}if(".mm.cellRenderer.maxMonomerLength"in u.temp){const t=u.temp[".mm.cellRenderer.maxMonomerLength"];h=!isNaN(t)&&t?t:50}t.save();try{const s=this.seqHelper.getSeqHandler(u);if("1"===u.temp[".mm.cellRenderer.settingsChanged"]||this.monomerLengthLimit!=h){let t=0;const e=8;t=u.temp[".mm.cellRenderer.gapLength"]??t,this.setMonomerLengthLimit(h),this.setSeparatorWidth(s.isMsa()?e:t),u.temp[".mm.cellRenderer.settingsChanged"]="0"}let[f,d]=this.getCellMonomerLengths(i.tableRowIndex,r);f.length;const p=i.cell.value,g=i.cell.rowIndex,m=(u.getTag(mt.gp.alphabet),50);a&&(r=function(t,e,n,r,o){return t?Math.max(Math.min(t.canvas.width/o-n,r)):Math.max(e.canvas.width/o-n,0)}(l?.grid,t,e,r,c)),t.beginPath(),t.rect(e+this.padding,n+this.padding,r-this.padding-1,o-2*this.padding),t.clip(),t.font=this.props?.font??"12px monospace",t.textBaseline="top";const y=u.meta.units,v=u.getTag(mt.gp.aligned),b=u.getTag(mt.gp.separator)??"",C=this.props.separatorWidth+1*this.props.fontCharWidth,A=Math.ceil(r/C),w=u.temp["reference-sequence"],E=this.tableCol.temp["current-word"];E&&-1===u?.dataFrame?.currentRowIdx&&(this.tableCol.temp["current-word"]=null);const _=(()=>{const t=s.getSplitter(A)(null!=w&&""!=w?w:E??"");return wt().count(0).take(t.length).map((e=>t.getOriginal(e))).toArray()})(),x=a?s.getSplitted(g):s.splitter(p);a||(d=this.getSummedMonomerLengths(this.getCellMonomerLengthsForSeqValue(p,r)));let T=Dt.classic;v&&v.includes("MSA")&&y==mt.Hi.SEPARATOR&&(T=Dt.MSA);const I=Math.min(x.length,A);for(let a=0;a<I;++a){const l=x.getOriginal(a),u=x.getCanonical(a);let c=kt;const f=this.getMonomerLib();if(f){const t=s.defaultBiotype;c=f.getMonomerTextColor(t,u)}t.fillStyle=kt;const p={color:c,pivot:0,left:!0,transparencyRate:1,separator:b,last:a===x.length-1,drawStyle:T,maxWord:d,wordIdx:a,gridCell:i,referenceSequence:_,maxLengthOfMonomer:h,monomerTextSizeMap:this._monomerLengthMap,logger:this.logger};if(Ht(t,l,e+this.padding,n,r,o,p),m>r)break}}catch(t){const[e,n]=(0,Ot.AP)(t);this.logger.error(e,void 0,n),this.errors.push(t)}finally{t.restore()}}onMouseMove(t,e){const n=`${this.toLog()}.onMouseMove()`;if(!this.seqHelper||null==t.tableRowIndex)return;const r=t.bounds,o=e.offsetX-t.gridColumn.left+(t.gridColumn.left-r.x),i=this.getPosition(t.tableRowIndex,o,r.width);this.logger.debug(`${n}, start, argsX: ${o}, left: ${i}`);const s=this.seqHelper.getSeqHandler(this.tableCol),a=s.getSplitted(t.tableRowIndex);if(null!==i&&i<a.length){const n=s.alphabet??mt.YI.UN,r={position:i,biotype:n===mt.YI.RNA||n===mt.YI.DNA?Ft.o.NUCLEOTIDE:Ft.o.AA,symbol:a.getCanonical(i)},o=[];let l=this._monomerStructureMap[r.symbol];{const t=this.getMonomerLib();l=this._monomerStructureMap[r.symbol]=t?t.getTooltip(r.biotype,r.symbol):N.divText("Monomer library is not available")}o.push(l),N.tooltip.show(N.divV(o),e.x+16,e.y+16),Tt(t,r)}else N.tooltip.hide(),Tt(t,null)}}class Ut extends Gt{constructor(t,e,n,r){super(t,e,Wt.logger,n,(()=>{const t=r.getSeqHandler(e),{font:n,fontWidth:o}=Gt.getFontSettings(e);return{seqHandler:t,font:n,fontCharWidth:o,separatorWidth:11,monomerToShort:mt.zS}}))}onMouseMove(t,e){super.onMouseMove(t,e)}}class jt{get defaultGapOriginal(){return""}constructor(t,e){this.separator=t,this.helmHelper=e,this.separatorSplitter=(0,mt.dh)(this.separator),this.splitter=this._splitter.bind(this)}setUnits(){}_splitter(t){const e=this.separatorSplitter(t);return new Vt(wt().count(0).take(e.length).map((t=>e.getOriginal(t))).toArray(),i.b9[i.Hi.SEPARATOR])}getHelm(t,e){return St.s.fromSeparator(t,this.helmHelper).getHelm()}createCellRendererBack(t,e){const n=new Ut(t,e,4,this.helmHelper.seqHelper);return n.init().then((()=>{})),n}}class Vt extends s.Mu{getCanonical(t){if(this.isGap(t))return i._S;const e=this.getOriginal(t);let n=e;return e.startsWith("{")?n=e.slice(1):e.endsWith("}")?n=e.slice(0,-1):e.startsWith("(")?n=e.replace(/^\(.\d+\)/,""):e.endsWith(")")&&(n=e.replace(/\(\d+\)$/,"")),n}constructor(t,e){super(t,e)}}const Wt=new P({debug:!0});function Yt(t,e){t.setTag("aligned","SEQ"),t.setTag("alphabet","UN"),t.setTag(".alphabetIsMultichar","true"),t.meta.units=i.Hi.CUSTOM,t.tags["polytool-data-role"]="template",t.temp[a.notationProvider]=new jt(e,Wt.helmHelper)}},5412:(t,e,n)=>{"use strict";n.d(e,{m:()=>l});var r=n(6082),o=n(4328),i=n(2890),s=n(6077),a=n(2003);async function l(t,e,n,l,u,c,f,h,d){const p=(await d.helmToAtomicLevel(t,l,u,f)).molCol,g=n.filter((t=>t)).length;if(c&&g>0){const t=new Array(g);let l=0;for(let r=0;r<n.length;r++)n[r]&&(t[l]=e[r],l++);const u=r.Column.fromStrings("helm",t);u.semType=r.SEMTYPE.MACROMOLECULE,u.meta.units=a.Hi.HELM,u.setTag(r.TAGS.CELL_RENDERER,"helm");const c=(await(0,i.pj)()).getMonomerLib();try{const t=await(0,s.C4)(r.DataFrame.create(0),u,c,d,h);l=0;for(let e=0;e<n.length;e++)n[e]&&(p.set(e,t.molCol.get(l)),l++)}catch(t){o.shell.warning("PolyTool was not able to linearize sequences")}}return function(t){for(let e=0;e<t.length;e++)t.set(e,t.get(e).replaceAll("undefined","H")),t.set(e,t.get(e).replaceAll("Oh","O")),t.set(e,t.get(e).replaceAll("0.000000 3","0.000000 0")),t.set(e,t.get(e).replaceAll("?","O")),t.set(e,t.get(e).replaceAll("0 3\n","0 0\n")),t.set(e,t.get(e).replaceAll("RGROUPS=(1 1)",""))}(p),p}},6307:(t,e,n)=>{"use strict";n.d(e,{s:()=>d});var r=n(2125),o=n(8438),i=n(100);function s(t,e){let n="";for(let t=0;t<e.length;t++){t>0&&(n+="|"),n+=`PEPTIDE${t+1}{`;for(let r=0;r<e[t].length;r++){r>0&&(n+=".");const o=e[t][r];n+=o.length>1?`[${o}]`:o}n+="}"}n+="$";for(let o=0;o<t.length;o++)o>0&&(n+="|"),n+=`PEPTIDE${t[o].fChain+1},PEPTIDE${t[o].sChain+1},`,n+=`${(0,r.M)(t[o].fMonomer-1,e)[0]+1}:R${t[o].fR}-`,n+=`${(0,r.M)(t[o].sMonomer-1,e)[0]+1}:R${t[o].sR}`;return n+="$$$V2.0",n}function a(t,e,n,r=0,o=[],i=[]){let[s,a,l,u,c]=[!1,!1,!1,-1,-1];for(let f=0;f<t.length;f++)if(t[f].includes(e)){if(s){if(l&&(n||t[f]==i[r]+e)){a=!0,c=f;break}if(l||!n&&t[f]!=o[r]+e)continue;a=!0,c=f;break}if(n)s=!0,l=!0,u=f;else if(t[f]==o[r]+e)s=!0,l=!0,u=f;else{if(t[f]!=i[r]+e)continue;s=!0,l=!!n,u=f}}return[s,a,l,u,c]}function l(t,e){const n=[];for(let r=0;r<e.length;r++){const o=`(${e[r].code})`,[s,l]=(0,i.Ln)(e[r]);if(s.length>0)for(let e=0;e<s.length;e++){const[i,u,c,f,h]=a(t,o,!1,e,s,l);i&&u&&(c?n.push({firstIdx:f,secondIdx:h,ruleIdx:r}):n.push({firstIdx:h,secondIdx:f,ruleIdx:r}))}else{const[e,i,s,l,u]=a(t,o,!0);if(!e||!i)continue;s?n.push({firstIdx:l,secondIdx:u,ruleIdx:r}):n.push({firstIdx:u,secondIdx:l,ruleIdx:r})}}return n}function u(t,e,n){const r=[],o=[],i=[],s=[],a=n.length;for(let l=0;l<a;l++){if(-1==n[l].firstIdx)continue;const a=n[l].ruleIdx,u=t[a].code;e[n[l].firstIdx]=e[n[l].firstIdx].replace(`(${u})`,""),e[n[l].secondIdx]=e[n[l].secondIdx].replace(`(${u})`,""),r.push(n[l].firstIdx+1),o.push(n[l].secondIdx+1),i.push(t[a].firstLinkingGroup),s.push(t[a].secondLinkingGroup)}return[r,o,i,s]}function c(t,e,n){const r=[],o=[],i=[],s=n.length;for(let a=0;a<s;a++){if(-1==n[a].firstIdx)continue;const s=n[a].firstIdx,l=n[a].secondIdx,u=n[a].ruleIdx,c=t[u].code;e[s]=e[s].replace(`(${c})`,"")+`_${t[u].name}`,e[l]=e[l].replace(`(${c})`,"")+`_${t[u].name}`,r.push(s+1),o.push(l+1),i.push(n[a].ruleIdx)}return[r,o,i]}var f=n(3599);function h(t,e,n){const r=n.createHelmWebEditor().editor.m;let o=0;const i=new JSDraw2.Point(0,0);for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++){if(e[t][n]){const s=e[t][n],a={type:f.o.AA,i:t,j:n,continuousId:o},l=new JSDraw2.Atom(i,s,a);if(r.addAtom(l),0!==n){const t=r.atoms[o-1],e=r.atoms[o],n=new JSDraw2.Bond(t,e);n.r1=2,n.r2=1,r.addBond(n)}o++,i.x+=JSDraw2.Editor.BONDLENGTH}i.y+=4*JSDraw2.Editor.BONDLENGTH}for(let e=0;e<t.length;e++){const n=r.atoms[t[e].fMonomer-1],o=r.atoms[t[e].sMonomer-1],i=new JSDraw2.Bond(n,o);i.r1=t[e].fR,i.r2=t[e].sR,r.addBond(i)}return r}class d{constructor(t,e,n){this.helmHelper=n,this.underRules=!1,this.posToPosUnderRules=[],this.linkages=e,this.monomers=t,this.mol=h(e,t,n)}static fromSeparator(t,e){const[n,r]=function(t){const e=[],n=[],r=/(\(.\d+\))?\{[^\}]*\}/g,o=[];o.push(t.replaceAll(r,""));const i=t.matchAll(r);for(const t of i){const e=t[0];e&&o.push(e)}let s=0;for(let t=0;t<o.length;t++){const r=o[t].split("-"),i=new Array(r.length);let a=0;for(let e=0;e<r.length;e++){const o=r[e].replace("{","").replace("}","");""!==o?(i[e]=o,s++,a++):n.push({fChain:t,sChain:t+1,fMonomer:s,sMonomer:s+1,fR:1,sR:1})}e.push(i.slice(0,a))}return[n,e]}(t);return new d(r,n,e)}static fromHelm(t,e){const[n,i]=function(t){const e=/(\w+\{.*\})\$(.*)\$(.*)\$(.*)\$/g.exec(t),n=[e[1],e[2],e[3],e[4]],i=n[0].split("|"),s=n[1].split("|"),a=new Array(i.length),l=[];for(let t=0;t<i.length;t++){const e=i[t].indexOf("{"),n=i[t].indexOf("}");a[t]=i[t].slice(e+1,n).split(".").map((t=>(0,o.D)(t)))}for(let t=0;t<s.length;t++)if(""!==s[t]&&"V2.0"!==s[t]){const e=s[t].split(","),n=parseInt(e[0].replace("PEPTIDE",""))-1,o=parseInt(e[1].replace("PEPTIDE",""))-1,i=e[2].split("-"),u=i[0].split(":"),c=i[1].split(":");l.push({fChain:n,sChain:o,fMonomer:(0,r.j)(parseInt(u[0]),n,a),sMonomer:(0,r.j)(parseInt(c[0]),o,a),fR:parseInt(u[1].replace("R","")),sR:parseInt(c[1].replace("R",""))})}return[l,a]}(t);return new d(i,n,e)}getNotation(){return function(t){const e=t.atoms,n=t.bonds,r=[],o=[];for(let t=0;t<n.length;t++)n[t].a1.bio.i!==n[t].a2.bio.i&&o.push(t);for(let t=0;t<e.length;t++){const n=e[t].bio?.i;n+1>r.length?r.push(1):r[n]++}const i=new Array(r.length);let s=0;for(let t=0;t<r.length;t++){const n=new Array(r[t]);for(let o=0;o<r[t];o++)n[o]=e[s].elem,s++;i[t]=n}let a="";for(let t=0;t<i.length;t++){let e="";for(let n=0;n<i[t].length;n++)e+=`${0==n?"":"-"}${i[t][n]}`;if(0!==t){const t=/(\(.\d+\))/,n=e.match(t);e=e.replace(n?.[0],""),e=`${n?n?.[0]:""}{${e}}`}else if(i.length>1){const t=0==n[o[0]].a1.bio.i&&0==n[o[0]].a1.bio.j,r=1==n[o[0]].a2.bio.i&&0==n[o[0]].a1.bio.j;t&&r&&(e+="-")}a+=e}return a}(this.mol)}getHelm(){return this.underRules?s(this.linkagesUnderRules,this.monomersUnderRules):s(this.linkages,this.monomers)}applyRules(t){const e=this.getNotation(),[n,r,o]=function(t,e){const n=[],r=[],o=[],i=e.heterodimerCode,s=e.homodimerCode,a=null!==i?t.split(`(${e.heterodimerCode})`):"";null!==i&&a.length>1?(o.push({fChain:0,sChain:1,fMonomer:1,sMonomer:1,fR:1,sR:1}),n.push(a[1].replaceAll("{","").replaceAll("}","")),n.push(a[2].replaceAll("{","").replaceAll("}","")),r.push(!1),r.push(!1)):(n.push(t),r.push(!1));for(let t=0;t<n.length;t++)if(null!==s&&n[t].includes(`(${s})`)){const e=n.length;o.push({fChain:t,sChain:e,fMonomer:1,sMonomer:1,fR:1,sR:1});const i=n[t].replace(`(${s})`,""),a=i.indexOf("{"),l=i.slice(0,a),u=i.replace(l,"").replaceAll("{","").replaceAll("}","");n[t]=l+u,n.push(u),r.push(!0)}return[o,n,r]}(e,t),i=new Array(r.length);let s=0;for(let t=0;t<r.length;t++)if(i[t]=r[t].split("-"),o[t]){const e=this.posToPosUnderRules.length-i[t].length;for(let n=0;n<i[t].length;n++)this.posToPosUnderRules[e+n].push(s),s++}else for(let e=0;e<i[t].length;e++)this.posToPosUnderRules.push([s]),s++;!function(t,e,n){for(let r=0;r<t.length;r++){const o=t[r],i=l(o,n.linkRules),[s,a,c,f]=u(n.linkRules,o,i);for(let t=0;t<s.length;t++)e.push({fChain:r,sChain:r,fMonomer:s[t],sMonomer:a[t],fR:c[t],sR:f[t]});t[r]=o}}(i,n,t),function(t,e,n){for(let r=0;r<t.length;r++){const o=l(t[r],n.reactionRules),[i,s,a]=c(n.reactionRules,t[r],o);i.length>=1&&(e.push({fChain:r,sChain:t.length,fMonomer:i[0],sMonomer:1,fR:3,sR:1}),e.push({fChain:r,sChain:t.length,fMonomer:s[0],sMonomer:1,fR:3,sR:2}),t.push([n.reactionRules[a[0]].name]))}}(i,n,t),this.underRules=!0,this.linkagesUnderRules=n,this.monomersUnderRules=i,this.molUnderRules=h(n,i,this.helmHelper)}check(t=!1){const e=[],n=this.monomers.map((t=>t.length)).reduce(((t,e)=>t+e),0);this.mol.atoms.length!==n&&e.push(`The mol atoms count ${this.mol.atoms.length} does not match the total number ${n} of chains' monomers.`);const r=this.monomers.map((t=>t.length-1)).reduce(((t,e)=>t+e),0)+this.linkages.length;this.mol.bonds.length!==r&&e.push(`The mol bonds count ${this.mol.bonds.length} does not match the total number ${r} in- and inter-chain linkages.`);let o=0;for(let t=0;t<this.monomers.length;++t){const n=this.monomers[t];for(let t=0;t<n.length;++t)try{const r=n[t],i=this.mol.atoms[o];i.bio.continuousId!==o&&e.push(`Atom #${o} has incorrect .bio.continuousId: ${i.bio.continuousId}.`),i.elem!==r&&e.push(`Atom #${o} elem: '${i.elem}' does not match chain monomer: '${r}'.`)}finally{o++}}if(t&&e.length>0)throw new Error(`Chain errors:\n${e.map((t=>` ${t}`)).join("\n")}`);return e}}},4229:(t,e,n)=>{"use strict";n.d(e,{b:()=>s});var r=n(9192),o=n(6307),i=n(8742);function s(t,e,n){const s=new Array(t.length),a=new Array(t.length),l=new Array(t.length);for(let u=0;u<t.length;u++)try{if(null==t[u])s[u]="";else{const r=o.s.fromSeparator(t[u],n);r.applyRules(e),a[u]=!(r.monomersUnderRules.length>1||r.linkagesUnderRules.length>0),s[u]=r.getHelm(),l[u]=r.posToPosUnderRules}}catch(t){const[e,n]=(0,r.AP)(t);i._package.logger.error(e,void 0,n),s[u]=""}return[s,a,l]}},2125:(t,e,n)=>{"use strict";function r(t,e){let n,r=t;for(n=0;n<e.length&&r>=e[n].length;++n)r-=e[n].length;return[r,n]}function o(t,e,n){let r=0;for(let t=0;t<e;++t)r+=n[t].length;return r+t}n.d(e,{M:()=>r,j:()=>o})},100:(t,e,n)=>{"use strict";n.d(e,{Ln:()=>V,Q4:()=>j});var r=n(6082),o=n(7389),i=n(4328);n(1991);var s=n(8742),a=n(9124),l=n(4229),u=n(439);const c="Links",f="Reactions";class h{constructor(t,e){this.v=null,this.rules=t,this.linkRuleDataFrame=this.rules.getLinkRulesDf(),this.synthRuleDataFrame=this.rules.getSynthesisRulesDf(),this.fileName=e;const n=this.rules.homodimerCode?this.rules.homodimerCode:"",r=this.rules.heterodimerCode?this.rules.heterodimerCode:"";this.homoDimerInput=o.input.string("Homo dimer",{value:n,onValueChanged:()=>{},nullable:!1}),this.heteroDimerInput=o.input.string("Hetero dimer",{value:r,onValueChanged:()=>{},nullable:!1})}async getAndAddView(){if(this.v)try{const t=Array.from(i.shell.views).find((t=>t.name===this.v.name));if(!t)throw this.v.detach(),this.v.close(),new Error("View is closed, making it null in catch statement");i.shell.v=t}catch(t){this.v=null}return this.v||(this.v=r.View.create(),this.v.name=`Manage Polytool Rules - ${this.fileName}`,this.v.append(await this.getForm()),this.v=i.shell.addView(this.v),i.shell.v=this.v),this.v}static async getInstance(t){if(!this.instances[t]){const e=await j([t]);this.instances[t]=new h(e,t)}return this.instances[t]}save(){this.rules.homodimerCode=this.homoDimerInput.value,this.rules.heterodimerCode=this.heteroDimerInput.value,this.rules.setLinkRules(this.linkRuleDataFrame),this.rules.setSynthesisRules(this.synthRuleDataFrame);const t={homodimerCode:this.rules.homodimerCode,heterodimerCode:this.rules.heterodimerCode,linkRules:this.rules.linkRules,reactionRules:this.rules.reactionRules},e=JSON.stringify(t,void 0,2);s._package.files.writeAsText(`polytool-rules/${this.fileName}`,e),i.shell.info(`Polytool rules at ${this.fileName} was updated`)}createGridDiv(t,e,n){const r=o.h1(t,"polytool-grid-header");o.tooltip.bind(r,n),r.style.marginTop="10px",r.style.marginRight="10px",e.root.style.height="100%";const i=o.splitV([o.box(r,{style:{maxHeight:"60px"}}),e.root]);return i.style.height="100%",i}async getLinkExamplesGrid(){const t=[];for(let e=0;e<this.rules.linkRules.length;e++){const n=this.rules.linkRules[e].code,[r,o]=V(this.rules.linkRules[e]);for(let e=0;e<r.length;e++){const i=`${r[e]}(${n})-A-A-A-A-${o[e]}(${n})`;t.push(i)}}const e=await(0,a.b2)(),[n,o,i]=(0,l.b)(t,this.rules,e),c=r.Column.fromStrings("Monomers",t),f=r.Column.fromStrings("Helm",n);return(0,s.applyNotationProviderForCyclized)(c,"-"),c.semType=r.SEMTYPE.MACROMOLECULE,f.semType=r.SEMTYPE.MACROMOLECULE,f.meta.units=u.Hi.HELM,f.setTag(r.TAGS.CELL_RENDERER,"helm"),r.DataFrame.fromColumns([c,f]).plot.grid()}async getReactionExamplesGrid(){const t=[];for(let e=0;e<this.rules.reactionRules.length;e++){const n=this.rules.reactionRules[e].code,[r,o]=V(this.rules.reactionRules[e]);for(let e=0;e<r.length;e++){const i=`${r[e]}(${n})-A-A-A-A-${o[e]}(${n})`;t.push(i)}}const e=await(0,a.b2)(),[n,o,i]=(0,l.b)(t,this.rules,e),c=r.Column.fromStrings("Monomers",t),f=r.Column.fromStrings("Helm",n);return c.semType=r.SEMTYPE.MACROMOLECULE,(0,s.applyNotationProviderForCyclized)(c,"-"),f.semType=r.SEMTYPE.MACROMOLECULE,f.meta.units=u.Hi.HELM,f.setTag(r.TAGS.CELL_RENDERER,"helm"),r.DataFrame.fromColumns([c,f]).plot.grid()}async getForm(){r.TabControl;const t=this.createGridDiv("Rules",this.linkRuleDataFrame.plot.grid({showAddNewRowIcon:!0}),"specification for monomers to link and linking positions"),e=this.createGridDiv("Examples",await this.getLinkExamplesGrid(),"specification for monomers to link and linking positions");t.style.width="50%",e.style.width="50%";const n=o.h1("Monomers","polytool-grid-header");o.tooltip.bind(n,"Click different cobination to see how monomers will link"),this.linkCards=await this.rules.getLinkCards();const i=o.splitV([o.box(n,{style:{maxHeight:"30px"}}),this.linkCards[0].root]);this.linkCards[0].render(),await this.linkCards[0].reset(),this.linkRuleDataFrame.currentRowIdx=0,this.linkRuleDataFrame.onCurrentRowChanged.subscribe((async()=>{const t=this.linkRuleDataFrame.currentRowIdx;-1!==t&&(o.empty(i),i.append(o.splitV([o.box(n,{style:{maxHeight:"30px"}}),this.linkCards[t].root]))),this.linkCards[t].render(),await this.linkCards[t].reset()}));const s=o.splitH([t,i],null,!0),a=this.createGridDiv("Rules",this.synthRuleDataFrame.plot.grid({showAddNewRowIcon:!0})),l=this.createGridDiv("Examples",await this.getReactionExamplesGrid());a.style.width="50%",l.style.width="50%";const u=o.divH([a,l]),h=o.divV([this.homoDimerInput,this.heteroDimerInput]),d=o.tabControl({Links:s,Reactions:u,Dimers:h},!1);o.tooltip.bind(d.getPane(c).header,"Specify rules to link monomers based on HELM notation"),o.tooltip.bind(d.getPane(f).header,"Specify rules to perform reactions within monomers"),o.tooltip.bind(d.getPane("Dimers").header,"Specify symbols for homodimeric and heterodimeric codes"),d.root.style.height="100%",d.root.style.width="100%",d.root.classList.add("rules-manager-form-tab-control"),d.header.style.marginBottom="10px";const p=o.divV([d.root]),g=[o.bigButton("Save",(()=>{this.save()})),o.button("Add rule",(()=>{const t=d.currentPane.name;t==c?this.linkRuleDataFrame.rows.addNew():t==f&&this.synthRuleDataFrame.rows.addNew()}))];return this.v.setRibbonPanels([g]),p.style.height="100%",p.style.alignItems="center",d.root}}h.instances={};var d=n(5072),p=n.n(d),g=n(7825),m=n.n(g),y=n(7659),v=n.n(y),b=n(5056),C=n.n(b),A=n(540),w=n.n(A),E=n(1113),_=n.n(E),x=n(890),T={};T.styleTagTransform=_(),T.setAttributes=C(),T.insert=v().bind(null,"head"),T.domAPI=m(),T.insertStyleElement=w(),p()(x.A,T),x.A&&x.A.locals&&x.A.locals;var I=n(2003),N=n(6717),S=n(8312),L=n(5174),P=n(5412);class O{get selected(){return this._selected}set selected(t){this._selected=t,this.root.style.border=t?"2px solid var(--green-2)":"2px solid var(--grey-2)"}constructor(t){this.monomer=t,this.root=o.divV([],{classes:"monomer-card-rule-root"}),this._selected=!1}render(){if(this.monomer){o.empty(this.root);const t=this.monomer.smiles&&i.chem.checkSmiles(this.monomer.smiles)?i.chem.drawMolecule(this.monomer.smiles,150,120):i.chem.drawMolecule(this.monomer.molfile??"",150,120);this.root.appendChild(t);const e=o.divH([o.divText("Monomer Name: "),o.divText(this.monomer.name)],{classes:"monomer-card-info-rules"});if(this.root.appendChild(e),o.tooltip.bind(e,this.monomer.name),this.monomer.lib?.source){const t=o.divH([o.divText("Source: "),o.divText(this.monomer.lib.source)],{classes:"monomer-card-info-rules"});this.root.appendChild(t),o.tooltip.bind(t,this.monomer.lib.source)}const n=o.divH([o.divText("Polymer Type: "),o.divText(this.monomer.polymerType)],{classes:"monomer-card-info-rules"});this.root.appendChild(n),o.tooltip.bind(n,this.monomer.polymerType),o.tooltip.bind(this.root,"Select Monomer")}}}class M{constructor(t,e,n,r,i){if(this.firstMonomers=t,this.secondMonomers=e,this.code=r,this.rules=i,this.root=o.divH([],{style:{alignItems:"center",width:"100%",overflow:"hidden",visibility:"visible"},classes:"monomer-cards"}),t.length>0){this.actionable=!0;const r=o.divH([],{style:{overflowX:"auto",width:"100%"}}),i=o.divH([],{style:{overflowX:"auto",width:"100%"}});this.resulting=o.divH([],{style:{overflowX:"auto",width:"100%",minHeight:"150px"}});const s=o.divV([r,i,this.resulting]);this.cardsFirst=t.map((t=>new O(n.getMonomer("PEPTIDE",t)))),this.cardsSecond=e.map((t=>new O(n.getMonomer("PEPTIDE",t)))),this.cardsFirst.forEach((t=>{t.root.onclick=()=>{this.cardsFirst.forEach((t=>t.selected=!1)),t.selected=!0,this.firstCard=t,this.reset()},r.appendChild(t.root)})),this.cardsSecond.forEach((t=>{t.root.onclick=()=>{this.cardsSecond.forEach((t=>t.selected=!1)),t.selected=!0,this.secondCard=t,this.reset()},i.appendChild(t.root)})),this.cardsFirst[0].selected=!0,this.cardsSecond[0].selected=!0,this.firstCard=this.cardsFirst[0],this.secondCard=this.cardsSecond[0],this.root.appendChild(s)}else{const t=o.divV(["Rule is active for all monomers, no examples to show"]);this.root.appendChild(t),this.actionable=!1}}async reset(){if(this.actionable){const t=[`${this.firstCard.monomer?.symbol}(${this.code})-A-A-A-A-${this.secondCard.monomer?.symbol}(${this.code})`],e=await(0,a.b2)(),[n,s,u]=(0,l.b)(t,this.rules,e),c=r.Column.fromType(r.COLUMN_TYPE.STRING,"helm",n.length).init((t=>n[t]));c.semType=r.SEMTYPE.MACROMOLECULE,c.meta.units=I.Hi.HELM,c.setTag(r.TAGS.CELL_RENDERER,"helm");const f=await(0,N.j)(),h=await(0,S.Q)(),d=await(0,L.A)(this.rules),p=c.temp;c.temp=p;const g=(await(0,P.m)(c,n,s,!0,!1,!1,d,f,h)).get(0),m=g&&i.chem.checkSmiles(g)?i.chem.drawMolecule(g,150,120):i.chem.drawMolecule(g??"",150,120);o.empty(this.resulting),this.resulting.append(o.divH([m],{style:{overflowX:"auto",width:"100%",minHeight:"150px"}}))}}render(){this.actionable&&(this.cardsFirst.forEach((t=>t.render())),this.cardsSecond.forEach((t=>t.render())))}}var R=n(2890);const $="System:AppData/SequenceTranslator/polytool-rules/",D="code",B="firstMonomers",H="secondMonomers",F="name",k="firstLinkingGroup",G="secondLinkingGroup";class U{constructor(t,e,n,r){this.homodimerCode=t,this.heterodimerCode=e,this.linkRules=n,this.reactionRules=r}set homodimer(t){this.homodimerCode=t}set heterodimer(t){this.heterodimerCode=t}addLinkRules(t){for(let e=0;e<t.length;e++)this.linkRules.push(t[e])}addSynthesisRules(t){for(let e=0;e<t.length;e++)this.reactionRules.push(t[e])}getLinkRulesDf(){const t=this.linkRules.length,e=r.Column.int(D,t);e.setTag("friendlyName","Code");const n=r.Column.string(B,t);n.setTag("friendlyName","First monomers"),n.semType=r.SEMTYPE.MACROMOLECULE,(0,s.applyNotationProviderForCyclized)(n,",");const o=r.Column.string(H,t);o.setTag("friendlyName","Second monomers"),o.semType=r.SEMTYPE.MACROMOLECULE,(0,s.applyNotationProviderForCyclized)(o,",");const i=r.Column.int(k,t);i.setTag("friendlyName","First group");const a=r.Column.int(G,t);a.setTag("friendlyName","Second group");for(let r=0;r<t;r++)e.set(r,this.linkRules[r].code),n.set(r,this.linkRules[r].firstMonomers.toString()),o.set(r,this.linkRules[r].secondMonomers.toString()),i.set(r,this.linkRules[r].firstLinkingGroup),a.set(r,this.linkRules[r].secondLinkingGroup);return r.DataFrame.fromColumns([e,n,o,i,a])}async getLinkCards(){const t=this.linkRules.length,e=new Array(t),n=(await(0,R.pj)()).getMonomerLib();for(let r=0;r<t;r++)e[r]=new M(this.linkRules[r].firstMonomers,this.linkRules[r].secondMonomers,n,this.linkRules[r].code,this);return e}getSynthesisRulesDf(){const t=this.reactionRules.length,e=r.Column.int(D,t);e.setTag("friendlyName","Code");const n=r.Column.string(B,t);n.setTag("friendlyName","First monomers");const o=r.Column.string(H,t);o.setTag("friendlyName","Second monomers");const i=r.Column.string(F,t);i.setTag("friendlyName","Name");const s=r.Column.string("firstReactant",t);s.setTag("friendlyName","First reactant");const a=r.Column.string("secondReactant",t);a.setTag("friendlyName","Second reactant");const l=r.Column.string("product",t);l.setTag("friendlyName","Product");for(let r=0;r<t;r++){e.set(r,this.reactionRules[r].code),n.set(r,this.reactionRules[r].firstMonomers.toString()),o.set(r,this.reactionRules[r].secondMonomers.toString()),i.set(r,this.reactionRules[r].name);const t=this.reactionRules[r].reaction.split(">>"),u=t[0].split(".");s.set(r,u[0]),a.set(r,u[1]),l.set(r,t[1])}return s.semType=r.SEMTYPE.MOLECULE,a.semType=r.SEMTYPE.MOLECULE,l.semType=r.SEMTYPE.MOLECULE,r.DataFrame.fromColumns([i,s,a,l,e,n,o])}setLinkRules(t){const e=t.rowCount,n=new Array(e),r=t.columns.byName(D),o=t.columns.byName(B),i=t.columns.byName(H),s=t.columns.byName(k),a=t.columns.byName(G);for(let t=0;t<e;t++){const e=o.get(t).split(","),l=i.get(t).split(","),u={code:r.get(t),firstMonomers:""!==e[0]?e:[],secondMonomers:""!==l[0]?l:[],firstLinkingGroup:s.get(t),secondLinkingGroup:a.get(t)};n[t]=u}this.linkRules=n}setSynthesisRules(t){const e=t.rowCount,n=new Array(e),r=t.columns.byName(D),o=t.columns.byName(B),i=t.columns.byName(H),s=t.columns.byName(F),a=t.columns.byName("firstReactant"),l=t.columns.byName("secondReactant"),u=t.columns.byName("product");for(let t=0;t<e;t++){const e=`${a.get(t)}.${l.get(t)}>>${u.get(t)}`,c=o.get(t).split(","),f=i.get(t).split(","),h={code:r.get(t),firstMonomers:""!==c[0]?c:[],secondMonomers:""!==f[0]?f:[],reaction:e,name:s.get(t)};n[t]=h}this.reactionRules=n}}async function j(t){const e=new r.FileSource($),n=new U(null,null,[],[]);for(let r=0;r<t.length;r++){const o=await e.readAsText(t[r].replace($,"")),i=JSON.parse(o);n.homodimer=i.homodimerCode,n.heterodimer=i.heterodimerCode,n.addLinkRules(i.linkRules),n.addSynthesisRules(i.reactionRules)}return n}function V(t){const e=t.firstMonomers.length*t.secondMonomers.length,n=new Array(e),r=new Array(e);let o=0;for(let e=0;e<t.firstMonomers.length;e++)for(let i=0;i<t.secondMonomers.length;i++)n[o]=t.firstMonomers[e],r[o]=t.secondMonomers[i],o++;return[n,r]}},5174:(t,e,n)=>{"use strict";n.d(e,{A:()=>c,T:()=>f});var r=n(6717),o=n(1296),i=n(9192),s=n(4328),a=n(1991),l=n.n(a),u=n(2890);async function c(t){const e=(await(0,u.pj)()).getMonomerLib(),n=await(0,r.j)(),o={};let i=[],a=[];for(let r=0;r<t.reactionRules.length;r++)try{[i,a]=f(n,e,t.reactionRules[r])}catch(t){i=[],a=[],console.error(t),s.shell.warning(t)}finally{for(let t=0;t<i.length;t++)o[i[t]]=a[t]}const c={PEPTIDE:o};return e.override(c,"ST-PT-reactions."+l().repeat(1).map((()=>Math.floor(36*Math.random()).toString(36))).take(4).toArray().join(""))}function f(t,e,n){const r=n.reaction,a=n.name,l=n.firstMonomers.length+n.secondMonomers.length+1,u=n.reaction.split(">>"),c=u[0].split("."),f=new Array(l),g=new Array(l),m=new Array(l),y=d(t,r),v=`${c[0]}>>[C:1]C`,b=`${c[1]}>>[C:2]C`,C=d(t,v),A=d(t,b);let w=0;for(let r=0;r<n.firstMonomers.length;r++){const i=e.getMonomer("PEPTIDE",n.firstMonomers[r]);if(!i)throw new o.bl("PEPTIDE",n.firstMonomers[r]);const s=h(t,i.molfile,C,i.name);m[w]=s,f[w]=`${i.symbol}_${a}`,w++}for(let r=0;r<n.secondMonomers.length;r++){const i=e.getMonomer("PEPTIDE",n.secondMonomers[r]);if(!i)throw new o.bl("PEPTIDE",n.secondMonomers[r]);const s=h(t,i.molfile,A,i.name);m[w]=s,f[w]=`${i.symbol}_${a}`,w++}let E=null,_="";try{E=t.get_mol(u[1]),_=E?.get_molblock()}catch(t){const[e,n]=(0,i.AP)(t);throw s.shell.error(`Can not assemble monomer '${a}': ${e}.`),t}finally{E?.delete()}m[w]=_,f[w]=a;for(let t=0;t<l-1;t++)m[t]=m[t].replace(" 0.0000 0.0000 0.0000 C "," 0.0000 0.0000 0.0000 R# ").replace("M RGP 2","M RGP 3 2 3");m[l-1]=function(t){const e=t.replace("M RAD","M RGP").split("\n"),n=4+Number(e[3].substring(0,3))+Number(e[3].substring(3,6)),r=Number(e[n].substring(9,13)),o=Number(e[n].substring(17,21));e[n]=e[n].substring(0,13)+" 1"+e[n].substring(17,21)+" 2",e[3+r]=e[3+r].substring(0,30)+" R# 0 0 0 0 0 0 0 0 0 0 0 0",e[3+o]=e[3+o].substring(0,30)+" R# 0 0 0 0 0 0 0 0 0 0 0 0";let i="";for(let t=0;t<e.length;t++)i+=e[t]+"\n";return i}(m[l-1]);for(let t=0;t<l;t++){const e=t==l-1,n={symbol:f[t],name:f[t],molfile:m[t],author:"",id:0,rgroups:p(e),smiles:"",polymerType:"PEPTIDE",monomerType:"Backbone",createDate:null};n.meta=Object.assign(n.meta??{},{colors:{default:{line:"#2083D5",text:"#2083D5",background:"#F2F2F5"}}}),f[t]=f[t],g[t]=n}return y.delete(),C.delete(),A.delete(),[f,g]}function h(t,e,n,r){let o=null,a=null,l=null,u=null,c="";try{o=new t.MolList,a=t.get_mol(e),o.append(a),l=n.run_reactants(o,1),u=l.get(0).next(),c=u?.get_molblock()}catch(t){const[e,n]=(0,i.AP)(t);throw s.shell.error(`Can not assemble monomer '${r}': ${e}.`),t}finally{o?.delete(),a?.delete(),l?.delete(),u?.delete()}return c}function d(t,e){let n=null;try{if(n=t.get_rxn(e),!n)throw new o.J5(e)}catch(t){n?.delete();const[r,o]=(0,i.AP)(t);throw s.shell.error(`Can not assemble monomer '${e}': ${r}.`),t}return n}function p(t){if(t){const t=new Array(2),e={capGroupSMILES:"[*:1][H]",alternateId:"R1-H",capGroupName:"H",label:"R1"},n={capGroupSMILES:"[*:2][H]",alternateId:"R2-H",capGroupName:"H",label:"R2"};return t[0]=e,t[1]=n,t}return[{capGroupSMILES:"[*:3][H]",alternateId:"R3-H",capGroupName:"H",label:"R3"}]}},3820:(t,e,n)=>{"use strict";n.d(e,{o:()=>i});var r=n(1296);function o(t,e,n,r){const o=new Array(r.length*(n-e+1));for(let i=0;i<r.length;++i){const s=n-e+1;for(let n=0;n<s;++n){const a=e+n,l=r[i],u=o[i*s+n]=t.clone(),c=u.atoms[a].elem;u.atoms[a].elem=l;const f=c?.length>1?`[${c}]`:c,h=l?.length>1?`[${l}]`:l;u.name=`${t.name}-${f}${a+1}${h}`}}return o}function i(t,e,n){const i=new JSDraw2.MolHandler,s=new org.helm.webeditor.Plugin(i);org.helm.webeditor.IO.parseHelm(s,t,new JSDraw2.Point(0,0),void 0);const a=i.m;a.name=e;let l=[];if(n.placeholders)switch(n.type){case r.aK.Single:l=function(t,e){return e.map((e=>o(t,e.position,e.position,e.monomers))).reduce(((t,e)=>t.concat(e)),[])}(i.m,n.placeholders);break;case r.aK.Matrix:l=function(t,e){let n=[t];for(const t of e){const e=n.map((e=>o(e,t.position,t.position,t.monomers)));n=e.reduce(((t,e)=>t.concat(e)),[])}return n}(i.m,n.placeholders)}let u=[];n.breadthPlaceholders&&(u=function(t,e){if(0==e.length)return[];let n=[t];for(const t of e){const e=n.map((e=>o(e,t.start,t.end,t.monomers)));n=e.reduce(((t,e)=>t.concat(e)),[])}return n}(i.m,n.breadthPlaceholders)),l=l.concat(u),n.keepOriginal&&(l=[a,...l]);const c=l.map((t=>[org.helm.webeditor.IO.getHelm(t),t.name]));return c}},1296:(t,e,n)=>{"use strict";var r;n.d(e,{J5:()=>i,aK:()=>r,bl:()=>o}),function(t){t.Single="single",t.Matrix="matrix",t.Library="library"}(r||(r={}));class o extends Error{constructor(t,e,n){super(`Monomer '${e}' of polymer type '${t}' not found`,n),this.type="MonomerNotFoundError"}}class i extends Error{constructor(t,e){super(`Invalid reaction '${t}'.`),this.type="InvalidReactionError"}}},6082:t=>{"use strict";t.exports=DG},4328:t=>{"use strict";t.exports=grok},7389:t=>{"use strict";t.exports=ui},1991:t=>{"use strict";t.exports=wu}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.m=t,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.u=t=>t+".js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=r[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})(),n.b=document.baseURI||self.location.href,n.nc=void 0;var r={};(()=>{"use strict";n.r(r),n.d(r,{_package:()=>M,initAutoTests:()=>$,test:()=>R,tests:()=>e.CN});var t=n(6082),e=n(8070),o=n(4328),i=n(6686);class s extends t.Package{async getTranslationHelper(){return await o.functions.call(`${this.name}:getTranslationHelper`)}}function a(t,e,n){return n.createFormatConverter(t,e).convertTo(i.NO.HELM)}function l(t,e,n){return n.createFormatConverter(t,i.NO.HELM).convertTo(e)}const u={Axolabs:{UfAfsCfsGfuacg:"RNA1{[fR](U)p.[fR](A)[sp].[fR](C)[sp].[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)}$$$$"},BioSpring:{"A*GC*123456789":"RNA1{r(A)[sp].r(G)p.r(C)[sp].[fR](U)p.[fR](A)p.[fR](C)p.[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)p.d([m5C])}$$$$"},Mermade12:{hefglijkLIJKHEFG:"RNA1{[25r](U)[sp].[25r](A)[sp].[25r](C)[sp].[25r](G)[sp].[fR](U)[sp].[fR](A)[sp].[fR](C)[sp].[fR](G)[sp].[fR](U)p.[fR](A)p.[fR](C)p.[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)}$$$$"}},c={"RNA1{[fR](U)p.[fR](A)[sp].[fR](C)[sp].[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)}$$$$":"UACGUACG","RNA1{r(A)[sp].r(G)p.r(C)[sp].[fR](U)p.[fR](A)p.[fR](C)p.[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)p}$$$$":"AGCUACGUACG","RNA1{[25r](U)[sp].[25r](A)[sp].[25r](C)[sp].[25r](G)[sp].[fR](U)[sp].[fR](A)[sp].[fR](C)[sp].[fR](G)[sp].[fR](U)p.[fR](A)p.[fR](C)p.[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)}$$$$":"UACGUACGUACGUACG"};(0,e.L1)("Formats to HELM",(()=>{let t;(0,e.gM)((async()=>{t=await M.getTranslationHelper()}));for(const n of Object.keys(u))for(const[r,o]of Object.entries(u[n]))(0,e.t6)(`${n} to HELM`,(async()=>{const i=o,s=a(r,n,t);(0,e.E3)(s,i)}))})),(0,e.L1)("HELM to Formats",(()=>{let t;(0,e.gM)((async()=>{t=await M.getTranslationHelper()}));for(const n of Object.keys(u))for(const[r,o]of Object.entries(u[n]))(0,e.t6)(`${n} to HELM`,(async()=>{const i=r,s=l(o,n,t);(0,e.E3)(s,i)}))}));var f=n(3480);(0,e.L1)("HELM to Nucleotides",(()=>{let t;(0,e.gM)((async()=>{t=await M.getTranslationHelper()})),Object.entries(c).forEach((([n,r],o)=>{(0,e.t6)(`Sequence ${o+1} to nucleotides`,(async()=>{const o=r,i=(0,f.Hs)(n,t.monomerLibWrapper);(0,e.E3)(i,o)}))}))}));const h={[i.NO.AXOLABS]:"Afcgacsu",[i.NO.HELM]:"RNA1{[fR](A)p.[25r](C)p.[25r](G)p.[25r](A)p.[25r](C)[sp].[25r](U)}$$$$"};(0,e.L1)("Formats support",(()=>{let t;(0,e.gM)((async()=>{t=await M.getTranslationHelper()})),Object.entries(h).forEach((([n,r])=>{(0,e.t6)(`All formats for ${n}`,(async()=>{const o=function(t,e,n){const r=n.createSequenceValidator(t).getInvalidCodeIndex(e);return(0,f.bD)(t,r,e,n)}(r,n,t),i=Object.keys(o).length,s=Object.keys(u).length+1;(0,e.E3)(!0,s<=i)}))}))}));var d=n(9192);(0,e.L1)("files",(()=>{let n;(0,e.gM)((async()=>{n=await M.getTranslationHelper()})),(0,e.t6)("list",(async()=>{let r;const o=t.DataFrame.fromColumns([t.Column.string("subTest"),r=t.Column.bool("success"),t.Column.string("format"),t.Column.string("src"),t.Column.string("res"),t.Column.string("tgt"),t.Column.string("error"),t.Column.string("stack")]),i=await M.files.list("tests",!0,".csv");for(const r of i){const i=t.DataFrame.fromCsv(await r.readAsString()),s=i.columns.byIndex(0),l=s.name,u=i.columns.byIndex(1),c=i.rowCount;for(let t=0;t<c;++t){const i=o.rows.addNew();i.subTest=`${r.name}, row: ${t}`;try{const r=s.get(t),o=u.get(t);i.format=l,i.src=r,i.tgt=o;const c=i.res=a(r,l,n);(0,e.E3)(c,o),i.success=!0}catch(t){const[e,n]=(0,d.AP)(t);i.error=e,i.stack=n,i.success=!1}}}0==o.rowCount&&o.rows.addNew(["empty",!0,"",""]);const s=r.toList().findIndex((t=>1!=t));if(-1!=s){const t=o.rows.get(s);throw new Error(`Subtest '${t.subTest}' failed: ${t.error}`)}return o}),{skipReason:"Can not create test in async manner based on files in Shares."})}));var p=n(8312),g=n(2003);class m{constructor(t,e,n,r,o,i){this.units=t,this.aligned=e,this.alphabet=n,this.alphabetSize=r,this.alphabetIsMultichar=o,this.separator=i}}async function y(e,n){const r=(await e()).getCol(n),i=await o.functions.call("Bio:detectMacromolecule",{col:r});if(i&&(r.semType=i),r.semType===t.SEMTYPE.MACROMOLECULE){const t=`Negative test detected semType='${r.semType}', units='${r.meta.units}'.`;throw new Error(t)}}async function v(n,r,i,s,a,l,u,c,f=null){const h=(await n()).col(r),d=await o.functions.call("Bio:detectMacromolecule",{col:h});d&&(h.semType=d),(0,e.E3)(h.semType,t.SEMTYPE.MACROMOLECULE),(0,e.E3)(h.meta.units,s),(0,e.E3)(h.getTag(g.gp.aligned),a),(0,e.E3)(h.getTag(g.gp.alphabet),l),f&&(0,e.E3)(h.getTag(g.gp.separator),f);const p=i.getSeqHandler(h);(0,e.E3)(p.getAlphabetSize(),u),(0,e.E3)(p.getAlphabetIsMultichar(),c),p.isHelm()||((0,e.E3)(p.aligned,a),(0,e.E3)(p.alphabet,l))}(0,e.L1)("PolyTool: detectors",(()=>{let n;(0,e.gM)((async()=>{n=await(0,p.Q)()}));const r={cyclized1:{csv:"n,seq\n1,R-F-C(1)-T-G-H-F-Y-G-H-F-Y-G-H-F-Y-P-C(1)-meI\n2,C(1)-T-G-H-F-Y-P-C(1)-meI\n3,R-F-C(1)-T-G-H-F-Y-P-C(1)\n4,C(1)-T-G-H-F-H-P-C(1)\n5,R-F-D(2)-T-G-H-F-Y-P-NH2(2)\n6,R-F-aG(4)-T-G-H-F-Y-P-azG(4)-meI",pos:{seq:new m(g.Hi.CUSTOM,"SEQ",g.YI.UN,13,!0,"-")}}};for(const[o,i]of Object.entries(r))(0,e.t6)(`${o}`,(async()=>{const e=async()=>t.DataFrame.fromCsv(i.csv);for(const t of i.neg??[])await y(e,t);for(const[t,r]of Object.entries(i.pos??{}))await v(e,t,n,r.units,r.aligned,r.alphabet,r.alphabetSize,r.alphabetIsMultichar,r.separator)}),{skipReason:"3156"})}));var b=n(2890);const C="Libraries";let A=Promise.resolve();async function w(){let t;return A=A.then((async()=>{const e=o.userSettings.getValue(C,"Settings",!0);t=e?JSON.parse(e):{exclude:[],explicit:[],duplicateMonomerPreferences:{}},t.exclude=t.exclude instanceof Array?t.exclude:[],t.explicit=t.explicit instanceof Array?t.explicit:[],t.duplicateMonomerPreferences=t.duplicateMonomerPreferences instanceof Object?t.duplicateMonomerPreferences:{},console.debug(`Bio: getUserLibSettings()\n${JSON.stringify(t,void 0,2)}`)})),await A,t}async function E(t){A=A.then((async()=>{console.debug(`Bio: setUserLibSettings()\n${JSON.stringify(t,void 0,2)}`),o.userSettings.add(C,"Settings",JSON.stringify(t),!0)})),await A}var _=n(6717),x=n(9124),T=n(4229),I=n(5174),N=n(100);(0,e.L1)("PolyTool: Convert",(()=>{let n,r,i,s,a;(0,e.gM)((async()=>{n=await(0,x.b2)(),r=await(0,p.Q)(),i=await(0,_.j)(),s=await(0,b.pj)(),a=await w(),await s.loadMonomerLibForTests()})),(0,e.Pl)((async()=>{await E(a),await s.loadMonomerLib(!0)}));const l={"cyclized-C(1)-2-1":{src:{seq:"R-F-C(1)-T-G-H-F-Y-P-C(1)-meI"},tgt:{helm:"PEPTIDE1{R.F.C.T.G.H.F.Y.P.C.[meI]}$PEPTIDE1,PEPTIDE1,3:R3-10:R3$$$V2.0",mol:{atomCount:95,bondCount:100,inchiKey:"LMJUFVBPWWJJPN-AJJYTACESA-N"}}},"cyclized-C(1)-0-1":{src:{seq:"C(1)-T-G-H-F-Y-P-C(1)-meI"},tgt:{helm:"PEPTIDE1{C.T.G.H.F.Y.P.C.[meI]}$PEPTIDE1,PEPTIDE1,1:R3-8:R3$$$V2.0",mol:{atomCount:73,bondCount:77,inchiKey:"KLFRBMUPPMMGJM-HXTBFBBASA-N"}}},"cyclized-C(1)-2-0":{src:{seq:"R-F-C(1)-T-G-H-F-Y-P-C(1)"},tgt:{helm:"PEPTIDE1{R.F.C.T.G.H.F.Y.P.C}$PEPTIDE1,PEPTIDE1,3:R3-10:R3$$$V2.0",mol:{atomCount:86,bondCount:91,inchiKey:"WIHSRTQGMICACU-DDDKLKPZSA-N"}}},"cyclized-C(1)-0-0":{src:{seq:"C(1)-T-G-H-F-Y-P-C(1)"},tgt:{helm:"PEPTIDE1{C.T.G.H.F.Y.P.C}$PEPTIDE1,PEPTIDE1,1:R3-8:R3$$$V2.0",mol:{atomCount:64,bondCount:68,inchiKey:"LOSMDBLEXLWPLB-OFZKBENXSA-N"}}},"cyclized-D(2)-NH2(2)-3-0":{src:{seq:"R-F-D(2)-T-G-H-F-Y-P-NH2(2)"},tgt:{helm:"PEPTIDE1{R.F.D.T.G.H.F.Y.P.[NH2]}$PEPTIDE1,PEPTIDE1,10:R2-3:R3$$$V2.0",mol:{atomCount:81,bondCount:86,inchiKey:"CBMGNYKOZWNVNK-AHGCAHLCSA-N"}}},"cyclized-D(2)-NH2(2)-0-0":{src:{seq:"D(2)-T-G-H-F-Y-P-NH2(2)"},tgt:{helm:"PEPTIDE1{D.T.G.H.F.Y.P.[NH2]}$PEPTIDE1,PEPTIDE1,8:R2-1:R3$$$V2.0",mol:{atomCount:59,bondCount:63,inchiKey:"HGRHAUQBJXFERJ-MUFWPYSASA-N"}}}};for(const[t,r]of Object.entries(l))(0,e.t6)(`toHelm-${t}`,(async()=>{const t=await(0,N.Q4)(["rules_example.json"]),o=(0,T.b)([r.src.seq],t,n);(0,e.E3)(o[0][0],r.tgt.helm)}));for(const[o,s]of Object.entries(l))(0,e.t6)(`toAtomicLevel-${o}`,(async()=>{const o=await(0,N.Q4)(["rules_example.json"]),[a,l,u]=(0,T.b)([s.src.seq],o,n),c=await(0,I.A)(o),f=t.Column.fromStrings("helm",a);f.semType=t.SEMTYPE.MACROMOLECULE,f.meta.units=g.Hi.HELM;const h=await r.helmToAtomicLevel(f,!1,!1,c);if(h.warnings&&h.warnings.length>0)throw new Error(h.warnings[0]);(0,e.E3)(null!=h.molCol,!0,".molCol is not null");const d=h.molCol.get(0),p=i.get_mol(d);try{const t={atomCount:p.get_num_atoms(),bondCount:p.get_num_bonds(),inchiKey:i.get_inchikey_for_inchi(p.get_inchi())};(0,e.Xk)(t,s.tgt.mol)}finally{p.delete()}}));(0,e.t6)("ui-col-wo-table",(async()=>{const n=M.name,r=Object.values(l).map((t=>t.src.seq)),i=Object.values(l).map((t=>t.tgt.helm)),s=t.Column.fromStrings("seq",r),a=await o.functions.call(`${n}:polyToolConvert2`,{seqCol:s,generateHelm:!0,chiralityEngine:!0,rules:["rules_example.json"]});(0,e.J6)(a.toList(),i),(0,e.E3)(a.semType,t.SEMTYPE.MACROMOLECULE),(0,e.E3)(a.meta.units,g.Hi.HELM),(0,e.E3)(a.dataFrame,null)})),(0,e.t6)("ui-col",(async()=>{const n=M.name,r=Object.values(l).map((t=>t.src.seq)),i=Object.values(l).map((t=>t.tgt.helm)),s=t.Column.fromStrings("seq",r),a=t.DataFrame.fromColumns([s]),u=o.shell.addTableView(a),c=await o.functions.call(`${n}:polyToolConvert2`,{seqCol:s,generateHelm:!0,chiralityEngine:!0,rules:["rules_example.json"]});(0,e.J6)(c.toList(),i),(0,e.E3)(c.semType,t.SEMTYPE.MACROMOLECULE),(0,e.E3)(c.meta.units,g.Hi.HELM),(0,e.E3)(c.dataFrame.id,a.id),await(0,e.PE)(u.grid.onAfterDrawContent,(()=>{}),(async()=>{u.grid.invalidate()}),15e3),(0,e.E3)(c.getTag(t.TAGS.CELL_RENDERER),"helm")}))}));var S=n(1296),L=n(3820);(0,e.L1)("PolyTool: Enumerate",(()=>{let t,n,r;(0,e.gM)((async()=>{t=await(0,x.b2)(),n=await(0,b.pj)(),r=await w(),await n.loadMonomerLibForTests()})),(0,e.Pl)((async()=>{await E(r),await n.loadMonomerLib(!0)}));const o={single1:{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Single,placeholders:[{position:4,monomers:["K","P","F4COO"]},{position:6,monomers:["Y","T"]}]},tgt:[{seq:"PEPTIDE1{[Ac(1)].F.W.G.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5P"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.[F4COO].L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5[F4COO]"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-[Tic]7T"}]},"single-with-original":{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Single,placeholders:[{position:4,monomers:["K","P","F4COO"]},{position:6,monomers:["Y","T"]}],keepOriginal:!0},tgt:[{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:""},{seq:"PEPTIDE1{[Ac(1)].F.W.G.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5P"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.[F4COO].L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5[F4COO]"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-[Tic]7T"}]},matrix1:{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Matrix,placeholders:[{position:1,monomers:["D","L"]},{position:4,monomers:["K","P","F4COO"]},{position:6,monomers:["Y","T"]}]},tgt:[{seq:"PEPTIDE1{[Ac(1)].D.W.G.K.L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2D-P5K-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].D.W.G.K.L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2D-P5K-[Tic]7T"},{seq:"PEPTIDE1{[Ac(1)].D.W.G.P.L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2D-P5P-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].D.W.G.P.L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2D-P5P-[Tic]7T"},{seq:"PEPTIDE1{[Ac(1)].D.W.G.[F4COO].L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2D-P5[F4COO]-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].D.W.G.[F4COO].L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2D-P5[F4COO]-[Tic]7T"},{seq:"PEPTIDE1{[Ac(1)].L.W.G.K.L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2L-P5K-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].L.W.G.K.L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2L-P5K-[Tic]7T"},{seq:"PEPTIDE1{[Ac(1)].L.W.G.P.L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2L-P5P-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].L.W.G.P.L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2L-P5P-[Tic]7T"},{seq:"PEPTIDE1{[Ac(1)].L.W.G.[F4COO].L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2L-P5[F4COO]-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].L.W.G.[F4COO].L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2L-P5[F4COO]-[Tic]7T"}]}};for(const[t,n]of Object.entries(o))(0,e.t6)(`${t}`,(async()=>{const t=(0,L.o)(n.src,"",n.params);(0,e.J6)(t,n.tgt.map((t=>[t.seq,t.name])))}))})),(0,e.L1)("PolyTool: Enumerate",(()=>{let t,n,r;(0,e.gM)((async()=>{t=await(0,x.b2)(),n=await(0,b.pj)(),r=await w(),await n.loadMonomerLibForTests()})),(0,e.Pl)((async()=>{await E(r),await n.loadMonomerLib(!0)}));const o={breadth1:{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Single,breadthPlaceholders:[{start:2,end:4,monomers:["K"]}]},tgt:[{seq:"PEPTIDE1{[Ac(1)].F.K.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3K"},{seq:"PEPTIDE1{[Ac(1)].F.W.K.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4K"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K"}]},"breadth1-with-original":{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Single,breadthPlaceholders:[{start:2,end:4,monomers:["K"]}],keepOriginal:!0},tgt:[{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:""},{seq:"PEPTIDE1{[Ac(1)].F.K.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3K"},{seq:"PEPTIDE1{[Ac(1)].F.W.K.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4K"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K"}]},breadth2:{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Single,breadthPlaceholders:[{start:2,end:4,monomers:["K","Y"]}]},tgt:[{seq:"PEPTIDE1{[Ac(1)].F.K.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3K"},{seq:"PEPTIDE1{[Ac(1)].F.W.K.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4K"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K"},{seq:"PEPTIDE1{[Ac(1)].F.Y.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.Y.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.Y.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5Y"}]},"breadth-double":{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Single,breadthPlaceholders:[{start:2,end:4,monomers:["K"]},{start:2,end:4,monomers:["Y"]}]},tgt:[{seq:"PEPTIDE1{[Ac(1)].F.Y.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3K-K3Y"},{seq:"PEPTIDE1{[Ac(1)].F.K.Y.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3K-G4Y"},{seq:"PEPTIDE1{[Ac(1)].F.K.G.Y.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3K-P5Y"},{seq:"PEPTIDE1{[Ac(1)].F.Y.K.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4K-W3Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.Y.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4K-K4Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.K.Y.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4K-P5Y"},{seq:"PEPTIDE1{[Ac(1)].F.Y.G.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K-W3Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.Y.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K-G4Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.Y.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K-K5Y"}]}};for(const[t,n]of Object.entries(o))(0,e.t6)(`${t}`,(async()=>{const t=(0,L.o)(n.src,"",n.params);(0,e.J6)(t,n.tgt.map((t=>[t.seq,t.name])))}))}));var P=n(6307),O=n(2125);(0,e.L1)("PolyTool: Chain: parseNotation",(()=>{let t;(0,e.gM)((async()=>{t=await(0,x.b2)()}));const n={cyclized:{src:{seq:"R-F-C(1)-T-G-H-F-Y-P-C(1)-meI"},tgt:{helm:"PEPTIDE1{R.F.[C(1)].T.G.H.F.Y.P.[C(1)].[meI]}$$$$V2.0"}},dimerized1:{src:{seq:"(#3)Succ-{A(CHOL)-F-C(1)-T-G-H-Y-P-C(1)-NH2}"},tgt:{helm:"PEPTIDE1{[(#3)Succ]}|PEPTIDE2{[A(CHOL)].F.[C(1)].T.G.H.Y.P.[C(1)].[NH2]}$PEPTIDE1,PEPTIDE2,1:R1-1:R1$$$V2.0"}},dimerized2:{src:{seq:"($3)Succ-{R-F-C(1)-T-G-H-F-P-C(1)-NH2}($2){A(CHOL)-F-C(1)-T-G-H-F-P-C(1)-NH2}"},tgt:{helm:"PEPTIDE1{[($3)Succ]}|PEPTIDE2{R.F.[C(1)].T.G.H.F.P.[C(1)].[NH2]}|PEPTIDE3{[($2)A(CHOL)].F.[C(1)].T.G.H.F.P.[C(1)].[NH2]}$PEPTIDE1,PEPTIDE2,1:R1-1:R1$$$V2.0"}}};for(const[r,o]of Object.entries(n))(0,e.t6)(`${r}`,(async()=>{await(0,N.Q4)(["rules_example.json"]);const n=await P.s.fromSeparator(o.src.seq,t),r=n.mol,i=t.createHelmWebEditor();i.editor.setMol(r);const s=i.editor.getHelm(),a=n.getHelm();(0,e.E3)(s,o.tgt.helm),(0,e.E3)(a,o.tgt.helm)}),"reaction2"==r?{skipReason:"reverse reaction"}:void 0);const r={"0-in-4-4-3":{inIdx:0,spIdx:0,outIdx:0,monomers:[["0","1","2","3"],["4","5","6","7"],["8","9","10"]]},"3-in-4-4-3":{inIdx:3,spIdx:0,outIdx:3,monomers:[["0","1","2","3"],["4","5","6","7"],["8","9","10"]]},"4-in-4-4-3":{inIdx:0,spIdx:1,outIdx:4,monomers:[["0","1","2","3"],["4","5","6","7"],["8","9","10"]]},"7-in-4-4-3":{inIdx:3,spIdx:1,outIdx:7,monomers:[["0","1","2","3"],["4","5","6","7"],["8","9","10"]]},"8-in-4-4-3":{inIdx:0,spIdx:2,outIdx:8,monomers:[["0","1","2","3"],["4","5","6","7"],["8","9","10"]]},"0-in-1-1-6-3":{inIdx:0,spIdx:0,outIdx:0,monomers:[["0"],["1"],["2","3","4","5","6","7"],["8","9","10"]]},"1-in-1-1-6-3":{inIdx:0,spIdx:1,outIdx:1,monomers:[["0"],["1"],["2","3","4","5","6","7"],["8","9","10"]]},"2-in-1-1-6-3":{inIdx:0,spIdx:2,outIdx:2,monomers:[["0"],["1"],["2","3","4","5","6","7"],["8","9","10"]]},"3-in-1-1-6-3":{inIdx:1,spIdx:2,outIdx:3,monomers:[["0"],["1"],["2","3","4","5","6","7"],["8","9","10"]]},"7-in-1-1-6-3":{inIdx:5,spIdx:2,outIdx:7,monomers:[["0"],["1"],["2","3","4","5","6","7"],["8","9","10"]]},"8-in-1-1-6-3":{inIdx:0,spIdx:3,outIdx:8,monomers:[["0"],["1"],["2","3","4","5","6","7"],["8","9","10"]]}};for(const[t,{inIdx:n,spIdx:o,outIdx:i,monomers:s}]of Object.entries(r))(0,e.t6)(`innerIdx-${t}`,(async()=>{const[t,r]=(0,O.M)(i,s);(0,e.E3)(t,n),(0,e.E3)(r,o)}));for(const[t,{inIdx:n,spIdx:o,outIdx:i,monomers:s}]of Object.entries(r))(0,e.t6)(`outerIdx-${t}`,(async()=>{const t=(0,O.j)(n,o,s);(0,e.E3)(t,i)}))})),(0,e.L1)("PolyTool: Chain",(()=>{let t;(0,e.gM)((async()=>{t=await(0,x.b2)()}));const n={cyclized:{data:{templateSeq:"R-F-C(1)-T-G-H-F-Y-P-C(1)-meI",templateHelm:"PEPTIDE1{R.F.[C(1)].T.G.H.F.Y.P.[C(1)].[meI]}$$$$V2.0",mmHelm:"PEPTIDE1{R.F.C.T.G.H.F.Y.P.C.[meI]}$PEPTIDE1,PEPTIDE1,3:R3-10:R3$$$V2.0"},tgt:{templateChain:{monomerCount:[11],linkageCount:0},mmChain:{monomerCount:[11],linkageCount:0}}},dimerized1:{data:{templateSeq:"(#3)Succ-{A(CHOL)-F-C(1)-T-G-H-Y-P-C(1)-NH2}",templateHelm:"PEPTIDE1{[(#3)Succ]}|PEPTIDE2{[A(CHOL)].F.[C(1)].T.G.H.Y.P.[C(1)].[NH2]}$PEPTIDE1,PEPTIDE2,1:R1-1:R1$$$V2.0",mmHelm:"PEPTIDE1{[(#3)Succ].[{A(CHOL)].F.C.T.G.H.Y.P.C.[NH2}]}$PEPTIDE1,PEPTIDE1,4:R3-10:R3$$$V2.0"},tgt:{templateChain:{monomerCount:[1,10],linkageCount:1},mmChain:{monomerCount:[11],linkageCount:1}}},dimerized2:{data:{templateSeq:"($3)Succ-{R-F-C(1)-T-G-H-F-P-C(1)-NH2}($3){A(CHOL)-F-C(1)-Y-H-G-D-N-C(1)-meI}",templateHelm:"PEPTIDE1{[($3)Succ]}|PEPTIDE2{R.F.[C(1)].T.G.H.F.P.[C(1)].[NH2]}|PEPTIDE3{[($3)A(CHOL)].F.[C(1)].Y.H.G.D.N.[C(1)].[meI]}$PEPTIDE1,PEPTIDE2,1:R1-1:R1$$$V2.0",mmHelm:"PEPTIDE1{[($3)Succ].[{R].F.C.T.G.H.F.P.C.[NH2}($3){A(CHOL)].F.[C(1)].Y.H.G.D.N.[C(1)].[meI}]}$PEPTIDE1,PEPTIDE1,4:R3-10:R3$$$V2.0"},tgt:{templateChain:{monomerCount:[1,10,10],linkageCount:1},mmChain:{monomerCount:[20],linkageCount:1}}}};for(const[r,{data:o,tgt:i}]of Object.entries(n))(0,e.t6)(`fromNotation-${r}`,(async()=>{const n=await(0,N.Q4)(["rules_example.json"]),r=P.s.fromSeparator(o.templateSeq,t);r.applyRules(n),r.check(!0),(0,e.J6)(r.monomers.map((t=>t.length)),i.mmChain.monomerCount),(0,e.E3)(r.linkages.length,i.mmChain.linkageCount),(0,e.E3)(r.getHelm(),o.mmHelm)}),{skipReason:"3157"});for(const[r,{data:o,tgt:i}]of Object.entries(n))(0,e.t6)(`parseNotation-${r}`,(async()=>{await(0,N.Q4)(["rules_example.json"]);const n=P.s.fromSeparator(o.templateSeq,t);n.check(!0),(0,e.J6)(n.monomers.map((t=>t.length)),i.templateChain.monomerCount),(0,e.E3)(n.linkages.length,i.templateChain.linkageCount),(0,e.E3)(n.getHelm(),o.templateHelm),(0,e.E3)(n.getNotation(),o.templateSeq)}));for(const[r,{data:o,tgt:i}]of Object.entries(n))(0,e.t6)(`parseHelm-${r}`,(async()=>{await(0,N.Q4)(["rules_example.json"]);const n=P.s.fromHelm(o.templateHelm,t);n.check(!0),(0,e.J6)(n.monomers.map((t=>t.length)),i.templateChain.monomerCount),(0,e.E3)(n.linkages.length,i.templateChain.linkageCount),(0,e.E3)(n.getHelm(),o.templateHelm),(0,e.E3)(n.getNotation(),o.templateSeq)}));for(const[r,{data:o,tgt:i}]of Object.entries(n))(0,e.t6)(`applyRules-${r}`,(async()=>{const n=await(0,N.Q4)(["rules_example.json"]),r=P.s.fromSeparator(o.templateSeq,t);r.applyRules(n),r.check(!0),(0,e.J6)(r.monomers.map((t=>t.length)),i.mmChain.monomerCount),(0,e.E3)(r.linkages.length,i.mmChain.linkageCount),(0,e.E3)(r.getHelm(),o.mmHelm)}),{skipReason:"applyRules is not implemented"})})),(0,e.L1)("toAtomicLevel",(()=>{let n,r,o;(0,e.gM)((async()=>{r=await(0,b.pj)(),n=await w(),o=await(0,_.j)(),await r.loadMonomerLibForTests()})),(0,e.Pl)((async()=>{await E(n),await r.loadMonomerLib(!0)})),(0,e.t6)("override",(async()=>{const n=r.getMonomerLib(),i=await M.files.readAsText("tests/polytool-reaction-lib.json"),s=JSON.parse(i).find((t=>"GGaz"===t.symbol));(0,e.E3)(null!=s,!0,"Monomer 'GGaz' not found.");const a={PEPTIDE:{GGaz:s}},l=n.override(a,"test"),u=await(0,p.Q)(),c=t.Column.fromList(t.COLUMN_TYPE.STRING,"helm",["PEPTIDE1{F.P.Y.[GGaz].H.A.A.G.G.A.C}|PEPTIDE2{A.A.A}$PEPTIDE1,PEPTIDE2,4:R4-1:R1|PEPTIDE1,PEPTIDE1,11:R2-4:R3$$$V2.0"]);c.semType=t.SEMTYPE.MACROMOLECULE,c.meta.units=g.Hi.HELM;const f=await u.helmToAtomicLevel(c,!1,!1,l);(0,e.E3)(null!=f.molCol,!0,"Result molCol is null");const h=f.molCol.get(0);(0,e.E3)(!!h,!0,"Molfile is empty");const d=o.get_mol(h);try{const t=d.get_inchi(),n=o.get_inchikey_for_inchi(t);(0,e.E3)(d.get_num_bonds(),103),(0,e.E3)(d.get_num_atoms(),98),(0,e.E3)(n,"XPQUTLNSNIMERR-WKBTUBAPSA-N")}finally{d.delete()}})),(0,e.t6)("getNewMonomer",(async()=>{const t=await(0,_.j)(),n=r.getMonomerLib(),o=(await(0,N.Q4)(["rules_example.json"])).reactionRules.find((t=>"GGaz"==t.name)),[i,s]=(0,I.T)(t,n,o);(0,e.E3)(i[0],"azG_GGaz");const a=t.get_mol(s[0].molfile);try{const n=a.get_inchi();t.get_inchikey_for_inchi(n),(0,e.E3)(a.get_num_bonds(),7),(0,e.E3)(a.get_num_atoms(),8)}finally{a.delete()}}))}));const M=new s;async function R(n,r,o){const i=await(0,e.N$)({category:n,test:r,testContext:o,verbose:!0});return t.DataFrame.fromObjects(i)}async function $(){await(0,e.Xb)(M,M.getModule("package-test.js"))}})(),sequencetranslator_test=r})();
|
|
2
|
+
var sequencetranslator_test;(()=>{var t={6717:(t,e,n)=>{"use strict";n.d(e,{j:()=>o});var r=n(6082);async function o(){const t=r.Func.find({package:"Chem",name:"getRdKitModule"});if(0===t.length)throw new Error('Package "Chem" must be installed for getRdKitModule.');return(await t[0].prepare().call()).getOutputParamValue()}},3599:(t,e,n)=>{"use strict";n.d(e,{o:()=>r.o});var r=n(6869)},9124:(t,e,n)=>{"use strict";n.d(e,{b2:()=>i});var r=n(7389),o=n(6082);async function i(){const t="Helm",e=o.Func.find({package:t,name:"getHelmHelper"});if(0===e.length)throw new Error(`Package '${t}' must be installed for HelmHelper.`);return(await e[0].prepare().call()).getOutputParamValue()}o.JsInputBase,Error,r.input.helmAsync=async function(t,e){return(await i()).createHelmInput(t,e)}},8438:(t,e,n)=>{"use strict";function r(t){return t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t}n.d(e,{D:()=>r})},8123:(t,e,n)=>{"use strict";n.d(e,{u:()=>r});const r={V2K_RGP_SHIFT:8,V2K_RGP_LINE:"M RGP",V2K_A_LINE:"A ",V3K_COUNTS_SHIFT:14,V3K_IDX_SHIFT:7,V3K_HEADER_FIRST_LINE:"\nDatagrok macromolecule handler\n\n",V3K_HEADER_SECOND_LINE:" 0 0 0 0 0 0 999 V3000\n",V3K_BEGIN_CTAB_BLOCK:"M V30 BEGIN CTAB\n",V3K_END_CTAB_BLOCK:"M V30 END CTAB\n",V3K_BEGIN_COUNTS_LINE:"M V30 COUNTS ",V3K_COUNTS_LINE_ENDING:" 0 0 0\n",V3K_BEGIN_ATOM_BLOCK:"M V30 BEGIN ATOM\n",V3K_END_ATOM_BLOCK:"M V30 END ATOM\n",V3K_BEGIN_BOND_BLOCK:"M V30 BEGIN BOND\n",V3K_END_BOND_BLOCK:"M V30 END BOND\n",V3K_BOND_CONFIG:" CFG=",V3K_BEGIN_DATA_LINE:"M V30 ",V3K_END:"M END",PRECISION_FACTOR:1e4,DEOXYRIBOSE:{polymerType:"RNA",symbol:"d"},RIBOSE:{polymerType:"RNA",symbol:"r"},PHOSPHATE:{polymerType:"RNA",symbol:"p"},OXYGEN:"O",HYDROGEN:"H"}},2890:(t,e,n)=>{"use strict";n.d(e,{pj:()=>d});var r,o,i,s,a,l,u,c=n(6082);n(4328);class f{constructor(t,e=!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 t){const n=t,r=f._createBuffer(n);if(e)for(let t=0;t<r.length;t++)r[t]=-1;this._data=r,this._length=n}else{if(!(t instanceof Uint32Array))throw new Error("Invalid constructor");this._data=t,this._length=e}}getRawData(){return this._data}assureGoez(t,e){if(t<0)throw new Error(`${e} should be greater than zero`)}assureInRange(t,e,n,r){if(t<e||t>n)throw new Error(`Argument ${r} (${t}) out of range (${e}, ${n})`)}copy(t,e,n){for(let r=0;r<n;r++)e[r]=t[r]}copyFrom(t){if(this._length!=t._length)throw new Error(`Lengths differ (${this._length} != ${t._length})`);this.copy(t._data,this._data,this.lengthInInts),this._version++}get length(){return this._length}get buffer(){return this._data}set buffer(t){this._data=t,this._version++}get version(){return this._version}set version(t){this._version=t}incrementVersion(t=!0){this._version++}get lengthInInts(){return Math.floor((this._length+31)/32)}get versionedName(){return this._version==this._versionedNameVersion?this._versionedName:""}set versionedName(t){this._versionedName=t,this._versionedNameVersion=this._version}get self(){return this}setLength(t){if(t<0)throw new Error("should be >= 0");if(t==this._length)return;const e=Math.floor((t+31)/32);if(e>this._data.length||e+this.SHRINK_THRESHOLD<this._data.length){const t=new Uint32Array(e);this.copy(this._data,t,e>this._data.length?this._data.length:e),this._data=t}t>this._length&&(this._length%32>0&&(this._data[this.lengthInInts-1]&=(1<<(this._length%32&31))-1),this._data.fill(0,this.lengthInInts,e)),this._length=t,this._version++}static fromAnd(t,e){if(t._length!=e._length)throw new Error(`Lengths differ (${t._length} != ${e._length})`);const n=new f(t._length);n._length=t._length,n._data=f._createBuffer(n._length),n._version=0;const r=t.lengthInInts;for(let o=0;o<r;o++)n._data[o]=t._data[o]&e._data[o];return n}static _createBuffer(t){return new Uint32Array(Math.floor((t+31)/32))}static fromValues(t){const e=new f(t.length);e._version=0;for(let n=0;n<e._length;n++)t[n]&&(e._data[Math.floor(n/32)]|=1<<(n%32&31));return e}static fromSeq(t,e){const n=new f(t);for(let r=0;r<t;++r)n.setBit(r,e(r));return n._version=0,n}static fromString(t){return f.fromSeq(t.length,(e=>"1"==t.charAt(e)))}static fromUint32Array(t,e){const n=new f(t);return n._data=e,n}static fromBytes(t){const e=t.length,n=new f(8*e);n._data=new Uint32Array(Math.floor((e+3)/4)),n._length=8*e;let r=0,o=0;for(;e-o>=4;)n._data[r++]=255&t[o]|(255&t[o+1])<<8|(255&t[o+2])<<16|(255&t[o+3])<<24,o+=4;return e-o==3&&(n._data[r]=(255&t[o+2])<<16),e-o==2&&(n._data[r]|=(255&t[o+1])<<8),e-o==1&&(n._data[r]|=255&t[o]),n._version=0,n}toString(){return`${this._length} bits, ${this.countBits(!0)} set`}equals(t){if(this==t)return!0;if(null==t)return!1;if(this._length!=t._length)return!1;if(0==this._length)return!0;for(let e=0;e<this._data.length-1;e++)if(this._data[e]!=t._data[e])return!1;for(let e=8*(this._data.length-1);e<this._length;e++)if(this.getBit(e)!=t.getBit(e))return!1;return!0}clone(){const t=new f(0,!1);return t._data=Uint32Array.from(this._data),t._length=this._length,t._version=this._version,t}init(t,e){this.setAll(!1,!1);for(let e=0;e<this._length;e++)t(e)&&(this._data[Math.floor(e/32)]|=1<<(e%32&31));return this.incrementVersion(e),this}invert(t=!0){for(let t=0;t<this._data.length;t++)this._data[t]^=-1;this.incrementVersion(t)}setAll(t,e=!1){const n=t?-1:0,r=this.lengthInInts;for(let t=0;t<r;t++)this._data[t]=n;this.incrementVersion(e)}setIndexes(t,e=!0,n=!0,r=!0){n&&this.setAll(!e,!1);for(const n of t)this.setFast(n,e);this.incrementVersion(r)}everyIndex(t,e=!0){for(const n of t)if(this.getBit(n)!=e)return!1;return!0}anyIndex(t,e=!0){for(const n of t)if(this.getBit(n)==e)return!0;return!1}setWhere(t,e=!0,n=!0,r=!0,o=!0){if(n&&o&&this.setAll(!e,!1),o)for(let n=0;n<this._length;n++)t(n)&&this.setFast(n,e);else for(let n=0;n<this._length;n++)this.setFast(n,t(n)?e:!e);this.incrementVersion(r)}getRange(t,e){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length,"to");const n=[];for(let r=t;r<e;++r)n.push(this.getBit(r));return f.fromValues(n)}getRangeAsList(t,e){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length,"to");const n=[];for(let r=t;r<e;++r)n.push(this.getBit(r));return n}setRange(t,e,n,r=!0){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length-1,"to");const o=Math.min(t,e),i=Math.max(t,e);if(n)for(let t=o;t<=i;t++)this.setTrue(t);else for(let t=o;t<=i;t++)this.setFalse(t);return this.incrementVersion(r),this}setRandom(t,e,n=!0){if(t<0||t>this._length)throw new Error("n must be >= 0 && <= Count");t>this._length/2&&this.setRandom(this._length-t,!e),this.setAll(!e);for(let n=0;n<t;){const t=Math.floor(Math.random()*this._length);this.getBit(t)!=e&&(this.setFast(t,e),n++)}this.incrementVersion(n)}and(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]&=t._data[e];return this.incrementVersion(e),this}andNot(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");const n=this.lengthInInts;for(let e=0;e<n;e++)this._data[e]&=~t._data[e];return this.incrementVersion(e),this}notAnd(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]=~this._data[e]&t._data[e];return this.incrementVersion(e),this}not(t=!0){for(let t=0,e=this.lengthInInts;t<e;t++)this._data[t]=~this._data[t];return this.incrementVersion(t),this}or(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]|=t._data[e];return this.incrementVersion(e),this}xor(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]^=t._data[e];return this.incrementVersion(e),this}insertAt(t,e,n=!1){if(this.assureInRange(t,0,this._length,"pos"),0==e)return;const r=this._length;this.setLength(this._length+e);for(let n=r-1;n>=t;n--)this.setBit(n+e,this.getBit(n));for(let r=t;r<t+e;r++)this.setBit(r,n)}removeAt(t,e=1){if(e<0)throw new Error("n cannot be negative");if(this.assureInRange(t,0,this._length-e,"pos"),this.contains(!0))for(let n=t;n<this._length-e;n++)this.setBit(n,this.getBit(n+e));this.setLength(this._length-e)}removeByMask(t,e=!0){if(this._length!=t.length)throw new Error("length != mask.length");if(t==this)this.setLength(t.countBits(!e)),this.setAll(!e);else{let n=0;for(let r=-1;-1!=(r=t.findNext(r,!e));)this.setFast(n++,this.getBit(r));this._length=n,this._version++}return this}getBit(t){return!!(this._data[Math.floor(t/32)]&1<<(31&t))}setBit(t,e,n=!0){this.setFast(t,e),this._version++}setFast(t,e){e?this._data[Math.floor(t/32)]|=1<<(31&t):this._data[Math.floor(t/32)]&=~(1<<(31&t))}setTrue(t){this._data[Math.floor(t/32)]|=1<<(31&t)}setFalse(t){this._data[Math.floor(t/32)]&=~(1<<(31&t))}trueCount(){return this.countBits(!0)}falseCount(){return this.countBits(!1)}countBits(t){if(0==this._length)return 0;if(this._selectedCountVersion!=this._version){this._selectedCount=0;const t=this.lengthInInts;let e=0;for(;e<t-1;e++)for(let t=this._data[e];0!=t;t>>>=8)this._selectedCount+=f._onBitCount[255&t];let n=this._data[e];const r=31&this._length;for(0!=r&&(n&=~(4294967295<<r));0!=n;n>>>=8)this._selectedCount+=f._onBitCount[255&n];this._selectedCountVersion=this._version}return t?this._selectedCount:this._length-this._selectedCount}countWhere(t){let e=0;if(this.trueCount()==this._length)for(let n=0;n<this._length;n++)e+=t(n)?1:0;else for(let n=-1;-1!=(n=this.findNext(n,!0));)e+=t(n)?1:0;return e}andWithCountBits(t,e){if(0==this._length)return 0;let n=0;const r=this.lengthInInts;let o=0;for(;o<r-1;o++)for(let e=this._data[o]&t._data[o];0!=e;e>>>=8)n+=f._onBitCount[255&e];let i=this._data[o]&t._data[o];const s=31&this._length;for(0!=s&&(i&=~(4294967295<<s));0!=i;i>>>=8)n+=f._onBitCount[255&i];return e?n:this._length-n}clear(){this.setLength(0)}contains(t){return this.findNext(-1,t)>=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(t,e=!0){if(this.assureInRange(t,-1,this._length,"index"),t>=this._length-1)return-1;let n=31&(t=t<0?0:t+1);const r=this.lengthInInts;for(let o=Math.floor(t/32);o<r;o++){let r=e?this._data[o]:~this._data[o];if(0!=n)r&=4294967295<<n&4294967295,n=0;else if(!e&&-4294967296==r)continue;for(let e=0;0!=r;e+=8,r>>>=8){const n=f._firstOnBit[255&r];if(n>=0)return(t=n+32*o+e)>=this._length?-1:t}}return-1}findPrev(t,e=!0){if(0==t)return-1;this.assureInRange(t,-1,this._length,"index");let n=1+(t=t<0?this._length-1:t-1)&31;for(let r=Math.floor(t/32);r>=0;r--){let t=e?this._data[r]:~this._data[r];0!=n&&(t&=~(4294967295<<n),n=0);for(let e=24;0!=t;e-=8,t<<=8){const n=f._lastOnBit[t>>>24];if(n>=0)return n+32*r+e}}return-1}}f._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]),f._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]),f._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]),function(t){t.Levenshtein="Levenshtein",t.JaroWinkler="Jaro-Winkler",t.Manhattan="Manhattan",t.Onehot="One-Hot"}(r||(r={})),function(t){t.Euclidean="Euclidean"}(o||(o={})),function(t){t.Tanimoto="Tanimoto",t.Dice="Dice",t.Asymmetric="Asymmetric",t.BraunBlanquet="Braun-Blanquet",t.Cosine="Cosine",t.Kulczynski="Kulczynski",t.McConnaughey="Mc-Connaughey",t.RogotGoldberg="Rogot-Goldberg",t.Russel="Russel",t.Sokal="Sokal",t.Hamming="Hamming",t.Euclidean="Euclidean"}(i||(i={})),function(t){t.TanimotoIntArray="TanimotoIntArray"}(s||(s={})),function(t){t.Vector="Vector",t.String="String",t.BitArray="BitArray",t.MacroMolecule="MacroMolecule",t.Number="Number",t.IntArray="IntArray",t.NumberArray="NumberArray"}(a||(a={})),function(t){t.Difference="Difference"}(l||(l={})),function(t){t.CommonItems="Common Items"}(u||(u={}));new Uint32Array(65536);var h;async function d(){const t=c.Func.find({package:"Bio",name:"getMonomerLibHelper"});if(0===t.length)throw new Error('Package "Bio" must be installed for MonomerLibHelper.');return(await t[0].prepare().call()).getOutputParamValue()}!function(t){t.HAMMING="Hamming",t.LEVENSHTEIN="Levenshtein",t.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",t.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(h||(h={})),h.HAMMING,h.LEVENSHTEIN,h.NEEDLEMANN_WUNSCH,h.MONOMER_CHEMICAL_DISTANCE,i.Tanimoto,i.Dice,i.Asymmetric,i.BraunBlanquet,i.Cosine,i.Kulczynski,i.McConnaughey,i.RogotGoldberg,i.Russel,i.Sokal,i.Hamming,i.Euclidean,i.Tanimoto,i.Dice,i.Asymmetric,i.BraunBlanquet,i.Cosine,i.Kulczynski,i.McConnaughey,i.RogotGoldberg,i.Russel,i.Sokal,i.Hamming,i.Euclidean,i.Tanimoto,i.Dice,i.Cosine,i.Tanimoto,i.Asymmetric,i.Cosine,i.Sokal,h.HAMMING,h.LEVENSHTEIN,h.MONOMER_CHEMICAL_DISTANCE,h.NEEDLEMANN_WUNSCH,n(3151),n(439)},6197:(t,e,n)=>{"use strict";n(3599)},9235:(t,e,n)=>{"use strict";n.d(e,{R:()=>l});var r=n(6082),o=n(1991),i=n.n(o),s=n(330),a=n(3599);async function l(t,e,o,l,u,c,f){const h=t.length,d=t.dataFrame,p=Math.max(navigator.hardwareConcurrency-2,1),g=new Array(p).fill(null).map((()=>new Worker(new URL(n.p+n.u(455),n.b)))),m=h/p,y=new Array(p),v=c.getSeqHandler(t),b="RNA"==l?a.o.NUCLEOTIDE:a.o.AA,C=i().count(0).take(t.length).map((t=>{const e=v.getSplitted(t);return i().count(0).take(e.length).map((t=>({position:t,symbol:e.getCanonical(t),biotype:b}))).toArray()})).toArray();for(let t=0;t<p;t++){const n=g[t],r=Math.floor(t*m),i=t===p-1?h:Math.floor((t+1)*m);y[t]=new Promise((t=>{n.onmessage=e=>{t(e.data)}})),n.postMessage({seqList:C,monomersDict:e,alphabet:o,polymerType:l,start:r,end:i})}const A=[],w=[];await Promise.all(y).then((t=>{for(const e of t)A.push(...e.molfiles),w.push(...e.warnings)})),setTimeout((()=>{g.forEach((t=>{t.terminate()}))}),0);const E=(0,s.qj)(d,t.name),_=r.Column.fromType(r.COLUMN_TYPE.STRING,E,t.length).init((t=>A[t]?.molfile));return _.semType=r.SEMTYPE.MOLECULE,_.meta.units=r.UNITS.Molecule.MOLBLOCK,_.setTag(".sequence-src-col",t.name),{molCol:_,warnings:w}}},3561:(t,e,n)=>{"use strict";n.d(e,{Hb:()=>s,YN:()=>a});var r=n(8123),o=(n(294),n(3151)),i=n(439);function s(t,e,n){const s=new Map;for(const a of t.getMonomerSymbolsByType(e)){const l=t.getMonomer(e,a);if("RNA"===e&&("Branch"===l.monomerType||n===i.YI.DNA&&l.symbol===r.u.DEOXYRIBOSE.symbol||n===i.YI.RNA&&l.symbol===r.u.RIBOSE.symbol||l.symbol===r.u.PHOSPHATE.symbol)||"PEPTIDE"===e&&"Branch"!==l.monomerType){const t={};o.f6.forEach((e=>{t[e]=l[e]})),s.set(l.symbol,t)}}return s}function a(t){return Math.round(r.u.PRECISION_FACTOR*t)/r.u.PRECISION_FACTOR}n(6197)},6077:(t,e,n)=>{"use strict";n.d(e,{C4:()=>p});var r=n(4328),o=n(6082),i=n(1991),s=n.n(i),a=n(439),l=n(3561),u=n(9235),c=n(294),f=n(9192),h=n(330),d=n(8123);async function p(t,e,n,i,c){if(e.semType!==o.SEMTYPE.MACROMOLECULE)return{molCol:null,warnings:[`Only the ${o.SEMTYPE.MACROMOLECULE} columns can be converted to atomic level, the chosen column has semType '${e.semType}'`]};let p=e;const m=i.getSeqHandler(e);let y,v;m.notation!==a.Hi.SEPARATOR&&(p=m.convert(a.Hi.SEPARATOR,"."),p.name=e.name);try{v=i.getSeqHandler(p).alphabet,y=(0,h.pz)(v)}catch(t){const[e,n]=(0,f.AP)(t);return{molCol:null,warnings:[e]}}const b=function(t,e){const n=t.length,o=new Array(n),i=e.getSeqHandler(t);let a=!1;const l=i.defaultBiotype;for(let t=0;t<n;++t){const e=i.getSplitted(t);a||(a=0===e.length),o[t]=s().count(0).take(e.length).filter((t=>!e.isGap(t))).map((t=>({position:t,biotype:l,symbol:e.getCanonical(t)}))).toArray()}return a&&r.shell.warning(`Some values in the "${t.name}" column are empty`),o}(p,i),C=function(t,e,n,r,o){const i=(0,l.Hb)(r,e,n),s={},u={value:null};if("RNA"===e){const t=n===a.YI.RNA?[d.u.RIBOSE,d.u.PHOSPHATE]:[d.u.DEOXYRIBOSE,d.u.PHOSPHATE];for(const n of t)g(s,n.symbol,i,o,e,u)}for(let n=0;n<t.length;++n){const r=t[n];for(const t of r){const n=t.symbol;if(""!==n)try{if("RNA"===e&&3===n.split(/\(|\)/).filter((t=>!!t)).length){const t=n.split(/\(|\)/)[1];g(s,t,i,o,e,u),s[e]?.[t]&&(s[e][n]=s[e][t])}else g(s,n,i,o,e,u)}catch(t){const e=t instanceof Error?t.message:t.toString(),r=t instanceof Error?t.stack:void 0;throw console.error(`bio lib: getMonomersDictFromLib() sym='${n}', error:\n${e}\n${r}`),new Error(`Can't get monomer '${n}' from library: ${e}`)}}}return s}(b,y,v,n,c),A=p.length,w=await(0,u.R)(p,C,v,y,n,i,c);return w.warnings.length>.05*A&&r.shell.warning(`Molfile conversion resulted in ${w.warnings.length} errors`),w}function g(t,e,n,r,o,i){const s={polymerType:o,symbol:e};if(!(0,c.bq)(t,s)){const a=function(t,e,n,r,o){if(e.has(t)){const s=e.get(t),a=function(t){const e=[];for(const n of t){let t=n.capGroupSmiles;t||(t=n.capGroupSMILES),t=t.replace(/(\[|\]|\*|:|\d)/g,""),e.push(t)}return e}(s.rgroups),u=(i=s.molfile).includes("V3000")?function(t){const e=new Map,n=/M V30 (\d+) R#.+RGROUPS=\((\d+) (\d+)\).*/gm;let r;for(;null!==(r=n.exec(t));)r.index===n.lastIndex&&n.lastIndex++,e.set(parseInt(r[1]),parseInt(r[3]));return e}(i):function(t){const e=new Map;let n=t.indexOf(d.u.V2K_A_LINE,0),r=n;for(;-1!==n;){r=t.indexOf("\n",n);const o=parseInt(t.substring(n,r).replace(/^A\s+/,""));n=t.indexOf("R",r),r=t.indexOf("\n",n);const i=parseInt(t.substring(n,r).replace(/^R/,""));e.set(o,i),n=t.indexOf(d.u.V2K_A_LINE,r)}for(n=t.indexOf(d.u.V2K_RGP_LINE,0),r=t.indexOf("\n",n);-1!==n;){n+=d.u.V2K_RGP_SHIFT,r=t.indexOf("\n",n);const o=t.substring(n,r).replaceAll(/\s+/g," ").split(" ").map((t=>parseInt(t))).slice(1);for(let t=0;t<o.length;t+=2){if(e.has(o[t])&&e.get(o[t])!==o[t+1])throw new Error(`r-group index ${o[t]} has already been added with a different value`);e.set(o[t],o[t+1])}n=t.indexOf(d.u.V2K_RGP_LINE,r)}return e}(i),c=s.molfile.includes("V3000")?s.molfile:function(t,e){const n=e.get_mol(t),r=n.get_v3Kmolblock();return n.delete(),r}(function(t){let e=t.indexOf(d.u.V2K_A_LINE,0);-1===e&&(e=t.indexOf(d.u.V2K_RGP_LINE));const n=t.indexOf(d.u.V3K_END,e);return t.substring(0,e)+t.substring(n)}(s.molfile),n),f=function(t){let e=(t=t.replaceAll("\r","")).indexOf(d.u.V3K_BEGIN_COUNTS_LINE)+d.u.V3K_COUNTS_SHIFT,n=t.indexOf(" ",e+1);const r=parseInt(t.substring(e,n));return e=n+1,n=t.indexOf(" ",e+1),{atomCount:r,bondCount:parseInt(t.substring(e,n))}}(c),h=function(t,e){const n=new Array(e),r=new Float32Array(e),o=new Float32Array(e),i=new Array(e);let s=t.indexOf(d.u.V3K_BEGIN_ATOM_BLOCK);s=t.indexOf("\n",s);let a=s;for(let l=0;l<e;l++){s=t.indexOf(d.u.V3K_BEGIN_DATA_LINE,s)+d.u.V3K_IDX_SHIFT,a=t.indexOf(" ",s),s=a+1,a=t.indexOf(" ",s),n[l]=t.substring(s,a);const e=new Array(2);for(let n=0;n<2;++n)s=a+1,a=t.indexOf(" ",s),e[n]=parseFloat(t.substring(s,a));r[l]=e[0],o[l]=e[1],s=a,a=t.indexOf("\n",s)+1,i[l]=t.slice(s,a),s=a}return{atomTypes:n,x:r,y:o,kwargs:i}}(c,f.atomCount),p=function(t,e){const n=new Uint32Array(e),r=new Array(e),o=new Map,i=new Map;let s=t.indexOf(d.u.V3K_BEGIN_BOND_BLOCK);s=t.indexOf("\n",s);let a=s;for(let l=0;l<e;++l){const e=new Array(3);s=t.indexOf(d.u.V3K_BEGIN_DATA_LINE,a)+d.u.V3K_IDX_SHIFT,a=t.indexOf(" ",s);for(let n=0;n<3;++n)s=a+1,a=Math.min(t.indexOf("\n",s),t.indexOf(" ",s)),e[n]=parseInt(t.slice(s,a));n[l]=e[0],r[l]=e.slice(1);const u=t.indexOf("\n",s);let c=t.slice(a,u),f=c.indexOf(d.u.V3K_BOND_CONFIG);if(-1!==f){f=c.indexOf("=",f)+1;let t=c.indexOf(" ",f);-1===t&&(t=c.length);const e=parseInt(c.slice(f,t));o.set(l,e);const n=d.u.V3K_BOND_CONFIG+e.toString();c=c.replace(n,"")}c||i.set(l,c)}return{bondTypes:n,atomPairs:r,bondConfiguration:o,kwargs:i}}(c,f.bondCount),g=function(t,e,n,r){const o={backboneShift:null,branchShift:null,terminalNodes:[],rNodes:[]};return function(t,e,n){for(const[r,o]of n)t.atomTypes[r-1]=e[o-1]}(t,n,r),function(t,e){e.rNodes=Array.from(t.keys());for(let n=0;n<e.rNodes.length;n++)for(const r of[1,2])if(t.get(e.rNodes[n])===r){const t=e.rNodes[r-1];e.rNodes[r-1]=e.rNodes[n],e.rNodes[n]=t}}(r,o),m(e,o),o}(h,p,a,u),v=function(t){let e=[],n=t.indexOf("M V30 MDLV30/STEABS ATOMS=(");for(;-1!==n;){n+=28;const r=t.indexOf(")",n);e=e.concat(t.substring(n,r).split(" ").slice(1).map((t=>parseInt(t)))),n=r,n=t.indexOf("M V30 MDLV30/STEABS ATOMS=(",n)}return e}(c),C={atoms:h,bonds:p,meta:g,stereoAtoms:v};return"PEPTIDE"===r?function(t){const e=t.meta.terminalNodes[0]-1,n=t.meta.rNodes[0]-1,r=t.atoms.x,o=t.atoms.y;x(t,-r[e],-o[e]);const i=A(r[n],o[n]);w(t.atoms,-i),r[t.meta.rNodes[1]-1]<0&&E(t);const s=function(t){const e=function(t){const e=new Map;for(const n of t.bonds.atomPairs)for(let t=0;t<2;t++){const r=n[t],o=n[(t+1)%2];e.has(r)?e.get(r)?.push(o):e.set(r,new Array(1).fill(o))}return e}(t);let n=0;const r=t.atoms.atomTypes.length;let o=0;if(t.meta.terminalNodes.length<2)return null;for(;0===n;){const i=e.get(t.meta.terminalNodes[1])[o];if(t.atoms.atomTypes[i-1]===d.u.OXYGEN&&i!==t.meta.rNodes[1]&&(n=i),o++,o>r)return null}return n}(t);null!=s&&(function(t,e){t.atoms.y[t.meta.rNodes[1]-1]<0&&t.atoms.y[e-1]<0&&(function(t){_(t,!0)}(t),w(t.atoms,-function(t,e){return A(t,e)+Math.PI/2}(t.atoms.x[t.meta.terminalNodes[1]-1],t.atoms.y[t.meta.terminalNodes[1]-1])))}(t,s),function(t,e){const n=t.atoms.x;n[t.meta.rNodes[1]-1]>n[e-1]&&function(t,e,n){const r=e-1,o=n-1,i=t.atoms.x,s=t.atoms.y,a=i[r],l=s[r];i[r]=i[o],s[r]=s[o],i[o]=a,s[o]=l}(t,e,t.meta.rNodes[1])}(t,s))}(C):t===d.u.RIBOSE.symbol||t===d.u.DEOXYRIBOSE.symbol?function(t,e){const n=t.atoms.x,r=t.atoms.y;let o=t.meta.terminalNodes[0]-1;const i=t.meta.rNodes[1]-1;x(t,-n[o],-r[o]);const s=A(n[t.meta.rNodes[2]-1],r[t.meta.rNodes[2]-1]);w(t.atoms,-s),n[t.meta.rNodes[0]-1]>n[t.meta.rNodes[1]-1]&&E(t);const a=A(n[i],r[i]);w(t.atoms,3*Math.PI/2-a),e.value=function(t){const e=t.atoms.x,n=t.atoms.y,r=t.meta.rNodes[2]-1,o=t.meta.terminalNodes[2]-1,i=e[r]-e[o],s=n[r]-n[o];return Math.atan2(i,s)}(t),o=t.meta.terminalNodes[0]-1,x(t,-n[o],-r[o])}(C,o):t===d.u.PHOSPHATE.symbol?function(t){const e=t.meta.rNodes[1]-1,n=t.meta.rNodes[0]-1,r=t.atoms.x,o=t.atoms.y;x(t,-r[e],-o[e]);const i=A(r[n],o[n]);w(t.atoms,Math.PI/2-i)}(C):function(t,e){const n=t.atoms.x,r=t.atoms.y,o=t.meta.terminalNodes[0]-1,i=t.meta.rNodes[0]-1;x(t,-n[o],-r[o]);const s=A(n[i],r[i]),a=e.value;if(!a)throw new Error("The value of sugarBranchToOYAngle is null");w(t.atoms,Math.PI-s+a);const u=function(t,e){return(0,l.YN)(Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2))}({x:n[t.meta.rNodes[0]-1],y:r[t.meta.rNodes[0]-1]},{x:n[t.meta.terminalNodes[0]-1],y:r[t.meta.terminalNodes[0]-1]});if(1!=u)for(let t=0;t<n.length;++t)n[t]=(0,l.YN)(n[t]/u),r[t]=(0,l.YN)(r[t]/u)}(C,o),function(t,e,n){"PEPTIDE"===t?(y(e,t),b(e,e.meta.rNodes[1])):n===d.u.RIBOSE.symbol||n===d.u.DEOXYRIBOSE.symbol?(b(e,e.meta.rNodes[1]),e.meta.rNodes[1]=e.meta.terminalNodes[1],m(e.bonds,e.meta),y(e,t),b(e,e.meta.rNodes[1]),b(e,e.meta.rNodes[0]),b(e,e.meta.rNodes[2])):n===d.u.PHOSPHATE.symbol&&(e.meta.terminalNodes[0]=e.meta.rNodes[0],x(e,-e.atoms.x[e.meta.terminalNodes[0]-1],-e.atoms.y[e.meta.terminalNodes[0]-1]),y(e,t),b(e,e.meta.rNodes[1]))}(r,C,t),function(t){let e=0;for(;e<t.atoms.atomTypes.length;)t.atoms.atomTypes[e]===d.u.HYDROGEN&&(b(t,e+1),--e),++e}(C),function(t){const e=" RGROUPS=(1 1)";for(let n=0;n<(t.atoms.kwargs?.length??0);n++){const r=t.atoms.kwargs[n];r&&r.includes(e)&&(t.atoms.kwargs[n]=r.replace(e,""))}}(C),C}var i;return null}(e,n,r,o,i);if(!a)throw new Error(`Monomer with symbol '${e}' is absent the monomer library`);(0,c.LQ)(t,s,a)}}function m(t,e){const n=e.rNodes;e.terminalNodes=new Array(n.length).fill(0);const r=e.terminalNodes,o=t.atomPairs;let i=0,s=0;for(;i<o.length&&s<r.length;){for(let t=0;t<r.length;++t)for(let e=0;e<2;++e)o[i][e]===n[t]&&(r[t]=o[i][(e+1)%2],n.length,++s);++i}}function y(t,e){t.meta.rNodes.length>1&&(t.meta.backboneShift=v(t,t.meta.rNodes[1]-1,t.meta.terminalNodes[0]-1)),"RNA"===e&&t.meta.rNodes.length>2&&(t.meta.branchShift=v(t,t.meta.rNodes[2]-1,t.meta.terminalNodes[0]-1))}function v(t,e,n){return[(0,l.YN)(t.atoms.x[e]-t.atoms.x[n]),(0,l.YN)(t.atoms.y[e]-t.atoms.y[n])]}function b(t,e){if(void 0!==e){const n=e-1,r=t.atoms,o=t.bonds,i=t.meta;r.atomTypes.splice(n,1),r.x=C(Float32Array,r.x,n,1),r.y=C(Float32Array,r.y,n,1),r.kwargs.splice(n,1);for(let t=0;t<i.terminalNodes.length;++t)i.terminalNodes[t]>e?--i.terminalNodes[t]:i.terminalNodes[t]===e&&(i.terminalNodes[t]=-1);for(let t=0;t<i.rNodes.length;++t)i.rNodes[t]>e?--i.rNodes[t]:i.rNodes[t]===e&&(i.rNodes[t]=-1);let s=0;for(;s<o.atomPairs.length;){const t=o.atomPairs[s][0],n=o.atomPairs[s][1];t===e||n===e?(o.atomPairs.splice(s,1),o.bondTypes=C(Uint32Array,o.bondTypes,s,1),o.bondConfiguration.has(s)&&o.bondConfiguration.delete(s),o.kwargs.has(s)&&o.kwargs.delete(s),--s):(o.atomPairs[s][0]=t>e?t-1:t,o.atomPairs[s][1]=n>e?n-1:n),++s}let a=Array.from(o.bondConfiguration.keys());a.forEach((t=>{if(o.bondConfiguration.has(t)&&t>n){const e=o.bondConfiguration.get(t);o.bondConfiguration.delete(t),o.bondConfiguration.set(t-1,e)}})),a=Array.from(o.kwargs.keys()),a.forEach((t=>{if(o.kwargs.has(t)&&t>n){const e=o.kwargs.get(t);o.kwargs.delete(t),o.kwargs.set(t-1,e)}}))}}function C(t,e,n,r){const o=new t(e.length-r);let i=0,s=0;for(;i<e.length;)i===n&&(i+=r),o[s]=e[i],++s,++i;return o}function A(t,e){let n;if(0===t)n=e>0?0:Math.PI;else if(0===e)n=t>0?-Math.PI/2:Math.PI/2;else{const r=e/t,o=Math.atan(r);n=t<0?Math.PI/2+o:-Math.PI/2+o}return n}function w(t,e){if(0!==e){const n=t.x,r=t.y,o=Math.cos(e),i=Math.sin(e);for(let t=0;t<n.length;++t){const e=n[t];n[t]=(0,l.YN)(e*o-r[t]*i),r[t]=(0,l.YN)(e*i+r[t]*o)}}}function E(t){_(t,!1)}function _(t,e){if(e){const e=t.atoms.y;for(let t=0;t<e.length;t++)e[t]=-e[t]}else{const e=t.atoms.x;for(let t=0;t<e.length;t++)e[t]=-e[t]}const n=t.bonds.bondConfiguration;for(const[t,e]of n){const r=1===e?3:1;n.set(t,r)}}function x(t,e,n){const r=t.atoms.x,o=t.atoms.y;for(let t=0;t<r.length;++t)r[t]=(0,l.YN)(r[t]+e),void 0!==n&&(o[t]=(0,l.YN)(o[t]+n))}},294:(t,e,n)=>{"use strict";function r(t,e){return!!t[e.polymerType]?.[e.symbol]}function o(t,e,n){let r=t[e.polymerType];r||(r=t[e.polymerType]={}),r[e.symbol]=n}n.d(e,{LQ:()=>o,bq:()=>r}),Map},330:(t,e,n)=>{"use strict";n.d(e,{pz:()=>i,qj:()=>o});var r=n(2003);function o(t,e){return function(t,e){return t?t.columns.getUnusedName(e):e}(t,`molfile(${e})`)}function i(t){let e;if(t===r.YI.PT||t===r.YI.UN)e="PEPTIDE";else{if(t!==r.YI.RNA&&t!==r.YI.DNA)throw new Error(`Unexpected alphabet '${t}'.`);e="RNA"}return e}},3151:(t,e,n)=>{"use strict";n.d(e,{f6:()=>r});const r=["symbol","molfile","rgroups","name"];new RegExp("[rd]\\((\\w)\\)p?","g")},9192:(t,e,n)=>{"use strict";function r(t){return"string"==typeof t||t instanceof String?t:"StateError"===t.constructor.name?t.message:"StateError"===t.constructor.name&&"$thrownJsError"in t?r(t.$thrownJsError):t instanceof Error?t.message:t.toString()}function o(t){return t instanceof Error?t.stack:"StateError"===t.constructor.name&&"$thrownJsError"in t?o(t.$thrownJsError):void 0}function i(t){return[r(t),o(t)]}n.d(e,{AP:()=>i})},439:(t,e,n)=>{"use strict";n.d(e,{Hi:()=>r,YI:()=>o,_S:()=>l,b9:()=>u,gp:()=>i});var r,o,i,s=n(2738);!function(t){t.FASTA="fasta",t.SEPARATOR="separator",t.HELM="helm",t.CUSTOM="custom"}(r||(r={})),function(t){t.DNA="DNA",t.RNA="RNA",t.PT="PT",t.UN="UN"}(o||(o={})),function(t){t.aligned="aligned",t.alphabet="alphabet",t.alphabetSize=".alphabetSize",t.alphabetIsMultichar=".alphabetIsMultichar",t.separator="separator",t.isHelmCompatible=".isHelmCompatible",t.positionNames=".positionNames",t.positionLabels=".positionLabels",t.regions=".regions"}(i||(i={}));const 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 s.a(o.PT,a.fasta.peptide,.5),new s.a(o.DNA,a.fasta.dna,.55),new s.a(o.RNA,a.fasta.rna,.55),""),u={[r.FASTA]:"-",[r.SEPARATOR]:"",[r.HELM]:"*"}},2003:(t,e,n)=>{"use strict";n.d(e,{Hi:()=>r.Hi,YI:()=>r.YI,dh:()=>o.dh,gp:()=>r.gp,zS:()=>o.zS});var r=n(439),o=n(7291)},2738:(t,e,n)=>{"use strict";n.d(e,{a:()=>r});class r{constructor(t,e,n){this.name=t,this.alphabet=e,this.cutoff=n}}},7291:(t,e,n)=>{"use strict";n.d(e,{Mu:()=>y,dh:()=>v,zS:()=>A,qp:()=>b});var r=n(6082),o=n(1991),i=n.n(o),s=(n(2738),n(439));class a{static makePalette(t,e=!1,n=a){const r={};return t.forEach((t=>{const n=t[0],o=t[1];n.forEach(((t,n)=>{r[t]=this.colourPalette[o][e?0:n]}))})),new n(r)}constructor(t){this._palette=t}get(t,e){return this._palette[t]}}a.undefinedColor="rgb(100,100,100)",a.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)"]};class l extends a{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,l)),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,l)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new l({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(t){const e=t in l.aaSynonyms?l.aaSynonyms[t]:t;return super.get(e)}}l.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class u{static getPalette(t="grok"){switch(t){case"grok":return l.GrokGroups;case"lesk":return l.Lesk;default:throw new Error(`ChemPalette: scheme \`${t}\` does not exist`)}}static getInnerOuter(t){let e=0,n="",r="";for(const o of t)"("==o?e++:")"==o?e--:e?n+=o:r+=o;return isNaN(parseInt(n))?[r,n]:[r,""]}static getColorAAPivot(t="",e="grok"){const n=this.getPalette(e);let[r,o]=this.getInnerOuter(t);if(r=r.length>6?`${r.slice(0,3)}...`:r,o=o.length>6?`${o.slice(0,3)}...`:o,1==t.length||"("==t[1]){const e=t[0]?.toUpperCase();return e in n?[n.get(e),e,o,1]:[this.undefinedColor,r,o,1]}if("d"==t[0]&&t[1]in n&&(2==t.length||"("==t[2])){const e=t[1]?.toUpperCase();return e in n?[n.get(e),e,o,2]:[this.undefinedColor,r,o,2]}if(t.substring(0,3)in this.AAFullNames&&(3==t.length||"("==t[3])){const e=this.AAFullNames[t.substring(0,3)];return e in n?[n.get(e),e,o,3]:[this.undefinedColor,r,o,3]}if(t[0]?.toLowerCase()==t[0]&&t.substring(1,3)in this.AAFullNames&&(4==t.length||"("==t[4])){const e=this.AAFullNames[t.substring(1,3)];return e in n?[n.get(e),e,o,4]:[this.undefinedColor,r,o,4]}return[this.undefinedColor,r,o,0]}}u.SemType="Aminoacids",u.SemTypeMultipleAlignment="AminoacidsMultipleAlignment",u.undefinedColor="rgb(100,100,100)",u.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"},u.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"},u.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(*)*"},u.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"};class c{}c.SemType="Nucleotides",c.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",c.Names={A:"Adenine",C:"Cytosine",G:"Guanine",T:"Thymine",U:"Uracil"};var f=n(2890);function h(t,e=!0){if(null==t)return"rgb(100,100,100)";const n=r.Color.fromHtml(t);if(e){const t=r.Color.g(n),e=r.Color.r(n),o=r.Color.b(n),i=Math.sqrt(Math.pow(0-e,2)+Math.pow(0-t,2)+Math.pow(0-o,2));if(i>210)return`rgb(${e/i*210},${t/i*210},${o/i*210})`}return r.Color.toRgb(n)}class d{static hashCode(t){let e=0;if(0===t.length)return e;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e}}class p{}class g extends p{static get palette(){return g._pallete||(g._pallete=g.buildPalette()),g._pallete}static buildPalette(){return(0,f.pj)().then((t=>{t.awaitLoaded(1/0).then((()=>{const e=t.getMonomerLib();e.onChanged.subscribe((()=>{g.customMonomerColors={},g.polymerTypes=e.getPolymerTypes();for(const t of this.polymerTypes){const n=e.getMonomerSymbolsByType(t);for(const r of n){const n=e.getMonomer(t,r);n?.meta?.colors?.default?.background&&(this.customMonomerColors[r]||(this.customMonomerColors[r]={}),this.customMonomerColors[r][t]=h(n.meta.colors.default.background))}}}))}))})),[].concat(...Object.values(a.colourPalette))}get(t,e){const n=g.palette.length,r=g.customMonomerColors[t],o=e??"PEPTIDE";if(r&&r[o])return r[o];const i=d.hashCode(t)%n;return h(g.palette[i])}}g._pallete=null,g.customMonomerColors={},g.polymerTypes=[];var m=n(8438);class y{get length(){return this.mList.length}isGap(t){return this.getOriginal(t)===this.gapOriginalMonomer}getCanonical(t){if(this.length<=t)throw new Error("Index out of bounds");const e=this.mList[t];return e!==this.gapOriginalMonomer?e:s._S}getOriginal(t){if(this.length<=t)throw new Error("Index out of bounds");return this.mList[t]}constructor(t,e){this.mList=t,this.gapOriginalMonomer=e}}function v(t,e=void 0){return n=>{if(n){let r;const o=new RegExp(`(?<=^|\\${t})("-"|'-'|[^\\${t}]*)(?=\\${t}|$)`,"g");return void 0!==e?(o.lastIndex=0,r=i()(n.matchAll(o)).take(e).map((t=>t[0])).toArray()):r=n.replaceAll('"-"',"").replaceAll("'-'","").split(t,e),new y(r,s.b9[s.Hi.SEPARATOR])}return new y([],s.b9[s.Hi.SEPARATOR])}}const b=t=>{const e=t.split("$")[0].split("|"),n=i()(e.map((t=>(t.match(/(?<=\{).+(?=})/)?.[0]?.split(".")??[]).map((t=>(0,m.D)(t)))))).flatten().toArray();return new y(n,s.b9[s.Hi.HELM])},C=/([^\W_]+)/g;function A(t,e){if(t.length<=e)return t;const n=t.match(C),r=t.length>e||(n?.length??0)>1,o=n?.[0]??" ";return r?o.substring(0,e-1)+"…":o}},8312:(t,e,n)=>{"use strict";n.d(e,{Q:()=>o});var r=n(6082);async function o(){const t=r.Func.find({package:"Bio",name:"getSeqHelper"});if(0===t.length)throw new Error("Package 'Bio' must be installed for SeqHelper.");return(await t[0].prepare().call()).getOutputParamValue()}},6869:(t,e,n)=>{"use strict";var r;n.d(e,{o:()=>r}),function(t){t.BASE="HELM_BASE",t.SUGAR="HELM_SUGAR",t.LINKER="HELM_LINKER",t.AA="HELM_AA",t.CHEM="HELM_CHEM",t.BLOB="HELM_BLOB",t.NUCLEOTIDE="HELM_NUCLETIDE"}(r||(r={}))},8070:(t,e,n)=>{"use strict";n.d(e,{Pl:()=>P,gM:()=>L,L1:()=>S,E3:()=>x,J6:()=>N,Xk:()=>I,Xb:()=>M,N$:()=>R,t6:()=>_,PE:()=>E,CN:()=>d});var r=n(4328),o=n(6082);n(9982);const i=o.DataFrame.fromCsv('countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,Questions,empty_number,empty_string\nBelgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,1,1,1QBS,1,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.497360340644872, 1.7058694986686864, 5.278052678195135, 0.16000320889028383],""points"":[{""x"":0.10000000149011612,""y"":2.374499797821045},{""x"":0.6000000238418579,""y"":2.6242473125457764},{""x"":1.100000023841858,""y"":2.367267608642578},{""x"":1.600000023841858,""y"":2.6723148822784424},{""x"":2.0999999046325684,""y"":2.6537344455718994},{""x"":2.5999999046325684,""y"":2.3651671409606934},{""x"":3.0999999046325684,""y"":2.5654284954071045},{""x"":3.5999999046325684,""y"":2.4160959720611572},{""x"":4.099999904632568,""y"":2.286726713180542},{""x"":4.599999904632568,""y"":2.5100042819976807},{""x"":5.099999904632568,""y"":1.6676985025405884},{""x"":5.599999904632568,""y"":0.680136501789093},{""x"":6.099999904632568,""y"":0.3391543924808502},{""x"":6.599999904632568,""y"":0.09038983285427094},{""x"":7.099999904632568,""y"":0.19802775979042053}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[7.525235855508179, 1.3186911876809984, 5.335672608564294, 0.7860743343958098],""points"":[{""x"":0.10000000149011612,""y"":7.988070487976074},{""x"":0.6000000238418579,""y"":7.018453121185303},{""x"":1.100000023841858,""y"":8.115279197692871},{""x"":1.600000023841858,""y"":7.486658096313477},{""x"":2.0999999046325684,""y"":7.396438121795654},{""x"":2.5999999046325684,""y"":7.477052211761475},{""x"":3.0999999046325684,""y"":6.913095474243164},{""x"":3.5999999046325684,""y"":8.01385498046875},{""x"":4.099999904632568,""y"":6.985900402069092},{""x"":4.599999904632568,""y"":6.970335960388184},{""x"":5.099999904632568,""y"":5.448817253112793},{""x"":5.599999904632568,""y"":2.5534818172454834},{""x"":6.099999904632568,""y"":1.893947958946228},{""x"":6.599999904632568,""y"":0.6340042352676392},{""x"":7.099999904632568,""y"":0.8403874039649963}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,100,abc\nBurundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,2,2,1ZP8,2,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.431460753103398, 2.1691498799246745, 5.266445597102774, 0.7825762827017926],""points"":[{""x"":0.10000000149011612,""y"":4.751083850860596},{""x"":0.6000000238418579,""y"":4.203000068664551},{""x"":1.100000023841858,""y"":4.415858745574951},{""x"":1.600000023841858,""y"":4.68414306640625},{""x"":2.0999999046325684,""y"":4.198400974273682},{""x"":2.5999999046325684,""y"":4.179222106933594},{""x"":3.0999999046325684,""y"":4.638473987579346},{""x"":3.5999999046325684,""y"":4.708553314208984},{""x"":4.099999904632568,""y"":4.291589260101318},{""x"":4.599999904632568,""y"":4.038082599639893},{""x"":5.099999904632568,""y"":3.4349939823150635},{""x"":5.599999904632568,""y"":1.2194708585739136},{""x"":6.099999904632568,""y"":1.1920831203460693},{""x"":6.599999904632568,""y"":0.5352635979652405},{""x"":7.099999904632568,""y"":0.3346920311450958}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.339458017970126, -1.0734184310171178, 4.746332950550934, 0.2482416857595658],""points"":[{""x"":0.10000000149011612,""y"":0.2139337658882141},{""x"":0.6000000238418579,""y"":0.4269562065601349},{""x"":1.100000023841858,""y"":0.2441573292016983},{""x"":1.600000023841858,""y"":0.146635964512825},{""x"":2.0999999046325684,""y"":0.08818462491035461},{""x"":2.5999999046325684,""y"":0.2560656666755676},{""x"":3.0999999046325684,""y"":0.42434045672416687},{""x"":3.5999999046325684,""y"":0.37111231684684753},{""x"":4.099999904632568,""y"":0.5581737160682678},{""x"":4.599999904632568,""y"":1.183590054512024},{""x"":5.099999904632568,""y"":1.5629843473434448},{""x"":5.599999904632568,""y"":2.3211288452148438},{""x"":6.099999904632568,""y"":2.229961633682251},{""x"":6.599999904632568,""y"":2.2560226917266846},{""x"":7.099999904632568,""y"":2.2142398357391357}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,3,3,2BDJ,3,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.6760652578642325, 0.9046956320756703, 5.651408971856738, 0.07738846012184185],""points"":[{""x"":0.10000000149011612,""y"":4.32425594329834},{""x"":0.6000000238418579,""y"":4.668442249298096},{""x"":1.100000023841858,""y"":4.379785060882568},{""x"":1.600000023841858,""y"":5.0345139503479},{""x"":2.0999999046325684,""y"":4.878653526306152},{""x"":2.5999999046325684,""y"":4.3451313972473145},{""x"":3.0999999046325684,""y"":4.336992263793945},{""x"":3.5999999046325684,""y"":5.037430286407471},{""x"":4.099999904632568,""y"":5.0092692375183105},{""x"":4.599999904632568,""y"":4.151902675628662},{""x"":5.099999904632568,""y"":3.4066951274871826},{""x"":5.599999904632568,""y"":2.3732759952545166},{""x"":6.099999904632568,""y"":1.673728108406067},{""x"":6.599999904632568,""y"":0.48574790358543396},{""x"":7.099999904632568,""y"":0.2783052325248718}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.938395863010111, -1.4658480661392117, 5.462702751996584, 0.3473139023615039],""points"":[{""x"":0.10000000149011612,""y"":0.4941710829734802},{""x"":0.6000000238418579,""y"":0.15323974192142487},{""x"":1.100000023841858,""y"":0.46373432874679565},{""x"":1.600000023841858,""y"":0.3370431363582611},{""x"":2.0999999046325684,""y"":0.5179030299186707},{""x"":2.5999999046325684,""y"":0.27899765968322754},{""x"":3.0999999046325684,""y"":0.22075064480304718},{""x"":3.5999999046325684,""y"":0.5789918899536133},{""x"":4.099999904632568,""y"":0.21169911324977875},{""x"":4.599999904632568,""y"":0.27857646346092224},{""x"":5.099999904632568,""y"":1.0906332731246948},{""x"":5.599999904632568,""y"":1.8520300388336182},{""x"":6.099999904632568,""y"":2.7177059650421143},{""x"":6.599999904632568,""y"":2.8680918216705322},{""x"":7.099999904632568,""y"":3.2413077354431152}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCanada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,4,4,1IAN,4,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[0.8597390975430008, 1.0957625732481946, 5.260537067987958, 0.07974187998177736],""points"":[{""x"":0.10000000149011612,""y"":0.8190152645111084},{""x"":0.6000000238418579,""y"":0.8421689867973328},{""x"":1.100000023841858,""y"":0.8740922212600708},{""x"":1.600000023841858,""y"":0.8924275040626526},{""x"":2.0999999046325684,""y"":0.8249067664146423},{""x"":2.5999999046325684,""y"":0.9327669143676758},{""x"":3.0999999046325684,""y"":0.8522974252700806},{""x"":3.5999999046325684,""y"":0.8174492716789246},{""x"":4.099999904632568,""y"":0.8394647240638733},{""x"":4.599999904632568,""y"":0.7139387726783752},{""x"":5.099999904632568,""y"":0.5561167597770691},{""x"":5.599999904632568,""y"":0.3276226818561554},{""x"":6.099999904632568,""y"":0.12479474395513535},{""x"":6.599999904632568,""y"":0.13006797432899475},{""x"":7.099999904632568,""y"":0.059702079743146896}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.760930219582546, 1.6591793293833013, 4.667155929720851, 0.7858109544121652],""points"":[{""x"":0.10000000149011612,""y"":6.156993389129639},{""x"":0.6000000238418579,""y"":5.236701965332031},{""x"":1.100000023841858,""y"":6.010560512542725},{""x"":1.600000023841858,""y"":5.495512962341309},{""x"":2.0999999046325684,""y"":6.087770462036133},{""x"":2.5999999046325684,""y"":5.79986572265625},{""x"":3.0999999046325684,""y"":5.597546577453613},{""x"":3.5999999046325684,""y"":5.520902156829834},{""x"":4.099999904632568,""y"":5.360654354095459},{""x"":4.599999904632568,""y"":3.5539746284484863},{""x"":5.099999904632568,""y"":1.577236294746399},{""x"":5.599999904632568,""y"":1.0001264810562134},{""x"":6.099999904632568,""y"":0.9305797815322876},{""x"":6.599999904632568,""y"":0.6033638715744019},{""x"":7.099999904632568,""y"":0.4203685522079468}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nColombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,5,5,4UJ1,5,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[6.4995088314153655, 2.4270351004539914, 5.178659535348579, 0.625653346241577],""points"":[{""x"":0.10000000149011612,""y"":6.496231555938721},{""x"":0.6000000238418579,""y"":6.42543363571167},{""x"":1.100000023841858,""y"":7.040063858032227},{""x"":1.600000023841858,""y"":6.1115403175354},{""x"":2.0999999046325684,""y"":6.680728435516357},{""x"":2.5999999046325684,""y"":6.406774520874023},{""x"":3.0999999046325684,""y"":6.611269474029541},{""x"":3.5999999046325684,""y"":5.889094352722168},{""x"":4.099999904632568,""y"":6.75344705581665},{""x"":4.599999904632568,""y"":6.361435890197754},{""x"":5.099999904632568,""y"":4.1666975021362305},{""x"":5.599999904632568,""y"":1.172118902206421},{""x"":6.099999904632568,""y"":0.801048994064331},{""x"":6.599999904632568,""y"":0.4640021026134491},{""x"":7.099999904632568,""y"":0.0010357667924836278}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[1.4734381347446401, 1.1649805188074196, 4.82958608866421, 0.09500545496710007],""points"":[{""x"":0.10000000149011612,""y"":1.5279096364974976},{""x"":0.6000000238418579,""y"":1.3559974431991577},{""x"":1.100000023841858,""y"":1.5246378183364868},{""x"":1.600000023841858,""y"":1.5567657947540283},{""x"":2.0999999046325684,""y"":1.4114240407943726},{""x"":2.5999999046325684,""y"":1.4045010805130005},{""x"":3.0999999046325684,""y"":1.4769829511642456},{""x"":3.5999999046325684,""y"":1.4875500202178955},{""x"":4.099999904632568,""y"":1.2991987466812134},{""x"":4.599999904632568,""y"":0.922961413860321},{""x"":5.099999904632568,""y"":0.6520044803619385},{""x"":5.599999904632568,""y"":0.15350978076457977},{""x"":6.099999904632568,""y"":0.1078903079032898},{""x"":6.599999904632568,""y"":0.17276449501514435},{""x"":7.099999904632568,""y"":0.14066608250141144}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCosta Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,6,6,2BPW,6,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.4833641843311227, -1.8945978742090062, 4.671127708092568, 0.24159861311815153],""points"":[{""x"":0.10000000149011612,""y"":0.0969524160027504},{""x"":0.6000000238418579,""y"":0.028483040630817413},{""x"":1.100000023841858,""y"":0.22087176144123077},{""x"":1.600000023841858,""y"":0.0068915546871721745},{""x"":2.0999999046325684,""y"":0.4305879771709442},{""x"":2.5999999046325684,""y"":0.44774115085601807},{""x"":3.0999999046325684,""y"":0.45346319675445557},{""x"":3.5999999046325684,""y"":0.2370593100786209},{""x"":4.099999904632568,""y"":0.4657953977584839},{""x"":4.599999904632568,""y"":1.155200719833374},{""x"":5.099999904632568,""y"":2.2294070720672607},{""x"":5.599999904632568,""y"":2.4311530590057373},{""x"":6.099999904632568,""y"":2.33846116065979},{""x"":6.599999904632568,""y"":2.608201026916504},{""x"":7.099999904632568,""y"":2.8136143684387207}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.224573521642033, 1.4454033924198528, 5.6014197746076535, 0.2823216054197577],""points"":[{""x"":0.10000000149011612,""y"":4.95027494430542},{""x"":0.6000000238418579,""y"":5.1754679679870605},{""x"":1.100000023841858,""y"":5.276752948760986},{""x"":1.600000023841858,""y"":5.589294910430908},{""x"":2.0999999046325684,""y"":5.616994857788086},{""x"":2.5999999046325684,""y"":5.120813846588135},{""x"":3.0999999046325684,""y"":5.340766906738281},{""x"":3.5999999046325684,""y"":4.876471042633057},{""x"":4.099999904632568,""y"":4.94999361038208},{""x"":4.599999904632568,""y"":5.162564754486084},{""x"":5.099999904632568,""y"":4.399557590484619},{""x"":5.599999904632568,""y"":2.7977969646453857},{""x"":6.099999904632568,""y"":1.0229872465133667},{""x"":6.599999904632568,""y"":0.48275601863861084},{""x"":7.099999904632568,""y"":0.10408931970596313}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,7,7,1QBS,7,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.320838679713925, -1.2421619987316728, 4.831325425225256, 0.3236011098403072],""points"":[{""x"":0.10000000149011612,""y"":0.3727470338344574},{""x"":0.6000000238418579,""y"":0.12365014106035233},{""x"":1.100000023841858,""y"":0.48422467708587646},{""x"":1.600000023841858,""y"":0.2264465093612671},{""x"":2.0999999046325684,""y"":0.16821794211864471},{""x"":2.5999999046325684,""y"":0.3879014551639557},{""x"":3.0999999046325684,""y"":0.5470244884490967},{""x"":3.5999999046325684,""y"":0.3419053554534912},{""x"":4.099999904632568,""y"":0.7655120491981506},{""x"":4.599999904632568,""y"":1.2346516847610474},{""x"":5.099999904632568,""y"":2.453336715698242},{""x"":5.599999904632568,""y"":2.9565491676330566},{""x"":6.099999904632568,""y"":3.335299491882324},{""x"":6.599999904632568,""y"":3.240290880203247},{""x"":7.099999904632568,""y"":3.1107218265533447}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.6401853521511094, 1.26211588875013, 5.399028074402744, 0.5089580830068091],""points"":[{""x"":0.10000000149011612,""y"":3.8585598468780518},{""x"":0.6000000238418579,""y"":3.6077206134796143},{""x"":1.100000023841858,""y"":3.855252265930176},{""x"":1.600000023841858,""y"":3.619039297103882},{""x"":2.0999999046325684,""y"":3.839388370513916},{""x"":2.5999999046325684,""y"":3.335283041000366},{""x"":3.0999999046325684,""y"":3.571141481399536},{""x"":3.5999999046325684,""y"":3.4155046939849854},{""x"":4.099999904632568,""y"":3.7316646575927734},{""x"":4.599999904632568,""y"":3.0680155754089355},{""x"":5.099999904632568,""y"":2.891066551208496},{""x"":5.599999904632568,""y"":1.6022753715515137},{""x"":6.099999904632568,""y"":0.7652576565742493},{""x"":6.599999904632568,""y"":0.6875326037406921},{""x"":7.099999904632568,""y"":0.5828871726989746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nItaly,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,8,8,1ZP8,8,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.293592105923809, 1.3781586549141835, 5.1025898038676605, 0.03493851245291291],""points"":[{""x"":0.10000000149011612,""y"":2.1287283897399902},{""x"":0.6000000238418579,""y"":2.267972230911255},{""x"":1.100000023841858,""y"":2.398442506790161},{""x"":1.600000023841858,""y"":2.5130622386932373},{""x"":2.0999999046325684,""y"":2.3255116939544678},{""x"":2.5999999046325684,""y"":2.127340793609619},{""x"":3.0999999046325684,""y"":2.47259783744812},{""x"":3.5999999046325684,""y"":2.131181478500366},{""x"":4.099999904632568,""y"":2.090421438217163},{""x"":4.599999904632568,""y"":2.02299165725708},{""x"":5.099999904632568,""y"":1.1105059385299683},{""x"":5.599999904632568,""y"":0.4494485855102539},{""x"":6.099999904632568,""y"":0.1375635862350464},{""x"":6.599999904632568,""y"":0.036351121962070465},{""x"":7.099999904632568,""y"":0.1619771122932434}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.953125499439879, 1.2528620255306528, 5.187637440149802, 0.3110348753260886],""points"":[{""x"":0.10000000149011612,""y"":5.6585283279418945},{""x"":0.6000000238418579,""y"":5.911152362823486},{""x"":1.100000023841858,""y"":5.924920082092285},{""x"":1.600000023841858,""y"":5.8469438552856445},{""x"":2.0999999046325684,""y"":5.929472923278809},{""x"":2.5999999046325684,""y"":6.190037727355957},{""x"":3.0999999046325684,""y"":6.236179828643799},{""x"":3.5999999046325684,""y"":6.141019344329834},{""x"":4.099999904632568,""y"":5.295210838317871},{""x"":4.599999904632568,""y"":5.265801906585693},{""x"":5.099999904632568,""y"":3.3722851276397705},{""x"":5.599999904632568,""y"":1.8299226760864258},{""x"":6.099999904632568,""y"":0.32690900564193726},{""x"":6.599999904632568,""y"":0.6274543404579163},{""x"":7.099999904632568,""y"":0.8441857099533081}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nRwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,9,2BDJ,9,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.8209972202654474, 1.3779216716448506, 5.299882228439686, 0.06040645519069608],""points"":[{""x"":0.10000000149011612,""y"":3.7821109294891357},{""x"":0.6000000238418579,""y"":3.542433023452759},{""x"":1.100000023841858,""y"":3.7008674144744873},{""x"":1.600000023841858,""y"":3.717301607131958},{""x"":2.0999999046325684,""y"":4.024452209472656},{""x"":2.5999999046325684,""y"":4.013899326324463},{""x"":3.0999999046325684,""y"":3.945094347000122},{""x"":3.5999999046325684,""y"":3.866621971130371},{""x"":4.099999904632568,""y"":3.7461626529693604},{""x"":4.599999904632568,""y"":3.3454740047454834},{""x"":5.099999904632568,""y"":2.61944317817688},{""x"":5.599999904632568,""y"":0.999405026435852},{""x"":6.099999904632568,""y"":0.46259793639183044},{""x"":6.599999904632568,""y"":0.054134611040353775},{""x"":7.099999904632568,""y"":0.05711187422275543}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.6318079657726035, 1.8495493770000595, 5.391793312471116, 0.17060707587348442],""points"":[{""x"":0.10000000149011612,""y"":5.458079814910889},{""x"":0.6000000238418579,""y"":5.554427146911621},{""x"":1.100000023841858,""y"":5.799983024597168},{""x"":1.600000023841858,""y"":5.364140033721924},{""x"":2.0999999046325684,""y"":5.864485740661621},{""x"":2.5999999046325684,""y"":5.4509806632995605},{""x"":3.0999999046325684,""y"":5.702574729919434},{""x"":3.5999999046325684,""y"":5.7314534187316895},{""x"":4.099999904632568,""y"":5.5123443603515625},{""x"":4.599999904632568,""y"":5.724395751953125},{""x"":5.099999904632568,""y"":4.354506969451904},{""x"":5.599999904632568,""y"":1.7307666540145874},{""x"":6.099999904632568,""y"":0.6305936574935913},{""x"":6.599999904632568,""y"":0.035183437168598175},{""x"":7.099999904632568,""y"":0.7575169205665588}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nSwitzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,10,1IAN,10,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[1.1190255865097471, 2.3163895161544437, 5.4968866182279195, 0.2035204047289052],""points"":[{""x"":0.10000000149011612,""y"":1.1057683229446411},{""x"":0.6000000238418579,""y"":1.1019697189331055},{""x"":1.100000023841858,""y"":1.0818607807159424},{""x"":1.600000023841858,""y"":1.062997817993164},{""x"":2.0999999046325684,""y"":1.046447515487671},{""x"":2.5999999046325684,""y"":1.1217249631881714},{""x"":3.0999999046325684,""y"":1.2166996002197266},{""x"":3.5999999046325684,""y"":1.215477705001831},{""x"":4.099999904632568,""y"":1.0581893920898438},{""x"":4.599999904632568,""y"":1.1747995615005493},{""x"":5.099999904632568,""y"":1.0181127786636353},{""x"":5.599999904632568,""y"":0.5344523191452026},{""x"":6.099999904632568,""y"":0.2569526433944702},{""x"":6.599999904632568,""y"":0.1912207305431366},{""x"":7.099999904632568,""y"":0.15060538053512573}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.1038581025805785, 2.0032224204185245, 5.087602825989163, 0.13277988512492753],""points"":[{""x"":0.10000000149011612,""y"":3.0498509407043457},{""x"":0.6000000238418579,""y"":2.805217742919922},{""x"":1.100000023841858,""y"":3.3415253162384033},{""x"":1.600000023841858,""y"":3.0549843311309814},{""x"":2.0999999046325684,""y"":3.250074863433838},{""x"":2.5999999046325684,""y"":3.0432586669921875},{""x"":3.0999999046325684,""y"":3.265852451324463},{""x"":3.5999999046325684,""y"":2.9475724697113037},{""x"":4.099999904632568,""y"":3.1929898262023926},{""x"":4.599999904632568,""y"":2.7460060119628906},{""x"":5.099999904632568,""y"":1.6175861358642578},{""x"":5.599999904632568,""y"":0.3006608486175537},{""x"":6.099999904632568,""y"":0.3444803059101105},{""x"":6.599999904632568,""y"":0.015537971630692482},{""x"":7.099999904632568,""y"":0.5527358055114746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\n,,,,,,,,,,,,,,,,,,,,,');i.columns.add(o.Column.fromList(o.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var s=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};const a=3e4,l=108e5,u=console.log.bind(console),c=console.info.bind(console),f=console.warn.bind(console),h=console.error.bind(console),d={},p="Auto Tests",g="Demo",m="Detectors",y="Core",v={};let b;var C;!function(t){t.notNull=function(t,e){if(null==t)throw new Error(`${null==e?"Value":e} not defined`)}}(C||(C={}));class A{constructor(t,e){this.catchUnhandled=!0,this.report=!1,void 0!==t&&(this.catchUnhandled=t),void 0!==e&&(this.report=e)}}class w{constructor(t,e,n,r){var o;this.category=t,this.name=e,null!=r||(r={}),null!==(o=r.timeout)&&void 0!==o||(r.timeout=a),this.options=r,this.test=()=>s(this,void 0,void 0,(function*(){return new Promise(((t,e)=>s(this,void 0,void 0,(function*(){let r="";try{r=yield n()}catch(t){e(t)}t(r)}))))}))}}function E(t,e,n,r=0,o="timeout"){return s(this,void 0,void 0,(function*(){return new Promise(((i,s)=>{const a=t.subscribe((t=>{try{e(t),i("OK")}catch(t){s(t)}finally{a.unsubscribe(),clearTimeout(l)}})),l=setTimeout((()=>{a.unsubscribe(),s(o)}),r);n()}))}))}function _(t,e,n){null==d[b]&&(d[b]={}),null==d[b].tests&&(d[b].tests=[]),d[b].tests.push(new w(b,t,e,n))}function x(t,e=!0,n){if(n=n?`${n}, `:"",t!==e)throw new Error(`${n}Expected "${e}", got "${t}"`)}function T(t,e,n=.001,r){if(t===Number.POSITIVE_INFINITY&&e===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY&&e===Number.NEGATIVE_INFINITY||t===Number.NaN&&e===Number.NaN||isNaN(t)&&isNaN(e))return;const o=Math.abs(t-e)<n;if(x(o,!0,`${null!=r?r:""} (tolerance = ${n})`),!o)throw new Error(`Expected ${e}, got ${t} (tolerance = ${n})`)}function I(t,e){for(const[n,r]of Object.entries(e)){if(!t.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const e=t[n];if(e instanceof Array&&r instanceof Array)N(e,r);else if(e instanceof Object&&r instanceof Object)I(e,r);else if(Number.isFinite(e)&&Number.isFinite(r))T(e,r);else if(e!=r)throw new Error(`Expected (${r}) for key '${n}', got (${e})`)}}function N(t,e){const n=t.length,r=e.length;if(n!=r)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${r}`);for(let r=0;r<n;r++)if(t[r]instanceof Array&&e[r]instanceof Array)N(t[r],e[r]);else if(t[r]instanceof Object&&e[r]instanceof Object)I(t[r],e[r]);else if(t[r]!=e[r])throw new Error(`Expected ${e[r]} at position ${r}, got ${t[r]}`)}function S(t,e,n){var r;b=t,e(),d[b]&&(d[b].clear=null===(r=null==n?void 0:n.clear)||void 0===r||r,d[b].timeout=null==n?void 0:n.timeout,d[b].benchmarks=null==n?void 0:n.benchmarks,d[b].stressTests=null==n?void 0:n.stressTests,d[b].owner=null==n?void 0:n.owner)}function L(t){null==d[b]&&(d[b]={}),d[b].before=t}function P(t){null==d[b]&&(d[b]={}),d[b].after=t}function O(t,e){return t.replace(new RegExp(e.name,"gi"),e.nqName)}function M(t,e){var n,u,c,f,h,b,C;return s(this,void 0,void 0,(function*(){const A=t.id;if(v[A])return;const E=e?e.tests:d;if(void 0!==E[p]||void 0!==E[g]||Object.keys(E).find((t=>t.startsWith(p)||t.startsWith(y))))return void(v[A]=!0);if("DevTools"===t.name||e&&"DevTools"===e._package.name)for(const t of window.dartTests){const e=t.name.split(/\s*\|\s*!/g);let r=null!==(n=e.pop())&&void 0!==n?n:t.name,o=e.length?y+": "+e.join(": "):y,i=r.split(" | ");r=i[i.length-1],i.unshift(o),i.pop(),o=i.join(": "),void 0===E[o]&&(E[o]={tests:[],clear:!0}),E[o].tests.push(new w(o,r,t.test,{isAggregated:!1,timeout:null!==(c=null===(u=t.options)||void 0===u?void 0:u.timeout)&&void 0!==c?c:a,skipReason:null===(f=t.options)||void 0===f?void 0:f.skipReason,owner:null===(h=t.options)||void 0===h?void 0:h.owner}))}const _=[],T=[],I=[],N=yield r.dapi.functions.filter(`package.id = "${A}"`).list(),S=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const e of N){const n=e.options.test,u=e.options.demoPath;if(n&&Array.isArray(n)&&n.length)for(let t=0;t<n.length;t++){const i=n[t].matchAll(S),u={};Array.from(i).forEach((t=>{t[0].startsWith("skip")?u.skip=t[1]:t[0].startsWith("wait")?u.wait=parseInt(t[2]):t[0].startsWith("cat")?u.cat=t[3]:t[0].startsWith("timeout")&&(u.timeout=parseInt(t[4]))}));const c=new w(p,1===n.length?e.name:`${e.name} ${t+1}`,(()=>s(this,void 0,void 0,(function*(){const o=yield r.functions.eval(O(n[t],e));if(u.wait&&(yield H(u.wait)),"boolean"==typeof o&&!o)throw`Failed: ${n[t]}, expected true, got ${o}`}))),{skipReason:u.skip,timeout:o.Test.isInBenchmark?null!==(b=u.benchmarkTimeout)&&void 0!==b?b:l:null!==(C=u.timeout)&&void 0!==C?C:a});if(u.cat){const t=p+": "+u.cat;c.category=t,void 0===E[t]&&(E[t]={tests:[],clear:!0}),E[t].tests.push(c)}else _.push(c)}if(u){const t=e.options.demoWait?parseInt(e.options.demoWait):void 0,n=new w(g,e.friendlyName,(()=>s(this,void 0,void 0,(function*(){r.shell.isInDemo=!0,void 0===r.shell.view(o.View.BROWSE)&&(r.shell.v=o.View.createByType(o.View.BROWSE)),yield H(300),r.shell.clearLastError(),yield e.apply(),yield H(t||2e3);const n=yield r.shell.lastError;if(n)throw new Error(n);r.shell.isInDemo=!1}))),{skipReason:e.options.demoSkip});T.push(n)}if(e.hasTag("semTypeDetector")){let n=i;e.options.testData&&(n=yield r.data.files.openTable(`System:AppData/${t.nqName}/${e.options.testData}`));const o=new w(m,e.friendlyName,(()=>s(this,void 0,void 0,(function*(){const r=[];console.log(`System:AppData/${t.nqName}/${e.options.testData}`);for(const t of n.clone().columns){const n=yield e.apply([t]);r.push(n||t.semType)}const o=r.filter((t=>t));x(o.length,1),e.options.testDataColumnName&&x(o[0],e.options.testDataColumnName)}))),{skipReason:e.options.skipTest});I.push(o)}}v[A]=!0,_.length>0&&(E[p]={tests:_,clear:!0}),T.length>0&&(E[g]={tests:T,clear:!0}),I.length>0&&(E[m]={tests:I,clear:!1})}))}function R(t){var e,n,i,p;return s(this,void 0,void 0,(function*(){const g=null===(n=null===(e=r.functions.getCurrentCall())||void 0===e?void 0:e.func)||void 0===n?void 0:n.package;yield M(g);const m=[];console.log("Running tests"),null!=t||(t={}),null!==(i=(p=t).testContext)&&void 0!==i||(p.testContext=new A),r.shell.clearLastError();const y=function(){const t=[];return console.log=(...e)=>{t.push(...e),u(...e)},console.info=(...e)=>{t.push(...e),c(...e)},console.warn=(...e)=>{t.push(...e),f(...e)},console.error=(...e)=>{t.push(...e),h(...e)},t}();yield function(t,e){var n,i,d,p,b,C,A,w,E,_,x,T,I,N,S,L,P,O,M,R;return s(this,void 0,void 0,(function*(){try{for(const[s,c]of Object.entries(t)){if((null==e?void 0:e.category)&&!s.toLowerCase().startsWith(null==e?void 0:e.category.toLowerCase())||(null===(n=e.exclude)||void 0===n?void 0:n.some((t=>s.startsWith(t)))))continue;u(`Started ${s} category`);const t=null===(i=c.tests)||void 0===i?void 0:i.every((t=>{var e;return null===(e=t.options)||void 0===e?void 0:e.skipReason}));t||(c.beforeStatus=yield v(c.before,null!==(d=e.category)&&void 0!==d?d:""));let f=null!==(p=c.tests)&&void 0!==p?p:[];e.stressTest&&(f=f.filter((t=>{var e;return null===(e=t.options)||void 0===e?void 0:e.stressTest})),f=B(f)),(null!==(C=null===(b=e.tags)||void 0===b?void 0:b.length)&&void 0!==C?C:0)>0&&(f=f.filter((t=>{var n,r;return null===(r=null===(n=t.options)||void 0===n?void 0:n.tags)||void 0===r?void 0:r.some((t=>{var n;return(null!==(n=null==e?void 0:e.tags)&&void 0!==n?n:[]).includes(t)}))})));const h=[];if(c.clear)for(let t=0;t<f.length;t++){f[t].options&&void 0===(null===(A=f[t].options)||void 0===A?void 0:A.benchmark)&&(f[t].options||(f[t].options={}),f[t].options.benchmark=null!==(w=c.benchmarks)&&void 0!==w&&w);let n=f[t];(null==n?void 0:n.options)&&(n.options.owner=null!==(_=null===(E=f[t].options)||void 0===E?void 0:E.owner)&&void 0!==_?_:null==c?void 0:c.owner);let i=yield D(n,null==e?void 0:e.test,y,o.Test.isInBenchmark?null!==(T=null===(x=f[t].options)||void 0===x?void 0:x.benchmarkTimeout)&&void 0!==T?T:l:null!==(N=null===(I=f[t].options)||void 0===I?void 0:I.timeout)&&void 0!==N?N:a,g.name,e.verbose);i&&h.push(i),r.shell.closeAll(),o.Balloon.closeAll()}else for(let t=0;t<f.length;t++){let n=f[t];(null==n?void 0:n.options)&&(n.options.owner=null!==(L=null===(S=f[t].options)||void 0===S?void 0:S.owner)&&void 0!==L?L:null==c?void 0:c.owner);let r=yield D(n,null==e?void 0:e.test,y,o.Test.isInBenchmark?null!==(O=null===(P=f[t].options)||void 0===P?void 0:P.benchmarkTimeout)&&void 0!==O?O:l:null===(M=f[t].options)||void 0===M?void 0:M.timeout,g.name,e.verbose);r&&h.push(r)}const $=h.filter((t=>"skipped"!=t.result));t||(c.afterStatus=yield v(c.after,null!==(R=e.category)&&void 0!==R?R:"")),c.afterStatus&&$.push({date:(new Date).toISOString(),logs:"",category:s,name:"after",result:c.afterStatus,success:!1,ms:0,skipped:!1}),c.beforeStatus&&$.push({date:(new Date).toISOString(),logs:"",category:s,name:"before",result:c.beforeStatus,success:!1,ms:0,skipped:!1}),m.push(...$)}}finally{console.log=u,console.info=c,console.warn=f,console.error=h}if(e.testContext.catchUnhandled&&!o.Test.isInBenchmark){yield H(1e3);const t=yield r.shell.lastError,e={logs:"",date:(new Date).toISOString(),category:"Unhandled exceptions",name:"Exception",result:null!=t?t:"",success:!t,ms:0,skipped:!1,flaking:o.Test.isReproducing&&!t};m.push(e),e.package=g.name,null!=r.shell.reportTest?yield r.shell.reportTest("package",e):yield fetch(`${r.dapi.root}/log/tests/package`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(e)})}}))}(d,t);for(let t of m)t.result=t.result.toString().replace(/"/g,"'"),null!=t.logs&&(t.logs=t.logs.toString().replace(/"/g,"'"));return m;function v(t,e){return s(this,void 0,void 0,(function*(){var n=void 0;try{void 0!==t&&(yield F((()=>s(this,void 0,void 0,(function*(){yield t()}))),1e5,`before ${e}: timeout error`))}catch(t){n=yield $(t)}return n}))}}))}function $(t){return s(this,void 0,void 0,(function*(){return`${t.toString()}\n${t.stack?yield o.Logger.translateStackTrace(t.stack):""}`}))}function D(t,e,n,i,l,c){var f,d,p,g,m,y,v,b,C,A;return s(this,void 0,void 0,(function*(){let s;n.length=0;let w="package";const E=null!=e&&t.name.toLowerCase()!==e.toLowerCase();let _=(null===(f=t.options)||void 0===f?void 0:f.skipReason)||E,x=E?"skipped":null===(d=t.options)||void 0===d?void 0:d.skipReason;if(o.Test.isInBenchmark&&!(null===(p=t.options)||void 0===p?void 0:p.benchmark))return void u(`SKIPPED: ${t.category} ${t.name} doesnt available in benchmark mode`);_||u(`Started ${t.category} ${t.name}`);const T=Date.now();try{if(_)s={date:(new Date).toISOString(),success:!0,result:x,ms:0,skipped:!0};else{let e=null!=i?i:a;s={date:(new Date).toISOString(),success:!0,result:null!==(g=yield F(t.test,e))&&void 0!==g?g:"OK",ms:0,skipped:!1}}}catch(t){h(t),s={date:(new Date).toISOString(),success:!1,result:yield $(t),ms:0,skipped:!1}}if((null===(m=t.options)||void 0===m?void 0:m.isAggregated)&&s.result.constructor===o.DataFrame){const t=s.result.col("success");if(t&&(s.success=t.stats.sum===t.length),!c){const t=s.result;t.columns.remove("stack"),t.rows.removeWhere((t=>t.get("success"))),s.result=t}s.result=s.result.toCsv()}if(s.logs=n.join("\n"),s.ms=Date.now()-T,_||u(`Finished ${t.category} ${t.name} for ${s.ms} ms`),s.category=t.category,s.name=t.name,s.owner=null!==(v=null===(y=t.options)||void 0===y?void 0:y.owner)&&void 0!==v?v:"",!E){let e={success:s.success,result:s.result,ms:s.ms,date:s.date,skipped:s.skipped,package:l,category:t.category,name:t.name,logs:s.logs,owner:s.owner,flaking:o.Test.isReproducing&&s.success,timeoutWarning:o.Test.isInBenchmark&&(null===(b=t.options)||void 0===b?void 0:b.benchmarkWarnTimeout)&&s.ms>(null===(C=t.options)||void 0===C?void 0:C.benchmarkWarnTimeout)};if(s.result.constructor==Object){const t=Object.keys(s.result).reduce(((t,e)=>Object.assign(Object.assign({},t),{["result."+e]:s.result[e]})),{});e=Object.assign(Object.assign({},e),t)}e.result instanceof o.DataFrame&&(e.result=JSON.stringify(null===(A=e.result)||void 0===A?void 0:A.toJson())||""),null!=r.shell.reportTest?yield r.shell.reportTest(w,e):yield fetch(`${r.dapi.root}/log/tests/${w}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(e)})}return s}))}function B(t){const e=t.slice();return e.sort((()=>Math.random()-.5)),e}function H(t){return s(this,void 0,void 0,(function*(){yield new Promise((e=>setTimeout(e,t)))}))}function F(t,e,n="EXECUTION TIMEOUT"){return s(this,void 0,void 0,(function*(){let r=null;const o=new Promise(((t,o)=>{r=setTimeout((()=>{o(n)}),e)}));try{return yield Promise.race([t(),o])}finally{r&&clearTimeout(r)}}))}o.DataFrame.fromColumns([o.Column.fromStrings("col",["val1","val2","val3"])])},2074:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(1354),o=n.n(r),i=n(6314),s=n.n(i)()(o());s.push([t.id,".st-colored-text-input > textarea {\n width: 100%;\n -webkit-text-fill-color: transparent;\n background-color: transparent;\n position: relative;\n z-index: 1;\n resize: none;\n height: 22px; /* Fine tuned value to avoid \"jumping\" of the textarea upon autoresize */\n}\n\n.st-colored-text-input > div {\n /* The values here are fine tuned to those of the ui.input textarea in order\n * to achieve precise overlap */\n overflow: auto;\n position: absolute;\n pointer-events: none;\n cursor: text;\n z-index: 0;\n max-width: 100%;\n padding: 2px;\n line-height: normal;\n font-family: 'Roboto', 'Roboto Local', sans-serif;\n font-size: 13px;\n padding-top: 6px !important;\n color: transparent;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n","",{version:3,sources:["webpack://./src/apps/common/view/components/colored-input/style.css"],names:[],mappings:"AAAA;EACE,WAAW;EACX,oCAAoC;EACpC,6BAA6B;EAC7B,kBAAkB;EAClB,UAAU;EACV,YAAY;EACZ,YAAY,EAAE,wEAAwE;AACxF;;AAEA;EACE;iCAC+B;EAC/B,cAAc;EACd,kBAAkB;EAClB,oBAAoB;EACpB,YAAY;EACZ,UAAU;EACV,eAAe;EACf,YAAY;EACZ,mBAAmB;EACnB,iDAAiD;EACjD,eAAe;EACf,2BAA2B;EAC3B,kBAAkB;EAClB,qBAAqB;EACrB,qBAAqB;AACvB",sourcesContent:[".st-colored-text-input > textarea {\n width: 100%;\n -webkit-text-fill-color: transparent;\n background-color: transparent;\n position: relative;\n z-index: 1;\n resize: none;\n height: 22px; /* Fine tuned value to avoid \"jumping\" of the textarea upon autoresize */\n}\n\n.st-colored-text-input > div {\n /* The values here are fine tuned to those of the ui.input textarea in order\n * to achieve precise overlap */\n overflow: auto;\n position: absolute;\n pointer-events: none;\n cursor: text;\n z-index: 0;\n max-width: 100%;\n padding: 2px;\n line-height: normal;\n font-family: 'Roboto', 'Roboto Local', sans-serif;\n font-size: 13px;\n padding-top: 6px !important;\n color: transparent;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n"],sourceRoot:""}]);const a=s},9252:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(1354),o=n.n(r),i=n(6314),s=n.n(i)()(o());s.push([t.id,"/* Naming convention: class names should begin with st and app name to avoid naming collitions */\n\n.st-pattern-text-input > textarea {\n resize: none;\n}\n","",{version:3,sources:["webpack://./src/apps/pattern/view/style.css"],names:[],mappings:"AAAA,gGAAgG;;AAEhG;EACE,YAAY;AACd",sourcesContent:["/* Naming convention: class names should begin with st and app name to avoid naming collitions */\n\n.st-pattern-text-input > textarea {\n resize: none;\n}\n"],sourceRoot:""}]);const a=s},8507:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(1354),o=n.n(r),i=n(6314),s=n.n(i)()(o());s.push([t.id,"/* Naming convention: class names should begin with st and app name to avoid naming collitions */\n\n.st-structure-body {\n padding-right: 20px;\n}\n\n.st-structure-mol-img {\n margin-right: 30px;\n float: right;\n}\n\n.st-structure-bool-button-block {\n justify-content: right;\n margin-bottom: 10px;\n}\n\n.st-structure-bottom {\n flex-direction: row-reverse;\n padding-top: 20px;\n}\n\n.st-structure-clear-buttons {\n justify-content: space-between;\n padding: 13px 10px 13px 10px;\n}\n\n.st-direction-inputs {\n align-items: end;\n}\n\n.st-structure-inputs {\n flex-grow: 2;\n padding-left: 10px;\n}","",{version:3,sources:["webpack://./src/apps/structure/view/style.css"],names:[],mappings:"AAAA,gGAAgG;;AAEhG;EACE,mBAAmB;AACrB;;AAEA;EACE,kBAAkB;EAClB,YAAY;AACd;;AAEA;EACE,sBAAsB;EACtB,mBAAmB;AACrB;;AAEA;EACE,2BAA2B;EAC3B,iBAAiB;AACnB;;AAEA;EACE,8BAA8B;EAC9B,4BAA4B;AAC9B;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,YAAY;EACZ,kBAAkB;AACpB",sourcesContent:["/* Naming convention: class names should begin with st and app name to avoid naming collitions */\n\n.st-structure-body {\n padding-right: 20px;\n}\n\n.st-structure-mol-img {\n margin-right: 30px;\n float: right;\n}\n\n.st-structure-bool-button-block {\n justify-content: right;\n margin-bottom: 10px;\n}\n\n.st-structure-bottom {\n flex-direction: row-reverse;\n padding-top: 20px;\n}\n\n.st-structure-clear-buttons {\n justify-content: space-between;\n padding: 13px 10px 13px 10px;\n}\n\n.st-direction-inputs {\n align-items: end;\n}\n\n.st-structure-inputs {\n flex-grow: 2;\n padding-left: 10px;\n}"],sourceRoot:""}]);const a=s},5254:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(1354),o=n.n(r),i=n(6314),s=n.n(i)()(o());s.push([t.id,"/* Naming convention: class names should begin with st and app name to avoid naming collitions */\n.st-translator-input-table {\n /* width: 100%; */\n margin-right: 20px;\n}\n\n.st-translator-input-table td:has(textarea) {\n width: 100%;\n}\n\n.st-translator-input-table td:has(select) {\n min-width: 120px;\n vertical-align: top;\n}\n\n.st-translator-output-table {\n margin-top: 20px;\n margin-right: 20px;\n margin-bottom: 10px;\n}\n\n.st-translator-output-table table {\n width: 100%;\n table-layout: fixed;\n}\n\n.st-translator-output-table td {\n padding-top: 6px;\n padding-bottom: 6px;\n}\n.st-translator-output-table tr:nth-child(even) {\n background-color: var(--grey-1);\n}\n\n.st-translator-output-table td:nth-child(odd) {\n width: 120px;\n vertical-align: top;\n}\n\n.st-translator-output-table td a {\n overflow-wrap: break-word;\n}\n","",{version:3,sources:["webpack://./src/apps/translator/view/style.css"],names:[],mappings:"AAAA,gGAAgG;AAChG;EACE,iBAAiB;EACjB,kBAAkB;AACpB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,mBAAmB;AACrB;;AAEA;EACE,WAAW;EACX,mBAAmB;AACrB;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;AACA;EACE,+BAA+B;AACjC;;AAEA;EACE,YAAY;EACZ,mBAAmB;AACrB;;AAEA;EACE,yBAAyB;AAC3B",sourcesContent:["/* Naming convention: class names should begin with st and app name to avoid naming collitions */\n.st-translator-input-table {\n /* width: 100%; */\n margin-right: 20px;\n}\n\n.st-translator-input-table td:has(textarea) {\n width: 100%;\n}\n\n.st-translator-input-table td:has(select) {\n min-width: 120px;\n vertical-align: top;\n}\n\n.st-translator-output-table {\n margin-top: 20px;\n margin-right: 20px;\n margin-bottom: 10px;\n}\n\n.st-translator-output-table table {\n width: 100%;\n table-layout: fixed;\n}\n\n.st-translator-output-table td {\n padding-top: 6px;\n padding-bottom: 6px;\n}\n.st-translator-output-table tr:nth-child(even) {\n background-color: var(--grey-1);\n}\n\n.st-translator-output-table td:nth-child(odd) {\n width: 120px;\n vertical-align: top;\n}\n\n.st-translator-output-table td a {\n overflow-wrap: break-word;\n}\n"],sourceRoot:""}]);const a=s},890:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(1354),o=n.n(r),i=n(6314),s=n.n(i)()(o());s.push([t.id,".monomer-card-rule-root {\n border: 2px solid var(--grey-2);\n border-radius: 5px;\n padding: 5px;\n margin: 5px;\n overflow: hidden;\n align-items: center;\n cursor: pointer;\n width: 200px;\n height: 210px;\n min-width: 200px;\n min-height: 210px;\n}\n\n.monomer-card-info-rules {\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 10px;\n}\n\n.monomer-card-info-rules > div:nth-child(2) {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.monomer-card-info-rules > div:nth-child(1) {\n font-weight: bold;\n margin-right: 5px;\n text-wrap: nowrap;\n}\n","",{version:3,sources:["webpack://./src/polytool/conversion/style.css"],names:[],mappings:"AAAA;IACI,+BAA+B;IAC/B,kBAAkB;IAClB,YAAY;IACZ,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,eAAe;IACf,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,iBAAiB;AACrB;;AAEA;IACI,WAAW;IACX,gBAAgB;IAChB,uBAAuB;IACvB,mBAAmB;AACvB;;AAEA;IACI,mBAAmB;IACnB,gBAAgB;IAChB,uBAAuB;AAC3B;;AAEA;IACI,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;AACrB",sourcesContent:[".monomer-card-rule-root {\n border: 2px solid var(--grey-2);\n border-radius: 5px;\n padding: 5px;\n margin: 5px;\n overflow: hidden;\n align-items: center;\n cursor: pointer;\n width: 200px;\n height: 210px;\n min-width: 200px;\n min-height: 210px;\n}\n\n.monomer-card-info-rules {\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 10px;\n}\n\n.monomer-card-info-rules > div:nth-child(2) {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.monomer-card-info-rules > div:nth-child(1) {\n font-weight: bold;\n margin-right: 5px;\n text-wrap: nowrap;\n}\n"],sourceRoot:""}]);const a=s},6314:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var u=0;u<t.length;u++){var c=[].concat(t[u]);r&&s[c[0]]||(void 0!==i&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),e.push(c))}},e}},1354:t=>{"use strict";t.exports=function(t){var e=t[1],n=t[3];if(!n)return e;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),i="/*# ".concat(o," */");return[e].concat([i]).join("\n")}return[e].join("\n")}},9982:function(t,e,n){var r;!function(){var e={};!function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(t,n,r,o,i){for(var s,a,l,u,c,f,h,d,p,g,m,y,v;i>=64;){for(s=n[0],a=n[1],l=n[2],u=n[3],c=n[4],f=n[5],h=n[6],d=n[7],g=0;g<16;g++)m=o+4*g,t[g]=(255&r[m])<<24|(255&r[m+1])<<16|(255&r[m+2])<<8|255&r[m+3];for(g=16;g<64;g++)y=((p=t[g-2])>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,v=((p=t[g-15])>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,t[g]=(y+t[g-7]|0)+(v+t[g-16]|0);for(g=0;g<64;g++)y=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&f^~c&h)|0)+(d+(e[g]+t[g]|0)|0)|0,v=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&a^s&l^a&l)|0,d=h,h=f,f=c,c=u+y|0,u=l,l=a,a=s,s=y+v|0;n[0]+=s,n[1]+=a,n[2]+=l,n[3]+=u,n[4]+=c,n[5]+=f,n[6]+=h,n[7]+=d,o+=64,i-=64}return o}var r=function(){function e(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return e.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},e.prototype.clean=function(){for(var t=0;t<this.buffer.length;t++)this.buffer[t]=0;for(t=0;t<this.temp.length;t++)this.temp[t]=0;this.reset()},e.prototype.update=function(t,e){if(void 0===e&&(e=t.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this.bytesHashed+=e,this.bufferLength>0){for(;this.bufferLength<64&&e>0;)this.buffer[this.bufferLength++]=t[r++],e--;64===this.bufferLength&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(e>=64&&(r=n(this.temp,this.state,t,r,e),e%=64);e>0;)this.buffer[this.bufferLength++]=t[r++],e--;return this},e.prototype.finish=function(t){if(!this.finished){var e=this.bytesHashed,r=this.bufferLength,o=e/536870912|0,i=e<<3,s=e%64<56?64:128;this.buffer[r]=128;for(var a=r+1;a<s-8;a++)this.buffer[a]=0;this.buffer[s-8]=o>>>24&255,this.buffer[s-7]=o>>>16&255,this.buffer[s-6]=o>>>8&255,this.buffer[s-5]=o>>>0&255,this.buffer[s-4]=i>>>24&255,this.buffer[s-3]=i>>>16&255,this.buffer[s-2]=i>>>8&255,this.buffer[s-1]=i>>>0&255,n(this.temp,this.state,this.buffer,0,s),this.finished=!0}for(a=0;a<8;a++)t[4*a+0]=this.state[a]>>>24&255,t[4*a+1]=this.state[a]>>>16&255,t[4*a+2]=this.state[a]>>>8&255,t[4*a+3]=this.state[a]>>>0&255;return this},e.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},e.prototype._saveState=function(t){for(var e=0;e<this.state.length;e++)t[e]=this.state[e]},e.prototype._restoreState=function(t,e){for(var n=0;n<this.state.length;n++)this.state[n]=t[n];this.bytesHashed=e,this.finished=!1,this.bufferLength=0},e}();t.Hash=r;var o=function(){function t(t){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var e=new Uint8Array(this.blockSize);if(t.length>this.blockSize)(new r).update(t).finish(e).clean();else for(var n=0;n<t.length;n++)e[n]=t[n];for(n=0;n<e.length;n++)e[n]^=54;for(this.inner.update(e),n=0;n<e.length;n++)e[n]^=106;for(this.outer.update(e),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate),n=0;n<e.length;n++)e[n]=0}return t.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},t.prototype.clean=function(){for(var t=0;t<this.istate.length;t++)this.ostate[t]=this.istate[t]=0;this.inner.clean(),this.outer.clean()},t.prototype.update=function(t){return this.inner.update(t),this},t.prototype.finish=function(t){return this.outer.finished?this.outer.finish(t):(this.inner.finish(t),this.outer.update(t,this.digestLength).finish(t)),this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t}();function i(t){var e=(new r).update(t),n=e.digest();return e.clean(),n}function s(t,e){var n=new o(t).update(e),r=n.digest();return n.clean(),r}function a(t,e,n,r){var o=r[0];if(0===o)throw new Error("hkdf: cannot expand more");e.reset(),o>1&&e.update(t),n&&e.update(n),e.update(r),e.finish(t),r[0]++}t.HMAC=o,t.hash=i,t.default=i,t.hmac=s;var l=new Uint8Array(t.digestLength);t.hkdf=function(t,e,n,r){void 0===e&&(e=l),void 0===r&&(r=32);for(var i=new Uint8Array([1]),u=s(e,t),c=new o(u),f=new Uint8Array(c.digestLength),h=f.length,d=new Uint8Array(r),p=0;p<r;p++)h===f.length&&(a(f,c,n,i),h=0),d[p]=f[h++];return c.clean(),f.fill(0),i.fill(0),d},t.pbkdf2=function(t,e,n,r){for(var i=new o(t),s=i.digestLength,a=new Uint8Array(4),l=new Uint8Array(s),u=new Uint8Array(s),c=new Uint8Array(r),f=0;f*s<r;f++){var h=f+1;a[0]=h>>>24&255,a[1]=h>>>16&255,a[2]=h>>>8&255,a[3]=h>>>0&255,i.reset(),i.update(e),i.update(a),i.finish(u);for(var d=0;d<s;d++)l[d]=u[d];for(d=2;d<=n;d++){i.reset(),i.update(u).finish(u);for(var p=0;p<s;p++)l[p]^=u[p]}for(d=0;d<s&&f*s+d<r;d++)c[f*s+d]=l[d]}for(f=0;f<s;f++)l[f]=u[f]=0;for(f=0;f<4;f++)a[f]=0;return i.clean(),c}}(e);var o=e.default;for(var i in e)o[i]=e[i];"object"==typeof t.exports?t.exports=o:void 0===(r=function(){return o}.call(e,n,e,t))||(t.exports=r)}()},2543:function(t,e,n){var r;t=n.nmd(t),function(){var o,i="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",l=32,u=128,c=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],g="[object Arguments]",m="[object Array]",y="[object Boolean]",v="[object Date]",b="[object Error]",C="[object Function]",A="[object GeneratorFunction]",w="[object Map]",E="[object Number]",_="[object Object]",x="[object Promise]",T="[object RegExp]",I="[object Set]",N="[object String]",S="[object Symbol]",L="[object WeakMap]",P="[object ArrayBuffer]",O="[object DataView]",M="[object Float32Array]",R="[object Float64Array]",$="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",H="[object Uint8Array]",F="[object Uint8ClampedArray]",k="[object Uint16Array]",G="[object Uint32Array]",U=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,q=RegExp(W.source),K=RegExp(Y.source),z=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,ot=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ut=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ht=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,vt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,Ct=/['\n\r\u2028\u2029\\]/g,At="\\ud800-\\udfff",wt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Et="\\u2700-\\u27bf",_t="a-z\\xdf-\\xf6\\xf8-\\xff",xt="A-Z\\xc0-\\xd6\\xd8-\\xde",Tt="\\ufe0e\\ufe0f",It="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Nt="["+At+"]",St="["+It+"]",Lt="["+wt+"]",Pt="\\d+",Ot="["+Et+"]",Mt="["+_t+"]",Rt="[^"+At+It+Pt+Et+_t+xt+"]",$t="\\ud83c[\\udffb-\\udfff]",Dt="[^"+At+"]",Bt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ht="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+xt+"]",kt="\\u200d",Gt="(?:"+Mt+"|"+Rt+")",Ut="(?:"+Ft+"|"+Rt+")",jt="(?:['’](?:d|ll|m|re|s|t|ve))?",Vt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Wt="(?:"+Lt+"|"+$t+")?",Yt="["+Tt+"]?",qt=Yt+Wt+"(?:"+kt+"(?:"+[Dt,Bt,Ht].join("|")+")"+Yt+Wt+")*",Kt="(?:"+[Ot,Bt,Ht].join("|")+")"+qt,zt="(?:"+[Dt+Lt+"?",Lt,Bt,Ht,Nt].join("|")+")",Jt=RegExp("['’]","g"),Qt=RegExp(Lt,"g"),Xt=RegExp($t+"(?="+$t+")|"+zt+qt,"g"),Zt=RegExp([Ft+"?"+Mt+"+"+jt+"(?="+[St,Ft,"$"].join("|")+")",Ut+"+"+Vt+"(?="+[St,Ft+Gt,"$"].join("|")+")",Ft+"?"+Gt+"+"+jt,Ft+"+"+Vt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pt,Kt].join("|"),"g"),te=RegExp("["+kt+At+wt+Tt+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,oe={};oe[M]=oe[R]=oe[$]=oe[D]=oe[B]=oe[H]=oe[F]=oe[k]=oe[G]=!0,oe[g]=oe[m]=oe[P]=oe[y]=oe[O]=oe[v]=oe[b]=oe[C]=oe[w]=oe[E]=oe[_]=oe[T]=oe[I]=oe[N]=oe[L]=!1;var ie={};ie[g]=ie[m]=ie[P]=ie[O]=ie[y]=ie[v]=ie[M]=ie[R]=ie[$]=ie[D]=ie[B]=ie[w]=ie[E]=ie[_]=ie[T]=ie[I]=ie[N]=ie[S]=ie[H]=ie[F]=ie[k]=ie[G]=!0,ie[b]=ie[C]=ie[L]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ae=parseFloat,le=parseInt,ue="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ce="object"==typeof self&&self&&self.Object===Object&&self,fe=ue||ce||Function("return this")(),he=e&&!e.nodeType&&e,de=he&&t&&!t.nodeType&&t,pe=de&&de.exports===he,ge=pe&&ue.process,me=function(){try{return de&&de.require&&de.require("util").types||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),ye=me&&me.isArrayBuffer,ve=me&&me.isDate,be=me&&me.isMap,Ce=me&&me.isRegExp,Ae=me&&me.isSet,we=me&&me.isTypedArray;function Ee(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function _e(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var s=t[o];e(r,s,n(s),t)}return r}function xe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Te(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ie(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ne(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}function Se(t,e){return!(null==t||!t.length)&&Fe(t,e,0)>-1}function Le(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}function Pe(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function Oe(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function Me(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function Re(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}function $e(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var De=je("length");function Be(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}function He(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Fe(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):He(t,Ge,n)}function ke(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function Ge(t){return t!=t}function Ue(t,e){var n=null==t?0:t.length;return n?Ye(t,e)/n:h}function je(t){return function(e){return null==e?o:e[t]}}function Ve(t){return function(e){return null==t?o:t[e]}}function We(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function Ye(t,e){for(var n,r=-1,i=t.length;++r<i;){var s=e(t[r]);s!==o&&(n=n===o?s:n+s)}return n}function qe(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ke(t){return t?t.slice(0,hn(t)+1).replace(rt,""):t}function ze(t){return function(e){return t(e)}}function Je(t,e){return Pe(e,(function(e){return t[e]}))}function Qe(t,e){return t.has(e)}function Xe(t,e){for(var n=-1,r=t.length;++n<r&&Fe(e,t[n],0)>-1;);return n}function Ze(t,e){for(var n=t.length;n--&&Fe(e,t[n],0)>-1;);return n}var tn=Ve({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),en=Ve({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(t){return"\\"+se[t]}function rn(t){return te.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function an(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var s=t[n];s!==e&&s!==a||(t[n]=a,i[o++]=n)}return i}function ln(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function cn(t){return rn(t)?function(t){for(var e=Xt.lastIndex=0;Xt.test(t);)++e;return e}(t):De(t)}function fn(t){return rn(t)?function(t){return t.match(Xt)||[]}(t):function(t){return t.split("")}(t)}function hn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var dn=Ve({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pn=function t(e){var n,r=(e=null==e?fe:pn.defaults(fe.Object(),e,pn.pick(fe,ne))).Array,ot=e.Date,At=e.Error,wt=e.Function,Et=e.Math,_t=e.Object,xt=e.RegExp,Tt=e.String,It=e.TypeError,Nt=r.prototype,St=wt.prototype,Lt=_t.prototype,Pt=e["__core-js_shared__"],Ot=St.toString,Mt=Lt.hasOwnProperty,Rt=0,$t=(n=/[^.]+$/.exec(Pt&&Pt.keys&&Pt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Dt=Lt.toString,Bt=Ot.call(_t),Ht=fe._,Ft=xt("^"+Ot.call(Mt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kt=pe?e.Buffer:o,Gt=e.Symbol,Ut=e.Uint8Array,jt=kt?kt.allocUnsafe:o,Vt=sn(_t.getPrototypeOf,_t),Wt=_t.create,Yt=Lt.propertyIsEnumerable,qt=Nt.splice,Kt=Gt?Gt.isConcatSpreadable:o,zt=Gt?Gt.iterator:o,Xt=Gt?Gt.toStringTag:o,te=function(){try{var t=ui(_t,"defineProperty");return t({},"",{}),t}catch(t){}}(),se=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,ue=ot&&ot.now!==fe.Date.now&&ot.now,ce=e.setTimeout!==fe.setTimeout&&e.setTimeout,he=Et.ceil,de=Et.floor,ge=_t.getOwnPropertySymbols,me=kt?kt.isBuffer:o,De=e.isFinite,Ve=Nt.join,gn=sn(_t.keys,_t),mn=Et.max,yn=Et.min,vn=ot.now,bn=e.parseInt,Cn=Et.random,An=Nt.reverse,wn=ui(e,"DataView"),En=ui(e,"Map"),_n=ui(e,"Promise"),xn=ui(e,"Set"),Tn=ui(e,"WeakMap"),In=ui(_t,"create"),Nn=Tn&&new Tn,Sn={},Ln=Bi(wn),Pn=Bi(En),On=Bi(_n),Mn=Bi(xn),Rn=Bi(Tn),$n=Gt?Gt.prototype:o,Dn=$n?$n.valueOf:o,Bn=$n?$n.toString:o;function Hn(t){if(ta(t)&&!js(t)&&!(t instanceof Un)){if(t instanceof Gn)return t;if(Mt.call(t,"__wrapped__"))return Hi(t)}return new Gn(t)}var Fn=function(){function t(){}return function(e){if(!Zs(e))return{};if(Wt)return Wt(e);t.prototype=e;var n=new t;return t.prototype=o,n}}();function kn(){}function Gn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function Un(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function jn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Yn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Wn;++e<n;)this.add(t[e])}function qn(t){var e=this.__data__=new Vn(t);this.size=e.size}function Kn(t,e){var n=js(t),r=!n&&Us(t),o=!n&&!r&&qs(t),i=!n&&!r&&!o&&la(t),s=n||r||o||i,a=s?qe(t.length,Tt):[],l=a.length;for(var u in t)!e&&!Mt.call(t,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||mi(u,l))||a.push(u);return a}function zn(t){var e=t.length;return e?t[Wr(0,e-1)]:o}function Jn(t,e){return Oi(Io(t),ir(e,0,t.length))}function Qn(t){return Oi(Io(t))}function Xn(t,e,n){(n!==o&&!Fs(t[e],n)||n===o&&!(e in t))&&rr(t,e,n)}function Zn(t,e,n){var r=t[e];Mt.call(t,e)&&Fs(r,n)&&(n!==o||e in t)||rr(t,e,n)}function tr(t,e){for(var n=t.length;n--;)if(Fs(t[n][0],e))return n;return-1}function er(t,e,n,r){return cr(t,(function(t,o,i){e(r,t,n(t),i)})),r}function nr(t,e){return t&&No(e,La(e),t)}function rr(t,e,n){"__proto__"==e&&te?te(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function or(t,e){for(var n=-1,i=e.length,s=r(i),a=null==t;++n<i;)s[n]=a?o:xa(t,e[n]);return s}function ir(t,e,n){return t==t&&(n!==o&&(t=t<=n?t:n),e!==o&&(t=t>=e?t:e)),t}function sr(t,e,n,r,i,s){var a,l=1&e,u=2&e,c=4&e;if(n&&(a=i?n(t,r,i,s):n(t)),a!==o)return a;if(!Zs(t))return t;var f=js(t);if(f){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Mt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!l)return Io(t,a)}else{var h=hi(t),d=h==C||h==A;if(qs(t))return Ao(t,l);if(h==_||h==g||d&&!i){if(a=u||d?{}:pi(t),!l)return u?function(t,e){return No(t,fi(t),e)}(t,function(t,e){return t&&No(e,Pa(e),t)}(a,t)):function(t,e){return No(t,ci(t),e)}(t,nr(a,t))}else{if(!ie[h])return i?t:{};a=function(t,e,n){var r,o=t.constructor;switch(e){case P:return wo(t);case y:case v:return new o(+t);case O:return function(t,e){var n=e?wo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case M:case R:case $:case D:case B:case H:case F:case k:case G:return Eo(t,n);case w:return new o;case E:case N:return new o(t);case T:return function(t){var e=new t.constructor(t.source,ht.exec(t));return e.lastIndex=t.lastIndex,e}(t);case I:return new o;case S:return r=t,Dn?_t(Dn.call(r)):{}}}(t,h,l)}}s||(s=new qn);var p=s.get(t);if(p)return p;s.set(t,a),ia(t)?t.forEach((function(r){a.add(sr(r,e,n,r,t,s))})):ea(t)&&t.forEach((function(r,o){a.set(o,sr(r,e,n,o,t,s))}));var m=f?o:(c?u?ni:ei:u?Pa:La)(t);return xe(m||t,(function(r,o){m&&(r=t[o=r]),Zn(a,o,sr(r,e,n,o,t,s))})),a}function ar(t,e,n){var r=n.length;if(null==t)return!r;for(t=_t(t);r--;){var i=n[r],s=e[i],a=t[i];if(a===o&&!(i in t)||!s(a))return!1}return!0}function lr(t,e,n){if("function"!=typeof t)throw new It(i);return Ni((function(){t.apply(o,n)}),e)}function ur(t,e,n,r){var o=-1,i=Se,s=!0,a=t.length,l=[],u=e.length;if(!a)return l;n&&(e=Pe(e,ze(n))),r?(i=Le,s=!1):e.length>=200&&(i=Qe,s=!1,e=new Yn(e));t:for(;++o<a;){var c=t[o],f=null==n?c:n(c);if(c=r||0!==c?c:0,s&&f==f){for(var h=u;h--;)if(e[h]===f)continue t;l.push(c)}else i(e,f,r)||l.push(c)}return l}Hn.templateSettings={escape:z,evaluate:J,interpolate:Q,variable:"",imports:{_:Hn}},Hn.prototype=kn.prototype,Hn.prototype.constructor=Hn,Gn.prototype=Fn(kn.prototype),Gn.prototype.constructor=Gn,Un.prototype=Fn(kn.prototype),Un.prototype.constructor=Un,jn.prototype.clear=function(){this.__data__=In?In(null):{},this.size=0},jn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},jn.prototype.get=function(t){var e=this.__data__;if(In){var n=e[t];return n===s?o:n}return Mt.call(e,t)?e[t]:o},jn.prototype.has=function(t){var e=this.__data__;return In?e[t]!==o:Mt.call(e,t)},jn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=In&&e===o?s:e,this},Vn.prototype.clear=function(){this.__data__=[],this.size=0},Vn.prototype.delete=function(t){var e=this.__data__,n=tr(e,t);return!(n<0||(n==e.length-1?e.pop():qt.call(e,n,1),--this.size,0))},Vn.prototype.get=function(t){var e=this.__data__,n=tr(e,t);return n<0?o:e[n][1]},Vn.prototype.has=function(t){return tr(this.__data__,t)>-1},Vn.prototype.set=function(t,e){var n=this.__data__,r=tr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new jn,map:new(En||Vn),string:new jn}},Wn.prototype.delete=function(t){var e=ai(this,t).delete(t);return this.size-=e?1:0,e},Wn.prototype.get=function(t){return ai(this,t).get(t)},Wn.prototype.has=function(t){return ai(this,t).has(t)},Wn.prototype.set=function(t,e){var n=ai(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Yn.prototype.add=Yn.prototype.push=function(t){return this.__data__.set(t,s),this},Yn.prototype.has=function(t){return this.__data__.has(t)},qn.prototype.clear=function(){this.__data__=new Vn,this.size=0},qn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},qn.prototype.get=function(t){return this.__data__.get(t)},qn.prototype.has=function(t){return this.__data__.has(t)},qn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Vn){var r=n.__data__;if(!En||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(t,e),this.size=n.size,this};var cr=Po(vr),fr=Po(br,!0);function hr(t,e){var n=!0;return cr(t,(function(t,r,o){return n=!!e(t,r,o)})),n}function dr(t,e,n){for(var r=-1,i=t.length;++r<i;){var s=t[r],a=e(s);if(null!=a&&(l===o?a==a&&!aa(a):n(a,l)))var l=a,u=s}return u}function pr(t,e){var n=[];return cr(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function gr(t,e,n,r,o){var i=-1,s=t.length;for(n||(n=gi),o||(o=[]);++i<s;){var a=t[i];e>0&&n(a)?e>1?gr(a,e-1,n,r,o):Oe(o,a):r||(o[o.length]=a)}return o}var mr=Oo(),yr=Oo(!0);function vr(t,e){return t&&mr(t,e,La)}function br(t,e){return t&&yr(t,e,La)}function Cr(t,e){return Ne(e,(function(e){return Js(t[e])}))}function Ar(t,e){for(var n=0,r=(e=yo(e,t)).length;null!=t&&n<r;)t=t[Di(e[n++])];return n&&n==r?t:o}function wr(t,e,n){var r=e(t);return js(t)?r:Oe(r,n(t))}function Er(t){return null==t?t===o?"[object Undefined]":"[object Null]":Xt&&Xt in _t(t)?function(t){var e=Mt.call(t,Xt),n=t[Xt];try{t[Xt]=o;var r=!0}catch(t){}var i=Dt.call(t);return r&&(e?t[Xt]=n:delete t[Xt]),i}(t):function(t){return Dt.call(t)}(t)}function _r(t,e){return t>e}function xr(t,e){return null!=t&&Mt.call(t,e)}function Tr(t,e){return null!=t&&e in _t(t)}function Ir(t,e,n){for(var i=n?Le:Se,s=t[0].length,a=t.length,l=a,u=r(a),c=1/0,f=[];l--;){var h=t[l];l&&e&&(h=Pe(h,ze(e))),c=yn(h.length,c),u[l]=!n&&(e||s>=120&&h.length>=120)?new Yn(l&&h):o}h=t[0];var d=-1,p=u[0];t:for(;++d<s&&f.length<c;){var g=h[d],m=e?e(g):g;if(g=n||0!==g?g:0,!(p?Qe(p,m):i(f,m,n))){for(l=a;--l;){var y=u[l];if(!(y?Qe(y,m):i(t[l],m,n)))continue t}p&&p.push(m),f.push(g)}}return f}function Nr(t,e,n){var r=null==(t=xi(t,e=yo(e,t)))?t:t[Di(zi(e))];return null==r?o:Ee(r,t,n)}function Sr(t){return ta(t)&&Er(t)==g}function Lr(t,e,n,r,i){return t===e||(null==t||null==e||!ta(t)&&!ta(e)?t!=t&&e!=e:function(t,e,n,r,i,s){var a=js(t),l=js(e),u=a?m:hi(t),c=l?m:hi(e),f=(u=u==g?_:u)==_,h=(c=c==g?_:c)==_,d=u==c;if(d&&qs(t)){if(!qs(e))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new qn),a||la(t)?Zo(t,e,n,r,i,s):function(t,e,n,r,o,i,s){switch(n){case O:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case P:return!(t.byteLength!=e.byteLength||!i(new Ut(t),new Ut(e)));case y:case v:case E:return Fs(+t,+e);case b:return t.name==e.name&&t.message==e.message;case T:case N:return t==e+"";case w:var a=on;case I:var l=1&r;if(a||(a=ln),t.size!=e.size&&!l)return!1;var u=s.get(t);if(u)return u==e;r|=2,s.set(t,e);var c=Zo(a(t),a(e),r,o,i,s);return s.delete(t),c;case S:if(Dn)return Dn.call(t)==Dn.call(e)}return!1}(t,e,u,n,r,i,s);if(!(1&n)){var p=f&&Mt.call(t,"__wrapped__"),C=h&&Mt.call(e,"__wrapped__");if(p||C){var A=p?t.value():t,x=C?e.value():e;return s||(s=new qn),i(A,x,n,r,s)}}return!!d&&(s||(s=new qn),function(t,e,n,r,i,s){var a=1&n,l=ei(t),u=l.length;if(u!=ei(e).length&&!a)return!1;for(var c=u;c--;){var f=l[c];if(!(a?f in e:Mt.call(e,f)))return!1}var h=s.get(t),d=s.get(e);if(h&&d)return h==e&&d==t;var p=!0;s.set(t,e),s.set(e,t);for(var g=a;++c<u;){var m=t[f=l[c]],y=e[f];if(r)var v=a?r(y,m,f,e,t,s):r(m,y,f,t,e,s);if(!(v===o?m===y||i(m,y,n,r,s):v)){p=!1;break}g||(g="constructor"==f)}if(p&&!g){var b=t.constructor,C=e.constructor;b==C||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof C&&C instanceof C||(p=!1)}return s.delete(t),s.delete(e),p}(t,e,n,r,i,s))}(t,e,n,r,Lr,i))}function Pr(t,e,n,r){var i=n.length,s=i,a=!r;if(null==t)return!s;for(t=_t(t);i--;){var l=n[i];if(a&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++i<s;){var u=(l=n[i])[0],c=t[u],f=l[1];if(a&&l[2]){if(c===o&&!(u in t))return!1}else{var h=new qn;if(r)var d=r(c,f,u,t,e,h);if(!(d===o?Lr(f,c,3,r,h):d))return!1}}return!0}function Or(t){return!(!Zs(t)||(e=t,$t&&$t in e))&&(Js(t)?Ft:gt).test(Bi(t));var e}function Mr(t){return"function"==typeof t?t:null==t?nl:"object"==typeof t?js(t)?Hr(t[0],t[1]):Br(t):fl(t)}function Rr(t){if(!Ai(t))return gn(t);var e=[];for(var n in _t(t))Mt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function $r(t,e){return t<e}function Dr(t,e){var n=-1,o=Ws(t)?r(t.length):[];return cr(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}function Br(t){var e=li(t);return 1==e.length&&e[0][2]?Ei(e[0][0],e[0][1]):function(n){return n===t||Pr(n,t,e)}}function Hr(t,e){return vi(t)&&wi(e)?Ei(Di(t),e):function(n){var r=xa(n,t);return r===o&&r===e?Ta(n,t):Lr(e,r,3)}}function Fr(t,e,n,r,i){t!==e&&mr(e,(function(s,a){if(i||(i=new qn),Zs(s))!function(t,e,n,r,i,s,a){var l=Ti(t,n),u=Ti(e,n),c=a.get(u);if(c)Xn(t,n,c);else{var f=s?s(l,u,n+"",t,e,a):o,h=f===o;if(h){var d=js(u),p=!d&&qs(u),g=!d&&!p&&la(u);f=u,d||p||g?js(l)?f=l:Ys(l)?f=Io(l):p?(h=!1,f=Ao(u,!0)):g?(h=!1,f=Eo(u,!0)):f=[]:ra(u)||Us(u)?(f=l,Us(l)?f=ma(l):Zs(l)&&!Js(l)||(f=pi(u))):h=!1}h&&(a.set(u,f),i(f,u,r,s,a),a.delete(u)),Xn(t,n,f)}}(t,e,a,n,Fr,r,i);else{var l=r?r(Ti(t,a),s,a+"",t,e,i):o;l===o&&(l=s),Xn(t,a,l)}}),Pa)}function kr(t,e){var n=t.length;if(n)return mi(e+=e<0?n:0,n)?t[e]:o}function Gr(t,e,n){e=e.length?Pe(e,(function(t){return js(t)?function(e){return Ar(e,1===t.length?t[0]:t)}:t})):[nl];var r=-1;e=Pe(e,ze(si()));var o=Dr(t,(function(t,n,o){var i=Pe(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t){var e=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,s=o.length,a=n.length;++r<s;){var l=_o(o[r],i[r]);if(l)return r>=a?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}));e--;)t[e]=t[e].value;return t}(o)}function Ur(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var s=e[r],a=Ar(t,s);n(a,s)&&Jr(i,yo(s,t),a)}return i}function jr(t,e,n,r){var o=r?ke:Fe,i=-1,s=e.length,a=t;for(t===e&&(e=Io(e)),n&&(a=Pe(t,ze(n)));++i<s;)for(var l=0,u=e[i],c=n?n(u):u;(l=o(a,c,l,r))>-1;)a!==t&&qt.call(a,l,1),qt.call(t,l,1);return t}function Vr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;mi(o)?qt.call(t,o,1):lo(t,o)}}return t}function Wr(t,e){return t+de(Cn()*(e-t+1))}function Yr(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=de(e/2))&&(t+=t)}while(e);return n}function qr(t,e){return Si(_i(t,e,nl),t+"")}function Kr(t){return zn(Fa(t))}function zr(t,e){var n=Fa(t);return Oi(n,ir(e,0,n.length))}function Jr(t,e,n,r){if(!Zs(t))return t;for(var i=-1,s=(e=yo(e,t)).length,a=s-1,l=t;null!=l&&++i<s;){var u=Di(e[i]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(i!=a){var f=l[u];(c=r?r(f,u,l):o)===o&&(c=Zs(f)?f:mi(e[i+1])?[]:{})}Zn(l,u,c),l=l[u]}return t}var Qr=Nn?function(t,e){return Nn.set(t,e),t}:nl,Xr=te?function(t,e){return te(t,"toString",{configurable:!0,enumerable:!1,value:Za(e),writable:!0})}:nl;function Zr(t){return Oi(Fa(t))}function to(t,e,n){var o=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=r(i);++o<i;)s[o]=t[o+e];return s}function eo(t,e){var n;return cr(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}function no(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,s=t[i];null!==s&&!aa(s)&&(n?s<=e:s<e)?r=i+1:o=i}return o}return ro(t,e,nl,n)}function ro(t,e,n,r){var i=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(e=n(e))!=e,l=null===e,u=aa(e),c=e===o;i<s;){var f=de((i+s)/2),h=n(t[f]),d=h!==o,p=null===h,g=h==h,m=aa(h);if(a)var y=r||g;else y=c?g&&(r||d):l?g&&d&&(r||!p):u?g&&d&&!p&&(r||!m):!p&&!m&&(r?h<=e:h<e);y?i=f+1:s=f}return yn(s,4294967294)}function oo(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var s=t[n],a=e?e(s):s;if(!n||!Fs(a,l)){var l=a;i[o++]=0===s?0:s}}return i}function io(t){return"number"==typeof t?t:aa(t)?h:+t}function so(t){if("string"==typeof t)return t;if(js(t))return Pe(t,so)+"";if(aa(t))return Bn?Bn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ao(t,e,n){var r=-1,o=Se,i=t.length,s=!0,a=[],l=a;if(n)s=!1,o=Le;else if(i>=200){var u=e?null:qo(t);if(u)return ln(u);s=!1,o=Qe,l=new Yn}else l=e?[]:a;t:for(;++r<i;){var c=t[r],f=e?e(c):c;if(c=n||0!==c?c:0,s&&f==f){for(var h=l.length;h--;)if(l[h]===f)continue t;e&&l.push(f),a.push(c)}else o(l,f,n)||(l!==a&&l.push(f),a.push(c))}return a}function lo(t,e){return null==(t=xi(t,e=yo(e,t)))||delete t[Di(zi(e))]}function uo(t,e,n,r){return Jr(t,e,n(Ar(t,e)),r)}function co(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?to(t,r?0:i,r?i+1:o):to(t,r?i+1:0,r?o:i)}function fo(t,e){var n=t;return n instanceof Un&&(n=n.value()),Me(e,(function(t,e){return e.func.apply(e.thisArg,Oe([t],e.args))}),n)}function ho(t,e,n){var o=t.length;if(o<2)return o?ao(t[0]):[];for(var i=-1,s=r(o);++i<o;)for(var a=t[i],l=-1;++l<o;)l!=i&&(s[i]=ur(s[i]||a,t[l],e,n));return ao(gr(s,1),e,n)}function po(t,e,n){for(var r=-1,i=t.length,s=e.length,a={};++r<i;){var l=r<s?e[r]:o;n(a,t[r],l)}return a}function go(t){return Ys(t)?t:[]}function mo(t){return"function"==typeof t?t:nl}function yo(t,e){return js(t)?t:vi(t,e)?[t]:$i(ya(t))}var vo=qr;function bo(t,e,n){var r=t.length;return n=n===o?r:n,!e&&n>=r?t:to(t,e,n)}var Co=se||function(t){return fe.clearTimeout(t)};function Ao(t,e){if(e)return t.slice();var n=t.length,r=jt?jt(n):new t.constructor(n);return t.copy(r),r}function wo(t){var e=new t.constructor(t.byteLength);return new Ut(e).set(new Ut(t)),e}function Eo(t,e){var n=e?wo(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function _o(t,e){if(t!==e){var n=t!==o,r=null===t,i=t==t,s=aa(t),a=e!==o,l=null===e,u=e==e,c=aa(e);if(!l&&!c&&!s&&t>e||s&&a&&u&&!l&&!c||r&&a&&u||!n&&u||!i)return 1;if(!r&&!s&&!c&&t<e||c&&n&&i&&!r&&!s||l&&n&&i||!a&&i||!u)return-1}return 0}function xo(t,e,n,o){for(var i=-1,s=t.length,a=n.length,l=-1,u=e.length,c=mn(s-a,0),f=r(u+c),h=!o;++l<u;)f[l]=e[l];for(;++i<a;)(h||i<s)&&(f[n[i]]=t[i]);for(;c--;)f[l++]=t[i++];return f}function To(t,e,n,o){for(var i=-1,s=t.length,a=-1,l=n.length,u=-1,c=e.length,f=mn(s-l,0),h=r(f+c),d=!o;++i<f;)h[i]=t[i];for(var p=i;++u<c;)h[p+u]=e[u];for(;++a<l;)(d||i<s)&&(h[p+n[a]]=t[i++]);return h}function Io(t,e){var n=-1,o=t.length;for(e||(e=r(o));++n<o;)e[n]=t[n];return e}function No(t,e,n,r){var i=!n;n||(n={});for(var s=-1,a=e.length;++s<a;){var l=e[s],u=r?r(n[l],t[l],l,n,t):o;u===o&&(u=t[l]),i?rr(n,l,u):Zn(n,l,u)}return n}function So(t,e){return function(n,r){var o=js(n)?_e:er,i=e?e():{};return o(n,t,si(r,2),i)}}function Lo(t){return qr((function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:o,a=i>2?n[2]:o;for(s=t.length>3&&"function"==typeof s?(i--,s):o,a&&yi(n[0],n[1],a)&&(s=i<3?o:s,i=1),e=_t(e);++r<i;){var l=n[r];l&&t(e,l,r,s)}return e}))}function Po(t,e){return function(n,r){if(null==n)return n;if(!Ws(n))return t(n,r);for(var o=n.length,i=e?o:-1,s=_t(n);(e?i--:++i<o)&&!1!==r(s[i],i,s););return n}}function Oo(t){return function(e,n,r){for(var o=-1,i=_t(e),s=r(e),a=s.length;a--;){var l=s[t?a:++o];if(!1===n(i[l],l,i))break}return e}}function Mo(t){return function(e){var n=rn(e=ya(e))?fn(e):o,r=n?n[0]:e.charAt(0),i=n?bo(n,1).join(""):e.slice(1);return r[t]()+i}}function Ro(t){return function(e){return Me(Ja(Ua(e).replace(Jt,"")),t,"")}}function $o(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Fn(t.prototype),r=t.apply(n,e);return Zs(r)?r:n}}function Do(t){return function(e,n,r){var i=_t(e);if(!Ws(e)){var s=si(n,3);e=La(e),n=function(t){return s(i[t],t,i)}}var a=t(e,n,r);return a>-1?i[s?e[a]:a]:o}}function Bo(t){return ti((function(e){var n=e.length,r=n,s=Gn.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new It(i);if(s&&!l&&"wrapper"==oi(a))var l=new Gn([],!0)}for(r=l?r:n;++r<n;){var u=oi(a=e[r]),c="wrapper"==u?ri(a):o;l=c&&bi(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[oi(c[0])].apply(l,c[3]):1==a.length&&bi(a)?l[u]():l.thru(a)}return function(){var t=arguments,r=t[0];if(l&&1==t.length&&js(r))return l.plant(r).value();for(var o=0,i=n?e[o].apply(this,t):r;++o<n;)i=e[o].call(this,i);return i}}))}function Ho(t,e,n,i,s,a,l,c,f,h){var d=e&u,p=1&e,g=2&e,m=24&e,y=512&e,v=g?o:$o(t);return function u(){for(var b=arguments.length,C=r(b),A=b;A--;)C[A]=arguments[A];if(m)var w=ii(u),E=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(C,w);if(i&&(C=xo(C,i,s,m)),a&&(C=To(C,a,l,m)),b-=E,m&&b<h){var _=an(C,w);return Wo(t,e,Ho,u.placeholder,n,C,_,c,f,h-b)}var x=p?n:this,T=g?x[t]:t;return b=C.length,c?C=function(t,e){for(var n=t.length,r=yn(e.length,n),i=Io(t);r--;){var s=e[r];t[r]=mi(s,n)?i[s]:o}return t}(C,c):y&&b>1&&C.reverse(),d&&f<b&&(C.length=f),this&&this!==fe&&this instanceof u&&(T=v||$o(T)),T.apply(x,C)}}function Fo(t,e){return function(n,r){return function(t,e,n,r){return vr(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}function ko(t,e){return function(n,r){var i;if(n===o&&r===o)return e;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=so(n),r=so(r)):(n=io(n),r=io(r)),i=t(n,r)}return i}}function Go(t){return ti((function(e){return e=Pe(e,ze(si())),qr((function(n){var r=this;return t(e,(function(t){return Ee(t,r,n)}))}))}))}function Uo(t,e){var n=(e=e===o?" ":so(e)).length;if(n<2)return n?Yr(e,t):e;var r=Yr(e,he(t/cn(e)));return rn(e)?bo(fn(r),0,t).join(""):r.slice(0,t)}function jo(t){return function(e,n,i){return i&&"number"!=typeof i&&yi(e,n,i)&&(n=i=o),e=ha(e),n===o?(n=e,e=0):n=ha(n),function(t,e,n,o){for(var i=-1,s=mn(he((e-t)/(n||1)),0),a=r(s);s--;)a[o?s:++i]=t,t+=n;return a}(e,n,i=i===o?e<n?1:-1:ha(i),t)}}function Vo(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ga(e),n=ga(n)),t(e,n)}}function Wo(t,e,n,r,i,s,a,u,c,f){var h=8&e;e|=h?l:64,4&(e&=~(h?64:l))||(e&=-4);var d=[t,e,i,h?s:o,h?a:o,h?o:s,h?o:a,u,c,f],p=n.apply(o,d);return bi(t)&&Ii(p,d),p.placeholder=r,Li(p,t,e)}function Yo(t){var e=Et[t];return function(t,n){if(t=ga(t),(n=null==n?0:yn(da(n),292))&&De(t)){var r=(ya(t)+"e").split("e");return+((r=(ya(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var qo=xn&&1/ln(new xn([,-0]))[1]==c?function(t){return new xn(t)}:al;function Ko(t){return function(e){var n=hi(e);return n==w?on(e):n==I?un(e):function(t,e){return Pe(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function zo(t,e,n,s,c,f,h,d){var p=2&e;if(!p&&"function"!=typeof t)throw new It(i);var g=s?s.length:0;if(g||(e&=-97,s=c=o),h=h===o?h:mn(da(h),0),d=d===o?d:da(d),g-=c?c.length:0,64&e){var m=s,y=c;s=c=o}var v=p?o:ri(t),b=[t,e,n,s,c,m,y,f,h,d];if(v&&function(t,e){var n=t[1],r=e[1],o=n|r,i=o<131,s=r==u&&8==n||r==u&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!i&&!s)return t;1&r&&(t[2]=e[2],o|=1&n?0:4);var l=e[3];if(l){var c=t[3];t[3]=c?xo(c,l,e[4]):l,t[4]=c?an(t[3],a):e[4]}(l=e[5])&&(c=t[5],t[5]=c?To(c,l,e[6]):l,t[6]=c?an(t[5],a):e[6]),(l=e[7])&&(t[7]=l),r&u&&(t[8]=null==t[8]?e[8]:yn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(b,v),t=b[0],e=b[1],n=b[2],s=b[3],c=b[4],!(d=b[9]=b[9]===o?p?0:t.length:mn(b[9]-g,0))&&24&e&&(e&=-25),e&&1!=e)C=8==e||16==e?function(t,e,n){var i=$o(t);return function s(){for(var a=arguments.length,l=r(a),u=a,c=ii(s);u--;)l[u]=arguments[u];var f=a<3&&l[0]!==c&&l[a-1]!==c?[]:an(l,c);return(a-=f.length)<n?Wo(t,e,Ho,s.placeholder,o,l,f,o,o,n-a):Ee(this&&this!==fe&&this instanceof s?i:t,this,l)}}(t,e,d):e!=l&&33!=e||c.length?Ho.apply(o,b):function(t,e,n,o){var i=1&e,s=$o(t);return function e(){for(var a=-1,l=arguments.length,u=-1,c=o.length,f=r(c+l),h=this&&this!==fe&&this instanceof e?s:t;++u<c;)f[u]=o[u];for(;l--;)f[u++]=arguments[++a];return Ee(h,i?n:this,f)}}(t,e,n,s);else var C=function(t,e,n){var r=1&e,o=$o(t);return function e(){return(this&&this!==fe&&this instanceof e?o:t).apply(r?n:this,arguments)}}(t,e,n);return Li((v?Qr:Ii)(C,b),t,e)}function Jo(t,e,n,r){return t===o||Fs(t,Lt[n])&&!Mt.call(r,n)?e:t}function Qo(t,e,n,r,i,s){return Zs(t)&&Zs(e)&&(s.set(e,t),Fr(t,e,o,Qo,s),s.delete(e)),t}function Xo(t){return ra(t)?o:t}function Zo(t,e,n,r,i,s){var a=1&n,l=t.length,u=e.length;if(l!=u&&!(a&&u>l))return!1;var c=s.get(t),f=s.get(e);if(c&&f)return c==e&&f==t;var h=-1,d=!0,p=2&n?new Yn:o;for(s.set(t,e),s.set(e,t);++h<l;){var g=t[h],m=e[h];if(r)var y=a?r(m,g,h,e,t,s):r(g,m,h,t,e,s);if(y!==o){if(y)continue;d=!1;break}if(p){if(!$e(e,(function(t,e){if(!Qe(p,e)&&(g===t||i(g,t,n,r,s)))return p.push(e)}))){d=!1;break}}else if(g!==m&&!i(g,m,n,r,s)){d=!1;break}}return s.delete(t),s.delete(e),d}function ti(t){return Si(_i(t,o,Vi),t+"")}function ei(t){return wr(t,La,ci)}function ni(t){return wr(t,Pa,fi)}var ri=Nn?function(t){return Nn.get(t)}:al;function oi(t){for(var e=t.name+"",n=Sn[e],r=Mt.call(Sn,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function ii(t){return(Mt.call(Hn,"placeholder")?Hn:t).placeholder}function si(){var t=Hn.iteratee||rl;return t=t===rl?Mr:t,arguments.length?t(arguments[0],arguments[1]):t}function ai(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function li(t){for(var e=La(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,wi(o)]}return e}function ui(t,e){var n=function(t,e){return null==t?o:t[e]}(t,e);return Or(n)?n:o}var ci=ge?function(t){return null==t?[]:(t=_t(t),Ne(ge(t),(function(e){return Yt.call(t,e)})))}:pl,fi=ge?function(t){for(var e=[];t;)Oe(e,ci(t)),t=Vt(t);return e}:pl,hi=Er;function di(t,e,n){for(var r=-1,o=(e=yo(e,t)).length,i=!1;++r<o;){var s=Di(e[r]);if(!(i=null!=t&&n(t,s)))break;t=t[s]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&Xs(o)&&mi(s,o)&&(js(t)||Us(t))}function pi(t){return"function"!=typeof t.constructor||Ai(t)?{}:Fn(Vt(t))}function gi(t){return js(t)||Us(t)||!!(Kt&&t&&t[Kt])}function mi(t,e){var n=typeof t;return!!(e=null==e?f:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e}function yi(t,e,n){if(!Zs(n))return!1;var r=typeof e;return!!("number"==r?Ws(n)&&mi(e,n.length):"string"==r&&e in n)&&Fs(n[e],t)}function vi(t,e){if(js(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!aa(t))||Z.test(t)||!X.test(t)||null!=e&&t in _t(e)}function bi(t){var e=oi(t),n=Hn[e];if("function"!=typeof n||!(e in Un.prototype))return!1;if(t===n)return!0;var r=ri(n);return!!r&&t===r[0]}(wn&&hi(new wn(new ArrayBuffer(1)))!=O||En&&hi(new En)!=w||_n&&hi(_n.resolve())!=x||xn&&hi(new xn)!=I||Tn&&hi(new Tn)!=L)&&(hi=function(t){var e=Er(t),n=e==_?t.constructor:o,r=n?Bi(n):"";if(r)switch(r){case Ln:return O;case Pn:return w;case On:return x;case Mn:return I;case Rn:return L}return e});var Ci=Pt?Js:gl;function Ai(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Lt)}function wi(t){return t==t&&!Zs(t)}function Ei(t,e){return function(n){return null!=n&&n[t]===e&&(e!==o||t in _t(n))}}function _i(t,e,n){return e=mn(e===o?t.length-1:e,0),function(){for(var o=arguments,i=-1,s=mn(o.length-e,0),a=r(s);++i<s;)a[i]=o[e+i];i=-1;for(var l=r(e+1);++i<e;)l[i]=o[i];return l[e]=n(a),Ee(t,this,l)}}function xi(t,e){return e.length<2?t:Ar(t,to(e,0,-1))}function Ti(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ii=Pi(Qr),Ni=ce||function(t,e){return fe.setTimeout(t,e)},Si=Pi(Xr);function Li(t,e,n){var r=e+"";return Si(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return xe(p,(function(n){var r="_."+n[0];e&n[1]&&!Se(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(at):[]}(r),n)))}function Pi(t){var e=0,n=0;return function(){var r=vn(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(o,arguments)}}function Oi(t,e){var n=-1,r=t.length,i=r-1;for(e=e===o?r:e;++n<e;){var s=Wr(n,i),a=t[s];t[s]=t[n],t[n]=a}return t.length=e,t}var Mi,Ri,$i=(Mi=Ms((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,o){e.push(r?o.replace(ct,"$1"):n||t)})),e}),(function(t){return 500===Ri.size&&Ri.clear(),t})),Ri=Mi.cache,Mi);function Di(t){if("string"==typeof t||aa(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Bi(t){if(null!=t){try{return Ot.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Hi(t){if(t instanceof Un)return t.clone();var e=new Gn(t.__wrapped__,t.__chain__);return e.__actions__=Io(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Fi=qr((function(t,e){return Ys(t)?ur(t,gr(e,1,Ys,!0)):[]})),ki=qr((function(t,e){var n=zi(e);return Ys(n)&&(n=o),Ys(t)?ur(t,gr(e,1,Ys,!0),si(n,2)):[]})),Gi=qr((function(t,e){var n=zi(e);return Ys(n)&&(n=o),Ys(t)?ur(t,gr(e,1,Ys,!0),o,n):[]}));function Ui(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:da(n);return o<0&&(o=mn(r+o,0)),He(t,si(e,3),o)}function ji(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return n!==o&&(i=da(n),i=n<0?mn(r+i,0):yn(i,r-1)),He(t,si(e,3),i,!0)}function Vi(t){return null!=t&&t.length?gr(t,1):[]}function Wi(t){return t&&t.length?t[0]:o}var Yi=qr((function(t){var e=Pe(t,go);return e.length&&e[0]===t[0]?Ir(e):[]})),qi=qr((function(t){var e=zi(t),n=Pe(t,go);return e===zi(n)?e=o:n.pop(),n.length&&n[0]===t[0]?Ir(n,si(e,2)):[]})),Ki=qr((function(t){var e=zi(t),n=Pe(t,go);return(e="function"==typeof e?e:o)&&n.pop(),n.length&&n[0]===t[0]?Ir(n,o,e):[]}));function zi(t){var e=null==t?0:t.length;return e?t[e-1]:o}var Ji=qr(Qi);function Qi(t,e){return t&&t.length&&e&&e.length?jr(t,e):t}var Xi=ti((function(t,e){var n=null==t?0:t.length,r=or(t,e);return Vr(t,Pe(e,(function(t){return mi(t,n)?+t:t})).sort(_o)),r}));function Zi(t){return null==t?t:An.call(t)}var ts=qr((function(t){return ao(gr(t,1,Ys,!0))})),es=qr((function(t){var e=zi(t);return Ys(e)&&(e=o),ao(gr(t,1,Ys,!0),si(e,2))})),ns=qr((function(t){var e=zi(t);return e="function"==typeof e?e:o,ao(gr(t,1,Ys,!0),o,e)}));function rs(t){if(!t||!t.length)return[];var e=0;return t=Ne(t,(function(t){if(Ys(t))return e=mn(t.length,e),!0})),qe(e,(function(e){return Pe(t,je(e))}))}function os(t,e){if(!t||!t.length)return[];var n=rs(t);return null==e?n:Pe(n,(function(t){return Ee(e,o,t)}))}var is=qr((function(t,e){return Ys(t)?ur(t,e):[]})),ss=qr((function(t){return ho(Ne(t,Ys))})),as=qr((function(t){var e=zi(t);return Ys(e)&&(e=o),ho(Ne(t,Ys),si(e,2))})),ls=qr((function(t){var e=zi(t);return e="function"==typeof e?e:o,ho(Ne(t,Ys),o,e)})),us=qr(rs),cs=qr((function(t){var e=t.length,n=e>1?t[e-1]:o;return n="function"==typeof n?(t.pop(),n):o,os(t,n)}));function fs(t){var e=Hn(t);return e.__chain__=!0,e}function hs(t,e){return e(t)}var ds=ti((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return or(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Un&&mi(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:hs,args:[i],thisArg:o}),new Gn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(o),t}))):this.thru(i)})),ps=So((function(t,e,n){Mt.call(t,n)?++t[n]:rr(t,n,1)})),gs=Do(Ui),ms=Do(ji);function ys(t,e){return(js(t)?xe:cr)(t,si(e,3))}function vs(t,e){return(js(t)?Te:fr)(t,si(e,3))}var bs=So((function(t,e,n){Mt.call(t,n)?t[n].push(e):rr(t,n,[e])})),Cs=qr((function(t,e,n){var o=-1,i="function"==typeof e,s=Ws(t)?r(t.length):[];return cr(t,(function(t){s[++o]=i?Ee(e,t,n):Nr(t,e,n)})),s})),As=So((function(t,e,n){rr(t,n,e)}));function ws(t,e){return(js(t)?Pe:Dr)(t,si(e,3))}var Es=So((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),_s=qr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&yi(t,e[0],e[1])?e=[]:n>2&&yi(e[0],e[1],e[2])&&(e=[e[0]]),Gr(t,gr(e,1),[])})),xs=ue||function(){return fe.Date.now()};function Ts(t,e,n){return e=n?o:e,e=t&&null==e?t.length:e,zo(t,u,o,o,o,o,e)}function Is(t,e){var n;if("function"!=typeof e)throw new It(i);return t=da(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=o),n}}var Ns=qr((function(t,e,n){var r=1;if(n.length){var o=an(n,ii(Ns));r|=l}return zo(t,r,e,n,o)})),Ss=qr((function(t,e,n){var r=3;if(n.length){var o=an(n,ii(Ss));r|=l}return zo(e,r,t,n,o)}));function Ls(t,e,n){var r,s,a,l,u,c,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new It(i);function g(e){var n=r,i=s;return r=s=o,f=e,l=t.apply(i,n)}function m(t){var n=t-c;return c===o||n>=e||n<0||d&&t-f>=a}function y(){var t=xs();if(m(t))return v(t);u=Ni(y,function(t){var n=e-(t-c);return d?yn(n,a-(t-f)):n}(t))}function v(t){return u=o,p&&r?g(t):(r=s=o,l)}function b(){var t=xs(),n=m(t);if(r=arguments,s=this,c=t,n){if(u===o)return function(t){return f=t,u=Ni(y,e),h?g(t):l}(c);if(d)return Co(u),u=Ni(y,e),g(c)}return u===o&&(u=Ni(y,e)),l}return e=ga(e)||0,Zs(n)&&(h=!!n.leading,a=(d="maxWait"in n)?mn(ga(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),b.cancel=function(){u!==o&&Co(u),f=0,r=c=s=u=o},b.flush=function(){return u===o?l:v(xs())},b}var Ps=qr((function(t,e){return lr(t,1,e)})),Os=qr((function(t,e,n){return lr(t,ga(e)||0,n)}));function Ms(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new It(i);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Ms.Cache||Wn),n}function Rs(t){if("function"!=typeof t)throw new It(i);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ms.Cache=Wn;var $s=vo((function(t,e){var n=(e=1==e.length&&js(e[0])?Pe(e[0],ze(si())):Pe(gr(e,1),ze(si()))).length;return qr((function(r){for(var o=-1,i=yn(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return Ee(t,this,r)}))})),Ds=qr((function(t,e){var n=an(e,ii(Ds));return zo(t,l,o,e,n)})),Bs=qr((function(t,e){var n=an(e,ii(Bs));return zo(t,64,o,e,n)})),Hs=ti((function(t,e){return zo(t,256,o,o,o,e)}));function Fs(t,e){return t===e||t!=t&&e!=e}var ks=Vo(_r),Gs=Vo((function(t,e){return t>=e})),Us=Sr(function(){return arguments}())?Sr:function(t){return ta(t)&&Mt.call(t,"callee")&&!Yt.call(t,"callee")},js=r.isArray,Vs=ye?ze(ye):function(t){return ta(t)&&Er(t)==P};function Ws(t){return null!=t&&Xs(t.length)&&!Js(t)}function Ys(t){return ta(t)&&Ws(t)}var qs=me||gl,Ks=ve?ze(ve):function(t){return ta(t)&&Er(t)==v};function zs(t){if(!ta(t))return!1;var e=Er(t);return e==b||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ra(t)}function Js(t){if(!Zs(t))return!1;var e=Er(t);return e==C||e==A||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Qs(t){return"number"==typeof t&&t==da(t)}function Xs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function Zs(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ta(t){return null!=t&&"object"==typeof t}var ea=be?ze(be):function(t){return ta(t)&&hi(t)==w};function na(t){return"number"==typeof t||ta(t)&&Er(t)==E}function ra(t){if(!ta(t)||Er(t)!=_)return!1;var e=Vt(t);if(null===e)return!0;var n=Mt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ot.call(n)==Bt}var oa=Ce?ze(Ce):function(t){return ta(t)&&Er(t)==T},ia=Ae?ze(Ae):function(t){return ta(t)&&hi(t)==I};function sa(t){return"string"==typeof t||!js(t)&&ta(t)&&Er(t)==N}function aa(t){return"symbol"==typeof t||ta(t)&&Er(t)==S}var la=we?ze(we):function(t){return ta(t)&&Xs(t.length)&&!!oe[Er(t)]},ua=Vo($r),ca=Vo((function(t,e){return t<=e}));function fa(t){if(!t)return[];if(Ws(t))return sa(t)?fn(t):Io(t);if(zt&&t[zt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[zt]());var e=hi(t);return(e==w?on:e==I?ln:Fa)(t)}function ha(t){return t?(t=ga(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function da(t){var e=ha(t),n=e%1;return e==e?n?e-n:e:0}function pa(t){return t?ir(da(t),0,d):0}function ga(t){if("number"==typeof t)return t;if(aa(t))return h;if(Zs(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Zs(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ke(t);var n=pt.test(t);return n||mt.test(t)?le(t.slice(2),n?2:8):dt.test(t)?h:+t}function ma(t){return No(t,Pa(t))}function ya(t){return null==t?"":so(t)}var va=Lo((function(t,e){if(Ai(e)||Ws(e))No(e,La(e),t);else for(var n in e)Mt.call(e,n)&&Zn(t,n,e[n])})),ba=Lo((function(t,e){No(e,Pa(e),t)})),Ca=Lo((function(t,e,n,r){No(e,Pa(e),t,r)})),Aa=Lo((function(t,e,n,r){No(e,La(e),t,r)})),wa=ti(or),Ea=qr((function(t,e){t=_t(t);var n=-1,r=e.length,i=r>2?e[2]:o;for(i&&yi(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],a=Pa(s),l=-1,u=a.length;++l<u;){var c=a[l],f=t[c];(f===o||Fs(f,Lt[c])&&!Mt.call(t,c))&&(t[c]=s[c])}return t})),_a=qr((function(t){return t.push(o,Qo),Ee(Ma,o,t)}));function xa(t,e,n){var r=null==t?o:Ar(t,e);return r===o?n:r}function Ta(t,e){return null!=t&&di(t,e,Tr)}var Ia=Fo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Dt.call(e)),t[e]=n}),Za(nl)),Na=Fo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Dt.call(e)),Mt.call(t,e)?t[e].push(n):t[e]=[n]}),si),Sa=qr(Nr);function La(t){return Ws(t)?Kn(t):Rr(t)}function Pa(t){return Ws(t)?Kn(t,!0):function(t){if(!Zs(t))return function(t){var e=[];if(null!=t)for(var n in _t(t))e.push(n);return e}(t);var e=Ai(t),n=[];for(var r in t)("constructor"!=r||!e&&Mt.call(t,r))&&n.push(r);return n}(t)}var Oa=Lo((function(t,e,n){Fr(t,e,n)})),Ma=Lo((function(t,e,n,r){Fr(t,e,n,r)})),Ra=ti((function(t,e){var n={};if(null==t)return n;var r=!1;e=Pe(e,(function(e){return e=yo(e,t),r||(r=e.length>1),e})),No(t,ni(t),n),r&&(n=sr(n,7,Xo));for(var o=e.length;o--;)lo(n,e[o]);return n})),$a=ti((function(t,e){return null==t?{}:function(t,e){return Ur(t,e,(function(e,n){return Ta(t,n)}))}(t,e)}));function Da(t,e){if(null==t)return{};var n=Pe(ni(t),(function(t){return[t]}));return e=si(e),Ur(t,n,(function(t,n){return e(t,n[0])}))}var Ba=Ko(La),Ha=Ko(Pa);function Fa(t){return null==t?[]:Je(t,La(t))}var ka=Ro((function(t,e,n){return e=e.toLowerCase(),t+(n?Ga(e):e)}));function Ga(t){return za(ya(t).toLowerCase())}function Ua(t){return(t=ya(t))&&t.replace(vt,tn).replace(Qt,"")}var ja=Ro((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Va=Ro((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Wa=Mo("toLowerCase"),Ya=Ro((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),qa=Ro((function(t,e,n){return t+(n?" ":"")+za(e)})),Ka=Ro((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),za=Mo("toUpperCase");function Ja(t,e,n){return t=ya(t),(e=n?o:e)===o?function(t){return ee.test(t)}(t)?function(t){return t.match(Zt)||[]}(t):function(t){return t.match(lt)||[]}(t):t.match(e)||[]}var Qa=qr((function(t,e){try{return Ee(t,o,e)}catch(t){return zs(t)?t:new At(t)}})),Xa=ti((function(t,e){return xe(e,(function(e){e=Di(e),rr(t,e,Ns(t[e],t))})),t}));function Za(t){return function(){return t}}var tl=Bo(),el=Bo(!0);function nl(t){return t}function rl(t){return Mr("function"==typeof t?t:sr(t,1))}var ol=qr((function(t,e){return function(n){return Nr(n,t,e)}})),il=qr((function(t,e){return function(n){return Nr(t,n,e)}}));function sl(t,e,n){var r=La(e),o=Cr(e,r);null!=n||Zs(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=Cr(e,La(e)));var i=!(Zs(n)&&"chain"in n&&!n.chain),s=Js(t);return xe(o,(function(n){var r=e[n];t[n]=r,s&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__);return(n.__actions__=Io(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Oe([this.value()],arguments))})})),t}function al(){}var ll=Go(Pe),ul=Go(Ie),cl=Go($e);function fl(t){return vi(t)?je(Di(t)):function(t){return function(e){return Ar(e,t)}}(t)}var hl=jo(),dl=jo(!0);function pl(){return[]}function gl(){return!1}var ml,yl=ko((function(t,e){return t+e}),0),vl=Yo("ceil"),bl=ko((function(t,e){return t/e}),1),Cl=Yo("floor"),Al=ko((function(t,e){return t*e}),1),wl=Yo("round"),El=ko((function(t,e){return t-e}),0);return Hn.after=function(t,e){if("function"!=typeof e)throw new It(i);return t=da(t),function(){if(--t<1)return e.apply(this,arguments)}},Hn.ary=Ts,Hn.assign=va,Hn.assignIn=ba,Hn.assignInWith=Ca,Hn.assignWith=Aa,Hn.at=wa,Hn.before=Is,Hn.bind=Ns,Hn.bindAll=Xa,Hn.bindKey=Ss,Hn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return js(t)?t:[t]},Hn.chain=fs,Hn.chunk=function(t,e,n){e=(n?yi(t,e,n):e===o)?1:mn(da(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var s=0,a=0,l=r(he(i/e));s<i;)l[a++]=to(t,s,s+=e);return l},Hn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},Hn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],o=t;o--;)e[o-1]=arguments[o];return Oe(js(n)?Io(n):[n],gr(e,1))},Hn.cond=function(t){var e=null==t?0:t.length,n=si();return t=e?Pe(t,(function(t){if("function"!=typeof t[1])throw new It(i);return[n(t[0]),t[1]]})):[],qr((function(n){for(var r=-1;++r<e;){var o=t[r];if(Ee(o[0],this,n))return Ee(o[1],this,n)}}))},Hn.conforms=function(t){return function(t){var e=La(t);return function(n){return ar(n,t,e)}}(sr(t,1))},Hn.constant=Za,Hn.countBy=ps,Hn.create=function(t,e){var n=Fn(t);return null==e?n:nr(n,e)},Hn.curry=function t(e,n,r){var i=zo(e,8,o,o,o,o,o,n=r?o:n);return i.placeholder=t.placeholder,i},Hn.curryRight=function t(e,n,r){var i=zo(e,16,o,o,o,o,o,n=r?o:n);return i.placeholder=t.placeholder,i},Hn.debounce=Ls,Hn.defaults=Ea,Hn.defaultsDeep=_a,Hn.defer=Ps,Hn.delay=Os,Hn.difference=Fi,Hn.differenceBy=ki,Hn.differenceWith=Gi,Hn.drop=function(t,e,n){var r=null==t?0:t.length;return r?to(t,(e=n||e===o?1:da(e))<0?0:e,r):[]},Hn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?to(t,0,(e=r-(e=n||e===o?1:da(e)))<0?0:e):[]},Hn.dropRightWhile=function(t,e){return t&&t.length?co(t,si(e,3),!0,!0):[]},Hn.dropWhile=function(t,e){return t&&t.length?co(t,si(e,3),!0):[]},Hn.fill=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&yi(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=da(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:da(r))<0&&(r+=i),r=n>r?0:pa(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Hn.filter=function(t,e){return(js(t)?Ne:pr)(t,si(e,3))},Hn.flatMap=function(t,e){return gr(ws(t,e),1)},Hn.flatMapDeep=function(t,e){return gr(ws(t,e),c)},Hn.flatMapDepth=function(t,e,n){return n=n===o?1:da(n),gr(ws(t,e),n)},Hn.flatten=Vi,Hn.flattenDeep=function(t){return null!=t&&t.length?gr(t,c):[]},Hn.flattenDepth=function(t,e){return null!=t&&t.length?gr(t,e=e===o?1:da(e)):[]},Hn.flip=function(t){return zo(t,512)},Hn.flow=tl,Hn.flowRight=el,Hn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},Hn.functions=function(t){return null==t?[]:Cr(t,La(t))},Hn.functionsIn=function(t){return null==t?[]:Cr(t,Pa(t))},Hn.groupBy=bs,Hn.initial=function(t){return null!=t&&t.length?to(t,0,-1):[]},Hn.intersection=Yi,Hn.intersectionBy=qi,Hn.intersectionWith=Ki,Hn.invert=Ia,Hn.invertBy=Na,Hn.invokeMap=Cs,Hn.iteratee=rl,Hn.keyBy=As,Hn.keys=La,Hn.keysIn=Pa,Hn.map=ws,Hn.mapKeys=function(t,e){var n={};return e=si(e,3),vr(t,(function(t,r,o){rr(n,e(t,r,o),t)})),n},Hn.mapValues=function(t,e){var n={};return e=si(e,3),vr(t,(function(t,r,o){rr(n,r,e(t,r,o))})),n},Hn.matches=function(t){return Br(sr(t,1))},Hn.matchesProperty=function(t,e){return Hr(t,sr(e,1))},Hn.memoize=Ms,Hn.merge=Oa,Hn.mergeWith=Ma,Hn.method=ol,Hn.methodOf=il,Hn.mixin=sl,Hn.negate=Rs,Hn.nthArg=function(t){return t=da(t),qr((function(e){return kr(e,t)}))},Hn.omit=Ra,Hn.omitBy=function(t,e){return Da(t,Rs(si(e)))},Hn.once=function(t){return Is(2,t)},Hn.orderBy=function(t,e,n,r){return null==t?[]:(js(e)||(e=null==e?[]:[e]),js(n=r?o:n)||(n=null==n?[]:[n]),Gr(t,e,n))},Hn.over=ll,Hn.overArgs=$s,Hn.overEvery=ul,Hn.overSome=cl,Hn.partial=Ds,Hn.partialRight=Bs,Hn.partition=Es,Hn.pick=$a,Hn.pickBy=Da,Hn.property=fl,Hn.propertyOf=function(t){return function(e){return null==t?o:Ar(t,e)}},Hn.pull=Ji,Hn.pullAll=Qi,Hn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?jr(t,e,si(n,2)):t},Hn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?jr(t,e,o,n):t},Hn.pullAt=Xi,Hn.range=hl,Hn.rangeRight=dl,Hn.rearg=Hs,Hn.reject=function(t,e){return(js(t)?Ne:pr)(t,Rs(si(e,3)))},Hn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=si(e,3);++r<i;){var s=t[r];e(s,r,t)&&(n.push(s),o.push(r))}return Vr(t,o),n},Hn.rest=function(t,e){if("function"!=typeof t)throw new It(i);return qr(t,e=e===o?e:da(e))},Hn.reverse=Zi,Hn.sampleSize=function(t,e,n){return e=(n?yi(t,e,n):e===o)?1:da(e),(js(t)?Jn:zr)(t,e)},Hn.set=function(t,e,n){return null==t?t:Jr(t,e,n)},Hn.setWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:Jr(t,e,n,r)},Hn.shuffle=function(t){return(js(t)?Qn:Zr)(t)},Hn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&yi(t,e,n)?(e=0,n=r):(e=null==e?0:da(e),n=n===o?r:da(n)),to(t,e,n)):[]},Hn.sortBy=_s,Hn.sortedUniq=function(t){return t&&t.length?oo(t):[]},Hn.sortedUniqBy=function(t,e){return t&&t.length?oo(t,si(e,2)):[]},Hn.split=function(t,e,n){return n&&"number"!=typeof n&&yi(t,e,n)&&(e=n=o),(n=n===o?d:n>>>0)?(t=ya(t))&&("string"==typeof e||null!=e&&!oa(e))&&!(e=so(e))&&rn(t)?bo(fn(t),0,n):t.split(e,n):[]},Hn.spread=function(t,e){if("function"!=typeof t)throw new It(i);return e=null==e?0:mn(da(e),0),qr((function(n){var r=n[e],o=bo(n,0,e);return r&&Oe(o,r),Ee(t,this,o)}))},Hn.tail=function(t){var e=null==t?0:t.length;return e?to(t,1,e):[]},Hn.take=function(t,e,n){return t&&t.length?to(t,0,(e=n||e===o?1:da(e))<0?0:e):[]},Hn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?to(t,(e=r-(e=n||e===o?1:da(e)))<0?0:e,r):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?co(t,si(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?co(t,si(e,3)):[]},Hn.tap=function(t,e){return e(t),t},Hn.throttle=function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new It(i);return Zs(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Ls(t,e,{leading:r,maxWait:e,trailing:o})},Hn.thru=hs,Hn.toArray=fa,Hn.toPairs=Ba,Hn.toPairsIn=Ha,Hn.toPath=function(t){return js(t)?Pe(t,Di):aa(t)?[t]:Io($i(ya(t)))},Hn.toPlainObject=ma,Hn.transform=function(t,e,n){var r=js(t),o=r||qs(t)||la(t);if(e=si(e,4),null==n){var i=t&&t.constructor;n=o?r?new i:[]:Zs(t)&&Js(i)?Fn(Vt(t)):{}}return(o?xe:vr)(t,(function(t,r,o){return e(n,t,r,o)})),n},Hn.unary=function(t){return Ts(t,1)},Hn.union=ts,Hn.unionBy=es,Hn.unionWith=ns,Hn.uniq=function(t){return t&&t.length?ao(t):[]},Hn.uniqBy=function(t,e){return t&&t.length?ao(t,si(e,2)):[]},Hn.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?ao(t,o,e):[]},Hn.unset=function(t,e){return null==t||lo(t,e)},Hn.unzip=rs,Hn.unzipWith=os,Hn.update=function(t,e,n){return null==t?t:uo(t,e,mo(n))},Hn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:uo(t,e,mo(n),r)},Hn.values=Fa,Hn.valuesIn=function(t){return null==t?[]:Je(t,Pa(t))},Hn.without=is,Hn.words=Ja,Hn.wrap=function(t,e){return Ds(mo(e),t)},Hn.xor=ss,Hn.xorBy=as,Hn.xorWith=ls,Hn.zip=us,Hn.zipObject=function(t,e){return po(t||[],e||[],Zn)},Hn.zipObjectDeep=function(t,e){return po(t||[],e||[],Jr)},Hn.zipWith=cs,Hn.entries=Ba,Hn.entriesIn=Ha,Hn.extend=ba,Hn.extendWith=Ca,sl(Hn,Hn),Hn.add=yl,Hn.attempt=Qa,Hn.camelCase=ka,Hn.capitalize=Ga,Hn.ceil=vl,Hn.clamp=function(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=(n=ga(n))==n?n:0),e!==o&&(e=(e=ga(e))==e?e:0),ir(ga(t),e,n)},Hn.clone=function(t){return sr(t,4)},Hn.cloneDeep=function(t){return sr(t,5)},Hn.cloneDeepWith=function(t,e){return sr(t,5,e="function"==typeof e?e:o)},Hn.cloneWith=function(t,e){return sr(t,4,e="function"==typeof e?e:o)},Hn.conformsTo=function(t,e){return null==e||ar(t,e,La(e))},Hn.deburr=Ua,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=bl,Hn.endsWith=function(t,e,n){t=ya(t),e=so(e);var r=t.length,i=n=n===o?r:ir(da(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},Hn.eq=Fs,Hn.escape=function(t){return(t=ya(t))&&K.test(t)?t.replace(Y,en):t},Hn.escapeRegExp=function(t){return(t=ya(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Hn.every=function(t,e,n){var r=js(t)?Ie:hr;return n&&yi(t,e,n)&&(e=o),r(t,si(e,3))},Hn.find=gs,Hn.findIndex=Ui,Hn.findKey=function(t,e){return Be(t,si(e,3),vr)},Hn.findLast=ms,Hn.findLastIndex=ji,Hn.findLastKey=function(t,e){return Be(t,si(e,3),br)},Hn.floor=Cl,Hn.forEach=ys,Hn.forEachRight=vs,Hn.forIn=function(t,e){return null==t?t:mr(t,si(e,3),Pa)},Hn.forInRight=function(t,e){return null==t?t:yr(t,si(e,3),Pa)},Hn.forOwn=function(t,e){return t&&vr(t,si(e,3))},Hn.forOwnRight=function(t,e){return t&&br(t,si(e,3))},Hn.get=xa,Hn.gt=ks,Hn.gte=Gs,Hn.has=function(t,e){return null!=t&&di(t,e,xr)},Hn.hasIn=Ta,Hn.head=Wi,Hn.identity=nl,Hn.includes=function(t,e,n,r){t=Ws(t)?t:Fa(t),n=n&&!r?da(n):0;var o=t.length;return n<0&&(n=mn(o+n,0)),sa(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&Fe(t,e,n)>-1},Hn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:da(n);return o<0&&(o=mn(r+o,0)),Fe(t,e,o)},Hn.inRange=function(t,e,n){return e=ha(e),n===o?(n=e,e=0):n=ha(n),function(t,e,n){return t>=yn(e,n)&&t<mn(e,n)}(t=ga(t),e,n)},Hn.invoke=Sa,Hn.isArguments=Us,Hn.isArray=js,Hn.isArrayBuffer=Vs,Hn.isArrayLike=Ws,Hn.isArrayLikeObject=Ys,Hn.isBoolean=function(t){return!0===t||!1===t||ta(t)&&Er(t)==y},Hn.isBuffer=qs,Hn.isDate=Ks,Hn.isElement=function(t){return ta(t)&&1===t.nodeType&&!ra(t)},Hn.isEmpty=function(t){if(null==t)return!0;if(Ws(t)&&(js(t)||"string"==typeof t||"function"==typeof t.splice||qs(t)||la(t)||Us(t)))return!t.length;var e=hi(t);if(e==w||e==I)return!t.size;if(Ai(t))return!Rr(t).length;for(var n in t)if(Mt.call(t,n))return!1;return!0},Hn.isEqual=function(t,e){return Lr(t,e)},Hn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:o)?n(t,e):o;return r===o?Lr(t,e,o,n):!!r},Hn.isError=zs,Hn.isFinite=function(t){return"number"==typeof t&&De(t)},Hn.isFunction=Js,Hn.isInteger=Qs,Hn.isLength=Xs,Hn.isMap=ea,Hn.isMatch=function(t,e){return t===e||Pr(t,e,li(e))},Hn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:o,Pr(t,e,li(e),n)},Hn.isNaN=function(t){return na(t)&&t!=+t},Hn.isNative=function(t){if(Ci(t))throw new At("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Or(t)},Hn.isNil=function(t){return null==t},Hn.isNull=function(t){return null===t},Hn.isNumber=na,Hn.isObject=Zs,Hn.isObjectLike=ta,Hn.isPlainObject=ra,Hn.isRegExp=oa,Hn.isSafeInteger=function(t){return Qs(t)&&t>=-9007199254740991&&t<=f},Hn.isSet=ia,Hn.isString=sa,Hn.isSymbol=aa,Hn.isTypedArray=la,Hn.isUndefined=function(t){return t===o},Hn.isWeakMap=function(t){return ta(t)&&hi(t)==L},Hn.isWeakSet=function(t){return ta(t)&&"[object WeakSet]"==Er(t)},Hn.join=function(t,e){return null==t?"":Ve.call(t,e)},Hn.kebabCase=ja,Hn.last=zi,Hn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=da(n))<0?mn(r+i,0):yn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):He(t,Ge,i,!0)},Hn.lowerCase=Va,Hn.lowerFirst=Wa,Hn.lt=ua,Hn.lte=ca,Hn.max=function(t){return t&&t.length?dr(t,nl,_r):o},Hn.maxBy=function(t,e){return t&&t.length?dr(t,si(e,2),_r):o},Hn.mean=function(t){return Ue(t,nl)},Hn.meanBy=function(t,e){return Ue(t,si(e,2))},Hn.min=function(t){return t&&t.length?dr(t,nl,$r):o},Hn.minBy=function(t,e){return t&&t.length?dr(t,si(e,2),$r):o},Hn.stubArray=pl,Hn.stubFalse=gl,Hn.stubObject=function(){return{}},Hn.stubString=function(){return""},Hn.stubTrue=function(){return!0},Hn.multiply=Al,Hn.nth=function(t,e){return t&&t.length?kr(t,da(e)):o},Hn.noConflict=function(){return fe._===this&&(fe._=Ht),this},Hn.noop=al,Hn.now=xs,Hn.pad=function(t,e,n){t=ya(t);var r=(e=da(e))?cn(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return Uo(de(o),n)+t+Uo(he(o),n)},Hn.padEnd=function(t,e,n){t=ya(t);var r=(e=da(e))?cn(t):0;return e&&r<e?t+Uo(e-r,n):t},Hn.padStart=function(t,e,n){t=ya(t);var r=(e=da(e))?cn(t):0;return e&&r<e?Uo(e-r,n)+t:t},Hn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),bn(ya(t).replace(rt,""),e||0)},Hn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&yi(t,e,n)&&(e=n=o),n===o&&("boolean"==typeof e?(n=e,e=o):"boolean"==typeof t&&(n=t,t=o)),t===o&&e===o?(t=0,e=1):(t=ha(t),e===o?(e=t,t=0):e=ha(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Cn();return yn(t+i*(e-t+ae("1e-"+((i+"").length-1))),e)}return Wr(t,e)},Hn.reduce=function(t,e,n){var r=js(t)?Me:We,o=arguments.length<3;return r(t,si(e,4),n,o,cr)},Hn.reduceRight=function(t,e,n){var r=js(t)?Re:We,o=arguments.length<3;return r(t,si(e,4),n,o,fr)},Hn.repeat=function(t,e,n){return e=(n?yi(t,e,n):e===o)?1:da(e),Yr(ya(t),e)},Hn.replace=function(){var t=arguments,e=ya(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(t,e,n){var r=-1,i=(e=yo(e,t)).length;for(i||(i=1,t=o);++r<i;){var s=null==t?o:t[Di(e[r])];s===o&&(r=i,s=n),t=Js(s)?s.call(t):s}return t},Hn.round=wl,Hn.runInContext=t,Hn.sample=function(t){return(js(t)?zn:Kr)(t)},Hn.size=function(t){if(null==t)return 0;if(Ws(t))return sa(t)?cn(t):t.length;var e=hi(t);return e==w||e==I?t.size:Rr(t).length},Hn.snakeCase=Ya,Hn.some=function(t,e,n){var r=js(t)?$e:eo;return n&&yi(t,e,n)&&(e=o),r(t,si(e,3))},Hn.sortedIndex=function(t,e){return no(t,e)},Hn.sortedIndexBy=function(t,e,n){return ro(t,e,si(n,2))},Hn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=no(t,e);if(r<n&&Fs(t[r],e))return r}return-1},Hn.sortedLastIndex=function(t,e){return no(t,e,!0)},Hn.sortedLastIndexBy=function(t,e,n){return ro(t,e,si(n,2),!0)},Hn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=no(t,e,!0)-1;if(Fs(t[n],e))return n}return-1},Hn.startCase=qa,Hn.startsWith=function(t,e,n){return t=ya(t),n=null==n?0:ir(da(n),0,t.length),e=so(e),t.slice(n,n+e.length)==e},Hn.subtract=El,Hn.sum=function(t){return t&&t.length?Ye(t,nl):0},Hn.sumBy=function(t,e){return t&&t.length?Ye(t,si(e,2)):0},Hn.template=function(t,e,n){var r=Hn.templateSettings;n&&yi(t,e,n)&&(e=o),t=ya(t),e=Ca({},e,r,Jo);var i,s,a=Ca({},e.imports,r.imports,Jo),l=La(a),u=Je(a,l),c=0,f=e.interpolate||bt,h="__p += '",d=xt((e.escape||bt).source+"|"+f.source+"|"+(f===Q?ft:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(Mt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++re+"]")+"\n";t.replace(d,(function(e,n,r,o,a,l){return r||(r=o),h+=t.slice(c,l).replace(Ct,nn),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=l+e.length,e})),h+="';\n";var g=Mt.call(e,"variable")&&e.variable;if(g){if(ut.test(g))throw new At("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(U,""):h).replace(j,"$1").replace(V,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Qa((function(){return wt(l,p+"return "+h).apply(o,u)}));if(m.source=h,zs(m))throw m;return m},Hn.times=function(t,e){if((t=da(t))<1||t>f)return[];var n=d,r=yn(t,d);e=si(e),t-=d;for(var o=qe(r,e);++n<t;)e(n);return o},Hn.toFinite=ha,Hn.toInteger=da,Hn.toLength=pa,Hn.toLower=function(t){return ya(t).toLowerCase()},Hn.toNumber=ga,Hn.toSafeInteger=function(t){return t?ir(da(t),-9007199254740991,f):0===t?t:0},Hn.toString=ya,Hn.toUpper=function(t){return ya(t).toUpperCase()},Hn.trim=function(t,e,n){if((t=ya(t))&&(n||e===o))return Ke(t);if(!t||!(e=so(e)))return t;var r=fn(t),i=fn(e);return bo(r,Xe(r,i),Ze(r,i)+1).join("")},Hn.trimEnd=function(t,e,n){if((t=ya(t))&&(n||e===o))return t.slice(0,hn(t)+1);if(!t||!(e=so(e)))return t;var r=fn(t);return bo(r,0,Ze(r,fn(e))+1).join("")},Hn.trimStart=function(t,e,n){if((t=ya(t))&&(n||e===o))return t.replace(rt,"");if(!t||!(e=so(e)))return t;var r=fn(t);return bo(r,Xe(r,fn(e))).join("")},Hn.truncate=function(t,e){var n=30,r="...";if(Zs(e)){var i="separator"in e?e.separator:i;n="length"in e?da(e.length):n,r="omission"in e?so(e.omission):r}var s=(t=ya(t)).length;if(rn(t)){var a=fn(t);s=a.length}if(n>=s)return t;var l=n-cn(r);if(l<1)return r;var u=a?bo(a,0,l).join(""):t.slice(0,l);if(i===o)return u+r;if(a&&(l+=u.length-l),oa(i)){if(t.slice(l).search(i)){var c,f=u;for(i.global||(i=xt(i.source,ya(ht.exec(i))+"g")),i.lastIndex=0;c=i.exec(f);)var h=c.index;u=u.slice(0,h===o?l:h)}}else if(t.indexOf(so(i),l)!=l){var d=u.lastIndexOf(i);d>-1&&(u=u.slice(0,d))}return u+r},Hn.unescape=function(t){return(t=ya(t))&&q.test(t)?t.replace(W,dn):t},Hn.uniqueId=function(t){var e=++Rt;return ya(t)+e},Hn.upperCase=Ka,Hn.upperFirst=za,Hn.each=ys,Hn.eachRight=vs,Hn.first=Wi,sl(Hn,(ml={},vr(Hn,(function(t,e){Mt.call(Hn.prototype,e)||(ml[e]=t)})),ml),{chain:!1}),Hn.VERSION="4.17.21",xe(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hn[t].placeholder=Hn})),xe(["drop","take"],(function(t,e){Un.prototype[t]=function(n){n=n===o?1:mn(da(n),0);var r=this.__filtered__&&!e?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Un.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),xe(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Un.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:si(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),xe(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Un.prototype[t]=function(){return this[n](1).value()[0]}})),xe(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Un.prototype[t]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(nl)},Un.prototype.find=function(t){return this.filter(t).head()},Un.prototype.findLast=function(t){return this.reverse().find(t)},Un.prototype.invokeMap=qr((function(t,e){return"function"==typeof t?new Un(this):this.map((function(n){return Nr(n,t,e)}))})),Un.prototype.reject=function(t){return this.filter(Rs(si(t)))},Un.prototype.slice=function(t,e){t=da(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Un(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==o&&(n=(e=da(e))<0?n.dropRight(-e):n.take(e-t)),n)},Un.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Un.prototype.toArray=function(){return this.take(d)},vr(Un.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=Hn[r?"take"+("last"==e?"Right":""):e],s=r||/^find/.test(e);i&&(Hn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,l=e instanceof Un,u=a[0],c=l||js(e),f=function(t){var e=i.apply(Hn,Oe([t],a));return r&&h?e[0]:e};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,g=l&&!d;if(!s&&c){e=g?e:new Un(this);var m=t.apply(e,a);return m.__actions__.push({func:hs,args:[f],thisArg:o}),new Gn(m,h)}return p&&g?t.apply(this,a):(m=this.thru(f),p?r?m.value()[0]:m.value():m)})})),xe(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Nt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Hn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(js(o)?o:[],t)}return this[n]((function(n){return e.apply(js(n)?n:[],t)}))}})),vr(Un.prototype,(function(t,e){var n=Hn[e];if(n){var r=n.name+"";Mt.call(Sn,r)||(Sn[r]=[]),Sn[r].push({name:e,func:n})}})),Sn[Ho(o,2).name]=[{name:"wrapper",func:o}],Un.prototype.clone=function(){var t=new Un(this.__wrapped__);return t.__actions__=Io(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Io(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Io(this.__views__),t},Un.prototype.reverse=function(){if(this.__filtered__){var t=new Un(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Un.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=js(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],s=i.size;switch(i.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=yn(e,t+s);break;case"takeRight":t=mn(t,e-s)}}return{start:t,end:e}}(0,o,this.__views__),s=i.start,a=i.end,l=a-s,u=r?a:s-1,c=this.__iteratees__,f=c.length,h=0,d=yn(l,this.__takeCount__);if(!n||!r&&o==l&&d==l)return fo(t,this.__actions__);var p=[];t:for(;l--&&h<d;){for(var g=-1,m=t[u+=e];++g<f;){var y=c[g],v=y.iteratee,b=y.type,C=v(m);if(2==b)m=C;else if(!C){if(1==b)continue t;break t}}p[h++]=m}return p},Hn.prototype.at=ds,Hn.prototype.chain=function(){return fs(this)},Hn.prototype.commit=function(){return new Gn(this.value(),this.__chain__)},Hn.prototype.next=function(){this.__values__===o&&(this.__values__=fa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},Hn.prototype.plant=function(t){for(var e,n=this;n instanceof kn;){var r=Hi(n);r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},Hn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Un){var e=t;return this.__actions__.length&&(e=new Un(this)),(e=e.reverse()).__actions__.push({func:hs,args:[Zi],thisArg:o}),new Gn(e,this.__chain__)}return this.thru(Zi)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return fo(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,zt&&(Hn.prototype[zt]=function(){return this}),Hn}();fe._=pn,(r=function(){return pn}.call(e,n,e,t))===o||(t.exports=r)}.call(this)},4802:t=>{t.exports=function t(e,n,r){function o(s,a){if(!n[s]){if(!e[s]){if(i)return i(s,!0);throw new Error("Cannot find module '"+s+"'")}a=n[s]={exports:{}},e[s][0].call(a.exports,(function(t){return o(e[s][1][t]||t)}),a,a.exports,t,e,n,r)}return n[s].exports}for(var i=void 0,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(t,e,n){(function(r,o,i,s,a,l,u,c,f){"use strict";var h=t("crypto");function d(t,e){var n;return void 0===(n="passthrough"!==(e=m(t,e)).algorithm?h.createHash(e.algorithm):new b).write&&(n.write=n.update,n.end=n.update),v(e,n).dispatch(t),n.update||n.end(""),n.digest?n.digest("buffer"===e.encoding?void 0:e.encoding):(t=n.read(),"buffer"!==e.encoding?t.toString(e.encoding):t)}(n=e.exports=d).sha1=function(t){return d(t)},n.keys=function(t){return d(t,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},n.MD5=function(t){return d(t,{algorithm:"md5",encoding:"hex"})},n.keysMD5=function(t){return d(t,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var p=h.getHashes?h.getHashes().slice():["sha1","md5"],g=(p.push("passthrough"),["buffer","hex","binary","base64"]);function m(t,e){var n={};if(n.algorithm=(e=e||{}).algorithm||"sha1",n.encoding=e.encoding||"hex",n.excludeValues=!!e.excludeValues,n.algorithm=n.algorithm.toLowerCase(),n.encoding=n.encoding.toLowerCase(),n.ignoreUnknown=!0===e.ignoreUnknown,n.respectType=!1!==e.respectType,n.respectFunctionNames=!1!==e.respectFunctionNames,n.respectFunctionProperties=!1!==e.respectFunctionProperties,n.unorderedArrays=!0===e.unorderedArrays,n.unorderedSets=!1!==e.unorderedSets,n.unorderedObjects=!1!==e.unorderedObjects,n.replacer=e.replacer||void 0,n.excludeKeys=e.excludeKeys||void 0,void 0===t)throw new Error("Object argument required.");for(var r=0;r<p.length;++r)p[r].toLowerCase()===n.algorithm.toLowerCase()&&(n.algorithm=p[r]);if(-1===p.indexOf(n.algorithm))throw new Error('Algorithm "'+n.algorithm+'" not supported. supported values: '+p.join(", "));if(-1===g.indexOf(n.encoding)&&"passthrough"!==n.algorithm)throw new Error('Encoding "'+n.encoding+'" not supported. supported values: '+g.join(", "));return n}function y(t){if("function"==typeof t)return null!=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(t))}function v(t,e,n){function r(t){return e.update?e.update(t,"utf8"):e.write(t,"utf8")}return n=n||[],{dispatch:function(e){return this["_"+(null===(e=t.replacer?t.replacer(e):e)?"null":typeof e)](e)},_object:function(e){var o,s=Object.prototype.toString.call(e),a=/\[object (.*)\]/i.exec(s);if(a=(a=a?a[1]:"unknown:["+s+"]").toLowerCase(),0<=(s=n.indexOf(e)))return this.dispatch("[CIRCULAR:"+s+"]");if(n.push(e),void 0!==i&&i.isBuffer&&i.isBuffer(e))return r("buffer:"),r(e);if("object"===a||"function"===a||"asyncfunction"===a)return s=Object.keys(e),t.unorderedObjects&&(s=s.sort()),!1===t.respectType||y(e)||s.splice(0,0,"prototype","__proto__","constructor"),t.excludeKeys&&(s=s.filter((function(e){return!t.excludeKeys(e)}))),r("object:"+s.length+":"),o=this,s.forEach((function(n){o.dispatch(n),r(":"),t.excludeValues||o.dispatch(e[n]),r(",")}));if(!this["_"+a]){if(t.ignoreUnknown)return r("["+a+"]");throw new Error('Unknown object type "'+a+'"')}this["_"+a](e)},_array:function(e,o){o=void 0!==o?o:!1!==t.unorderedArrays;var i=this;if(r("array:"+e.length+":"),!o||e.length<=1)return e.forEach((function(t){return i.dispatch(t)}));var s=[];return o=e.map((function(e){var r=new b,o=n.slice();return v(t,r,o).dispatch(e),s=s.concat(o.slice(n.length)),r.read().toString()})),n=n.concat(s),o.sort(),this._array(o,!1)},_date:function(t){return r("date:"+t.toJSON())},_symbol:function(t){return r("symbol:"+t.toString())},_error:function(t){return r("error:"+t.toString())},_boolean:function(t){return r("bool:"+t.toString())},_string:function(t){r("string:"+t.length+":"),r(t.toString())},_function:function(e){r("fn:"),y(e)?this.dispatch("[native]"):this.dispatch(e.toString()),!1!==t.respectFunctionNames&&this.dispatch("function-name:"+String(e.name)),t.respectFunctionProperties&&this._object(e)},_number:function(t){return r("number:"+t.toString())},_xml:function(t){return r("xml:"+t.toString())},_null:function(){return r("Null")},_undefined:function(){return r("Undefined")},_regexp:function(t){return r("regex:"+t.toString())},_uint8array:function(t){return r("uint8array:"),this.dispatch(Array.prototype.slice.call(t))},_uint8clampedarray:function(t){return r("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(t))},_int8array:function(t){return r("int8array:"),this.dispatch(Array.prototype.slice.call(t))},_uint16array:function(t){return r("uint16array:"),this.dispatch(Array.prototype.slice.call(t))},_int16array:function(t){return r("int16array:"),this.dispatch(Array.prototype.slice.call(t))},_uint32array:function(t){return r("uint32array:"),this.dispatch(Array.prototype.slice.call(t))},_int32array:function(t){return r("int32array:"),this.dispatch(Array.prototype.slice.call(t))},_float32array:function(t){return r("float32array:"),this.dispatch(Array.prototype.slice.call(t))},_float64array:function(t){return r("float64array:"),this.dispatch(Array.prototype.slice.call(t))},_arraybuffer:function(t){return r("arraybuffer:"),this.dispatch(new Uint8Array(t))},_url:function(t){return r("url:"+t.toString())},_map:function(e){return r("map:"),e=Array.from(e),this._array(e,!1!==t.unorderedSets)},_set:function(e){return r("set:"),e=Array.from(e),this._array(e,!1!==t.unorderedSets)},_file:function(t){return r("file:"),this.dispatch([t.name,t.size,t.type,t.lastModfied])},_blob:function(){if(t.ignoreUnknown)return r("[blob]");throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n')},_domwindow:function(){return r("domwindow")},_bigint:function(t){return r("bigint:"+t.toString())},_process:function(){return r("process")},_timer:function(){return r("timer")},_pipe:function(){return r("pipe")},_tcp:function(){return r("tcp")},_udp:function(){return r("udp")},_tty:function(){return r("tty")},_statwatcher:function(){return r("statwatcher")},_securecontext:function(){return r("securecontext")},_connection:function(){return r("connection")},_zlib:function(){return r("zlib")},_context:function(){return r("context")},_nodescript:function(){return r("nodescript")},_httpparser:function(){return r("httpparser")},_dataview:function(){return r("dataview")},_signal:function(){return r("signal")},_fsevent:function(){return r("fsevent")},_tlswrap:function(){return r("tlswrap")}}}function b(){return{buf:"",write:function(t){this.buf+=t},end:function(t){this.buf+=t},read:function(){return this.buf}}}n.writeToStream=function(t,e,n){return void 0===n&&(n=e,e={}),v(e=m(t,e),n).dispatch(t)}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(t,e,n){(function(t,e,r,o,i,s,a,l,u){!function(t){"use strict";var e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="+".charCodeAt(0),r="/".charCodeAt(0),o="0".charCodeAt(0),i="a".charCodeAt(0),s="A".charCodeAt(0),a="-".charCodeAt(0),l="_".charCodeAt(0);function u(t){return(t=t.charCodeAt(0))===n||t===a?62:t===r||t===l?63:t<o?-1:t<o+10?t-o+26+26:t<s+26?t-s:t<i+26?t-i+26:void 0}t.toByteArray=function(t){var n,r;if(0<t.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var o=t.length,i=(o="="===t.charAt(o-2)?2:"="===t.charAt(o-1)?1:0,new e(3*t.length/4-o)),s=0<o?t.length-4:t.length,a=0;function l(t){i[a++]=t}for(n=0;n<s;n+=4,0)l((16711680&(r=u(t.charAt(n))<<18|u(t.charAt(n+1))<<12|u(t.charAt(n+2))<<6|u(t.charAt(n+3))))>>16),l((65280&r)>>8),l(255&r);return 2==o?l(255&(r=u(t.charAt(n))<<2|u(t.charAt(n+1))>>4)):1==o&&(l((r=u(t.charAt(n))<<10|u(t.charAt(n+1))<<4|u(t.charAt(n+2))>>2)>>8&255),l(255&r)),i},t.fromByteArray=function(t){var e,n,r,o,i=t.length%3,s="";function a(t){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)}for(e=0,r=t.length-i;e<r;e+=3)s+=a((o=n=(t[e]<<16)+(t[e+1]<<8)+t[e+2])>>18&63)+a(o>>12&63)+a(o>>6&63)+a(63&o);switch(i){case 1:s=(s+=a((n=t[t.length-1])>>2))+a(n<<4&63)+"==";break;case 2:s=(s=(s+=a((n=(t[t.length-2]<<8)+t[t.length-1])>>10))+a(n>>4&63))+a(n<<2&63)+"="}return s}}(void 0===n?this.base64js={}:n)}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(t,e,n){(function(e,r,o,i,s,a,l,u,c){var f=t("base64-js"),h=t("ieee754");function o(t,e,n){if(!(this instanceof o))return new o(t,e,n);var r,i,s,a,l=typeof t;if("base64"===e&&"string"==l)for(t=(a=t).trim?a.trim():a.replace(/^\s+|\s+$/g,"");t.length%4!=0;)t+="=";if("number"==l)r=I(t);else if("string"==l)r=o.byteLength(t,e);else{if("object"!=l)throw new Error("First argument needs to be a number, array or string.");r=I(t.length)}if(o._useTypedArrays?i=o._augment(new Uint8Array(r)):((i=this).length=r,i._isBuffer=!0),o._useTypedArrays&&"number"==typeof t.byteLength)i._set(t);else if(N(a=t)||o.isBuffer(a)||a&&"object"==typeof a&&"number"==typeof a.length)for(s=0;s<r;s++)o.isBuffer(t)?i[s]=t.readUInt8(s):i[s]=t[s];else if("string"==l)i.write(t,0,e);else if("number"==l&&!o._useTypedArrays&&!n)for(s=0;s<r;s++)i[s]=0;return i}function d(t,e,n,r){var o;if(r||(B("boolean"==typeof n,"missing or invalid endian"),B(null!=e,"missing offset"),B(e+1<t.length,"Trying to read beyond buffer length")),!((r=t.length)<=e))return n?(o=t[e],e+1<r&&(o|=t[e+1]<<8)):(o=t[e]<<8,e+1<r&&(o|=t[e+1])),o}function p(t,e,n,r){var o;if(r||(B("boolean"==typeof n,"missing or invalid endian"),B(null!=e,"missing offset"),B(e+3<t.length,"Trying to read beyond buffer length")),!((r=t.length)<=e))return n?(e+2<r&&(o=t[e+2]<<16),e+1<r&&(o|=t[e+1]<<8),o|=t[e],e+3<r&&(o+=t[e+3]<<24>>>0)):(e+1<r&&(o=t[e+1]<<16),e+2<r&&(o|=t[e+2]<<8),e+3<r&&(o|=t[e+3]),o+=t[e]<<24>>>0),o}function g(t,e,n,r){if(r||(B("boolean"==typeof n,"missing or invalid endian"),B(null!=e,"missing offset"),B(e+1<t.length,"Trying to read beyond buffer length")),!(t.length<=e))return 32768&(r=d(t,e,n,!0))?-1*(65535-r+1):r}function m(t,e,n,r){if(r||(B("boolean"==typeof n,"missing or invalid endian"),B(null!=e,"missing offset"),B(e+3<t.length,"Trying to read beyond buffer length")),!(t.length<=e))return 2147483648&(r=p(t,e,n,!0))?-1*(4294967295-r+1):r}function y(t,e,n,r){return r||(B("boolean"==typeof n,"missing or invalid endian"),B(e+3<t.length,"Trying to read beyond buffer length")),h.read(t,e,n,23,4)}function v(t,e,n,r){return r||(B("boolean"==typeof n,"missing or invalid endian"),B(e+7<t.length,"Trying to read beyond buffer length")),h.read(t,e,n,52,8)}function b(t,e,n,r,o){if(o||(B(null!=e,"missing value"),B("boolean"==typeof r,"missing or invalid endian"),B(null!=n,"missing offset"),B(n+1<t.length,"trying to write beyond buffer length"),R(e,65535)),!((o=t.length)<=n))for(var i=0,s=Math.min(o-n,2);i<s;i++)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function C(t,e,n,r,o){if(o||(B(null!=e,"missing value"),B("boolean"==typeof r,"missing or invalid endian"),B(null!=n,"missing offset"),B(n+3<t.length,"trying to write beyond buffer length"),R(e,4294967295)),!((o=t.length)<=n))for(var i=0,s=Math.min(o-n,4);i<s;i++)t[n+i]=e>>>8*(r?i:3-i)&255}function A(t,e,n,r,o){o||(B(null!=e,"missing value"),B("boolean"==typeof r,"missing or invalid endian"),B(null!=n,"missing offset"),B(n+1<t.length,"Trying to write beyond buffer length"),$(e,32767,-32768)),t.length<=n||b(t,0<=e?e:65535+e+1,n,r,o)}function w(t,e,n,r,o){o||(B(null!=e,"missing value"),B("boolean"==typeof r,"missing or invalid endian"),B(null!=n,"missing offset"),B(n+3<t.length,"Trying to write beyond buffer length"),$(e,2147483647,-2147483648)),t.length<=n||C(t,0<=e?e:4294967295+e+1,n,r,o)}function E(t,e,n,r,o){o||(B(null!=e,"missing value"),B("boolean"==typeof r,"missing or invalid endian"),B(null!=n,"missing offset"),B(n+3<t.length,"Trying to write beyond buffer length"),D(e,34028234663852886e22,-34028234663852886e22)),t.length<=n||h.write(t,e,n,r,23,4)}function _(t,e,n,r,o){o||(B(null!=e,"missing value"),B("boolean"==typeof r,"missing or invalid endian"),B(null!=n,"missing offset"),B(n+7<t.length,"Trying to write beyond buffer length"),D(e,17976931348623157e292,-17976931348623157e292)),t.length<=n||h.write(t,e,n,r,52,8)}n.Buffer=o,n.SlowBuffer=o,n.INSPECT_MAX_BYTES=50,o.poolSize=8192,o._useTypedArrays=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray}catch(t){return!1}}(),o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.byteLength=function(t,e){var n;switch(t+="",e||"utf8"){case"hex":n=t.length/2;break;case"utf8":case"utf-8":n=L(t).length;break;case"ascii":case"binary":case"raw":n=t.length;break;case"base64":n=P(t).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*t.length;break;default:throw new Error("Unknown encoding")}return n},o.concat=function(t,e){if(B(N(t),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===t.length)return new o(0);if(1===t.length)return t[0];if("number"!=typeof e)for(i=e=0;i<t.length;i++)e+=t[i].length;for(var n=new o(e),r=0,i=0;i<t.length;i++){var s=t[i];s.copy(n,r),r+=s.length}return n},o.prototype.write=function(t,e,n,r){isFinite(e)?isFinite(n)||(r=n,n=void 0):(u=r,r=e,e=n,n=u),e=Number(e)||0;var i,s,a,l,u=this.length-e;switch((!n||u<(n=Number(n)))&&(n=u),r=String(r||"utf8").toLowerCase()){case"hex":i=function(t,e,n,r){n=Number(n)||0;var i=t.length-n;(!r||i<(r=Number(r)))&&(r=i),B((i=e.length)%2==0,"Invalid hex string"),i/2<r&&(r=i/2);for(var s=0;s<r;s++){var a=parseInt(e.substr(2*s,2),16);B(!isNaN(a),"Invalid hex string"),t[n+s]=a}return o._charsWritten=2*s,s}(this,t,e,n);break;case"utf8":case"utf-8":s=this,a=e,l=n,i=o._charsWritten=O(L(t),s,a,l);break;case"ascii":case"binary":i=function(t,e,n,r){return o._charsWritten=O(function(t){for(var e=[],n=0;n<t.length;n++)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}(this,t,e,n);break;case"base64":s=this,a=e,l=n,i=o._charsWritten=O(P(t),s,a,l);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=function(t,e,n,r){return o._charsWritten=O(function(t){for(var e,n,r=[],o=0;o<t.length;o++)e=(n=t.charCodeAt(o))>>8,n%=256,r.push(n),r.push(e);return r}(e),t,n,r)}(this,t,e,n);break;default:throw new Error("Unknown encoding")}return i},o.prototype.toString=function(t,e,n){var r,o,i,s,a=this;if(t=String(t||"utf8").toLowerCase(),e=Number(e)||0,(n=void 0!==n?Number(n):a.length)===e)return"";switch(t){case"hex":r=function(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||r<n)&&(n=r);for(var o="",i=e;i<n;i++)o+=S(t[i]);return o}(a,e,n);break;case"utf8":case"utf-8":r=function(t,e,n){var r="",o="";n=Math.min(t.length,n);for(var i=e;i<n;i++)t[i]<=127?(r+=M(o)+String.fromCharCode(t[i]),o=""):o+="%"+t[i].toString(16);return r+M(o)}(a,e,n);break;case"ascii":case"binary":r=function(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;o++)r+=String.fromCharCode(t[o]);return r}(a,e,n);break;case"base64":o=a,s=n,r=0===(i=e)&&s===o.length?f.fromByteArray(o):f.fromByteArray(o.slice(i,s));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=function(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}(a,e,n);break;default:throw new Error("Unknown encoding")}return r},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.copy=function(t,e,n,r){if(e=e||0,(r=r||0===r?r:this.length)!==(n=n||0)&&0!==t.length&&0!==this.length){B(n<=r,"sourceEnd < sourceStart"),B(0<=e&&e<t.length,"targetStart out of bounds"),B(0<=n&&n<this.length,"sourceStart out of bounds"),B(0<=r&&r<=this.length,"sourceEnd out of bounds"),r>this.length&&(r=this.length);var i=(r=t.length-e<r-n?t.length-e+n:r)-n;if(i<100||!o._useTypedArrays)for(var s=0;s<i;s++)t[s+e]=this[s+n];else t._set(this.subarray(n,n+i),e)}},o.prototype.slice=function(t,e){var n=this.length;if(t=T(t,n,0),e=T(e,n,n),o._useTypedArrays)return o._augment(this.subarray(t,e));for(var r=e-t,i=new o(r,void 0,!0),s=0;s<r;s++)i[s]=this[s+t];return i},o.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},o.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},o.prototype.readUInt8=function(t,e){if(e||(B(null!=t,"missing offset"),B(t<this.length,"Trying to read beyond buffer length")),!(t>=this.length))return this[t]},o.prototype.readUInt16LE=function(t,e){return d(this,t,!0,e)},o.prototype.readUInt16BE=function(t,e){return d(this,t,!1,e)},o.prototype.readUInt32LE=function(t,e){return p(this,t,!0,e)},o.prototype.readUInt32BE=function(t,e){return p(this,t,!1,e)},o.prototype.readInt8=function(t,e){if(e||(B(null!=t,"missing offset"),B(t<this.length,"Trying to read beyond buffer length")),!(t>=this.length))return 128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){return g(this,t,!0,e)},o.prototype.readInt16BE=function(t,e){return g(this,t,!1,e)},o.prototype.readInt32LE=function(t,e){return m(this,t,!0,e)},o.prototype.readInt32BE=function(t,e){return m(this,t,!1,e)},o.prototype.readFloatLE=function(t,e){return y(this,t,!0,e)},o.prototype.readFloatBE=function(t,e){return y(this,t,!1,e)},o.prototype.readDoubleLE=function(t,e){return v(this,t,!0,e)},o.prototype.readDoubleBE=function(t,e){return v(this,t,!1,e)},o.prototype.writeUInt8=function(t,e,n){n||(B(null!=t,"missing value"),B(null!=e,"missing offset"),B(e<this.length,"trying to write beyond buffer length"),R(t,255)),e>=this.length||(this[e]=t)},o.prototype.writeUInt16LE=function(t,e,n){b(this,t,e,!0,n)},o.prototype.writeUInt16BE=function(t,e,n){b(this,t,e,!1,n)},o.prototype.writeUInt32LE=function(t,e,n){C(this,t,e,!0,n)},o.prototype.writeUInt32BE=function(t,e,n){C(this,t,e,!1,n)},o.prototype.writeInt8=function(t,e,n){n||(B(null!=t,"missing value"),B(null!=e,"missing offset"),B(e<this.length,"Trying to write beyond buffer length"),$(t,127,-128)),e>=this.length||(0<=t?this.writeUInt8(t,e,n):this.writeUInt8(255+t+1,e,n))},o.prototype.writeInt16LE=function(t,e,n){A(this,t,e,!0,n)},o.prototype.writeInt16BE=function(t,e,n){A(this,t,e,!1,n)},o.prototype.writeInt32LE=function(t,e,n){w(this,t,e,!0,n)},o.prototype.writeInt32BE=function(t,e,n){w(this,t,e,!1,n)},o.prototype.writeFloatLE=function(t,e,n){E(this,t,e,!0,n)},o.prototype.writeFloatBE=function(t,e,n){E(this,t,e,!1,n)},o.prototype.writeDoubleLE=function(t,e,n){_(this,t,e,!0,n)},o.prototype.writeDoubleBE=function(t,e,n){_(this,t,e,!1,n)},o.prototype.fill=function(t,e,n){if(e=e||0,n=n||this.length,B("number"==typeof(t="string"==typeof(t=t||0)?t.charCodeAt(0):t)&&!isNaN(t),"value is not a number"),B(e<=n,"end < start"),n!==e&&0!==this.length){B(0<=e&&e<this.length,"start out of bounds"),B(0<=n&&n<=this.length,"end out of bounds");for(var r=e;r<n;r++)this[r]=t}},o.prototype.inspect=function(){for(var t=[],e=this.length,r=0;r<e;r++)if(t[r]=S(this[r]),r===n.INSPECT_MAX_BYTES){t[r+1]="...";break}return"<Buffer "+t.join(" ")+">"},o.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(o._useTypedArrays)return new o(this).buffer;for(var t=new Uint8Array(this.length),e=0,n=t.length;e<n;e+=1)t[e]=this[e];return t.buffer};var x=o.prototype;function T(t,e,n){return"number"!=typeof t?n:e<=(t=~~t)?e:0<=t||0<=(t+=e)?t:0}function I(t){return(t=~~Math.ceil(+t))<0?0:t}function N(t){return(Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)})(t)}function S(t){return t<16?"0"+t.toString(16):t.toString(16)}function L(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r<=127)e.push(t.charCodeAt(n));else for(var o=n,i=(55296<=r&&r<=57343&&n++,encodeURIComponent(t.slice(o,n+1)).substr(1).split("%")),s=0;s<i.length;s++)e.push(parseInt(i[s],16))}return e}function P(t){return f.toByteArray(t)}function O(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);o++)e[o+n]=t[o];return o}function M(t){try{return decodeURIComponent(t)}catch(t){return String.fromCharCode(65533)}}function R(t,e){B("number"==typeof t,"cannot write a non-number as a number"),B(0<=t,"specified a negative value for writing an unsigned value"),B(t<=e,"value is larger than maximum value for type"),B(Math.floor(t)===t,"value has a fractional component")}function $(t,e,n){B("number"==typeof t,"cannot write a non-number as a number"),B(t<=e,"value larger than maximum allowed value"),B(n<=t,"value smaller than minimum allowed value"),B(Math.floor(t)===t,"value has a fractional component")}function D(t,e,n){B("number"==typeof t,"cannot write a non-number as a number"),B(t<=e,"value larger than maximum allowed value"),B(n<=t,"value smaller than minimum allowed value")}function B(t,e){if(!t)throw new Error(e||"Failed assertion")}o._augment=function(t){return t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=x.get,t.set=x.set,t.write=x.write,t.toString=x.toString,t.toLocaleString=x.toString,t.toJSON=x.toJSON,t.copy=x.copy,t.slice=x.slice,t.readUInt8=x.readUInt8,t.readUInt16LE=x.readUInt16LE,t.readUInt16BE=x.readUInt16BE,t.readUInt32LE=x.readUInt32LE,t.readUInt32BE=x.readUInt32BE,t.readInt8=x.readInt8,t.readInt16LE=x.readInt16LE,t.readInt16BE=x.readInt16BE,t.readInt32LE=x.readInt32LE,t.readInt32BE=x.readInt32BE,t.readFloatLE=x.readFloatLE,t.readFloatBE=x.readFloatBE,t.readDoubleLE=x.readDoubleLE,t.readDoubleBE=x.readDoubleBE,t.writeUInt8=x.writeUInt8,t.writeUInt16LE=x.writeUInt16LE,t.writeUInt16BE=x.writeUInt16BE,t.writeUInt32LE=x.writeUInt32LE,t.writeUInt32BE=x.writeUInt32BE,t.writeInt8=x.writeInt8,t.writeInt16LE=x.writeInt16LE,t.writeInt16BE=x.writeInt16BE,t.writeInt32LE=x.writeInt32LE,t.writeInt32BE=x.writeInt32BE,t.writeFloatLE=x.writeFloatLE,t.writeFloatBE=x.writeFloatBE,t.writeDoubleLE=x.writeDoubleLE,t.writeDoubleBE=x.writeDoubleBE,t.fill=x.fill,t.inspect=x.inspect,t.toArrayBuffer=x.toArrayBuffer,t}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(t,e,n){(function(n,r,o,i,s,a,l,u,c){o=t("buffer").Buffer;var f=new o(4);f.fill(0),e.exports={hash:function(t,e,n,r){for(var i=e(function(t,e){t.length%4!=0&&(n=t.length+(4-t.length%4),t=o.concat([t,f],n));for(var n,r=[],i=e?t.readInt32BE:t.readInt32LE,s=0;s<t.length;s+=4)r.push(i.call(t,s));return r}(t=o.isBuffer(t)?t:new o(t),r),8*t.length),s=(e=r,new o(n)),a=e?s.writeInt32BE:s.writeInt32LE,l=0;l<i.length;l++)a.call(s,i[l],4*l,!0);return s}}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(t,e,n){(function(e,r,o,i,s,a,l,u,c){o=t("buffer").Buffer;var f=t("./sha"),h=t("./sha256"),d=t("./rng"),p={sha1:f,sha256:h,md5:t("./md5")},g=64,m=new o(g);function y(t,e){var n=p[t=t||"sha1"],r=[];return n||v("algorithm:",t,"is not yet supported"),{update:function(t){return o.isBuffer(t)||(t=new o(t)),r.push(t),t.length,this},digest:function(t){var i=o.concat(r);return i=e?function(t,e,n){o.isBuffer(e)||(e=new o(e)),o.isBuffer(n)||(n=new o(n)),e.length>g?e=t(e):e.length<g&&(e=o.concat([e,m],g));for(var r=new o(g),i=new o(g),s=0;s<g;s++)r[s]=54^e[s],i[s]=92^e[s];return n=t(o.concat([r,n])),t(o.concat([i,n]))}(n,e,i):n(i),r=null,t?i.toString(t):i}}}function v(){var t=[].slice.call(arguments).join(" ");throw new Error([t,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}m.fill(0),n.createHash=function(t){return y(t)},n.createHmac=y,n.randomBytes=function(t,e){if(!e||!e.call)return new o(d(t));try{e.call(this,void 0,new o(d(t)))}catch(t){e(t)}};var b,C=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],A=function(t){n[t]=function(){v("sorry,",t,"is not implemented yet")}};for(b in C)A(C[b])}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(t,e,n){(function(n,r,o,i,s,a,l,u,c){var f=t("./helpers");function h(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,s=0;s<t.length;s+=16){var a=n,l=r,u=o,c=i;n=p(n,r,o,i,t[s+0],7,-680876936),i=p(i,n,r,o,t[s+1],12,-389564586),o=p(o,i,n,r,t[s+2],17,606105819),r=p(r,o,i,n,t[s+3],22,-1044525330),n=p(n,r,o,i,t[s+4],7,-176418897),i=p(i,n,r,o,t[s+5],12,1200080426),o=p(o,i,n,r,t[s+6],17,-1473231341),r=p(r,o,i,n,t[s+7],22,-45705983),n=p(n,r,o,i,t[s+8],7,1770035416),i=p(i,n,r,o,t[s+9],12,-1958414417),o=p(o,i,n,r,t[s+10],17,-42063),r=p(r,o,i,n,t[s+11],22,-1990404162),n=p(n,r,o,i,t[s+12],7,1804603682),i=p(i,n,r,o,t[s+13],12,-40341101),o=p(o,i,n,r,t[s+14],17,-1502002290),n=g(n,r=p(r,o,i,n,t[s+15],22,1236535329),o,i,t[s+1],5,-165796510),i=g(i,n,r,o,t[s+6],9,-1069501632),o=g(o,i,n,r,t[s+11],14,643717713),r=g(r,o,i,n,t[s+0],20,-373897302),n=g(n,r,o,i,t[s+5],5,-701558691),i=g(i,n,r,o,t[s+10],9,38016083),o=g(o,i,n,r,t[s+15],14,-660478335),r=g(r,o,i,n,t[s+4],20,-405537848),n=g(n,r,o,i,t[s+9],5,568446438),i=g(i,n,r,o,t[s+14],9,-1019803690),o=g(o,i,n,r,t[s+3],14,-187363961),r=g(r,o,i,n,t[s+8],20,1163531501),n=g(n,r,o,i,t[s+13],5,-1444681467),i=g(i,n,r,o,t[s+2],9,-51403784),o=g(o,i,n,r,t[s+7],14,1735328473),n=m(n,r=g(r,o,i,n,t[s+12],20,-1926607734),o,i,t[s+5],4,-378558),i=m(i,n,r,o,t[s+8],11,-2022574463),o=m(o,i,n,r,t[s+11],16,1839030562),r=m(r,o,i,n,t[s+14],23,-35309556),n=m(n,r,o,i,t[s+1],4,-1530992060),i=m(i,n,r,o,t[s+4],11,1272893353),o=m(o,i,n,r,t[s+7],16,-155497632),r=m(r,o,i,n,t[s+10],23,-1094730640),n=m(n,r,o,i,t[s+13],4,681279174),i=m(i,n,r,o,t[s+0],11,-358537222),o=m(o,i,n,r,t[s+3],16,-722521979),r=m(r,o,i,n,t[s+6],23,76029189),n=m(n,r,o,i,t[s+9],4,-640364487),i=m(i,n,r,o,t[s+12],11,-421815835),o=m(o,i,n,r,t[s+15],16,530742520),n=y(n,r=m(r,o,i,n,t[s+2],23,-995338651),o,i,t[s+0],6,-198630844),i=y(i,n,r,o,t[s+7],10,1126891415),o=y(o,i,n,r,t[s+14],15,-1416354905),r=y(r,o,i,n,t[s+5],21,-57434055),n=y(n,r,o,i,t[s+12],6,1700485571),i=y(i,n,r,o,t[s+3],10,-1894986606),o=y(o,i,n,r,t[s+10],15,-1051523),r=y(r,o,i,n,t[s+1],21,-2054922799),n=y(n,r,o,i,t[s+8],6,1873313359),i=y(i,n,r,o,t[s+15],10,-30611744),o=y(o,i,n,r,t[s+6],15,-1560198380),r=y(r,o,i,n,t[s+13],21,1309151649),n=y(n,r,o,i,t[s+4],6,-145523070),i=y(i,n,r,o,t[s+11],10,-1120210379),o=y(o,i,n,r,t[s+2],15,718787259),r=y(r,o,i,n,t[s+9],21,-343485551),n=v(n,a),r=v(r,l),o=v(o,u),i=v(i,c)}return Array(n,r,o,i)}function d(t,e,n,r,o,i){return v((e=v(v(e,t),v(r,i)))<<o|e>>>32-o,n)}function p(t,e,n,r,o,i,s){return d(e&n|~e&r,t,e,o,i,s)}function g(t,e,n,r,o,i,s){return d(e&r|n&~r,t,e,o,i,s)}function m(t,e,n,r,o,i,s){return d(e^n^r,t,e,o,i,s)}function y(t,e,n,r,o,i,s){return d(n^(e|~r),t,e,o,i,s)}function v(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}e.exports=function(t){return f.hash(t,h,16)}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(t,e,n){(function(t,n,r,o,i,s,a,l,u){e.exports=function(t){for(var e,n=new Array(t),r=0;r<t;r++)!(3&r)&&(e=4294967296*Math.random()),n[r]=e>>>((3&r)<<3)&255;return n}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(t,e,n){(function(n,r,o,i,s,a,l,u,c){var f=t("./helpers");function h(t,e){t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e;for(var n,r,o,i=Array(80),s=1732584193,a=-271733879,l=-1732584194,u=271733878,c=-1009589776,f=0;f<t.length;f+=16){for(var h=s,g=a,m=l,y=u,v=c,b=0;b<80;b++){i[b]=b<16?t[f+b]:p(i[b-3]^i[b-8]^i[b-14]^i[b-16],1);var C=d(d(p(s,5),(C=a,r=l,o=u,(n=b)<20?C&r|~C&o:!(n<40)&&n<60?C&r|C&o|r&o:C^r^o)),d(d(c,i[b]),(n=b)<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514));c=u,u=l,l=p(a,30),a=s,s=C}s=d(s,h),a=d(a,g),l=d(l,m),u=d(u,y),c=d(c,v)}return Array(s,a,l,u,c)}function d(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function p(t,e){return t<<e|t>>>32-e}e.exports=function(t){return f.hash(t,h,20,!0)}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(t,e,n){(function(n,r,o,i,s,a,l,u,c){function f(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function h(t,e){var n,r=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),o=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),i=new Array(64);t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e;for(var s,a,l=0;l<t.length;l+=16){for(var u=o[0],c=o[1],h=o[2],d=o[3],m=o[4],y=o[5],v=o[6],b=o[7],C=0;C<64;C++)i[C]=C<16?t[C+l]:f(f(f((a=i[C-2],p(a,17)^p(a,19)^g(a,10)),i[C-7]),(a=i[C-15],p(a,7)^p(a,18)^g(a,3))),i[C-16]),n=f(f(f(f(b,p(a=m,6)^p(a,11)^p(a,25)),m&y^~m&v),r[C]),i[C]),s=f(p(s=u,2)^p(s,13)^p(s,22),u&c^u&h^c&h),b=v,v=y,y=m,m=f(d,n),d=h,h=c,c=u,u=f(n,s);o[0]=f(u,o[0]),o[1]=f(c,o[1]),o[2]=f(h,o[2]),o[3]=f(d,o[3]),o[4]=f(m,o[4]),o[5]=f(y,o[5]),o[6]=f(v,o[6]),o[7]=f(b,o[7])}return o}var d=t("./helpers"),p=function(t,e){return t>>>e|t<<32-e},g=function(t,e){return t>>>e};e.exports=function(t){return d.hash(t,h,32,!0)}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(t,e,n){(function(t,e,r,o,i,s,a,l,u){n.read=function(t,e,n,r,o){var i,s,a=8*o-r-1,l=(1<<a)-1,u=l>>1,c=-7,f=n?o-1:0,h=n?-1:1;for(o=t[e+f],f+=h,i=o&(1<<-c)-1,o>>=-c,c+=a;0<c;i=256*i+t[e+f],f+=h,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=r;0<c;s=256*s+t[e+f],f+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return s?NaN:1/0*(o?-1:1);s+=Math.pow(2,r),i-=u}return(o?-1:1)*s*Math.pow(2,i-r)},n.write=function(t,e,n,r,o,i){var s,a,l=8*i-o-1,u=(1<<l)-1,c=u>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,d=r?1:-1;for(i=e<0||0===e&&1/e<0?1:0,e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(r=Math.pow(2,-s))<1&&(s--,r*=2),2<=(e+=1<=s+c?f/r:f*Math.pow(2,1-c))*r&&(s++,r/=2),u<=s+c?(a=0,s=u):1<=s+c?(a=(e*r-1)*Math.pow(2,o),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,o),s=0));8<=o;t[n+h]=255&a,h+=d,a/=256,o-=8);for(s=s<<o|a,l+=o;0<l;t[n+h]=255&s,h+=d,s/=256,l-=8);t[n+h-d]|=128*i}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(t,e,n){(function(t,n,r,o,i,s,a,l,u){var c,f,h;function d(){}(t=e.exports={}).nextTick=(f="undefined"!=typeof window&&window.setImmediate,h="undefined"!=typeof window&&window.postMessage&&window.addEventListener,f?function(t){return window.setImmediate(t)}:h?(c=[],window.addEventListener("message",(function(t){var e=t.source;e!==window&&null!==e||"process-tick"!==t.data||(t.stopPropagation(),0<c.length&&c.shift()())}),!0),function(t){c.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}),t.title="browser",t.browser=!0,t.env={},t.argv=[],t.on=d,t.addListener=d,t.once=d,t.off=d,t.removeListener=d,t.removeAllListeners=d,t.emit=d,t.binding=function(t){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(t){throw new Error("process.chdir is not supported")}}).call(this,t("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)},9146:(t,e)=>{"use strict";var n;!function(){var r=e||{}||this||window;void 0===(n=function(){return r}.apply(e,[]))||(t.exports=n),r.default=r;var o="http://www.w3.org/2000/xmlns/",i="http://www.w3.org/2000/svg",s=/url\(["']?(.+?)["']?\)/,a={woff2:"font/woff2",woff:"font/woff",otf:"application/x-font-opentype",ttf:"application/x-font-ttf",eot:"application/vnd.ms-fontobject",sfnt:"application/font-sfnt",svg:"image/svg+xml"},l=function(t){return t instanceof HTMLElement||t instanceof SVGElement},u=function(t){if(!l(t))throw new Error("an HTMLElement or SVGElement is required; got "+t)},c=function(t){return new Promise((function(e,n){l(t)?e(t):n(new Error("an HTMLElement or SVGElement is required; got "+t))}))},f=function(t,e,n){var r=t.viewBox&&t.viewBox.baseVal&&t.viewBox.baseVal[n]||null!==e.getAttribute(n)&&!e.getAttribute(n).match(/%$/)&&parseInt(e.getAttribute(n))||t.getBoundingClientRect()[n]||parseInt(e.style[n])||parseInt(window.getComputedStyle(t).getPropertyValue(n));return null==r||isNaN(parseFloat(r))?0:r},h=function(t){for(var e=window.atob(t.split(",")[1]),n=t.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(e.length),o=new Uint8Array(r),i=0;i<e.length;i++)o[i]=e.charCodeAt(i);return new Blob([r],{type:n})},d={},p=null,g=function(t,e){var n=e||{},r=n.selectorRemap,o=n.modifyStyle,i=n.modifyCss,l=n.fonts,u=n.excludeUnusedCss,c=i||function(t,e){return(r?r(t):t)+"{"+(o?o(e):e)+"}\n"},f=[],h=void 0===l,g=l||[];return(p||(p=Array.from(document.styleSheets).map((function(t){try{return{rules:t.cssRules,href:t.href}}catch(e){return console.warn("Stylesheet could not be loaded: "+t.href,e),{}}})))).forEach((function(e){var n=e.rules,r=e.href;n&&Array.from(n).forEach((function(e){if(void 0!==e.style)if(function(t,e){if(e)try{return t.querySelector(e)||t.parentNode&&t.parentNode.querySelector(e)}catch(t){console.warn('Invalid CSS selector "'+e+'"',t)}}(t,e.selectorText))f.push(c(e.selectorText,e.style.cssText));else if(h&&e.cssText.match(/^@font-face/)){var n=function(t,e){var n=t.cssText.match(s),r=n&&n[1]||"";if(r&&!r.match(/^data:/)&&"about:blank"!==r){var o,i,l=r.startsWith("../")?e+"/../"+r:r.startsWith("./")?e+"/."+r:r;return{text:t.cssText,format:(o=l,i=Object.keys(a).filter((function(t){return o.indexOf("."+t)>0})).map((function(t){return a[t]})),i?i[0]:(console.error("Unknown font format for "+o+". Fonts may not be working correctly."),"application/octet-stream")),url:l}}}(e,r);n&&g.push(n)}else u||f.push(e.cssText)}))})),function(t){return Promise.all(t.map((function(t){return new Promise((function(e,n){if(d[t.url])return e(d[t.url]);var r=new XMLHttpRequest;r.addEventListener("load",(function(){var n=function(t){for(var e="",n=new Uint8Array(t),r=0;r<n.byteLength;r++)e+=String.fromCharCode(n[r]);return window.btoa(e)}(r.response),o=t.text.replace(s,'url("data:'+t.format+";base64,"+n+'")')+"\n";d[t.url]=o,e(o)})),r.addEventListener("error",(function(n){console.warn("Failed to load font from: "+t.url,n),d[t.url]=null,e(null)})),r.addEventListener("abort",(function(n){console.warn("Aborted loading font from: "+t.url,n),e(null)})),r.open("GET",t.url),r.responseType="arraybuffer",r.send()}))}))).then((function(t){return t.filter((function(t){return t})).join("")}))}(g).then((function(t){return f.join("\n")+t}))},m=function(){if(!navigator.msSaveOrOpenBlob&&!("download"in document.createElement("a")))return{popup:window.open()}};r.prepareSvg=function(t,e,n){u(t);var r=e||{},s=r.left,a=void 0===s?0:s,l=r.top,c=void 0===l?0:l,h=r.width,d=r.height,p=r.scale,m=void 0===p?1:p,y=r.responsive,v=void 0!==y&&y,b=r.excludeCss,C=void 0!==b&&b;return function(t){return Promise.all(Array.from(t.querySelectorAll("image")).map((function(t){var e,n=t.getAttributeNS("http://www.w3.org/1999/xlink","href")||t.getAttribute("href");return n?((e=n)&&0===e.lastIndexOf("http",0)&&-1===e.lastIndexOf(window.location.host)&&(n+=(-1===n.indexOf("?")?"?":"&")+"t="+(new Date).valueOf()),new Promise((function(e,r){var o=document.createElement("canvas"),i=new Image;i.crossOrigin="anonymous",i.src=n,i.onerror=function(){return r(new Error("Could not load "+n))},i.onload=function(){o.width=i.width,o.height=i.height,o.getContext("2d").drawImage(i,0,0),t.setAttributeNS("http://www.w3.org/1999/xlink","href",o.toDataURL("image/png")),e(!0)}}))):Promise.resolve(null)})))}(t).then((function(){var r=t.cloneNode(!0);r.style.backgroundColor=(e||{}).backgroundColor||t.style.backgroundColor;var s=function(t,e,n,r){if("svg"===t.tagName)return{width:n||f(t,e,"width"),height:r||f(t,e,"height")};if(t.getBBox){var o=t.getBBox(),i=o.x,s=o.y;return{width:i+o.width,height:s+o.height}}}(t,r,h,d),l=s.width,u=s.height;if("svg"!==t.tagName){if(!t.getBBox)return void console.error("Attempted to render non-SVG element",t);null!=r.getAttribute("transform")&&r.setAttribute("transform",r.getAttribute("transform").replace(/translate\(.*?\)/,""));var p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.appendChild(r),r=p}if(r.setAttribute("version","1.1"),r.setAttribute("viewBox",[a,c,l,u].join(" ")),r.getAttribute("xmlns")||r.setAttributeNS(o,"xmlns",i),r.getAttribute("xmlns:xlink")||r.setAttributeNS(o,"xmlns:xlink","http://www.w3.org/1999/xlink"),v?(r.removeAttribute("width"),r.removeAttribute("height"),r.setAttribute("preserveAspectRatio","xMinYMin meet")):(r.setAttribute("width",l*m),r.setAttribute("height",u*m)),Array.from(r.querySelectorAll("foreignObject > *")).forEach((function(t){t.setAttributeNS(o,"xmlns","svg"===t.tagName?i:"http://www.w3.org/1999/xhtml")})),!C)return g(t,e).then((function(t){var e=document.createElement("style");e.setAttribute("type","text/css"),e.innerHTML="<![CDATA[\n"+t+"\n]]>";var o=document.createElement("defs");o.appendChild(e),r.insertBefore(o,r.firstChild);var i=document.createElement("div");i.appendChild(r);var s=i.innerHTML.replace(/NS\d+:href/gi,'xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href');if("function"!=typeof n)return{src:s,width:l,height:u};n(s,l,u)}));var y=document.createElement("div");y.appendChild(r);var b=y.innerHTML;if("function"!=typeof n)return{src:b,width:l,height:u};n(b,l,u)}))},r.svgAsDataUri=function(t,e,n){return u(t),r.prepareSvg(t,e).then((function(t){var e=t.src,r=t.width,o=t.height,i="data:image/svg+xml;base64,"+window.btoa(decodeURIComponent(encodeURIComponent('<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [<!ENTITY nbsp " ">]>'+e).replace(/%([0-9A-F]{2})/g,(function(t,e){var n=String.fromCharCode("0x"+e);return"%"===n?"%25":n}))));return"function"==typeof n&&n(i,r,o),i}))},r.svgAsPngUri=function(t,e,n){u(t);var o=e||{},i=o.encoderType,s=void 0===i?"image/png":i,a=o.encoderOptions,l=void 0===a?.8:a,c=o.canvg,f=function(t){var e=t.src,r=t.width,o=t.height,i=document.createElement("canvas"),a=i.getContext("2d"),u=window.devicePixelRatio||1;i.width=r*u,i.height=o*u,i.style.width=i.width+"px",i.style.height=i.height+"px",a.setTransform(u,0,0,u,0,0),c?c(i,e):a.drawImage(e,0,0);var f=void 0;try{f=i.toDataURL(s,l)}catch(t){if("undefined"!=typeof SecurityError&&t instanceof SecurityError||"SecurityError"===t.name)return void console.error("Rendered SVG images cannot be downloaded in this browser.");throw t}return"function"==typeof n&&n(f,i.width,i.height),Promise.resolve(f)};return c?r.prepareSvg(t,e).then(f):r.svgAsDataUri(t,e).then((function(t){return new Promise((function(e,n){var r=new Image;r.onload=function(){return e(f({src:r,width:r.width,height:r.height}))},r.onerror=function(){n("There was an error loading the data URI as an image on the following SVG\n"+window.atob(t.slice(26))+"Open the following link to see browser's diagnosis\n"+t)},r.src=t}))}))},r.download=function(t,e,n){if(navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(h(e),t);else{var r=document.createElement("a");if("download"in r){r.download=t,r.style.display="none",document.body.appendChild(r);try{var o=h(e),i=URL.createObjectURL(o);r.href=i,r.onclick=function(){return requestAnimationFrame((function(){return URL.revokeObjectURL(i)}))}}catch(t){console.error(t),console.warn("Error while getting object URL. Falling back to string URL."),r.href=e}r.click(),document.body.removeChild(r)}else n&&n.popup&&(n.popup.document.title=t,n.popup.location.replace(e))}},r.saveSvg=function(t,e,n){var o=m();return c(t).then((function(t){return r.svgAsDataUri(t,n||{})})).then((function(t){return r.download(e,t,o)}))},r.saveSvgAsPng=function(t,e,n){var o=m();return c(t).then((function(t){return r.svgAsPngUri(t,n||{})})).then((function(t){return r.download(e,t,o)}))}}()},5072:t=>{"use strict";var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var i={},s=[],a=0;a<t.length;a++){var l=t[a],u=r.base?l[0]+r.base:l[0],c=i[u]||0,f="".concat(u," ").concat(c);i[u]=c+1;var h=n(f),d={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==h)e[h].references++,e[h].updater(d);else{var p=o(d,r);r.byIndex=a,e.splice(a,0,{identifier:f,updater:p,references:1})}s.push(f)}return s}function o(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,o){var i=r(t=t||[],o=o||{});return function(t){t=t||[];for(var s=0;s<i.length;s++){var a=n(i[s]);e[a].references--}for(var l=r(t,o),u=0;u<i.length;u++){var c=n(i[u]);0===e[c].references&&(e[c].updater(),e.splice(c,1))}i=l}}},7659:t=>{"use strict";var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},5056:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},7825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},1113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},6686:(t,e,n)=>{"use strict";n.d(e,{AL:()=>r,NO:()=>o});const r=["A","G","C","U"];var o;!function(t){t.HELM="HELM",t.AXOLABS="Axolabs"}(o||(o={}))},5670:(t,e,n)=>{"use strict";function r(t,e=!0){let n="\n Datagrok macromolecule handler\n\n";n+=" 0 0 0 0 0 0 999 V3000\n",n+="M V30 BEGIN CTAB\n";let r="",a="",l="";const u=[];let c=0,f=0,h=0;if(t.antiStrands.length>0)for(let e=0;e<t.antiStrands.length;e++)t.antiStrands[e]=o(t.antiStrands[e]);let d=!1;const p=t.senseStrands.concat(t.antiStrands);let g=0;for(let e=0;e<p.length;e++){p[e]=p[e].replaceAll("(-\nM V30 ","(").replaceAll("-\nM V30 ","").replaceAll(" )",")");const n=i(p[e]),o=s(p[e]);if(e>=t.senseStrands.length?!1===d&&(d=!0,h=0):g=Math.min(g,Math.min(...o.y.filter((t=>t<0)))),d){const t=Math.min(...o.x)-h,e=Math.max(...o.y)+5;for(let e=0;e<o.x.length;e++)o.x[e]-=t;for(let t=0;t<o.y.length;t++)o.y[t]-=e-g}let l=p[e].indexOf("M V30 BEGIN ATOM");l=p[e].indexOf("\n",l);let m=l,y=l;for(let t=0;t<n.natom;t++){m=p[e].indexOf("V30",m)+4,y=p[e].indexOf(" ",m);const n=parseInt(p[e].substring(m,y))+c;p[e]=p[e].slice(0,m)+n+p[e].slice(y),m=p[e].indexOf(" ",m)+1,m=p[e].indexOf(" ",m)+1,y=p[e].indexOf(" ",m);let r=Math.round(1e4*o.x[t])/1e4;p[e]=p[e].slice(0,m)+r+p[e].slice(y),m=p[e].indexOf(" ",m)+1,y=p[e].indexOf(" ",m),r=Math.round(1e4*o.y[t])/1e4,p[e]=p[e].slice(0,m)+r+p[e].slice(y),m=p[e].indexOf("\n",m)+1}const v=p[e].indexOf("M V30 END ATOM");r+=p[e].substring(l+1,v);let b=p[e].indexOf("M V30 BEGIN BOND");b=p[e].indexOf("\n",b),m=b,y=b;for(let t=0;t<n.nbond;t++){m=p[e].indexOf("V30",m)+4,y=p[e].indexOf(" ",m);const t=parseInt(p[e].substring(m,y))+f;p[e]=p[e].slice(0,m)+t+p[e].slice(y),m=p[e].indexOf(" ",m)+1,m=p[e].indexOf(" ",m)+1,y=p[e].indexOf(" ",m);let n=parseInt(p[e].substring(m,y))+c;p[e]=p[e].slice(0,m)+n+p[e].slice(y),m=p[e].indexOf(" ",m)+1,y=Math.min(p[e].indexOf("\n",m),p[e].indexOf(" ",m)),n=parseInt(p[e].substring(m,y))+c,p[e]=p[e].slice(0,m)+n+p[e].slice(y),m=p[e].indexOf("\n",m)+1}const C=p[e].indexOf("M V30 END BOND");a+=p[e].substring(b+1,C);let A=p[e].indexOf("M V30 MDLV30/STEABS ATOMS=(");for(;-1!==A;){A+=28;const t=p[e].indexOf(")",A);p[e].substring(A,t).split(" ").slice(1).forEach((t=>{u.push(parseInt(t)+c)})),A=t,A=p[e].indexOf("M V30 MDLV30/STEABS ATOMS=(",A)}c+=n.natom,f+=n.nbond,h+=Math.max(...o.x)+5}const m=Math.ceil(u.length/4);l+="M V30 MDLV30/STEABS ATOMS=("+u.length+" -\n";for(let t=0;t<m;t++){l+="M V30 ";const e=t+1===m?u.length-4*(m-1):4;for(let n=0;n<e;n++)l+=n+1===e?t===m-1?u[4*t+n]+")\n":u[4*t+n]+" -\n":u[4*t+n]+" "}return n+="M V30 COUNTS "+c+" "+f+" 0 0 0\n",n+="M V30 BEGIN ATOM\n",n+=r,n+="M V30 END ATOM\n",n+="M V30 BEGIN BOND\n",n+=a,n+="M V30 END BOND\n",e&&u.length>0?(n+="M V30 BEGIN COLLECTION\n",n+=l,n+="M V30 END COLLECTION\n"):n=n.replace(/ CFG=\d/g," "),n+="M V30 END CTAB\n",n+="M END",n}function o(t){const e=s(t),n=e.atomIndex.length,r=(Math.max(...e.x)+Math.min(...e.x))/2,o=(Math.max(...e.y)+Math.min(...e.y))/2;for(let t=0;t<n;t++)e.x[t]-=r,e.y[t]-=o;const i=Math.PI,a=Math.cos(i),l=Math.sin(i);for(let t=0;t<n;t++){const n=e.x[t];e.x[t]=n*a-e.y[t]*l,e.y[t]=n*l+e.y[t]*a}const u=Math.max(...e.y);for(let t=0;t<n;t++)e.x[t]+=r,e.y[t]-=u;let c=t.indexOf("M V30 BEGIN ATOM");c=t.indexOf("\n",c);let f=c;for(let r=0;r<n;r++)c=t.indexOf("V30",c)+4,c=t.indexOf(" ",c)+1,c=t.indexOf(" ",c)+1,f=t.indexOf(" ",c)+1,f=t.indexOf(" ",f),c=(t=t.slice(0,c)+e.x[r]+" "+e.y[r]+t.slice(f)).indexOf("\n",c)+1;return t}function i(t){let e=(t=t.replaceAll("\r","")).indexOf("COUNTS")+7,n=t.indexOf(" ",e);const r=parseInt(t.substring(e,n));return e=n+1,n=t.indexOf(" ",e),{natom:r,nbond:parseInt(t.substring(e,n))}}function s(t){const e=i(t);let n=t.indexOf("M V30 BEGIN ATOM");n=t.indexOf("\n",n);let r=n;const o=Array(e.natom),s=Array(e.natom),a=Array(e.natom),l=Array(e.natom);for(let i=0;i<e.natom;i++)n=t.indexOf("V30",n)+4,r=t.indexOf(" ",n),o[i]=parseInt(t.substring(n,r)),n=r+1,r=t.indexOf(" ",n),s[i]=t.substring(n,r),n=r+1,r=t.indexOf(" ",n),a[i]=parseFloat(t.substring(n,r)),n=r+1,r=t.indexOf(" ",n),l[i]=parseFloat(t.substring(n,r)),n=t.indexOf("\n",n)+1;return{atomIndex:o,atomType:s,x:a,y:l}}n.d(e,{cx:()=>s,vS:()=>r})},9537:(t,e,n)=>{"use strict";n.d(e,{iL:()=>i,q7:()=>o,ti:()=>r});const r={NUCLEOSIDE:"nucleoside",LINKAGE:"phosphateBackbone"},o="p",i="<?>"},3480:(t,e,n)=>{"use strict";n.d(e,{C6:()=>l,Hs:()=>a,OT:()=>u,bD:()=>s});var r=n(6686),o=n(5067),i=n(9537);function s(t,e,n,o){const i=Object.keys(o.jsonData.codesToHelmDict).concat([r.NO.HELM]);if(!t||-1!==e&&n!==r.NO.HELM)return{};if(!i.includes(n))throw new Error(`${n} format is not supported by SequenceTranslator`);const s=i.filter((t=>t!=n)).sort(((t,e)=>t.localeCompare(e))),l=o.createFormatConverter(t,n),u=Object.fromEntries(s.map((t=>{let e;try{e=l.convertTo(t)}catch{e=null}return[t,e]})).filter((([t,e])=>e))),c=a(n===r.NO.HELM?t:u[r.NO.HELM],o.monomerLibWrapper);return c&&(u.Nucleotides=c),u}function a(t,e){const n=new RegExp("\\([^()]*\\)","g"),o=t.match(n);return o?o.map((t=>{const n=t.replace(/[\[\]()]/g,"");return r.AL.includes(n)?n:e.getNaturalAnalogBySymbol(n)})).map((t=>t||i.iL)).join(""):null}function l(t,e,n,i){const s=i.createFormatConverter(t,e);return n===o.qP?a(s.convertTo(r.NO.HELM),i.monomerLibWrapper):s.convertTo(n)}function u(t){return Object.keys(t.jsonData.codesToHelmDict).concat([r.NO.HELM,o.qP]).sort()}},5067:(t,e,n)=>{"use strict";n.d(e,{U_:()=>o,n_:()=>r,qP:()=>i});const r="Copied",o="Copy sequence",i="Nucleotides"},1950:(t,e,n)=>{"use strict";n.d(e,{_package:()=>Wt,applyNotationProviderForCyclized:()=>Yt});var r=n(4328),o=n(6082),i=n(439),s=n(7291);const a=new class{constructor(){this.seqHandler="seq-handler",this.notationProvider="seq-handler.notation-provider"}};o.SemanticValue;var l=n(2890);class u{constructor(t,e,n=""){this.target=t,this.debugEnabled=e,this.prefix=n}error(t,e,n){return this.target.error(this.prefix+t,e,n)}warning(t,e){return this.target.warning(this.prefix+t,e)}info(t,e){return this.target.info(this.prefix+t,e)}debug(t,e){if(this.debugEnabled)return this.target.debug(this.prefix+t,e)}}const c="System:AppData/SequenceTranslator/monomers-sample",f="pattern-app-data.json",h="formats-to-helm.json",d="codes-to-symbols.json",p="linkers.json";var g=n(6686);function m(t){return t.sort(((t,e)=>e.length-t.length))}class y{constructor(t,e){this.sequence=t,this.th=e,this.libWrapper=this.th.monomerLibWrapper}getInvalidCodeIndex(t){if(t===g.NO.HELM)return this.sequence.length;const e=["r","d"],n=m(this.libWrapper.getCodesByFormat(t));let r=0;for(;r<this.sequence.length;){const t=n.find((t=>t===this.sequence.substring(r,r+t.length)));if(!t)break;if(r>1&&g.AL.includes(this.sequence[r])&&e.includes(this.sequence[r-2]))break;if(e.includes(this.sequence[r+1])&&g.AL.includes(this.sequence[r])){r++;break}r+=t.length}return r===this.sequence.length&&(r=-1),r}isValidSequence(t){return-1===this.getInvalidCodeIndex(t)}}class v{constructor(t,e,n,r){this.patternAppData=t,this.codesToHelmDict=e,this.codesToSymbolsDict=n,this.monomersWithPhosphate=r}}async function b(t){const e=await Promise.all([f,h,d,p].map((e=>async function(t,e){const n=t.endsWith("/")?`${t}${e}`:`${t}/${e}`;try{const t=await r.dapi.files.readAsText(n);return JSON.parse(t)}catch(t){console.error(`Error loading json from '${n}':`,t)}}(t,e))));return new v(e[0],e[1],e[2],e[3])}class C{constructor(t,e){if(this.lib=t,this.jsonData=e,null===this.lib)throw new Error("SequenceTranslator: monomer library is null");this.allMonomers=this.getAllMonomers()}formatMonomerForViewer(t){const e={};return e.name=t.symbol,e.symbol=t.symbol,e.molfile=t.molfile,this.getAllFormats().forEach((n=>{if(n===g.NO.HELM)return;const r=this.jsonData.codesToSymbolsDict[n],o=Object.keys(r).filter((e=>r[e]===t.symbol));e[n]=o.join(", ")})),e}getAllMonomers(){const t=this.lib.getPolymerTypes();let e=[];for(const n of t){const t=this.lib.getMonomerSymbolsByType(n).map((t=>this.lib.getMonomer(n,t))).filter((t=>null!==t));e=e.concat(t)}return e}getMonomer(t){const e=this.lib.getMonomer("RNA",t);if(void 0===e)throw new Error(`SequenceTranslator: no monomer with symbol ${t}`);return e}getMolfileBySymbol(t){return this.getMonomer(t).molfile}getNaturalAnalogBySymbol(t){const e=this.getMonomer(t).naturalAnalog;if(!e)throw new Error(`ST: no natural analog for ${t}`);return e}isModification(t){return!!this.getMolfileBySymbol(t).includes("MODIFICATION")}getCodeToSymbolMap(t){return new Map(Object.entries(this.jsonData.codesToSymbolsDict[t]))}getCodesByFormat(t){return Object.keys(this.jsonData.codesToSymbolsDict[t])}getAllFormats(){return Object.keys(this.jsonData.codesToSymbolsDict)}getTableForViewer(){const t=this.allMonomers.map((t=>this.formatMonomerForViewer(t)));return o.DataFrame.fromObjects(t)}getCodesToWeightsMap(){const t=new Map;return Object.entries(this.jsonData.codesToSymbolsDict).forEach((([e,n])=>{Object.entries(n).forEach((([e,n])=>{const r=this.getMonomer(n),o=r.meta?.molecularWeight;t.set(e,o)}))})),t}}var A=n(9537);const w=(t,e)=>e.length-t.length;class E{constructor(t){this.th=t,this.formats=this.getFormats()}getFormatNames(){return this.formats.sort()}getCodesByFormat(t){if(this.validateFormat(t),this.isHelm(t))throw new Error("Codes cannot be obtained for HELM");return this.getFormatCodes(t)}getHelmToFormatDict(t){return this.validateFormat(t),function(t){const e={};return Object.values(t).forEach((t=>{Object.entries(t).forEach((([t,n])=>{const r=n.replace(/\)p/g,")").replace(/\]p/g,"]");void 0===e[r]?e[r]=[t]:e[r].push(t)}))})),Object.entries(e).forEach((([t,n])=>{const r=n.sort(w);e[t]=r[0]})),e}(this.th.jsonData.codesToHelmDict[t])}getFormatToHelmDict(t){this.validateFormat(t);const e=this.th.jsonData.codesToHelmDict[t];return Object.assign({},...Object.values(e))}getTargetFormatHelmCodes(t){this.validateFormat(t);const e=this.getHelmToFormatDict(t);return Object.keys(e).sort(w)}getTargetFormatHelmCodesRegExp(t){this.validateFormat(t);const e=this.getTargetFormatHelmCodes(t);return new RegExp(_(e)+"|.","g")}getFormatRegExp(t){if(this.validateFormat(t),this.isHelm(t))throw new Error("Helm RegExp can be built for non-HELM target formats");return this.getNonHelmFormatRegExp(t)}getPhosphateHelmCodesRegExp(t){this.validateFormat(t);const e=this.th.jsonData.codesToHelmDict[t],n=_(Array.from(new Set(Object.values(e[A.ti.LINKAGE]))).sort(w));return new RegExp(`${A.q7}.(${n})`,"g")}isValidFormat(t){return this.formats.includes(t)}getFormats(){return Object.keys(this.th.jsonData.codesToHelmDict)}validateFormat(t){if(!this.isValidFormat(t))throw new Error(`Invalid format: ${t}`)}isHelm(t){return t===g.NO.HELM}getFormatCodes(t){const e=this.getFormatToHelmDict(t);return Object.keys(e).sort(w)}getNonHelmFormatRegExp(t){const e=this.getCodesByFormat(t);return new RegExp(_(e)+"|\\([^()]*\\)|.","g")}}function _(t){return t.map((t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))).map((t=>t.includes("(")||t.includes(")")?t:`(?<!\\([^()]*)${t}(?![^()]*\\))`)).join("|")}const x={LEFT:"RNA1{",RIGHT:"}$$$$"};class T{constructor(t,e,n){this.sequence=t,this.sourceFormat=e,this.th=n,this.formats=new E(this.th)}convertTo(t){const e=this.formats.getFormatNames();if(this.sourceFormat===g.NO.HELM&&e.includes(t))return this.helmToFormat(this.sequence,t);if(e.includes(this.sourceFormat)&&t===g.NO.HELM)return this.formatToHelm(this.sequence,this.sourceFormat);if([this.sourceFormat,t].every((t=>e.includes(t)))){const e=this.formatToHelm(this.sequence,this.sourceFormat);return this.helmToFormat(e,t)}throw new Error(`ST: unsupported translation direction ${this.sourceFormat} -> ${t}`)}helmToFormat(t,e){const n=new RegExp(_(Object.values(x)),"g");let r=t.replace(n,"");const o=this.formats.getHelmToFormatDict(e),i=this.formats.getTargetFormatHelmCodes(e),s=this.formats.getTargetFormatHelmCodesRegExp(e);return r=r.replace(s,(t=>i.includes(t)?o[t]:"p"===t||"."===t?t:"?")).replace(/\?+/g,A.iL).replace(/p\.|\./g,""),r=r.replace(/<empty>/g,""),r=r.replace(/\/\//g,"/"),r}formatToHelm(t,e){const n=this.formats.getFormatToHelmDict(e),r=this.formats.getCodesByFormat(e),o=this.formats.getFormatRegExp(e),i=this.formats.getPhosphateHelmCodesRegExp(e);let s=t?t.replace(o,(t=>r.includes(t)?n[t]+".":"?")):"";return s=s.replace(/\?+/g,`${A.iL}.`),s=s.slice(0,-1),s[s.length-1]===A.q7&&(s=s.slice(0,-1)),s=s.replace(i,((t,e)=>e)),s=s.replace(/<empty>/g,""),`${x.LEFT+s+x.RIGHT}`}}class I{constructor(t,e){this.sequence=t,this.th=e,this.libWrapper=this.th.monomerLibWrapper,this.formats=Object.keys(this.th.jsonData.codesToHelmDict)}getFormat(){if(this.sequence.startsWith("RNA"))return g.NO.HELM;const t=this.getListOfPossibleSynthesizersByFirstMatchedCode();if(0===t.length)return null;const e=this.th.createSequenceValidator(this.sequence),n=Array(t.length).fill(0);for(let r=0;r<t.length;++r){const o=t[r];n[r]=e.getInvalidCodeIndex(o)}const r=n.some((t=>-1===t))?-1:Math.max(...n);return t[n.indexOf(r)]}getListOfPossibleSynthesizersByFirstMatchedCode(){const t=this.sequence,e=[];for(const n of this.formats){const r=m(this.libWrapper.getCodesByFormat(n));let o=0;for(let e=0;e<t.length;e++)if(")"===t[e]&&e!==t.length-1){o=e+1;break}r.some((e=>e===t.slice(o,o+e.length)))&&e.push(n)}return e}}var N=n(7389);const S=$;var L=n.n(S);class P extends o.Package{get helmHelper(){if(!this._helmHelper)throw new Error("Package SequenceTranslator .helmHelper is not initialized");return this._helmHelper}get seqHelper(){return this._helmHelper.seqHelper}get monomerLib(){if(!this._monomerLib)throw new Error("Monomer lib not loaded");return this._monomerLib}get jsonData(){if(!this._jsonData)throw new Error("Json data not loaded");return this._jsonData}get monomerLibWrapper(){if(!this._monomerLibWrapper)throw new Error("Monomer lib wrapper not loaded");return this._monomerLibWrapper}get initPromise(){return this._initPromise}constructor(t={debug:!1}){super(),this.highlightInvalidSubsequence=t=>function(t,e){let n=0;const r=e.createFormatDetector(t).getFormat();null!==r&&(n=new y(t,e).getInvalidCodeIndex(r));const o=n<0||""===t,i=N.span([]);L()(i).css("-webkit-text-fill-color","var(--grey-6)");const s=N.span([]);return L()(s).css("-webkit-text-fill-color","red"),o?i.innerHTML=t:(i.innerHTML=t.slice(0,n),s.innerHTML=t.slice(n)),[i,s]}(t,this),super._logger=new u(super.logger,t.debug)}startInit(t){this._initPromise=t}completeInit(t){this._helmHelper=t}async initLibData(){return this.initLibDataPromise||(this.initLibDataPromise=(async()=>{const t=await this.getSettings();let e=t instanceof Map?t.get("MonomersPath"):t.MonomersPath;e&&await r.dapi.files.exists(e)||(this.logger.warning(`Monomers path '${e}' not found. Fallback to monomers sample path '${c}'.`),e=c),[this._jsonData,this._monomerLib]=await Promise.all([b(e),O(e)]),this._monomerLibWrapper=new C(this.monomerLib,this.jsonData)})()),this.initLibDataPromise}async getTranslationHelper(){return await r.functions.call(`${this.name}:getTranslationHelper`)}createSequenceValidator(t){return new y(t,this)}createFormatConverter(t,e){return new T(t,e,this)}createFormatDetector(t){return new I(t,this)}}async function O(t){const e=o.TaskBarProgressIndicator.create("Initializing Oligo Toolkit monomer library ...");try{const e=await(0,l.pj)();return await e.readLibrary(t,"monomer-lib.json")}finally{e.close()}}const M=["SS","AS"],R={SS:"Sense strand",AS:"Anti sense"},D=["3'","5'"];var B,H,F,k;!function(t){t.IS_ANTISENSE_STRAND_INCLUDED="isAntisenseStrandIncluded",t.NUCLEOTIDE_SEQUENCES="nucleotideSequences",t.PHOSPHOROTHIOATE_LINKAGE_FLAGS="phosphorothioateLinkageFlags",t.STRAND_TERMINUS_MODIFICATIONS="strandTerminusModifications"}(B||(B={})),function(t){t.PATTERN_NAME="patternName",t.PATTERN_COMMENT="patternComment",t.NUCLEOTIDES_WITH_NUMERIC_LABELS="nucleotidesWithNumericLabels"}(H||(H={})),function(t){t.PATTERN_CONFIG="patternConfig",t.AUTHOR_ID="authorID",t.DATE="date"}(F||(F={})),function(t){t.CREATE="create",t.MODIFY="modify"}(k||(k={})),B.IS_ANTISENSE_STRAND_INCLUDED,B.NUCLEOTIDE_SEQUENCES,B.PHOSPHOROTHIOATE_LINKAGE_FLAGS,B.STRAND_TERMINUS_MODIFICATIONS,H.PATTERN_NAME,H.PATTERN_COMMENT,H.NUCLEOTIDES_WITH_NUMERIC_LABELS,Error,Error,n(4802);const G=rxjs;var U;rxjs.operators,function(t){t.getTruncatedStrandData=function(t,e,n){return{nucleotides:t.slice(0,n),ptoFlags:e.slice(0,n+1)}},t.getExtendedStrandData=function(t,e,n,r){const o=n-t.length,i=t.concat(new Array(n-t.length).fill(r)),s=0===t.length?n+1:o;return{nucleotides:i,ptoFlags:e.concat(new Array(s).fill(!0))}}}(U||(U={}));var j=n(2543),V=n.n(j),W=n(5072),Y=n.n(W),q=n(7825),K=n.n(q),z=n(7659),J=n.n(z),Q=n(5056),X=n.n(Q),Z=n(540),tt=n.n(Z),et=n(1113),nt=n.n(et),rt=n(9252),ot={};ot.styleTagTransform=nt(),ot.setAttributes=X(),ot.insert=J().bind(null,"head"),ot.domAPI=K(),ot.insertStyleElement=tt(),Y()(rt.A,ot),rt.A&&rt.A.locals&&rt.A.locals;class it{constructor(t,e,n){this.eventBus=t,this.initialPatternConfig=e,this.subscriptions=n}create(){return N.divV([N.h1("PTO"),N.divH([this.createAllPtoActivationInput().root,...this.createFirstPtoInputs().map((t=>t.root))],{style:{gap:"12px"}})])}areAllPtoLinkagesSet(t){return M.map((e=>t[e].filter((t=>t)).length)).reduce(((t,e)=>t+e),0)===M.map((t=>this.initialPatternConfig.nucleotideSequences[t].length)).reduce(((t,e)=>t+e),0)+M.filter((e=>t[e].length)).length}createAllPtoActivationInput(){const t=this.initialPatternConfig.phosphorothioateLinkageFlags,e=this.areAllPtoLinkagesSet(t),n=N.input.bool("All PTO",{value:e});n.onInput.subscribe((()=>{const t=n.value;this.eventBus.setAllPTOLinkages(t)}));const r=this.eventBus.phosphorothioateLingeFlagsChanged$.subscribe((()=>{const t=this.eventBus.getPatternConfig().phosphorothioateLinkageFlags,e=this.areAllPtoLinkagesSet(t);n.value=e}));return this.subscriptions.add(r),this.addStyleToPtoInput(n),N.tooltip.bind(n.captionLabel,"Activate all phosphothioates"),n}addStyleToPtoInput(t){const e=t.captionLabel;e.classList.add("ui-label-right"),Object.assign(e.style,{textAlign:"left",maxWidth:"100px",minWidth:"40px",width:"auto"})}createFirstPtoInputs(){return M.map((t=>{if(!this.eventBus.isAntisenseStrandActive()&&"AS"===t)return;const e=this.isFirstPtoActive(t),n=N.input.bool(`First ${t} PTO`,{value:e});n.onInput.subscribe((()=>{const e=n.value;this.eventBus.setPhosphorothioateLinkageFlag(t,0,e)}));const r=this.eventBus.phosphorothioateLingeFlagsChanged$.subscribe((e=>{const r=e[t][0];n.value=r}));return this.subscriptions.add(r),this.addStyleToPtoInput(n),N.tooltip.bind(n.captionLabel,`Activate first phosphothioate in ${t}`),n})).filter((t=>void 0!==t))}isFirstPtoActive(t){return this.initialPatternConfig.phosphorothioateLinkageFlags[t][0]}}class st{constructor(t,e,n){this.eventBus=t,this.dataManager=e,this.subscriptions=n;const r=this.eventBus.nucleotideSequencesChanged$.subscribe((()=>{this.displayedInputLabels=this.computeDisplayedInputLabels()}));this.subscriptions.add(r)}create(){const t=M.map((t=>this.constructControlsPanel(t)));return N.divH(t,{style:{gap:"24px"}})}constructControlsPanel(t){if(!this.eventBus.isAntisenseStrandActive()&&"AS"===t)return N.div([]);const e=this.constructHeader(),n=this.createControls(t);return N.block([N.h1(`${R[t]}`),e,n],{style:{paddingTop:"12px"}})}constructHeader(){return N.divH([N.div([N.divText("#")],{style:{width:"20px"}}),N.block75([N.divText("Modification")]),N.div([N.divText("PTO")])])}createControls(t){const e=this.createNucleobaseInputs(t),n=this.createLabelDivs(t),r=this.createPTOFlagInputs(t);return N.div(e.map(((t,e)=>N.divH([n[e],N.block75([t.root]),r[e].root],{style:{alignItems:"center"}}))))}createNucleobaseInputs(t){const e=this.dataManager.fetchAvailableNucleotideBases().sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase())));return this.eventBus.getNucleotideSequences()[t].map(((n,r)=>{const o=N.input.choice("",{value:n,items:e});return o.onInput.subscribe((()=>{const e=o.value;this.eventBus.setNucleotide(t,r,e)})),o}))}createPTOFlagInputs(t){return this.eventBus.getPhosphorothioateLinkageFlags()[t].slice(1).map(((e,n)=>{const r=N.input.bool("",{value:e});r.onInput.subscribe((()=>{const e=r.value;this.eventBus.setPhosphorothioateLinkageFlag(t,n+1,e)}));const o=this.eventBus.phosphorothioateLingeFlagsChanged$.subscribe((e=>{const o=e[t][n+1];r.value=o}));return this.subscriptions.add(o),r}))}computeDisplayedInputLabels(){const t=this.eventBus.getNucleotideSequences(),e=new Map;return M.forEach((n=>{let r=1;const o=t[n].map((t=>{if(function(t){return t.endsWith("(o)")}(t))return"";const e=String(r);return r++,e}));e.set(n,o)})),e}createLabelDivs(t){const e=this.createLabels(t).map((t=>N.div([t],{style:{width:"20px"}}))),n=this.eventBus.nucleotideSequencesChanged$.subscribe((()=>{this.createLabels(t).forEach(((t,n)=>{L()(e[n]).empty(),L()(e[n]).append(t)}))}));return this.subscriptions.add(n),e}createLabels(t){return this.eventBus.getNucleotideSequences()[t].map(((e,n)=>{const r=this.displayedInputLabels.get(t)[n];return N.label(r)}))}}class at{constructor(){this.rxjsSubscriptions=[],this.dgSubscriptions=[]}add(t){t instanceof G.Subscription?this.rxjsSubscriptions.push(t):this.dgSubscriptions.push(t)}unsubscribeAll(){for(const t of[this.rxjsSubscriptions,this.dgSubscriptions])t.forEach((t=>t.unsubscribe())),t.length=0}}class lt{constructor(t,e){this.eventBus=t,this.dataManager=e,this.subscriptions=new at}static open(t,e){lt.isDialogOpen||(lt.instance||(lt.instance=new lt(t,e)),lt.instance.openDialog())}openDialog(){this.initialPatternConfig=V().cloneDeep(this.eventBus.getPatternConfig()),lt.isDialogOpen=!0,this.createDialog().show()}createDialog(){const t=N.divV([]);this.subscriptions.add(this.eventBus.strandsUpdated$.subscribe((()=>this.onStrandsUpdated(t))));const e=N.dialog("Edit strands").add(t).onOK((()=>{})).onCancel((()=>this.resetToInitialState()));return this.subscriptions.add(e.onClose.subscribe((()=>{lt.isDialogOpen=!1,this.subscriptions.unsubscribeAll()}))),e}onStrandsUpdated(t){const e=new it(this.eventBus,this.initialPatternConfig,this.subscriptions).create(),n=new st(this.eventBus,this.dataManager,this.subscriptions).create();L()(t).empty(),L()(t).append(e,n)}resetToInitialState(){this.eventBus.setPatternConfig(this.initialPatternConfig)}}lt.isDialogOpen=!1;class ut{constructor(t){this.eventBus=t,this.subscriptions=new at}static open(t){ut.isDialogOpen||(ut.instance||(ut.instance=new ut(t)),ut.instance.openDialog())}openDialog(){this.initialPatternConfig=V().cloneDeep(this.eventBus.getPatternConfig()),ut.isDialogOpen=!0,this.createDialog().show()}createDialog(){const t=N.divV([]);this.subscriptions.add(this.eventBus.strandsUpdated$.subscribe((()=>this.onStrandsUpdated(t))));const e=N.dialog("Edit terminal modifications").add(t).onOK((()=>{})).onCancel((()=>this.resetToInitialState()));return this.subscriptions.add(e.onClose.subscribe((()=>{ut.isDialogOpen=!1,this.subscriptions.unsubscribeAll()}))),e}onStrandsUpdated(t){const e=new ct(this.eventBus).create();L()(t).empty(),L()(t).append(e)}resetToInitialState(){this.eventBus.setPatternConfig(this.initialPatternConfig)}}ut.isDialogOpen=!1;class ct{constructor(t){this.eventBus=t}create(){const t=M.map((t=>this.constructControlsPanel(t)));return N.divH(t,{style:{gap:"24px"}})}constructControlsPanel(t){if(!this.eventBus.isAntisenseStrandActive()&&"AS"===t)return N.div([]);const e=this.createInputs(t);return N.block([N.h1(`${R[t]}`),e],{style:{paddingTop:"12px"}})}createInputs(t){const e=("SS"===t?[...D].reverse():D).map((e=>this.createInputForTerminus(t,e)));return N.form(e)}createInputForTerminus(t,e){const n=this.eventBus.getTerminalModifications()[t][e],r=N.input.textArea(e,{value:n});return this.applyStylingToInput(r),r.onInput.subscribe((()=>{const n=r.value;null!==n&&this.eventBus.updateTerminusModification(t,e,n)})),r}applyStylingToInput(t){const e=t.root.getElementsByTagName("textarea")[0];L()(e).css("resize","none")}}n(9146);var ft=n(8507),ht={};ht.styleTagTransform=nt(),ht.setAttributes=X(),ht.insert=J().bind(null,"head"),ht.domAPI=K(),ht.insertStyleElement=tt(),Y()(ft.A,ht),ft.A&&ft.A.locals&&ft.A.locals;var dt,pt=n(2074),gt={};gt.styleTagTransform=nt(),gt.setAttributes=X(),gt.insert=J().bind(null,"head"),gt.domAPI=K(),gt.insertStyleElement=tt(),Y()(pt.A,gt),pt.A&&pt.A.locals&&pt.A.locals,function(t){t.TYPE="V2000",t[t.NUM_OF_HEADER_LINES=3]="NUM_OF_HEADER_LINES",t[t.NUM_OF_COUNTS_DIGITS=3]="NUM_OF_COUNTS_DIGITS",t[t.ATOM_TYPE_COL=4]="ATOM_TYPE_COL",t[t.FIRST_BONDED_ATOM_COL=1]="FIRST_BONDED_ATOM_COL",t[t.BOND_TYPE_COL=3]="BOND_TYPE_COL",t[t.RGP_SHIFT=8]="RGP_SHIFT",t[t.MAX_ATOM_COUNT=999]="MAX_ATOM_COUNT",t.RGP_LINE_START="M RGP",t.ATOM_ALIAS_LINE_START="A ",t.END="M END"}(dt||(dt={})),Error,Error,n(5670);var mt=n(2003);n(3480),n(5067);var yt=n(5254),vt={};vt.styleTagTransform=nt(),vt.setAttributes=X(),vt.insert=J().bind(null,"head"),vt.domAPI=K(),vt.insertStyleElement=tt(),Y()(yt.A,vt),yt.A&&yt.A.locals&&yt.A.locals;var bt=n(8070);n(9124);var Ct=n(8312),At=n(1991),wt=n.n(At);"object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,new Set;const Et="object"==typeof process&&process?process:{};let _t=globalThis.AbortController,xt=globalThis.AbortSignal;if(void 0===_t){xt=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},_t=class{constructor(){e()}signal=new xt;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==Et.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{var n,r,o,i;t&&(t=!1,n="AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.",r="NO_ABORT_CONTROLLER",o="ENOTSUP",i=e,"function"==typeof Et.emitWarning?Et.emitWarning(n,r,o,i):console.error(`[${o}] ${r}: ${n}`))}}Symbol("type"),Symbol.iterator,Symbol.toStringTag,n(6077),n(3561),n(9235);function Tt(t,e){try{const n=t.tableColumn;if(!n)return;const r=function(t){return t.temp.MonomerHoverLinks??[]}(n);for(let n=r.length-1;n>=0;--n){const o=r[n],i=t.grid.col(o.targetCol.name);if(i&&!o.handler(t,e,i))break}}catch(t){console.error(t)}}n(6717),n(100),n(4229),n(5174),n(5412),n(6197);class It extends o.InputBase{constructor(t,e){super(N.input.column(t,e).dart,e?.onValueChanged),this.options=e}setColumnInputTable(t){N.input.setColumnInputTable(this,t,this.options?.filter)}}N.input.column2=function(t,e){return new It(t,e)},n(1296),n(3820),o.JsInputBase,o.JsInputBase;var Nt,St=n(6307);n(3151),function(t){t.table="table",t.seqCol="seqCol",t.generateHelm="generateHelm",t.chiralityEngine="chiralityEngine",t.rules="rules"}(Nt||(Nt={}));class Lt{onKeyDown(t,e){}onKeyPress(t,e){}onMouseEnter(t,e){}onMouseLeave(t,e){}onMouseDown(t,e){}onMouseUp(t,e){}onMouseMove(t,e){}onClick(t,e){}onDoubleClick(t,e){}}class Pt extends Lt{constructor(t,e,n){super(),this.gridCol=t,this.tableCol=e,this.logger=n,this.subs=[],this.dirty=!0,this.destroyed=!1,this.viewerId=++Pt.viewerCounter,this.errors=[],this._onRendered=new G.Subject,this.tableCol&&this.tableCol.dataFrame&&(this.subs.push(this.tableCol.dataFrame.onDataChanged.subscribe((()=>{this.dirty=!0}))),this.subs.push(this.tableCol.dataFrame.onColumnsRemoved.subscribe((t=>{try{this.destroyed||!this.tableCol||this.tableCol.dataFrame||this.destroy()}catch(t){this.logger.error(t)}})))),this.tableCol&&this.subs.push(r.events.onTableRemoved.subscribe((t=>{try{const e=t.args.dataFrame;this.tableCol?.dataFrame.id!==e.id||this.destroyed||this.destroy()}catch(t){this.logger.error(t)}}))),this.gridCol&&this.subs.push(r.events.onViewRemoving.subscribe((t=>{try{const e=t.args.view;this.gridCol?.dart&&this.gridCol.grid&&this.gridCol?.grid?.dart&&this.gridCol?.grid?.view?.id===e.id&&!this.destroyed&&this.destroy()}catch(t){this.logger.error(t)}})))}toLog(){return`${this.constructor.name}<${this.viewerId}>`}destroy(){for(const t of this.subs)t.unsubscribe();this.destroyed=!0}invalidateGrid(){this.gridCol&&this.gridCol.dart&&this.gridCol.grid?.invalidate()}reset(){this.dirty=!1}get onRendered(){return this._onRendered}invalidate(t){this.invalidateGrid()}async awaitRendered(t=1e4,e=`${t} timeout`){const n=`${this.toLog()}.awaitRendered()`;if(this.logger.debug(`${n}, start, testEvent before`),await(0,bt.PE)(this._onRendered,(()=>{}),(()=>{this.invalidate()}),t,`${n}, ${e}`),this.errors.length>0){const t=this.errors[0];throw this.errors=[],t}this.logger.debug(`${n}, end`)}}Pt.viewerCounter=-1;var Ot=n(9192);const Mt=s.zS;var Rt,$t,Dt;!function(t){t.maxMonomerLength=".mm.cellRenderer.maxMonomerLength"}(Rt||(Rt={})),function(t){t.applyToBackground=".m.cellRenderer.applyToBackground"}($t||($t={})),function(t){t.MSA="MSA",t.classic="classic"}(Dt||(Dt={}));const Bt=new class{constructor(){this.color="rgb(100,100,100)",this.pivot=0,this.left=!1,this.transparencyRate=1,this.separator="",this.last=!1,this.drawStyle=Dt.classic,this.maxWord=[],this.wordIdx=0,this.gridCell=null,this.referenceSequence=null,this.maxLengthOfMonomer=null,this.monomerTextSizeMap={},this.logger=void 0}};function Ht(t,e,n,r,o,i,s){var a,l,u;const c=Object.assign(Object.assign({},Bt),s);s.logger?.debug("Bio: printLeftOrCentered(), start"),t.textAlign="start";let f=e.substring(0),h=c.last?"":c.separator;c.drawStyle===Dt.MSA&&(h="");let d=!0,p=!0,g="difference";if(null!=c.gridCell&&null!=c.gridCell.cell.column&&(d=c.gridCell.cell.column.temp["color-code"]??!0,p=c.gridCell.cell.column.temp["compare-with-current"]??!0,g=c.gridCell.cell.column.temp["highlight-difference"]??"difference"),c.referenceSequence){const t=c.referenceSequence[c.wordIdx];p&&c.referenceSequence.length>0&&"difference"===g&&(c.transparencyRate=f==t?.3:c.transparencyRate),p&&c.referenceSequence.length>0&&"equal"===g&&(c.transparencyRate=f!=t?.3:c.transparencyRate)}null!=c.maxLengthOfMonomer&&(f=Mt(f,c.maxLengthOfMonomer));const m=f+h;(a=c.monomerTextSizeMap)[m]??(a[m]=t.measureText(m));let y=c.monomerTextSizeMap[m];(l=c.monomerTextSizeMap)[f]??(l[f]=t.measureText(f));let v=c.monomerTextSizeMap[f].width;const b=i/2-(y.fontBoundingBoxAscent+y.fontBoundingBoxDescent)/2+1;(u=c.monomerTextSizeMap)[h]??(u[h]=t.measureText(h));const C=c.monomerTextSizeMap[h].width;function A(e,o){const i=d?c.color:"rgb(0,0,0)";t.fillStyle=i,t.globalAlpha=c.transparencyRate,c.drawStyle===Dt.classic&&(t.fillText(f,n+e,r+b),t.fillStyle="#808080",t.fillText(h,n+o,r+b)),c.drawStyle===Dt.MSA&&t.fillText(f,n+e,r+b)}y=y.width,c.drawStyle===Dt.MSA&&(v=c.maxWord[c.wordIdx],y=c.maxWord[c.wordIdx]);const w=(c.maxWord[c.wordIdx]??0)-(c.maxWord[0]??0);if(c.left||y>o)return A(w,w+v),n+w+v+C;{const t=(o-y)/2;return A(t,t+v),n+w+t+v}}var Ft=n(3599);const kt="rgb(100,100,100)";class Gt extends Pt{get separatorWidth(){return this.props?.fontCharWidth?this.props?.fontCharWidth:5}constructor(t,e,n,r,i){super(t,e,n),this.monomerLengthLimit=r,this.propsProvider=i,this.colWidth=0,this._monomerLengthList=null,this._processedMaxVisibleSeqLength=0,this._monomerLengthMap={},this._monomerStructureMap={},this.sysMonomerLib=null,this.padding=5,this.props=this.propsProvider(),this._processedRows=o.BitSet.create(this.tableCol.length),this.gridCol&&this.subs.push(this.gridCol.grid.onAfterDrawContent.subscribe((()=>{this._onRendered.next()}))),this.tableCol&&this.gridCol&&this.subs.push(this.tableCol.dataFrame.onCurrentRowChanged.subscribe((()=>{const t=this.tableCol.dataFrame;this.gridCol.grid,-1===t.currentRowIdx&&(this.tableCol.temp["reference-sequence"]=null,this.tableCol.temp["current-word"]=null,this.invalidateGrid())})))}async init(){await Promise.all([(async()=>{this.seqHelper=await(0,Ct.Q)(),this.invalidateGrid()})(),(async()=>{const t=await(0,l.pj)();this.sysMonomerLib=t.getMonomerLib()})()]),this.subs.push(this.sysMonomerLib.onChanged.subscribe((()=>{this.reset()}))),this.reset()}static getFontSettings(t){let e=12;return t&&t.temp[".mm.cellRenderer.fontSize"]&&"number"==typeof t.temp[".mm.cellRenderer.fontSize"]&&!isNaN(t.temp[".mm.cellRenderer.fontSize"])&&(e=Math.max(t.temp[".mm.cellRenderer.fontSize"],1)),{font:`${e}px monospace`,fontWidth:.6*e}}toLog(){return`MonomerPlacer<${this.viewerId}>`}getMonomerLib(){return this.tableCol.temp[".mm.cellRenderer.overriddenLibrary"]??this.sysMonomerLib}reset(){this.propsProvider&&(this.props=this.propsProvider()),this._processedRows=o.BitSet.create(this.tableCol.length),this._monomerLengthList=null,this._monomerLengthMap={},this._monomerStructureMap={},super.reset(),this.invalidateGrid()}invalidateGrid(){this.gridCol&&this.gridCol.dart&&this.gridCol.grid?.invalidate()}getCellMonomerLengths(t,e){const n=this.seqHelper.getSeqHandler(this.tableCol);if(this.colWidth<e&&(this.colWidth=e,this.dirty=!0),this.dirty)try{this.reset()}catch(t){const[e,n]=(0,Ot.AP)(t);this.logger.error(e,void 0,n)}const r=n.isMsa()?this.getCellMonomerLengthsForSeqMsa():this.getCellMonomerLengthsForSeq(t);return[r,this.getSummedMonomerLengths(r)]}getSummedMonomerLengths(t){const e=new Array(t.length+1);e[0]=5;for(let n=1;n<e.length;n++)e[n]=e[n-1]+t[n-1];let n=e[0];for(let t=1;t<e.length;t++)e[t]?n=e[t]:e[t]=n;return e}getCellMonomerLengthsForSeq(t){this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(this.tableCol.length).fill(null));const e=this.seqHelper.getSeqHandler(this.tableCol),n=this.props.separatorWidth+1*this.props.fontCharWidth,r=Math.ceil(this.colWidth/n),o=e.getSplitted(t),i=Math.min(r,o.length);let s=this._monomerLengthList[t];if(null===s||s.length<i){s=this._monomerLengthList[t]=new Array(o.length);let n=0;for(let t=0;t<i;++t){const r=o.getOriginal(t),i=this.props.monomerToShort(r,this.monomerLengthLimit),a=(e.isSeparator()?this.separatorWidth:this.props.separatorWidth)+i.length*this.props.fontCharWidth;if(s[t]=a,n+=a,n>this.colWidth)break}}return s}getCellMonomerLengthsForSeqValue(t,e){const n=this.seqHelper.getSeqHandler(this.tableCol),r=this.props.separatorWidth+1*this.props.fontCharWidth,o=Math.ceil(e/r),i=n.splitter(t),s=Math.min(o,i.length),a=new Array(s);let l=0;for(let t=0;t<s;++t){const r=i.getOriginal(t),o=this.props.monomerToShort(r,this.monomerLengthLimit),s=(n.isSeparator()?this.separatorWidth:this.props.separatorWidth)+o.length*this.props.fontCharWidth;if(a[t]=s,l+=s,l>e)break}return a}getCellMonomerLengthsForSeqMsa(){var t;this.toLog(),null===this._monomerLengthList&&(this._monomerLengthList=new Array(1).fill(null)),(t=this._monomerLengthList)[0]??(t[0]=new Array(0));const e=this._monomerLengthList[0],{startIdx:n,endIdx:r}=(()=>{try{const t=this.gridCol&&this.gridCol.dart?this.gridCol.grid:null;return t&&t.dart?{startIdx:Math.max(Math.floor((t?.vertScroll.min??0)-10),0),endIdx:Math.min(Math.ceil((t?.vertScroll.max??0)+10),this.tableCol.length)}:{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}catch(t){return{startIdx:0,endIdx:Math.min(this.tableCol.length,10)}}})(),o=this.props.separatorWidth+1*this.props.fontCharWidth,i=Math.ceil(this.colWidth/o);for(let t=n;t<r;t++){if(this._processedRows.get(t)&&i<=this._processedMaxVisibleSeqLength)continue;const n=this.seqHelper.getSeqHandler(this.tableCol).getSplitted(t,i),r=Math.min(i,n.length);r>e.length&&e.push(...new Array(r-e.length).fill(o));let s=0;for(let t=0;t<r;++t){const r=n.getOriginal(t),o=this.props.monomerToShort(r,this.monomerLengthLimit),i=this.props.separatorWidth+o.length*this.props.fontCharWidth;if(e[t]=Math.max(e[t]??0,i),s+=i,s>=this.colWidth)break}this._processedMaxVisibleSeqLength=Math.max(this._processedMaxVisibleSeqLength,i)}return e}getPosition(t,e,n){const[r,o]=this.getCellMonomerLengths(t,n);return 0===this.seqHelper.getSeqHandler(this.tableCol).getSplitted(t).length?null:function(t,e){let n,r=100,o=0,i=t.length-1;for(;o<=i;){if(n=Math.floor((i+o)/2),t[n]<=e&&e<t[n+1])return n;if(e<t[n]?i=n-1:o=n+1,--r<=0)throw new Error(`Get position for pointer x = ${e} searching has not converged on ${JSON.stringify(t)}. `)}return null}(o,e)}setMonomerLengthLimit(t){this.monomerLengthLimit!=t&&(this.monomerLengthLimit=t,this.dirty=!0)}setSeparatorWidth(t){this.separatorWidth!=t&&(this.props.separatorWidth=t,this.dirty=!0)}render(t,e,n,r,o,i,s){const a=i.grid?.canvas===t.canvas;if(!this.seqHelper)return;const l=this.gridCol,u=this.tableCol,c=window.devicePixelRatio,f=`${this.toLog()}.render()`;this.logger.debug(`${f}, start`);let h=this.monomerLengthLimit;if(Rt.maxMonomerLength in u.tags){const t=parseInt(u.getTag(Rt.maxMonomerLength));h=!isNaN(t)&&t?t:50}if(".mm.cellRenderer.maxMonomerLength"in u.temp){const t=u.temp[".mm.cellRenderer.maxMonomerLength"];h=!isNaN(t)&&t?t:50}t.save();try{const s=this.seqHelper.getSeqHandler(u);if("1"===u.temp[".mm.cellRenderer.settingsChanged"]||this.monomerLengthLimit!=h){let t=0;const e=8;t=u.temp[".mm.cellRenderer.gapLength"]??t,this.setMonomerLengthLimit(h),this.setSeparatorWidth(s.isMsa()?e:t),u.temp[".mm.cellRenderer.settingsChanged"]="0"}let[f,d]=this.getCellMonomerLengths(i.tableRowIndex,r);f.length;const p=i.cell.value,g=i.cell.rowIndex,m=(u.getTag(mt.gp.alphabet),50);a&&(r=function(t,e,n,r,o){return t?Math.max(Math.min(t.canvas.width/o-n,r)):Math.max(e.canvas.width/o-n,0)}(l?.grid,t,e,r,c)),t.beginPath(),t.rect(e+this.padding,n+this.padding,r-this.padding-1,o-2*this.padding),t.clip(),t.font=this.props?.font??"12px monospace",t.textBaseline="top";const y=u.meta.units,v=u.getTag(mt.gp.aligned),b=u.getTag(mt.gp.separator)??"",C=this.props.separatorWidth+1*this.props.fontCharWidth,A=Math.ceil(r/C),w=u.temp["reference-sequence"],E=this.tableCol.temp["current-word"];E&&-1===u?.dataFrame?.currentRowIdx&&(this.tableCol.temp["current-word"]=null);const _=(()=>{const t=s.getSplitter(A)(null!=w&&""!=w?w:E??"");return wt().count(0).take(t.length).map((e=>t.getOriginal(e))).toArray()})(),x=a?s.getSplitted(g):s.splitter(p);a||(d=this.getSummedMonomerLengths(this.getCellMonomerLengthsForSeqValue(p,r)));let T=Dt.classic;v&&v.includes("MSA")&&y==mt.Hi.SEPARATOR&&(T=Dt.MSA);const I=Math.min(x.length,A);for(let a=0;a<I;++a){const l=x.getOriginal(a),u=x.getCanonical(a);let c=kt;const f=this.getMonomerLib();if(f){const t=s.defaultBiotype;c=f.getMonomerTextColor(t,u)}t.fillStyle=kt;const p={color:c,pivot:0,left:!0,transparencyRate:1,separator:b,last:a===x.length-1,drawStyle:T,maxWord:d,wordIdx:a,gridCell:i,referenceSequence:_,maxLengthOfMonomer:h,monomerTextSizeMap:this._monomerLengthMap,logger:this.logger};if(Ht(t,l,e+this.padding,n,r,o,p),m>r)break}}catch(t){const[e,n]=(0,Ot.AP)(t);this.logger.error(e,void 0,n),this.errors.push(t)}finally{t.restore()}}onMouseMove(t,e){const n=`${this.toLog()}.onMouseMove()`;if(!this.seqHelper||null==t.tableRowIndex)return;const r=t.bounds,o=e.offsetX-t.gridColumn.left+(t.gridColumn.left-r.x),i=this.getPosition(t.tableRowIndex,o,r.width);this.logger.debug(`${n}, start, argsX: ${o}, left: ${i}`);const s=this.seqHelper.getSeqHandler(this.tableCol),a=s.getSplitted(t.tableRowIndex);if(null!==i&&i<a.length){const n=s.alphabet??mt.YI.UN,r={position:i,biotype:n===mt.YI.RNA||n===mt.YI.DNA?Ft.o.NUCLEOTIDE:Ft.o.AA,symbol:a.getCanonical(i)},o=[];let l=this._monomerStructureMap[r.symbol];{const t=this.getMonomerLib();l=this._monomerStructureMap[r.symbol]=t?t.getTooltip(r.biotype,r.symbol):N.divText("Monomer library is not available")}o.push(l),N.tooltip.show(N.divV(o),e.x+16,e.y+16),Tt(t,r)}else N.tooltip.hide(),Tt(t,null)}}class Ut extends Gt{constructor(t,e,n,r){super(t,e,Wt.logger,n,(()=>{const t=r.getSeqHandler(e),{font:n,fontWidth:o}=Gt.getFontSettings(e);return{seqHandler:t,font:n,fontCharWidth:o,separatorWidth:11,monomerToShort:mt.zS}}))}onMouseMove(t,e){super.onMouseMove(t,e)}}class jt{get defaultGapOriginal(){return""}constructor(t,e){this.separator=t,this.helmHelper=e,this.separatorSplitter=(0,mt.dh)(this.separator),this.splitter=this._splitter.bind(this)}setUnits(){}_splitter(t){const e=this.separatorSplitter(t);return new Vt(wt().count(0).take(e.length).map((t=>e.getOriginal(t))).toArray(),i.b9[i.Hi.SEPARATOR])}getHelm(t,e){return St.s.fromSeparator(t,this.helmHelper).getHelm()}createCellRendererBack(t,e){const n=new Ut(t,e,4,this.helmHelper.seqHelper);return n.init().then((()=>{})),n}}class Vt extends s.Mu{getCanonical(t){if(this.isGap(t))return i._S;const e=this.getOriginal(t);let n=e;return e.startsWith("{")?n=e.slice(1):e.endsWith("}")?n=e.slice(0,-1):e.startsWith("(")?n=e.replace(/^\(.\d+\)/,""):e.endsWith(")")&&(n=e.replace(/\(\d+\)$/,"")),n}constructor(t,e){super(t,e)}}const Wt=new P({debug:!0});function Yt(t,e){t.setTag("aligned","SEQ"),t.setTag("alphabet","UN"),t.setTag(".alphabetIsMultichar","true"),t.meta.units=i.Hi.CUSTOM,t.tags["polytool-data-role"]="template",t.temp[a.notationProvider]=new jt(e,Wt.helmHelper)}},5412:(t,e,n)=>{"use strict";n.d(e,{m:()=>l});var r=n(6082),o=n(4328),i=n(2890),s=n(6077),a=n(2003);async function l(t,e,n,l,u,c,f,h,d){const p=(await d.helmToAtomicLevel(t,l,u,f)).molCol,g=n.filter((t=>t)).length;if(c&&g>0){const t=new Array(g);let l=0;for(let r=0;r<n.length;r++)n[r]&&(t[l]=e[r],l++);const u=r.Column.fromStrings("helm",t);u.semType=r.SEMTYPE.MACROMOLECULE,u.meta.units=a.Hi.HELM,u.setTag(r.TAGS.CELL_RENDERER,"helm");const c=(await(0,i.pj)()).getMonomerLib();try{const t=await(0,s.C4)(r.DataFrame.create(0),u,c,d,h);l=0;for(let e=0;e<n.length;e++)n[e]&&(p.set(e,t.molCol.get(l)),l++)}catch(t){o.shell.warning("PolyTool was not able to linearize sequences")}}return function(t){for(let e=0;e<t.length;e++)t.set(e,t.get(e).replaceAll("undefined","H")),t.set(e,t.get(e).replaceAll("Oh","O")),t.set(e,t.get(e).replaceAll("0.000000 3","0.000000 0")),t.set(e,t.get(e).replaceAll("?","O")),t.set(e,t.get(e).replaceAll("0 3\n","0 0\n")),t.set(e,t.get(e).replaceAll("RGROUPS=(1 1)",""))}(p),p}},6307:(t,e,n)=>{"use strict";n.d(e,{s:()=>d});var r=n(2125),o=n(8438),i=n(100);function s(t,e){let n="";for(let t=0;t<e.length;t++){t>0&&(n+="|"),n+=`PEPTIDE${t+1}{`;for(let r=0;r<e[t].length;r++){r>0&&(n+=".");const o=e[t][r];n+=o.length>1?`[${o}]`:o}n+="}"}n+="$";for(let o=0;o<t.length;o++)o>0&&(n+="|"),n+=`PEPTIDE${t[o].fChain+1},PEPTIDE${t[o].sChain+1},`,n+=`${(0,r.M)(t[o].fMonomer-1,e)[0]+1}:R${t[o].fR}-`,n+=`${(0,r.M)(t[o].sMonomer-1,e)[0]+1}:R${t[o].sR}`;return n+="$$$V2.0",n}function a(t,e,n,r=0,o=[],i=[]){let[s,a,l,u,c]=[!1,!1,!1,-1,-1];for(let f=0;f<t.length;f++)if(t[f].includes(e)){if(s){if(l&&(n||t[f]==i[r]+e)){a=!0,c=f;break}if(l||!n&&t[f]!=o[r]+e)continue;a=!0,c=f;break}if(n)s=!0,l=!0,u=f;else if(t[f]==o[r]+e)s=!0,l=!0,u=f;else{if(t[f]!=i[r]+e)continue;s=!0,l=!!n,u=f}}return[s,a,l,u,c]}function l(t,e){const n=[];for(let r=0;r<e.length;r++){const o=`(${e[r].code})`,[s,l]=(0,i.Ln)(e[r]);if(s.length>0)for(let e=0;e<s.length;e++){const[i,u,c,f,h]=a(t,o,!1,e,s,l);i&&u&&(c?n.push({firstIdx:f,secondIdx:h,ruleIdx:r}):n.push({firstIdx:h,secondIdx:f,ruleIdx:r}))}else{const[e,i,s,l,u]=a(t,o,!0);if(!e||!i)continue;s?n.push({firstIdx:l,secondIdx:u,ruleIdx:r}):n.push({firstIdx:u,secondIdx:l,ruleIdx:r})}}return n}function u(t,e,n){const r=[],o=[],i=[],s=[],a=n.length;for(let l=0;l<a;l++){if(-1==n[l].firstIdx)continue;const a=n[l].ruleIdx,u=t[a].code;e[n[l].firstIdx]=e[n[l].firstIdx].replace(`(${u})`,""),e[n[l].secondIdx]=e[n[l].secondIdx].replace(`(${u})`,""),r.push(n[l].firstIdx+1),o.push(n[l].secondIdx+1),i.push(t[a].firstLinkingGroup),s.push(t[a].secondLinkingGroup)}return[r,o,i,s]}function c(t,e,n){const r=[],o=[],i=[],s=n.length;for(let a=0;a<s;a++){if(-1==n[a].firstIdx)continue;const s=n[a].firstIdx,l=n[a].secondIdx,u=n[a].ruleIdx,c=t[u].code;e[s]=e[s].replace(`(${c})`,"")+`_${t[u].name}`,e[l]=e[l].replace(`(${c})`,"")+`_${t[u].name}`,r.push(s+1),o.push(l+1),i.push(n[a].ruleIdx)}return[r,o,i]}var f=n(3599);function h(t,e,n){const r=n.createHelmWebEditor().editor.m;let o=0;const i=new JSDraw2.Point(0,0);for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++){if(e[t][n]){const s=e[t][n],a={type:f.o.AA,i:t,j:n,continuousId:o},l=new JSDraw2.Atom(i,s,a);if(r.addAtom(l),0!==n){const t=r.atoms[o-1],e=r.atoms[o],n=new JSDraw2.Bond(t,e);n.r1=2,n.r2=1,r.addBond(n)}o++,i.x+=JSDraw2.Editor.BONDLENGTH}i.y+=4*JSDraw2.Editor.BONDLENGTH}for(let e=0;e<t.length;e++){const n=r.atoms[t[e].fMonomer-1],o=r.atoms[t[e].sMonomer-1],i=new JSDraw2.Bond(n,o);i.r1=t[e].fR,i.r2=t[e].sR,r.addBond(i)}return r}class d{constructor(t,e,n){this.helmHelper=n,this.underRules=!1,this.posToPosUnderRules=[],this.linkages=e,this.monomers=t,this.mol=h(e,t,n)}static fromSeparator(t,e){const[n,r]=function(t){const e=[],n=[],r=/(\(.\d+\))?\{[^\}]*\}/g,o=[];o.push(t.replaceAll(r,""));const i=t.matchAll(r);for(const t of i){const e=t[0];e&&o.push(e)}let s=0;for(let t=0;t<o.length;t++){const r=o[t].split("-"),i=new Array(r.length);let a=0;for(let e=0;e<r.length;e++){const o=r[e].replace("{","").replace("}","");""!==o?(i[e]=o,s++,a++):n.push({fChain:t,sChain:t+1,fMonomer:s,sMonomer:s+1,fR:1,sR:1})}e.push(i.slice(0,a))}return[n,e]}(t);return new d(r,n,e)}static fromHelm(t,e){const[n,i]=function(t){const e=/(\w+\{.*\})\$(.*)\$(.*)\$(.*)\$/g.exec(t),n=[e[1],e[2],e[3],e[4]],i=n[0].split("|"),s=n[1].split("|"),a=new Array(i.length),l=[];for(let t=0;t<i.length;t++){const e=i[t].indexOf("{"),n=i[t].indexOf("}");a[t]=i[t].slice(e+1,n).split(".").map((t=>(0,o.D)(t)))}for(let t=0;t<s.length;t++)if(""!==s[t]&&"V2.0"!==s[t]){const e=s[t].split(","),n=parseInt(e[0].replace("PEPTIDE",""))-1,o=parseInt(e[1].replace("PEPTIDE",""))-1,i=e[2].split("-"),u=i[0].split(":"),c=i[1].split(":");l.push({fChain:n,sChain:o,fMonomer:(0,r.j)(parseInt(u[0]),n,a),sMonomer:(0,r.j)(parseInt(c[0]),o,a),fR:parseInt(u[1].replace("R","")),sR:parseInt(c[1].replace("R",""))})}return[l,a]}(t);return new d(i,n,e)}getNotation(){return function(t){const e=t.atoms,n=t.bonds,r=[],o=[];for(let t=0;t<n.length;t++)n[t].a1.bio.i!==n[t].a2.bio.i&&o.push(t);for(let t=0;t<e.length;t++){const n=e[t].bio?.i;n+1>r.length?r.push(1):r[n]++}const i=new Array(r.length);let s=0;for(let t=0;t<r.length;t++){const n=new Array(r[t]);for(let o=0;o<r[t];o++)n[o]=e[s].elem,s++;i[t]=n}let a="";for(let t=0;t<i.length;t++){let e="";for(let n=0;n<i[t].length;n++)e+=`${0==n?"":"-"}${i[t][n]}`;if(0!==t){const t=/(\(.\d+\))/,n=e.match(t);e=e.replace(n?.[0],""),e=`${n?n?.[0]:""}{${e}}`}else if(i.length>1){const t=0==n[o[0]].a1.bio.i&&0==n[o[0]].a1.bio.j,r=1==n[o[0]].a2.bio.i&&0==n[o[0]].a1.bio.j;t&&r&&(e+="-")}a+=e}return a}(this.mol)}getHelm(){return this.underRules?s(this.linkagesUnderRules,this.monomersUnderRules):s(this.linkages,this.monomers)}applyRules(t){const e=this.getNotation(),[n,r,o]=function(t,e){const n=[],r=[],o=[],i=e.heterodimerCode,s=e.homodimerCode,a=null!==i?t.split(`(${e.heterodimerCode})`):"";null!==i&&a.length>1?(o.push({fChain:0,sChain:1,fMonomer:1,sMonomer:1,fR:1,sR:1}),n.push(a[1].replaceAll("{","").replaceAll("}","")),n.push(a[2].replaceAll("{","").replaceAll("}","")),r.push(!1),r.push(!1)):(n.push(t),r.push(!1));for(let t=0;t<n.length;t++)if(null!==s&&n[t].includes(`(${s})`)){const e=n.length;o.push({fChain:t,sChain:e,fMonomer:1,sMonomer:1,fR:1,sR:1});const i=n[t].replace(`(${s})`,""),a=i.indexOf("{"),l=i.slice(0,a),u=i.replace(l,"").replaceAll("{","").replaceAll("}","");n[t]=l+u,n.push(u),r.push(!0)}return[o,n,r]}(e,t),i=new Array(r.length);let s=0;for(let t=0;t<r.length;t++)if(i[t]=r[t].split("-"),o[t]){const e=this.posToPosUnderRules.length-i[t].length;for(let n=0;n<i[t].length;n++)this.posToPosUnderRules[e+n].push(s),s++}else for(let e=0;e<i[t].length;e++)this.posToPosUnderRules.push([s]),s++;!function(t,e,n){for(let r=0;r<t.length;r++){const o=t[r],i=l(o,n.linkRules),[s,a,c,f]=u(n.linkRules,o,i);for(let t=0;t<s.length;t++)e.push({fChain:r,sChain:r,fMonomer:s[t],sMonomer:a[t],fR:c[t],sR:f[t]});t[r]=o}}(i,n,t),function(t,e,n){for(let r=0;r<t.length;r++){const o=l(t[r],n.reactionRules),[i,s,a]=c(n.reactionRules,t[r],o);i.length>=1&&(e.push({fChain:r,sChain:t.length,fMonomer:i[0],sMonomer:1,fR:3,sR:1}),e.push({fChain:r,sChain:t.length,fMonomer:s[0],sMonomer:1,fR:3,sR:2}),t.push([n.reactionRules[a[0]].name]))}}(i,n,t),this.underRules=!0,this.linkagesUnderRules=n,this.monomersUnderRules=i,this.molUnderRules=h(n,i,this.helmHelper)}check(t=!1){const e=[],n=this.monomers.map((t=>t.length)).reduce(((t,e)=>t+e),0);this.mol.atoms.length!==n&&e.push(`The mol atoms count ${this.mol.atoms.length} does not match the total number ${n} of chains' monomers.`);const r=this.monomers.map((t=>t.length-1)).reduce(((t,e)=>t+e),0)+this.linkages.length;this.mol.bonds.length!==r&&e.push(`The mol bonds count ${this.mol.bonds.length} does not match the total number ${r} in- and inter-chain linkages.`);let o=0;for(let t=0;t<this.monomers.length;++t){const n=this.monomers[t];for(let t=0;t<n.length;++t)try{const r=n[t],i=this.mol.atoms[o];i.bio.continuousId!==o&&e.push(`Atom #${o} has incorrect .bio.continuousId: ${i.bio.continuousId}.`),i.elem!==r&&e.push(`Atom #${o} elem: '${i.elem}' does not match chain monomer: '${r}'.`)}finally{o++}}if(t&&e.length>0)throw new Error(`Chain errors:\n${e.map((t=>` ${t}`)).join("\n")}`);return e}}},4229:(t,e,n)=>{"use strict";n.d(e,{b:()=>s});var r=n(9192),o=n(6307),i=n(1950);function s(t,e,n){const s=new Array(t.length),a=new Array(t.length),l=new Array(t.length);for(let u=0;u<t.length;u++)try{if(null==t[u])s[u]="";else{const r=o.s.fromSeparator(t[u],n);r.applyRules(e),a[u]=!(r.monomersUnderRules.length>1||r.linkagesUnderRules.length>0),s[u]=r.getHelm(),l[u]=r.posToPosUnderRules}}catch(t){const[e,n]=(0,r.AP)(t);i._package.logger.error(e,void 0,n),s[u]=""}return[s,a,l]}},2125:(t,e,n)=>{"use strict";function r(t,e){let n,r=t;for(n=0;n<e.length&&r>=e[n].length;++n)r-=e[n].length;return[r,n]}function o(t,e,n){let r=0;for(let t=0;t<e;++t)r+=n[t].length;return r+t}n.d(e,{M:()=>r,j:()=>o})},100:(t,e,n)=>{"use strict";n.d(e,{Ln:()=>V,Q4:()=>j});var r=n(6082),o=n(7389),i=n(4328);n(1991);var s=n(1950),a=n(9124),l=n(4229),u=n(439);const c="Links",f="Reactions";class h{constructor(t,e){this.v=null,this.rules=t,this.linkRuleDataFrame=this.rules.getLinkRulesDf(),this.synthRuleDataFrame=this.rules.getSynthesisRulesDf(),this.fileName=e;const n=this.rules.homodimerCode?this.rules.homodimerCode:"",r=this.rules.heterodimerCode?this.rules.heterodimerCode:"";this.homoDimerInput=o.input.string("Homo dimer",{value:n,onValueChanged:()=>{},nullable:!1}),this.heteroDimerInput=o.input.string("Hetero dimer",{value:r,onValueChanged:()=>{},nullable:!1})}async getAndAddView(){if(this.v)try{const t=Array.from(i.shell.views).find((t=>t.name===this.v.name));if(!t)throw this.v.detach(),this.v.close(),new Error("View is closed, making it null in catch statement");i.shell.v=t}catch(t){this.v=null}return this.v||(this.v=r.View.create(),this.v.name=`Manage Polytool Rules - ${this.fileName}`,this.v.append(await this.getForm()),this.v=i.shell.addView(this.v),i.shell.v=this.v),this.v}static async getInstance(t){if(!this.instances[t]){const e=await j([t]);this.instances[t]=new h(e,t)}return this.instances[t]}save(){this.rules.homodimerCode=this.homoDimerInput.value,this.rules.heterodimerCode=this.heteroDimerInput.value,this.rules.setLinkRules(this.linkRuleDataFrame),this.rules.setSynthesisRules(this.synthRuleDataFrame);const t={homodimerCode:this.rules.homodimerCode,heterodimerCode:this.rules.heterodimerCode,linkRules:this.rules.linkRules,reactionRules:this.rules.reactionRules},e=JSON.stringify(t,void 0,2);s._package.files.writeAsText(`polytool-rules/${this.fileName}`,e),i.shell.info(`Polytool rules at ${this.fileName} was updated`)}createGridDiv(t,e,n){const r=o.h1(t,"polytool-grid-header");o.tooltip.bind(r,n),r.style.marginTop="10px",r.style.marginRight="10px",e.root.style.height="100%";const i=o.splitV([o.box(r,{style:{maxHeight:"60px"}}),e.root]);return i.style.height="100%",i}async getLinkExamplesGrid(){const t=[];for(let e=0;e<this.rules.linkRules.length;e++){const n=this.rules.linkRules[e].code,[r,o]=V(this.rules.linkRules[e]);for(let e=0;e<r.length;e++){const i=`${r[e]}(${n})-A-A-A-A-${o[e]}(${n})`;t.push(i)}}const e=await(0,a.b2)(),[n,o,i]=(0,l.b)(t,this.rules,e),c=r.Column.fromStrings("Monomers",t),f=r.Column.fromStrings("Helm",n);return(0,s.applyNotationProviderForCyclized)(c,"-"),c.semType=r.SEMTYPE.MACROMOLECULE,f.semType=r.SEMTYPE.MACROMOLECULE,f.meta.units=u.Hi.HELM,f.setTag(r.TAGS.CELL_RENDERER,"helm"),r.DataFrame.fromColumns([c,f]).plot.grid()}async getReactionExamplesGrid(){const t=[];for(let e=0;e<this.rules.reactionRules.length;e++){const n=this.rules.reactionRules[e].code,[r,o]=V(this.rules.reactionRules[e]);for(let e=0;e<r.length;e++){const i=`${r[e]}(${n})-A-A-A-A-${o[e]}(${n})`;t.push(i)}}const e=await(0,a.b2)(),[n,o,i]=(0,l.b)(t,this.rules,e),c=r.Column.fromStrings("Monomers",t),f=r.Column.fromStrings("Helm",n);return c.semType=r.SEMTYPE.MACROMOLECULE,(0,s.applyNotationProviderForCyclized)(c,"-"),f.semType=r.SEMTYPE.MACROMOLECULE,f.meta.units=u.Hi.HELM,f.setTag(r.TAGS.CELL_RENDERER,"helm"),r.DataFrame.fromColumns([c,f]).plot.grid()}async getForm(){r.TabControl;const t=this.createGridDiv("Rules",this.linkRuleDataFrame.plot.grid({showAddNewRowIcon:!0}),"specification for monomers to link and linking positions"),e=this.createGridDiv("Examples",await this.getLinkExamplesGrid(),"specification for monomers to link and linking positions");t.style.width="50%",e.style.width="50%";const n=o.h1("Monomers","polytool-grid-header");o.tooltip.bind(n,"Click different cobination to see how monomers will link"),this.linkCards=await this.rules.getLinkCards();const i=o.splitV([o.box(n,{style:{maxHeight:"30px"}}),this.linkCards[0].root]);this.linkCards[0].render(),await this.linkCards[0].reset(),this.linkRuleDataFrame.currentRowIdx=0,this.linkRuleDataFrame.onCurrentRowChanged.subscribe((async()=>{const t=this.linkRuleDataFrame.currentRowIdx;-1!==t&&(o.empty(i),i.append(o.splitV([o.box(n,{style:{maxHeight:"30px"}}),this.linkCards[t].root]))),this.linkCards[t].render(),await this.linkCards[t].reset()}));const s=o.splitH([t,i],null,!0),a=this.createGridDiv("Rules",this.synthRuleDataFrame.plot.grid({showAddNewRowIcon:!0})),l=this.createGridDiv("Examples",await this.getReactionExamplesGrid());a.style.width="50%",l.style.width="50%";const u=o.divH([a,l]),h=o.divV([this.homoDimerInput,this.heteroDimerInput]),d=o.tabControl({Links:s,Reactions:u,Dimers:h},!1);o.tooltip.bind(d.getPane(c).header,"Specify rules to link monomers based on HELM notation"),o.tooltip.bind(d.getPane(f).header,"Specify rules to perform reactions within monomers"),o.tooltip.bind(d.getPane("Dimers").header,"Specify symbols for homodimeric and heterodimeric codes"),d.root.style.height="100%",d.root.style.width="100%",d.root.classList.add("rules-manager-form-tab-control"),d.header.style.marginBottom="10px";const p=o.divV([d.root]),g=[o.bigButton("Save",(()=>{this.save()})),o.button("Add rule",(()=>{const t=d.currentPane.name;t==c?this.linkRuleDataFrame.rows.addNew():t==f&&this.synthRuleDataFrame.rows.addNew()}))];return this.v.setRibbonPanels([g]),p.style.height="100%",p.style.alignItems="center",d.root}}h.instances={};var d=n(5072),p=n.n(d),g=n(7825),m=n.n(g),y=n(7659),v=n.n(y),b=n(5056),C=n.n(b),A=n(540),w=n.n(A),E=n(1113),_=n.n(E),x=n(890),T={};T.styleTagTransform=_(),T.setAttributes=C(),T.insert=v().bind(null,"head"),T.domAPI=m(),T.insertStyleElement=w(),p()(x.A,T),x.A&&x.A.locals&&x.A.locals;var I=n(2003),N=n(6717),S=n(8312),L=n(5174),P=n(5412);class O{get selected(){return this._selected}set selected(t){this._selected=t,this.root.style.border=t?"2px solid var(--green-2)":"2px solid var(--grey-2)"}constructor(t){this.monomer=t,this.root=o.divV([],{classes:"monomer-card-rule-root"}),this._selected=!1}render(){if(this.monomer){o.empty(this.root);const t=this.monomer.smiles&&i.chem.checkSmiles(this.monomer.smiles)?i.chem.drawMolecule(this.monomer.smiles,150,120):i.chem.drawMolecule(this.monomer.molfile??"",150,120);this.root.appendChild(t);const e=o.divH([o.divText("Monomer Name: "),o.divText(this.monomer.name)],{classes:"monomer-card-info-rules"});if(this.root.appendChild(e),o.tooltip.bind(e,this.monomer.name),this.monomer.lib?.source){const t=o.divH([o.divText("Source: "),o.divText(this.monomer.lib.source)],{classes:"monomer-card-info-rules"});this.root.appendChild(t),o.tooltip.bind(t,this.monomer.lib.source)}const n=o.divH([o.divText("Polymer Type: "),o.divText(this.monomer.polymerType)],{classes:"monomer-card-info-rules"});this.root.appendChild(n),o.tooltip.bind(n,this.monomer.polymerType),o.tooltip.bind(this.root,"Select Monomer")}}}class M{constructor(t,e,n,r,i){if(this.firstMonomers=t,this.secondMonomers=e,this.code=r,this.rules=i,this.root=o.divH([],{style:{alignItems:"center",width:"100%",overflow:"hidden",visibility:"visible"},classes:"monomer-cards"}),t.length>0){this.actionable=!0;const r=o.divH([],{style:{overflowX:"auto",width:"100%"}}),i=o.divH([],{style:{overflowX:"auto",width:"100%"}});this.resulting=o.divH([],{style:{overflowX:"auto",width:"100%",minHeight:"150px"}});const s=o.divV([r,i,this.resulting]);this.cardsFirst=t.map((t=>new O(n.getMonomer("PEPTIDE",t)))),this.cardsSecond=e.map((t=>new O(n.getMonomer("PEPTIDE",t)))),this.cardsFirst.forEach((t=>{t.root.onclick=()=>{this.cardsFirst.forEach((t=>t.selected=!1)),t.selected=!0,this.firstCard=t,this.reset()},r.appendChild(t.root)})),this.cardsSecond.forEach((t=>{t.root.onclick=()=>{this.cardsSecond.forEach((t=>t.selected=!1)),t.selected=!0,this.secondCard=t,this.reset()},i.appendChild(t.root)})),this.cardsFirst[0].selected=!0,this.cardsSecond[0].selected=!0,this.firstCard=this.cardsFirst[0],this.secondCard=this.cardsSecond[0],this.root.appendChild(s)}else{const t=o.divV(["Rule is active for all monomers, no examples to show"]);this.root.appendChild(t),this.actionable=!1}}async reset(){if(this.actionable){const t=[`${this.firstCard.monomer?.symbol}(${this.code})-A-A-A-A-${this.secondCard.monomer?.symbol}(${this.code})`],e=await(0,a.b2)(),[n,s,u]=(0,l.b)(t,this.rules,e),c=r.Column.fromType(r.COLUMN_TYPE.STRING,"helm",n.length).init((t=>n[t]));c.semType=r.SEMTYPE.MACROMOLECULE,c.meta.units=I.Hi.HELM,c.setTag(r.TAGS.CELL_RENDERER,"helm");const f=await(0,N.j)(),h=await(0,S.Q)(),d=await(0,L.A)(this.rules),p=c.temp;c.temp=p;const g=(await(0,P.m)(c,n,s,!0,!1,!1,d,f,h)).get(0),m=g&&i.chem.checkSmiles(g)?i.chem.drawMolecule(g,150,120):i.chem.drawMolecule(g??"",150,120);o.empty(this.resulting),this.resulting.append(o.divH([m],{style:{overflowX:"auto",width:"100%",minHeight:"150px"}}))}}render(){this.actionable&&(this.cardsFirst.forEach((t=>t.render())),this.cardsSecond.forEach((t=>t.render())))}}var R=n(2890);const $="System:AppData/SequenceTranslator/polytool-rules/",D="code",B="firstMonomers",H="secondMonomers",F="name",k="firstLinkingGroup",G="secondLinkingGroup";class U{constructor(t,e,n,r){this.homodimerCode=t,this.heterodimerCode=e,this.linkRules=n,this.reactionRules=r}set homodimer(t){this.homodimerCode=t}set heterodimer(t){this.heterodimerCode=t}addLinkRules(t){for(let e=0;e<t.length;e++)this.linkRules.push(t[e])}addSynthesisRules(t){for(let e=0;e<t.length;e++)this.reactionRules.push(t[e])}getLinkRulesDf(){const t=this.linkRules.length,e=r.Column.int(D,t);e.setTag("friendlyName","Code");const n=r.Column.string(B,t);n.setTag("friendlyName","First monomers"),n.semType=r.SEMTYPE.MACROMOLECULE,(0,s.applyNotationProviderForCyclized)(n,",");const o=r.Column.string(H,t);o.setTag("friendlyName","Second monomers"),o.semType=r.SEMTYPE.MACROMOLECULE,(0,s.applyNotationProviderForCyclized)(o,",");const i=r.Column.int(k,t);i.setTag("friendlyName","First group");const a=r.Column.int(G,t);a.setTag("friendlyName","Second group");for(let r=0;r<t;r++)e.set(r,this.linkRules[r].code),n.set(r,this.linkRules[r].firstMonomers.toString()),o.set(r,this.linkRules[r].secondMonomers.toString()),i.set(r,this.linkRules[r].firstLinkingGroup),a.set(r,this.linkRules[r].secondLinkingGroup);return r.DataFrame.fromColumns([e,n,o,i,a])}async getLinkCards(){const t=this.linkRules.length,e=new Array(t),n=(await(0,R.pj)()).getMonomerLib();for(let r=0;r<t;r++)e[r]=new M(this.linkRules[r].firstMonomers,this.linkRules[r].secondMonomers,n,this.linkRules[r].code,this);return e}getSynthesisRulesDf(){const t=this.reactionRules.length,e=r.Column.int(D,t);e.setTag("friendlyName","Code");const n=r.Column.string(B,t);n.setTag("friendlyName","First monomers");const o=r.Column.string(H,t);o.setTag("friendlyName","Second monomers");const i=r.Column.string(F,t);i.setTag("friendlyName","Name");const s=r.Column.string("firstReactant",t);s.setTag("friendlyName","First reactant");const a=r.Column.string("secondReactant",t);a.setTag("friendlyName","Second reactant");const l=r.Column.string("product",t);l.setTag("friendlyName","Product");for(let r=0;r<t;r++){e.set(r,this.reactionRules[r].code),n.set(r,this.reactionRules[r].firstMonomers.toString()),o.set(r,this.reactionRules[r].secondMonomers.toString()),i.set(r,this.reactionRules[r].name);const t=this.reactionRules[r].reaction.split(">>"),u=t[0].split(".");s.set(r,u[0]),a.set(r,u[1]),l.set(r,t[1])}return s.semType=r.SEMTYPE.MOLECULE,a.semType=r.SEMTYPE.MOLECULE,l.semType=r.SEMTYPE.MOLECULE,r.DataFrame.fromColumns([i,s,a,l,e,n,o])}setLinkRules(t){const e=t.rowCount,n=new Array(e),r=t.columns.byName(D),o=t.columns.byName(B),i=t.columns.byName(H),s=t.columns.byName(k),a=t.columns.byName(G);for(let t=0;t<e;t++){const e=o.get(t).split(","),l=i.get(t).split(","),u={code:r.get(t),firstMonomers:""!==e[0]?e:[],secondMonomers:""!==l[0]?l:[],firstLinkingGroup:s.get(t),secondLinkingGroup:a.get(t)};n[t]=u}this.linkRules=n}setSynthesisRules(t){const e=t.rowCount,n=new Array(e),r=t.columns.byName(D),o=t.columns.byName(B),i=t.columns.byName(H),s=t.columns.byName(F),a=t.columns.byName("firstReactant"),l=t.columns.byName("secondReactant"),u=t.columns.byName("product");for(let t=0;t<e;t++){const e=`${a.get(t)}.${l.get(t)}>>${u.get(t)}`,c=o.get(t).split(","),f=i.get(t).split(","),h={code:r.get(t),firstMonomers:""!==c[0]?c:[],secondMonomers:""!==f[0]?f:[],reaction:e,name:s.get(t)};n[t]=h}this.reactionRules=n}}async function j(t){const e=new r.FileSource($),n=new U(null,null,[],[]);for(let r=0;r<t.length;r++){const o=await e.readAsText(t[r].replace($,"")),i=JSON.parse(o);n.homodimer=i.homodimerCode,n.heterodimer=i.heterodimerCode,n.addLinkRules(i.linkRules),n.addSynthesisRules(i.reactionRules)}return n}function V(t){const e=t.firstMonomers.length*t.secondMonomers.length,n=new Array(e),r=new Array(e);let o=0;for(let e=0;e<t.firstMonomers.length;e++)for(let i=0;i<t.secondMonomers.length;i++)n[o]=t.firstMonomers[e],r[o]=t.secondMonomers[i],o++;return[n,r]}},5174:(t,e,n)=>{"use strict";n.d(e,{A:()=>c,T:()=>f});var r=n(6717),o=n(1296),i=n(9192),s=n(4328),a=n(1991),l=n.n(a),u=n(2890);async function c(t){const e=(await(0,u.pj)()).getMonomerLib(),n=await(0,r.j)(),o={};let i=[],a=[];for(let r=0;r<t.reactionRules.length;r++)try{[i,a]=f(n,e,t.reactionRules[r])}catch(t){i=[],a=[],console.error(t),s.shell.warning(t)}finally{for(let t=0;t<i.length;t++)o[i[t]]=a[t]}const c={PEPTIDE:o};return e.override(c,"ST-PT-reactions."+l().repeat(1).map((()=>Math.floor(36*Math.random()).toString(36))).take(4).toArray().join(""))}function f(t,e,n){const r=n.reaction,a=n.name,l=n.firstMonomers.length+n.secondMonomers.length+1,u=n.reaction.split(">>"),c=u[0].split("."),f=new Array(l),g=new Array(l),m=new Array(l),y=d(t,r),v=`${c[0]}>>[C:1]C`,b=`${c[1]}>>[C:2]C`,C=d(t,v),A=d(t,b);let w=0;for(let r=0;r<n.firstMonomers.length;r++){const i=e.getMonomer("PEPTIDE",n.firstMonomers[r]);if(!i)throw new o.bl("PEPTIDE",n.firstMonomers[r]);const s=h(t,i.molfile,C,i.name);m[w]=s,f[w]=`${i.symbol}_${a}`,w++}for(let r=0;r<n.secondMonomers.length;r++){const i=e.getMonomer("PEPTIDE",n.secondMonomers[r]);if(!i)throw new o.bl("PEPTIDE",n.secondMonomers[r]);const s=h(t,i.molfile,A,i.name);m[w]=s,f[w]=`${i.symbol}_${a}`,w++}let E=null,_="";try{E=t.get_mol(u[1]),_=E?.get_molblock()}catch(t){const[e,n]=(0,i.AP)(t);throw s.shell.error(`Can not assemble monomer '${a}': ${e}.`),t}finally{E?.delete()}m[w]=_,f[w]=a;for(let t=0;t<l-1;t++)m[t]=m[t].replace(" 0.0000 0.0000 0.0000 C "," 0.0000 0.0000 0.0000 R# ").replace("M RGP 2","M RGP 3 2 3");m[l-1]=function(t){const e=t.replace("M RAD","M RGP").split("\n"),n=4+Number(e[3].substring(0,3))+Number(e[3].substring(3,6)),r=Number(e[n].substring(9,13)),o=Number(e[n].substring(17,21));e[n]=e[n].substring(0,13)+" 1"+e[n].substring(17,21)+" 2",e[3+r]=e[3+r].substring(0,30)+" R# 0 0 0 0 0 0 0 0 0 0 0 0",e[3+o]=e[3+o].substring(0,30)+" R# 0 0 0 0 0 0 0 0 0 0 0 0";let i="";for(let t=0;t<e.length;t++)i+=e[t]+"\n";return i}(m[l-1]);for(let t=0;t<l;t++){const e=t==l-1,n={symbol:f[t],name:f[t],molfile:m[t],author:"",id:0,rgroups:p(e),smiles:"",polymerType:"PEPTIDE",monomerType:"Backbone",createDate:null};n.meta=Object.assign(n.meta??{},{colors:{default:{line:"#2083D5",text:"#2083D5",background:"#F2F2F5"}}}),f[t]=f[t],g[t]=n}return y.delete(),C.delete(),A.delete(),[f,g]}function h(t,e,n,r){let o=null,a=null,l=null,u=null,c="";try{o=new t.MolList,a=t.get_mol(e),o.append(a),l=n.run_reactants(o,1),u=l.get(0).next(),c=u?.get_molblock()}catch(t){const[e,n]=(0,i.AP)(t);throw s.shell.error(`Can not assemble monomer '${r}': ${e}.`),t}finally{o?.delete(),a?.delete(),l?.delete(),u?.delete()}return c}function d(t,e){let n=null;try{if(n=t.get_rxn(e),!n)throw new o.J5(e)}catch(t){n?.delete();const[r,o]=(0,i.AP)(t);throw s.shell.error(`Can not assemble monomer '${e}': ${r}.`),t}return n}function p(t){if(t){const t=new Array(2),e={capGroupSMILES:"[*:1][H]",alternateId:"R1-H",capGroupName:"H",label:"R1"},n={capGroupSMILES:"[*:2][H]",alternateId:"R2-H",capGroupName:"H",label:"R2"};return t[0]=e,t[1]=n,t}return[{capGroupSMILES:"[*:3][H]",alternateId:"R3-H",capGroupName:"H",label:"R3"}]}},3820:(t,e,n)=>{"use strict";n.d(e,{o:()=>i});var r=n(1296);function o(t,e,n,r){const o=new Array(r.length*(n-e+1));for(let i=0;i<r.length;++i){const s=n-e+1;for(let n=0;n<s;++n){const a=e+n,l=r[i],u=o[i*s+n]=t.clone(),c=u.atoms[a].elem;u.atoms[a].elem=l;const f=c?.length>1?`[${c}]`:c,h=l?.length>1?`[${l}]`:l;u.name=`${t.name}-${f}${a+1}${h}`}}return o}function i(t,e,n){const i=new JSDraw2.MolHandler,s=new org.helm.webeditor.Plugin(i);org.helm.webeditor.IO.parseHelm(s,t,new JSDraw2.Point(0,0),void 0);const a=i.m;a.name=e;let l=[];if(n.placeholders)switch(n.type){case r.aK.Single:l=function(t,e){return e.map((e=>o(t,e.position,e.position,e.monomers))).reduce(((t,e)=>t.concat(e)),[])}(i.m,n.placeholders);break;case r.aK.Matrix:l=function(t,e){let n=[t];for(const t of e){const e=n.map((e=>o(e,t.position,t.position,t.monomers)));n=e.reduce(((t,e)=>t.concat(e)),[])}return n}(i.m,n.placeholders)}let u=[];n.breadthPlaceholders&&(u=function(t,e){if(0==e.length)return[];let n=[t];for(const t of e){const e=n.map((e=>o(e,t.start,t.end,t.monomers)));n=e.reduce(((t,e)=>t.concat(e)),[])}return n}(i.m,n.breadthPlaceholders)),l=l.concat(u),n.keepOriginal&&(l=[a,...l]);const c=l.map((t=>[org.helm.webeditor.IO.getHelm(t),t.name]));return c}},1296:(t,e,n)=>{"use strict";var r;n.d(e,{J5:()=>i,aK:()=>r,bl:()=>o}),function(t){t.Single="single",t.Matrix="matrix",t.Library="library"}(r||(r={}));class o extends Error{constructor(t,e,n){super(`Monomer '${e}' of polymer type '${t}' not found`,n),this.type="MonomerNotFoundError"}}class i extends Error{constructor(t,e){super(`Invalid reaction '${t}'.`),this.type="InvalidReactionError"}}},6082:t=>{"use strict";t.exports=DG},4328:t=>{"use strict";t.exports=grok},7389:t=>{"use strict";t.exports=ui},1991:t=>{"use strict";t.exports=wu}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.m=t,n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.u=t=>t+".js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=r[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t})(),n.b=document.baseURI||self.location.href,n.nc=void 0;var r={};(()=>{"use strict";n.r(r),n.d(r,{_package:()=>M,initAutoTests:()=>$,test:()=>R,tests:()=>e.CN});var t=n(6082),e=n(8070),o=n(4328),i=n(6686);class s extends t.Package{async getTranslationHelper(){return await o.functions.call(`${this.name}:getTranslationHelper`)}}function a(t,e,n){return n.createFormatConverter(t,e).convertTo(i.NO.HELM)}function l(t,e,n){return n.createFormatConverter(t,i.NO.HELM).convertTo(e)}const u={Axolabs:{UfAfsCfsGfuacg:"RNA1{[fR](U)p.[fR](A)[sp].[fR](C)[sp].[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)}$$$$"},BioSpring:{"A*GC*123456789":"RNA1{r(A)[sp].r(G)p.r(C)[sp].[fR](U)p.[fR](A)p.[fR](C)p.[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)p.d([m5C])}$$$$"},Mermade12:{hefglijkLIJKHEFG:"RNA1{[25r](U)[sp].[25r](A)[sp].[25r](C)[sp].[25r](G)[sp].[fR](U)[sp].[fR](A)[sp].[fR](C)[sp].[fR](G)[sp].[fR](U)p.[fR](A)p.[fR](C)p.[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)}$$$$"}},c={"RNA1{[fR](U)p.[fR](A)[sp].[fR](C)[sp].[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)}$$$$":"UACGUACG","RNA1{r(A)[sp].r(G)p.r(C)[sp].[fR](U)p.[fR](A)p.[fR](C)p.[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)p}$$$$":"AGCUACGUACG","RNA1{[25r](U)[sp].[25r](A)[sp].[25r](C)[sp].[25r](G)[sp].[fR](U)[sp].[fR](A)[sp].[fR](C)[sp].[fR](G)[sp].[fR](U)p.[fR](A)p.[fR](C)p.[fR](G)p.[25r](U)p.[25r](A)p.[25r](C)p.[25r](G)}$$$$":"UACGUACGUACGUACG"};(0,e.L1)("Formats to HELM",(()=>{let t;(0,e.gM)((async()=>{t=await M.getTranslationHelper()}));for(const n of Object.keys(u))for(const[r,o]of Object.entries(u[n]))(0,e.t6)(`${n} to HELM`,(async()=>{const i=o,s=a(r,n,t);(0,e.E3)(s,i)}))})),(0,e.L1)("HELM to Formats",(()=>{let t;(0,e.gM)((async()=>{t=await M.getTranslationHelper()}));for(const n of Object.keys(u))for(const[r,o]of Object.entries(u[n]))(0,e.t6)(`${n} to HELM`,(async()=>{const i=r,s=l(o,n,t);(0,e.E3)(s,i)}))}));var f=n(3480);(0,e.L1)("HELM to Nucleotides",(()=>{let t;(0,e.gM)((async()=>{t=await M.getTranslationHelper()})),Object.entries(c).forEach((([n,r],o)=>{(0,e.t6)(`Sequence ${o+1} to nucleotides`,(async()=>{const o=r,i=(0,f.Hs)(n,t.monomerLibWrapper);(0,e.E3)(i,o)}))}))}));const h={[i.NO.AXOLABS]:"Afcgacsu",[i.NO.HELM]:"RNA1{[fR](A)p.[25r](C)p.[25r](G)p.[25r](A)p.[25r](C)[sp].[25r](U)}$$$$"};(0,e.L1)("Formats support",(()=>{let t;(0,e.gM)((async()=>{t=await M.getTranslationHelper()})),Object.entries(h).forEach((([n,r])=>{(0,e.t6)(`All formats for ${n}`,(async()=>{const o=function(t,e,n){const r=n.createSequenceValidator(t).getInvalidCodeIndex(e);return(0,f.bD)(t,r,e,n)}(r,n,t),i=Object.keys(o).length,s=Object.keys(u).length+1;(0,e.E3)(!0,s<=i)}))}))}));var d=n(9192);(0,e.L1)("files",(()=>{let n;(0,e.gM)((async()=>{n=await M.getTranslationHelper()})),(0,e.t6)("list",(async()=>{let r;const o=t.DataFrame.fromColumns([t.Column.string("subTest"),r=t.Column.bool("success"),t.Column.string("format"),t.Column.string("src"),t.Column.string("res"),t.Column.string("tgt"),t.Column.string("error"),t.Column.string("stack")]),i=await M.files.list("tests",!0,".csv");for(const r of i){const i=t.DataFrame.fromCsv(await r.readAsString()),s=i.columns.byIndex(0),l=s.name,u=i.columns.byIndex(1),c=i.rowCount;for(let t=0;t<c;++t){const i=o.rows.addNew();i.subTest=`${r.name}, row: ${t}`;try{const r=s.get(t),o=u.get(t);i.format=l,i.src=r,i.tgt=o;const c=i.res=a(r,l,n);(0,e.E3)(c,o),i.success=!0}catch(t){const[e,n]=(0,d.AP)(t);i.error=e,i.stack=n,i.success=!1}}}0==o.rowCount&&o.rows.addNew(["empty",!0,"",""]);const s=r.toList().findIndex((t=>1!=t));if(-1!=s){const t=o.rows.get(s);throw new Error(`Subtest '${t.subTest}' failed: ${t.error}`)}return o}),{skipReason:"Can not create test in async manner based on files in Shares."})}));var p=n(8312),g=n(2003);class m{constructor(t,e,n,r,o,i){this.units=t,this.aligned=e,this.alphabet=n,this.alphabetSize=r,this.alphabetIsMultichar=o,this.separator=i}}async function y(e,n){const r=(await e()).getCol(n),i=await o.functions.call("Bio:detectMacromolecule",{col:r});if(i&&(r.semType=i),r.semType===t.SEMTYPE.MACROMOLECULE){const t=`Negative test detected semType='${r.semType}', units='${r.meta.units}'.`;throw new Error(t)}}async function v(n,r,i,s,a,l,u,c,f=null){const h=(await n()).col(r),d=await o.functions.call("Bio:detectMacromolecule",{col:h});d&&(h.semType=d),(0,e.E3)(h.semType,t.SEMTYPE.MACROMOLECULE),(0,e.E3)(h.meta.units,s),(0,e.E3)(h.getTag(g.gp.aligned),a),(0,e.E3)(h.getTag(g.gp.alphabet),l),f&&(0,e.E3)(h.getTag(g.gp.separator),f);const p=i.getSeqHandler(h);(0,e.E3)(p.getAlphabetSize(),u),(0,e.E3)(p.getAlphabetIsMultichar(),c),p.isHelm()||((0,e.E3)(p.aligned,a),(0,e.E3)(p.alphabet,l))}(0,e.L1)("PolyTool: detectors",(()=>{let n;(0,e.gM)((async()=>{n=await(0,p.Q)()}));const r={cyclized1:{csv:"n,seq\n1,R-F-C(1)-T-G-H-F-Y-G-H-F-Y-G-H-F-Y-P-C(1)-meI\n2,C(1)-T-G-H-F-Y-P-C(1)-meI\n3,R-F-C(1)-T-G-H-F-Y-P-C(1)\n4,C(1)-T-G-H-F-H-P-C(1)\n5,R-F-D(2)-T-G-H-F-Y-P-NH2(2)\n6,R-F-aG(4)-T-G-H-F-Y-P-azG(4)-meI",pos:{seq:new m(g.Hi.CUSTOM,"SEQ",g.YI.UN,13,!0,"-")}}};for(const[o,i]of Object.entries(r))(0,e.t6)(`${o}`,(async()=>{const e=async()=>t.DataFrame.fromCsv(i.csv);for(const t of i.neg??[])await y(e,t);for(const[t,r]of Object.entries(i.pos??{}))await v(e,t,n,r.units,r.aligned,r.alphabet,r.alphabetSize,r.alphabetIsMultichar,r.separator)}),{skipReason:"3156"})}));var b=n(2890);const C="Libraries";let A=Promise.resolve();async function w(){let t;return A=A.then((async()=>{const e=o.userSettings.getValue(C,"Settings",!0);t=e?JSON.parse(e):{exclude:[],explicit:[],duplicateMonomerPreferences:{}},t.exclude=t.exclude instanceof Array?t.exclude:[],t.explicit=t.explicit instanceof Array?t.explicit:[],t.duplicateMonomerPreferences=t.duplicateMonomerPreferences instanceof Object?t.duplicateMonomerPreferences:{},console.debug(`Bio: getUserLibSettings()\n${JSON.stringify(t,void 0,2)}`)})),await A,t}async function E(t){A=A.then((async()=>{console.debug(`Bio: setUserLibSettings()\n${JSON.stringify(t,void 0,2)}`),o.userSettings.add(C,"Settings",JSON.stringify(t),!0)})),await A}var _=n(6717),x=n(9124),T=n(4229),I=n(5174),N=n(100);(0,e.L1)("PolyTool: Convert",(()=>{let n,r,i,s,a;(0,e.gM)((async()=>{n=await(0,x.b2)(),r=await(0,p.Q)(),i=await(0,_.j)(),s=await(0,b.pj)(),a=await w(),await s.loadMonomerLibForTests()})),(0,e.Pl)((async()=>{await E(a),await s.loadMonomerLib(!0)}));const l={"cyclized-C(1)-2-1":{src:{seq:"R-F-C(1)-T-G-H-F-Y-P-C(1)-meI"},tgt:{helm:"PEPTIDE1{R.F.C.T.G.H.F.Y.P.C.[meI]}$PEPTIDE1,PEPTIDE1,3:R3-10:R3$$$V2.0",mol:{atomCount:95,bondCount:100,inchiKey:"LMJUFVBPWWJJPN-AJJYTACESA-N"}}},"cyclized-C(1)-0-1":{src:{seq:"C(1)-T-G-H-F-Y-P-C(1)-meI"},tgt:{helm:"PEPTIDE1{C.T.G.H.F.Y.P.C.[meI]}$PEPTIDE1,PEPTIDE1,1:R3-8:R3$$$V2.0",mol:{atomCount:73,bondCount:77,inchiKey:"KLFRBMUPPMMGJM-HXTBFBBASA-N"}}},"cyclized-C(1)-2-0":{src:{seq:"R-F-C(1)-T-G-H-F-Y-P-C(1)"},tgt:{helm:"PEPTIDE1{R.F.C.T.G.H.F.Y.P.C}$PEPTIDE1,PEPTIDE1,3:R3-10:R3$$$V2.0",mol:{atomCount:86,bondCount:91,inchiKey:"WIHSRTQGMICACU-DDDKLKPZSA-N"}}},"cyclized-C(1)-0-0":{src:{seq:"C(1)-T-G-H-F-Y-P-C(1)"},tgt:{helm:"PEPTIDE1{C.T.G.H.F.Y.P.C}$PEPTIDE1,PEPTIDE1,1:R3-8:R3$$$V2.0",mol:{atomCount:64,bondCount:68,inchiKey:"LOSMDBLEXLWPLB-OFZKBENXSA-N"}}},"cyclized-D(2)-NH2(2)-3-0":{src:{seq:"R-F-D(2)-T-G-H-F-Y-P-NH2(2)"},tgt:{helm:"PEPTIDE1{R.F.D.T.G.H.F.Y.P.[NH2]}$PEPTIDE1,PEPTIDE1,10:R2-3:R3$$$V2.0",mol:{atomCount:81,bondCount:86,inchiKey:"CBMGNYKOZWNVNK-AHGCAHLCSA-N"}}},"cyclized-D(2)-NH2(2)-0-0":{src:{seq:"D(2)-T-G-H-F-Y-P-NH2(2)"},tgt:{helm:"PEPTIDE1{D.T.G.H.F.Y.P.[NH2]}$PEPTIDE1,PEPTIDE1,8:R2-1:R3$$$V2.0",mol:{atomCount:59,bondCount:63,inchiKey:"HGRHAUQBJXFERJ-MUFWPYSASA-N"}}}};for(const[t,r]of Object.entries(l))(0,e.t6)(`toHelm-${t}`,(async()=>{const t=await(0,N.Q4)(["rules_example.json"]),o=(0,T.b)([r.src.seq],t,n);(0,e.E3)(o[0][0],r.tgt.helm)}));for(const[o,s]of Object.entries(l))(0,e.t6)(`toAtomicLevel-${o}`,(async()=>{const o=await(0,N.Q4)(["rules_example.json"]),[a,l,u]=(0,T.b)([s.src.seq],o,n),c=await(0,I.A)(o),f=t.Column.fromStrings("helm",a);f.semType=t.SEMTYPE.MACROMOLECULE,f.meta.units=g.Hi.HELM;const h=await r.helmToAtomicLevel(f,!1,!1,c);if(h.warnings&&h.warnings.length>0)throw new Error(h.warnings[0]);(0,e.E3)(null!=h.molCol,!0,".molCol is not null");const d=h.molCol.get(0),p=i.get_mol(d);try{const t={atomCount:p.get_num_atoms(),bondCount:p.get_num_bonds(),inchiKey:i.get_inchikey_for_inchi(p.get_inchi())};(0,e.Xk)(t,s.tgt.mol)}finally{p.delete()}}));(0,e.t6)("ui-col-wo-table",(async()=>{const n=M.name,r=Object.values(l).map((t=>t.src.seq)),i=Object.values(l).map((t=>t.tgt.helm)),s=t.Column.fromStrings("seq",r),a=await o.functions.call(`${n}:polyToolConvert2`,{seqCol:s,generateHelm:!0,chiralityEngine:!0,rules:["rules_example.json"]});(0,e.J6)(a.toList(),i),(0,e.E3)(a.semType,t.SEMTYPE.MACROMOLECULE),(0,e.E3)(a.meta.units,g.Hi.HELM),(0,e.E3)(a.dataFrame,null)})),(0,e.t6)("ui-col",(async()=>{const n=M.name,r=Object.values(l).map((t=>t.src.seq)),i=Object.values(l).map((t=>t.tgt.helm)),s=t.Column.fromStrings("seq",r),a=t.DataFrame.fromColumns([s]),u=o.shell.addTableView(a),c=await o.functions.call(`${n}:polyToolConvert2`,{seqCol:s,generateHelm:!0,chiralityEngine:!0,rules:["rules_example.json"]});(0,e.J6)(c.toList(),i),(0,e.E3)(c.semType,t.SEMTYPE.MACROMOLECULE),(0,e.E3)(c.meta.units,g.Hi.HELM),(0,e.E3)(c.dataFrame.id,a.id),await(0,e.PE)(u.grid.onAfterDrawContent,(()=>{}),(async()=>{u.grid.invalidate()}),15e3),(0,e.E3)(c.getTag(t.TAGS.CELL_RENDERER),"helm")}))}));var S=n(1296),L=n(3820);(0,e.L1)("PolyTool: Enumerate",(()=>{let t,n,r;(0,e.gM)((async()=>{t=await(0,x.b2)(),n=await(0,b.pj)(),r=await w(),await n.loadMonomerLibForTests()})),(0,e.Pl)((async()=>{await E(r),await n.loadMonomerLib(!0)}));const o={single1:{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Single,placeholders:[{position:4,monomers:["K","P","F4COO"]},{position:6,monomers:["Y","T"]}]},tgt:[{seq:"PEPTIDE1{[Ac(1)].F.W.G.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5P"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.[F4COO].L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5[F4COO]"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-[Tic]7T"}]},"single-with-original":{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Single,placeholders:[{position:4,monomers:["K","P","F4COO"]},{position:6,monomers:["Y","T"]}],keepOriginal:!0},tgt:[{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:""},{seq:"PEPTIDE1{[Ac(1)].F.W.G.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5P"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.[F4COO].L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5[F4COO]"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-[Tic]7T"}]},matrix1:{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Matrix,placeholders:[{position:1,monomers:["D","L"]},{position:4,monomers:["K","P","F4COO"]},{position:6,monomers:["Y","T"]}]},tgt:[{seq:"PEPTIDE1{[Ac(1)].D.W.G.K.L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2D-P5K-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].D.W.G.K.L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2D-P5K-[Tic]7T"},{seq:"PEPTIDE1{[Ac(1)].D.W.G.P.L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2D-P5P-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].D.W.G.P.L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2D-P5P-[Tic]7T"},{seq:"PEPTIDE1{[Ac(1)].D.W.G.[F4COO].L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2D-P5[F4COO]-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].D.W.G.[F4COO].L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2D-P5[F4COO]-[Tic]7T"},{seq:"PEPTIDE1{[Ac(1)].L.W.G.K.L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2L-P5K-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].L.W.G.K.L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2L-P5K-[Tic]7T"},{seq:"PEPTIDE1{[Ac(1)].L.W.G.P.L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2L-P5P-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].L.W.G.P.L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2L-P5P-[Tic]7T"},{seq:"PEPTIDE1{[Ac(1)].L.W.G.[F4COO].L.Y.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2L-P5[F4COO]-[Tic]7Y"},{seq:"PEPTIDE1{[Ac(1)].L.W.G.[F4COO].L.T.[C(1)].G.[NH2]}$$$$V2.0",name:"-F2L-P5[F4COO]-[Tic]7T"}]}};for(const[t,n]of Object.entries(o))(0,e.t6)(`${t}`,(async()=>{const t=(0,L.o)(n.src,"",n.params);(0,e.J6)(t,n.tgt.map((t=>[t.seq,t.name])))}))})),(0,e.L1)("PolyTool: Enumerate",(()=>{let t,n,r;(0,e.gM)((async()=>{t=await(0,x.b2)(),n=await(0,b.pj)(),r=await w(),await n.loadMonomerLibForTests()})),(0,e.Pl)((async()=>{await E(r),await n.loadMonomerLib(!0)}));const o={breadth1:{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Single,breadthPlaceholders:[{start:2,end:4,monomers:["K"]}]},tgt:[{seq:"PEPTIDE1{[Ac(1)].F.K.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3K"},{seq:"PEPTIDE1{[Ac(1)].F.W.K.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4K"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K"}]},"breadth1-with-original":{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Single,breadthPlaceholders:[{start:2,end:4,monomers:["K"]}],keepOriginal:!0},tgt:[{seq:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:""},{seq:"PEPTIDE1{[Ac(1)].F.K.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3K"},{seq:"PEPTIDE1{[Ac(1)].F.W.K.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4K"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K"}]},breadth2:{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Single,breadthPlaceholders:[{start:2,end:4,monomers:["K","Y"]}]},tgt:[{seq:"PEPTIDE1{[Ac(1)].F.K.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3K"},{seq:"PEPTIDE1{[Ac(1)].F.W.K.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4K"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K"},{seq:"PEPTIDE1{[Ac(1)].F.Y.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.Y.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.Y.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5Y"}]},"breadth-double":{src:"PEPTIDE1{[Ac(1)].F.W.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",params:{type:S.aK.Single,breadthPlaceholders:[{start:2,end:4,monomers:["K"]},{start:2,end:4,monomers:["Y"]}]},tgt:[{seq:"PEPTIDE1{[Ac(1)].F.Y.G.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3K-K3Y"},{seq:"PEPTIDE1{[Ac(1)].F.K.Y.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3K-G4Y"},{seq:"PEPTIDE1{[Ac(1)].F.K.G.Y.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-W3K-P5Y"},{seq:"PEPTIDE1{[Ac(1)].F.Y.K.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4K-W3Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.Y.P.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4K-K4Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.K.Y.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-G4K-P5Y"},{seq:"PEPTIDE1{[Ac(1)].F.Y.G.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K-W3Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.Y.K.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K-G4Y"},{seq:"PEPTIDE1{[Ac(1)].F.W.G.Y.L.[Tic].[C(1)].G.[NH2]}$$$$V2.0",name:"-P5K-K5Y"}]}};for(const[t,n]of Object.entries(o))(0,e.t6)(`${t}`,(async()=>{const t=(0,L.o)(n.src,"",n.params);(0,e.J6)(t,n.tgt.map((t=>[t.seq,t.name])))}))}));var P=n(6307),O=n(2125);(0,e.L1)("PolyTool: Chain: parseNotation",(()=>{let t;(0,e.gM)((async()=>{t=await(0,x.b2)()}));const n={cyclized:{src:{seq:"R-F-C(1)-T-G-H-F-Y-P-C(1)-meI"},tgt:{helm:"PEPTIDE1{R.F.[C(1)].T.G.H.F.Y.P.[C(1)].[meI]}$$$$V2.0"}},dimerized1:{src:{seq:"(#3)Succ-{A(CHOL)-F-C(1)-T-G-H-Y-P-C(1)-NH2}"},tgt:{helm:"PEPTIDE1{[(#3)Succ]}|PEPTIDE2{[A(CHOL)].F.[C(1)].T.G.H.Y.P.[C(1)].[NH2]}$PEPTIDE1,PEPTIDE2,1:R1-1:R1$$$V2.0"}},dimerized2:{src:{seq:"($3)Succ-{R-F-C(1)-T-G-H-F-P-C(1)-NH2}($2){A(CHOL)-F-C(1)-T-G-H-F-P-C(1)-NH2}"},tgt:{helm:"PEPTIDE1{[($3)Succ]}|PEPTIDE2{R.F.[C(1)].T.G.H.F.P.[C(1)].[NH2]}|PEPTIDE3{[($2)A(CHOL)].F.[C(1)].T.G.H.F.P.[C(1)].[NH2]}$PEPTIDE1,PEPTIDE2,1:R1-1:R1$$$V2.0"}}};for(const[r,o]of Object.entries(n))(0,e.t6)(`${r}`,(async()=>{await(0,N.Q4)(["rules_example.json"]);const n=await P.s.fromSeparator(o.src.seq,t),r=n.mol,i=t.createHelmWebEditor();i.editor.setMol(r);const s=i.editor.getHelm(),a=n.getHelm();(0,e.E3)(s,o.tgt.helm),(0,e.E3)(a,o.tgt.helm)}),"reaction2"==r?{skipReason:"reverse reaction"}:void 0);const r={"0-in-4-4-3":{inIdx:0,spIdx:0,outIdx:0,monomers:[["0","1","2","3"],["4","5","6","7"],["8","9","10"]]},"3-in-4-4-3":{inIdx:3,spIdx:0,outIdx:3,monomers:[["0","1","2","3"],["4","5","6","7"],["8","9","10"]]},"4-in-4-4-3":{inIdx:0,spIdx:1,outIdx:4,monomers:[["0","1","2","3"],["4","5","6","7"],["8","9","10"]]},"7-in-4-4-3":{inIdx:3,spIdx:1,outIdx:7,monomers:[["0","1","2","3"],["4","5","6","7"],["8","9","10"]]},"8-in-4-4-3":{inIdx:0,spIdx:2,outIdx:8,monomers:[["0","1","2","3"],["4","5","6","7"],["8","9","10"]]},"0-in-1-1-6-3":{inIdx:0,spIdx:0,outIdx:0,monomers:[["0"],["1"],["2","3","4","5","6","7"],["8","9","10"]]},"1-in-1-1-6-3":{inIdx:0,spIdx:1,outIdx:1,monomers:[["0"],["1"],["2","3","4","5","6","7"],["8","9","10"]]},"2-in-1-1-6-3":{inIdx:0,spIdx:2,outIdx:2,monomers:[["0"],["1"],["2","3","4","5","6","7"],["8","9","10"]]},"3-in-1-1-6-3":{inIdx:1,spIdx:2,outIdx:3,monomers:[["0"],["1"],["2","3","4","5","6","7"],["8","9","10"]]},"7-in-1-1-6-3":{inIdx:5,spIdx:2,outIdx:7,monomers:[["0"],["1"],["2","3","4","5","6","7"],["8","9","10"]]},"8-in-1-1-6-3":{inIdx:0,spIdx:3,outIdx:8,monomers:[["0"],["1"],["2","3","4","5","6","7"],["8","9","10"]]}};for(const[t,{inIdx:n,spIdx:o,outIdx:i,monomers:s}]of Object.entries(r))(0,e.t6)(`innerIdx-${t}`,(async()=>{const[t,r]=(0,O.M)(i,s);(0,e.E3)(t,n),(0,e.E3)(r,o)}));for(const[t,{inIdx:n,spIdx:o,outIdx:i,monomers:s}]of Object.entries(r))(0,e.t6)(`outerIdx-${t}`,(async()=>{const t=(0,O.j)(n,o,s);(0,e.E3)(t,i)}))})),(0,e.L1)("PolyTool: Chain",(()=>{let t;(0,e.gM)((async()=>{t=await(0,x.b2)()}));const n={cyclized:{data:{templateSeq:"R-F-C(1)-T-G-H-F-Y-P-C(1)-meI",templateHelm:"PEPTIDE1{R.F.[C(1)].T.G.H.F.Y.P.[C(1)].[meI]}$$$$V2.0",mmHelm:"PEPTIDE1{R.F.C.T.G.H.F.Y.P.C.[meI]}$PEPTIDE1,PEPTIDE1,3:R3-10:R3$$$V2.0"},tgt:{templateChain:{monomerCount:[11],linkageCount:0},mmChain:{monomerCount:[11],linkageCount:0}}},dimerized1:{data:{templateSeq:"(#3)Succ-{A(CHOL)-F-C(1)-T-G-H-Y-P-C(1)-NH2}",templateHelm:"PEPTIDE1{[(#3)Succ]}|PEPTIDE2{[A(CHOL)].F.[C(1)].T.G.H.Y.P.[C(1)].[NH2]}$PEPTIDE1,PEPTIDE2,1:R1-1:R1$$$V2.0",mmHelm:"PEPTIDE1{[(#3)Succ].[{A(CHOL)].F.C.T.G.H.Y.P.C.[NH2}]}$PEPTIDE1,PEPTIDE1,4:R3-10:R3$$$V2.0"},tgt:{templateChain:{monomerCount:[1,10],linkageCount:1},mmChain:{monomerCount:[11],linkageCount:1}}},dimerized2:{data:{templateSeq:"($3)Succ-{R-F-C(1)-T-G-H-F-P-C(1)-NH2}($3){A(CHOL)-F-C(1)-Y-H-G-D-N-C(1)-meI}",templateHelm:"PEPTIDE1{[($3)Succ]}|PEPTIDE2{R.F.[C(1)].T.G.H.F.P.[C(1)].[NH2]}|PEPTIDE3{[($3)A(CHOL)].F.[C(1)].Y.H.G.D.N.[C(1)].[meI]}$PEPTIDE1,PEPTIDE2,1:R1-1:R1$$$V2.0",mmHelm:"PEPTIDE1{[($3)Succ].[{R].F.C.T.G.H.F.P.C.[NH2}($3){A(CHOL)].F.[C(1)].Y.H.G.D.N.[C(1)].[meI}]}$PEPTIDE1,PEPTIDE1,4:R3-10:R3$$$V2.0"},tgt:{templateChain:{monomerCount:[1,10,10],linkageCount:1},mmChain:{monomerCount:[20],linkageCount:1}}}};for(const[r,{data:o,tgt:i}]of Object.entries(n))(0,e.t6)(`fromNotation-${r}`,(async()=>{const n=await(0,N.Q4)(["rules_example.json"]),r=P.s.fromSeparator(o.templateSeq,t);r.applyRules(n),r.check(!0),(0,e.J6)(r.monomers.map((t=>t.length)),i.mmChain.monomerCount),(0,e.E3)(r.linkages.length,i.mmChain.linkageCount),(0,e.E3)(r.getHelm(),o.mmHelm)}),{skipReason:"3157"});for(const[r,{data:o,tgt:i}]of Object.entries(n))(0,e.t6)(`parseNotation-${r}`,(async()=>{await(0,N.Q4)(["rules_example.json"]);const n=P.s.fromSeparator(o.templateSeq,t);n.check(!0),(0,e.J6)(n.monomers.map((t=>t.length)),i.templateChain.monomerCount),(0,e.E3)(n.linkages.length,i.templateChain.linkageCount),(0,e.E3)(n.getHelm(),o.templateHelm),(0,e.E3)(n.getNotation(),o.templateSeq)}));for(const[r,{data:o,tgt:i}]of Object.entries(n))(0,e.t6)(`parseHelm-${r}`,(async()=>{await(0,N.Q4)(["rules_example.json"]);const n=P.s.fromHelm(o.templateHelm,t);n.check(!0),(0,e.J6)(n.monomers.map((t=>t.length)),i.templateChain.monomerCount),(0,e.E3)(n.linkages.length,i.templateChain.linkageCount),(0,e.E3)(n.getHelm(),o.templateHelm),(0,e.E3)(n.getNotation(),o.templateSeq)}));for(const[r,{data:o,tgt:i}]of Object.entries(n))(0,e.t6)(`applyRules-${r}`,(async()=>{const n=await(0,N.Q4)(["rules_example.json"]),r=P.s.fromSeparator(o.templateSeq,t);r.applyRules(n),r.check(!0),(0,e.J6)(r.monomers.map((t=>t.length)),i.mmChain.monomerCount),(0,e.E3)(r.linkages.length,i.mmChain.linkageCount),(0,e.E3)(r.getHelm(),o.mmHelm)}),{skipReason:"applyRules is not implemented"})})),(0,e.L1)("toAtomicLevel",(()=>{let n,r,o;(0,e.gM)((async()=>{r=await(0,b.pj)(),n=await w(),o=await(0,_.j)(),await r.loadMonomerLibForTests()})),(0,e.Pl)((async()=>{await E(n),await r.loadMonomerLib(!0)})),(0,e.t6)("override",(async()=>{const n=r.getMonomerLib(),i=await M.files.readAsText("tests/polytool-reaction-lib.json"),s=JSON.parse(i).find((t=>"GGaz"===t.symbol));(0,e.E3)(null!=s,!0,"Monomer 'GGaz' not found.");const a={PEPTIDE:{GGaz:s}},l=n.override(a,"test"),u=await(0,p.Q)(),c=t.Column.fromList(t.COLUMN_TYPE.STRING,"helm",["PEPTIDE1{F.P.Y.[GGaz].H.A.A.G.G.A.C}|PEPTIDE2{A.A.A}$PEPTIDE1,PEPTIDE2,4:R4-1:R1|PEPTIDE1,PEPTIDE1,11:R2-4:R3$$$V2.0"]);c.semType=t.SEMTYPE.MACROMOLECULE,c.meta.units=g.Hi.HELM;const f=await u.helmToAtomicLevel(c,!1,!1,l);(0,e.E3)(null!=f.molCol,!0,"Result molCol is null");const h=f.molCol.get(0);(0,e.E3)(!!h,!0,"Molfile is empty");const d=o.get_mol(h);try{const t=d.get_inchi(),n=o.get_inchikey_for_inchi(t);(0,e.E3)(d.get_num_bonds(),103),(0,e.E3)(d.get_num_atoms(),98),(0,e.E3)(n,"XPQUTLNSNIMERR-WKBTUBAPSA-N")}finally{d.delete()}})),(0,e.t6)("getNewMonomer",(async()=>{const t=await(0,_.j)(),n=r.getMonomerLib(),o=(await(0,N.Q4)(["rules_example.json"])).reactionRules.find((t=>"GGaz"==t.name)),[i,s]=(0,I.T)(t,n,o);(0,e.E3)(i[0],"azG_GGaz");const a=t.get_mol(s[0].molfile);try{const n=a.get_inchi();t.get_inchikey_for_inchi(n),(0,e.E3)(a.get_num_bonds(),7),(0,e.E3)(a.get_num_atoms(),8)}finally{a.delete()}}))}));const M=new s;async function R(n,r,o){const i=await(0,e.N$)({category:n,test:r,testContext:o,verbose:!0});return t.DataFrame.fromObjects(i)}async function $(){await(0,e.Xb)(M,M.getModule("package-test.js"))}})(),sequencetranslator_test=r})();
|
|
3
3
|
//# sourceMappingURL=package-test.js.map
|