avo-inspector 3.0.0-alpha.1 → 3.0.0-alpha.2

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 CHANGED
@@ -9,12 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Changed
11
11
 
12
- - **Encryption Migration**: Migrated encryption implementation from `eciesjs` (secp256k1) to `elliptic` library + Web Crypto API (prime256v1 / NIST P-256) for browser compatibility
13
- - Uses `elliptic` library for ECDH operations (browser-compatible)
12
+ - **Encryption Migration**: Migrated encryption implementation from `eciesjs` (secp256k1) to `@noble/curves` + Web Crypto API (prime256v1 / NIST P-256) for browser compatibility
13
+ - Uses `@noble/curves` library for ECDH operations (lightweight, modern, audited - ~20KB)
14
14
  - Uses Web Crypto API for AES-256-GCM encryption/decryption
15
15
  - Updated curve to prime256v1 (NIST P-256), standard for Web Crypto API
16
16
  - Updated CLI tool to use Node.js crypto (Node-only, so crypto module is fine)
17
17
  - Maintains same encryption format specification: `[Version(1b)] + [EphemeralPubKey(65b)] + [IV(16b)] + [AuthTag(16b)] + [Ciphertext]`
18
+ - Maintains same key format (Hex strings) for compatibility with other languages
18
19
 
19
20
  ### Breaking Changes
20
21
 
@@ -28,16 +29,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
28
29
  // After (v3.0)
29
30
  const schema = await inspector.extractSchema(eventProperties);
30
31
  ```
31
- - **[Breaking]** `shouldRegisterSchemaFromManually()` in `AvoDeduplicator` is now async
32
+ - **[Breaking]** `shouldRegisterSchemaFromManually()` in `AvoDeduplicator` is now async. It should not be used in the client code though.
32
33
 
33
34
  ### Removed
34
35
 
35
- - Removed `eciesjs` dependency (replaced with `elliptic`)
36
+ - Removed `eciesjs` dependency (replaced with `@noble/curves`)
37
+ - Removed `elliptic` dependency (replaced with `@noble/curves`)
36
38
 
37
39
  ### Added
38
40
 
39
- - Added `elliptic` dependency for browser-compatible ECDH operations
40
- - Added `@types/elliptic` dev dependency
41
+ - Added `@noble/curves` dependency for browser-compatible ECDH operations (lightweight, modern, audited)
41
42
 
42
43
  ## [2.2.1-alpha] - 2025-11-24
43
44
 
package/dist/index.js CHANGED
@@ -1 +1,2 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(()=>(()=>{var e={9404:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(e){}function f(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=f(e,r);return r-1>=t&&(n|=f(e,r-1)<<4),n}function d(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o<a;o++){var f=e.charCodeAt(o)-48;i*=n,i+=f>=49?f-49+10:f>=17?f-17+10:f}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,f=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<f&67108863,this.words[a+1]=o>>>26-f&67108863,(f+=24)>=26&&(f-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<f&67108863,this.words[a+1]=o>>>26-f&67108863,(f+=24)>=26&&(f-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=s(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=s(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,f=Math.min(a,a-o)+r,s=0,c=r;c<f;c+=n)s=d(e,c,c+n,t),this.imuln(i),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s);if(0!==o){var h=1;for(s=d(e,c,e.length,t),c=0;c<o;c++)h*=t;this.imuln(h),this.words[0]+s<67108864?this.words[0]+=s:this._iaddn(s)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,f=67108863&o,s=o/67108864|0;r.words[0]=f;for(var d=1;d<n;d++){for(var c=s>>>26,h=67108863&s,u=Math.min(d,t.length-1),l=Math.max(0,d-e.length+1);l<=u;l++){var b=d-l|0;c+=(o=(i=0|e.words[b])*(a=0|t.words[l])+h)/67108864|0,h=67108863&o}r.words[d]=0|h,s=0|c}return 0!==s?r.words[d]=0|s:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o<this.length;o++){var f=this.words[o],s=(16777215&(f<<i|a)).toString(16);a=f>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==a||o!==this.length-1?c[6-s.length]+s+r:s+r}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],l=u[e];r="";var b=this.clone();for(b.negative=0;!b.isZero();){var p=b.modn(l).toString(e);r=(b=b.idivn(l)).isZero()?p+r:c[d-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,f,s="le"===t,d=new e(a),c=this.clone();if(s){for(f=0;!c.isZero();f++)o=c.andln(255),c.iushrn(8),d[f]=o;for(;f<a;f++)d[f]=0}else{for(f=0;f<a-i;f++)d[f]=0;for(f=0;!c.isZero();f++)o=c.andln(255),c.iushrn(8),d[a-f-1]=o}return d},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return n(!(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return n(!(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return n(!(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o<n.length;o++)a=(t=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<r.length;o++)a=(t=(0|r.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var b=function(e,t,r){var n,i,a,o=e.words,f=t.words,s=r.words,d=0,c=0|o[0],h=8191&c,u=c>>>13,l=0|o[1],b=8191&l,p=l>>>13,v=0|o[2],m=8191&v,g=v>>>13,y=0|o[3],w=8191&y,M=y>>>13,S=0|o[4],A=8191&S,I=S>>>13,_=0|o[5],x=8191&_,E=_>>>13,P=0|o[6],k=8191&P,R=P>>>13,z=0|o[7],N=8191&z,q=z>>>13,O=0|o[8],L=8191&O,F=O>>>13,T=0|o[9],j=8191&T,C=T>>>13,V=0|f[0],B=8191&V,K=V>>>13,D=0|f[1],J=8191&D,H=D>>>13,U=0|f[2],Y=8191&U,X=U>>>13,W=0|f[3],Z=8191&W,G=W>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],re=8191&te,ne=te>>>13,ie=0|f[6],ae=8191&ie,oe=ie>>>13,fe=0|f[7],se=8191&fe,de=fe>>>13,ce=0|f[8],he=8191&ce,ue=ce>>>13,le=0|f[9],be=8191&le,pe=le>>>13;r.negative=e.negative^t.negative,r.length=19;var ve=(d+(n=Math.imul(h,B))|0)+((8191&(i=(i=Math.imul(h,K))+Math.imul(u,B)|0))<<13)|0;d=((a=Math.imul(u,K))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(b,B),i=(i=Math.imul(b,K))+Math.imul(p,B)|0,a=Math.imul(p,K);var me=(d+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,H)|0)+Math.imul(u,J)|0))<<13)|0;d=((a=a+Math.imul(u,H)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,B),i=(i=Math.imul(m,K))+Math.imul(g,B)|0,a=Math.imul(g,K),n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,H)|0)+Math.imul(p,J)|0,a=a+Math.imul(p,H)|0;var ge=(d+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(u,Y)|0))<<13)|0;d=((a=a+Math.imul(u,X)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,B),i=(i=Math.imul(w,K))+Math.imul(M,B)|0,a=Math.imul(M,K),n=n+Math.imul(m,J)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,H)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(p,Y)|0,a=a+Math.imul(p,X)|0;var ye=(d+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(u,Z)|0))<<13)|0;d=((a=a+Math.imul(u,G)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(A,B),i=(i=Math.imul(A,K))+Math.imul(I,B)|0,a=Math.imul(I,K),n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,H)|0,n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(g,Y)|0,a=a+Math.imul(g,X)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(p,Z)|0,a=a+Math.imul(p,G)|0;var we=(d+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(u,$)|0))<<13)|0;d=((a=a+Math.imul(u,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,B),i=(i=Math.imul(x,K))+Math.imul(E,B)|0,a=Math.imul(E,K),n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,H)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,H)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,Y)|0,a=a+Math.imul(M,X)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,G)|0)+Math.imul(g,Z)|0,a=a+Math.imul(g,G)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(p,$)|0,a=a+Math.imul(p,ee)|0;var Me=(d+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(u,re)|0))<<13)|0;d=((a=a+Math.imul(u,ne)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(k,B),i=(i=Math.imul(k,K))+Math.imul(R,B)|0,a=Math.imul(R,K),n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,H)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(I,Y)|0,a=a+Math.imul(I,X)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,Z)|0,a=a+Math.imul(M,G)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(g,$)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(p,re)|0,a=a+Math.imul(p,ne)|0;var Se=(d+(n=n+Math.imul(h,ae)|0)|0)+((8191&(i=(i=i+Math.imul(h,oe)|0)+Math.imul(u,ae)|0))<<13)|0;d=((a=a+Math.imul(u,oe)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(N,B),i=(i=Math.imul(N,K))+Math.imul(q,B)|0,a=Math.imul(q,K),n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(R,J)|0,a=a+Math.imul(R,H)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(E,Y)|0,a=a+Math.imul(E,X)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(I,Z)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,oe)|0)+Math.imul(p,ae)|0,a=a+Math.imul(p,oe)|0;var Ae=(d+(n=n+Math.imul(h,se)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(u,se)|0))<<13)|0;d=((a=a+Math.imul(u,de)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,B),i=(i=Math.imul(L,K))+Math.imul(F,B)|0,a=Math.imul(F,K),n=n+Math.imul(N,J)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(q,J)|0,a=a+Math.imul(q,H)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(R,Y)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(E,Z)|0,a=a+Math.imul(E,G)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(M,re)|0,a=a+Math.imul(M,ne)|0,n=n+Math.imul(m,ae)|0,i=(i=i+Math.imul(m,oe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,n=n+Math.imul(b,se)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(p,se)|0,a=a+Math.imul(p,de)|0;var Ie=(d+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,ue)|0)+Math.imul(u,he)|0))<<13)|0;d=((a=a+Math.imul(u,ue)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(j,B),i=(i=Math.imul(j,K))+Math.imul(C,B)|0,a=Math.imul(C,K),n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,H)|0)+Math.imul(F,J)|0,a=a+Math.imul(F,H)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(q,Y)|0,a=a+Math.imul(q,X)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(R,Z)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(E,$)|0,a=a+Math.imul(E,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(I,re)|0,a=a+Math.imul(I,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,n=n+Math.imul(m,se)|0,i=(i=i+Math.imul(m,de)|0)+Math.imul(g,se)|0,a=a+Math.imul(g,de)|0,n=n+Math.imul(b,he)|0,i=(i=i+Math.imul(b,ue)|0)+Math.imul(p,he)|0,a=a+Math.imul(p,ue)|0;var _e=(d+(n=n+Math.imul(h,be)|0)|0)+((8191&(i=(i=i+Math.imul(h,pe)|0)+Math.imul(u,be)|0))<<13)|0;d=((a=a+Math.imul(u,pe)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(j,J),i=(i=Math.imul(j,H))+Math.imul(C,J)|0,a=Math.imul(C,H),n=n+Math.imul(L,Y)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(F,Y)|0,a=a+Math.imul(F,X)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(q,Z)|0,a=a+Math.imul(q,G)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(E,re)|0,a=a+Math.imul(E,ne)|0,n=n+Math.imul(A,ae)|0,i=(i=i+Math.imul(A,oe)|0)+Math.imul(I,ae)|0,a=a+Math.imul(I,oe)|0,n=n+Math.imul(w,se)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(M,se)|0,a=a+Math.imul(M,de)|0,n=n+Math.imul(m,he)|0,i=(i=i+Math.imul(m,ue)|0)+Math.imul(g,he)|0,a=a+Math.imul(g,ue)|0;var xe=(d+(n=n+Math.imul(b,be)|0)|0)+((8191&(i=(i=i+Math.imul(b,pe)|0)+Math.imul(p,be)|0))<<13)|0;d=((a=a+Math.imul(p,pe)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(j,Y),i=(i=Math.imul(j,X))+Math.imul(C,Y)|0,a=Math.imul(C,X),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(F,Z)|0,a=a+Math.imul(F,G)|0,n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(q,$)|0,a=a+Math.imul(q,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(R,re)|0,a=a+Math.imul(R,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,oe)|0)+Math.imul(E,ae)|0,a=a+Math.imul(E,oe)|0,n=n+Math.imul(A,se)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(I,se)|0,a=a+Math.imul(I,de)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(M,he)|0,a=a+Math.imul(M,ue)|0;var Ee=(d+(n=n+Math.imul(m,be)|0)|0)+((8191&(i=(i=i+Math.imul(m,pe)|0)+Math.imul(g,be)|0))<<13)|0;d=((a=a+Math.imul(g,pe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,Z),i=(i=Math.imul(j,G))+Math.imul(C,Z)|0,a=Math.imul(C,G),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(F,$)|0,a=a+Math.imul(F,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(q,re)|0,a=a+Math.imul(q,ne)|0,n=n+Math.imul(k,ae)|0,i=(i=i+Math.imul(k,oe)|0)+Math.imul(R,ae)|0,a=a+Math.imul(R,oe)|0,n=n+Math.imul(x,se)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(E,se)|0,a=a+Math.imul(E,de)|0,n=n+Math.imul(A,he)|0,i=(i=i+Math.imul(A,ue)|0)+Math.imul(I,he)|0,a=a+Math.imul(I,ue)|0;var Pe=(d+(n=n+Math.imul(w,be)|0)|0)+((8191&(i=(i=i+Math.imul(w,pe)|0)+Math.imul(M,be)|0))<<13)|0;d=((a=a+Math.imul(M,pe)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(j,$),i=(i=Math.imul(j,ee))+Math.imul(C,$)|0,a=Math.imul(C,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(F,re)|0,a=a+Math.imul(F,ne)|0,n=n+Math.imul(N,ae)|0,i=(i=i+Math.imul(N,oe)|0)+Math.imul(q,ae)|0,a=a+Math.imul(q,oe)|0,n=n+Math.imul(k,se)|0,i=(i=i+Math.imul(k,de)|0)+Math.imul(R,se)|0,a=a+Math.imul(R,de)|0,n=n+Math.imul(x,he)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(E,he)|0,a=a+Math.imul(E,ue)|0;var ke=(d+(n=n+Math.imul(A,be)|0)|0)+((8191&(i=(i=i+Math.imul(A,pe)|0)+Math.imul(I,be)|0))<<13)|0;d=((a=a+Math.imul(I,pe)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(j,re),i=(i=Math.imul(j,ne))+Math.imul(C,re)|0,a=Math.imul(C,ne),n=n+Math.imul(L,ae)|0,i=(i=i+Math.imul(L,oe)|0)+Math.imul(F,ae)|0,a=a+Math.imul(F,oe)|0,n=n+Math.imul(N,se)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(q,se)|0,a=a+Math.imul(q,de)|0,n=n+Math.imul(k,he)|0,i=(i=i+Math.imul(k,ue)|0)+Math.imul(R,he)|0,a=a+Math.imul(R,ue)|0;var Re=(d+(n=n+Math.imul(x,be)|0)|0)+((8191&(i=(i=i+Math.imul(x,pe)|0)+Math.imul(E,be)|0))<<13)|0;d=((a=a+Math.imul(E,pe)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(j,ae),i=(i=Math.imul(j,oe))+Math.imul(C,ae)|0,a=Math.imul(C,oe),n=n+Math.imul(L,se)|0,i=(i=i+Math.imul(L,de)|0)+Math.imul(F,se)|0,a=a+Math.imul(F,de)|0,n=n+Math.imul(N,he)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(q,he)|0,a=a+Math.imul(q,ue)|0;var ze=(d+(n=n+Math.imul(k,be)|0)|0)+((8191&(i=(i=i+Math.imul(k,pe)|0)+Math.imul(R,be)|0))<<13)|0;d=((a=a+Math.imul(R,pe)|0)+(i>>>13)|0)+(ze>>>26)|0,ze&=67108863,n=Math.imul(j,se),i=(i=Math.imul(j,de))+Math.imul(C,se)|0,a=Math.imul(C,de),n=n+Math.imul(L,he)|0,i=(i=i+Math.imul(L,ue)|0)+Math.imul(F,he)|0,a=a+Math.imul(F,ue)|0;var Ne=(d+(n=n+Math.imul(N,be)|0)|0)+((8191&(i=(i=i+Math.imul(N,pe)|0)+Math.imul(q,be)|0))<<13)|0;d=((a=a+Math.imul(q,pe)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(j,he),i=(i=Math.imul(j,ue))+Math.imul(C,he)|0,a=Math.imul(C,ue);var qe=(d+(n=n+Math.imul(L,be)|0)|0)+((8191&(i=(i=i+Math.imul(L,pe)|0)+Math.imul(F,be)|0))<<13)|0;d=((a=a+Math.imul(F,pe)|0)+(i>>>13)|0)+(qe>>>26)|0,qe&=67108863;var Oe=(d+(n=Math.imul(j,be))|0)+((8191&(i=(i=Math.imul(j,pe))+Math.imul(C,be)|0))<<13)|0;return d=((a=Math.imul(C,pe))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,s[0]=ve,s[1]=me,s[2]=ge,s[3]=ye,s[4]=we,s[5]=Me,s[6]=Se,s[7]=Ae,s[8]=Ie,s[9]=_e,s[10]=xe,s[11]=Ee,s[12]=Pe,s[13]=ke,s[14]=Re,s[15]=ze,s[16]=Ne,s[17]=qe,s[18]=Oe,0!==d&&(s[19]=d,r.length++),r};function p(e,t,r){return(new v).mulp(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(b=l),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?b(this,e,t):n<63?l(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var f=67108863&n,s=Math.min(a,t.length-1),d=Math.max(0,a-e.length+1);d<=s;d++){var c=a-d,h=(0|e.words[c])*(0|t.words[d]),u=67108863&h;f=67108863&(u=u+f|0),i+=(o=(o=o+(h/67108864|0)|0)+(u>>>26)|0)>>>26,o&=67108863}r.words[a]=f,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o<a;o++)n[o]=t[e[o]],i[o]=r[e[o]]},v.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var o=1;o<i;o<<=1)for(var f=o<<1,s=Math.cos(2*Math.PI/f),d=Math.sin(2*Math.PI/f),c=0;c<i;c+=f)for(var h=s,u=d,l=0;l<o;l++){var b=r[c+l],p=n[c+l],v=r[c+l+o],m=n[c+l+o],g=h*v-u*m;m=h*m+u*v,v=g,r[c+l]=b+v,n[c+l]=p+m,r[c+l+o]=b-v,n[c+l+o]=p-m,l!==f&&(g=s*h-d*u,u=s*u+d*h,h=g)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},v.prototype.convert13b=function(e,t,r,i){for(var a=0,o=0;o<t;o++)a+=0|e[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<i;++o)r[o]=0;n(0===a),n(!(-8192&a))},v.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),f=new Array(n),s=new Array(n),d=new Array(n),c=new Array(n),h=new Array(n),u=r.words;u.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,d,n),this.transform(o,a,f,s,n,i),this.transform(d,a,c,h,n,i);for(var l=0;l<n;l++){var b=f[l]*c[l]-s[l]*h[l];s[l]=f[l]*h[l]+s[l]*c[l],f[l]=b}return this.conjugate(f,s,n),this.transform(f,s,u,a,n,i),this.conjugate(u,a,n),this.normalize13b(u,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),p(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this.length=0===e?1:this.length,this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var f=this.words[t]&a,s=(0|this.words[t])-f<<r;this.words[t]=s|o,o=f>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),f=67108863^67108863>>>a<<a,s=r;if(i-=o,i=Math.max(0,i),s){for(var d=0;d<o;d++)s.words[d]=this.words[d];s.length=o}if(0===o);else if(this.length>o)for(this.length-=o,d=0;d<this.length;d++)this.words[d]=this.words[d+o];else this.words[0]=0,this.length=1;var c=0;for(d=this.length-1;d>=0&&(0!==c||d>=i);d--){var h=0|this.words[d];this.words[d]=c<<26-a|h>>>a,c=h&f}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r||!(this.words[r]&i))},a.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var i,a,o=e.length+r;this._expand(o);var f=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+f;var s=(0|e.words[i])*t;f=((a-=67108863&s)>>26)-(s/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)f=(a=(0|this.words[i+r])+f)>>26,this.words[i+r]=67108863&a;if(0===f)return this.strip();for(n(-1===f),f=0,i=0;i<this.length;i++)f=(a=-(0|this.words[i])+f)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var f,s=n.length-i.length;if("mod"!==t){(f=new a(null)).length=s+1,f.words=new Array(f.length);for(var d=0;d<f.length;d++)f.words[d]=0}var c=n.clone()._ishlnsubmul(i,1,s);0===c.negative&&(n=c,f&&(f.words[s]=1));for(var h=s-1;h>=0;h--){var u=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(u=Math.min(u/o|0,67108863),n._ishlnsubmul(i,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);f&&(f.words[h]=u)}return f&&f.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:f||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(i=f.div.neg()),"div"!==t&&(o=f.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(i=f.div.neg()),{div:i,mod:f.mod}):this.negative&e.negative?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(o=f.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:f.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,f},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),f=new a(0),s=new a(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var u=0,l=1;!(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var b=0,p=1;!(r.words[0]&p)&&b<26;++b,p<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(f.isOdd()||s.isOdd())&&(f.iadd(c),s.isub(h)),f.iushrn(1),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(f),o.isub(s)):(r.isub(t),f.isub(i),s.isub(o))}return{a:f,b:s,gcd:r.iushln(d)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),f=new a(0),s=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,c=1;!(t.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(t.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);for(var h=0,u=1;!(r.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(r.iushrn(h);h-- >0;)f.isOdd()&&f.iadd(s),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(f)):(r.isub(t),f.isub(o))}return(i=0===t.cmpn(1)?o:f).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var f=0|this.words[o];a=(f+=a)>>>26,f&=67108863,this.words[o]=f}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new A(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(y,g),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&r)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,g),i(M,g),i(S,g),S.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new w;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return m[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(!(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var f=new a(1).toRed(this),s=f.redNeg(),d=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,d).cmp(s);)c.redIAdd(s);for(var h=this.pow(c,i),u=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),b=o;0!==l.cmp(f);){for(var p=l,v=0;0!==p.cmp(f);v++)p=p.redSqr();n(v<b);var m=this.pow(h,new a(1).iushln(b-v-1));u=u.redMul(m),h=m.redSqr(),l=l.redMul(h),b=v}return u},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],o=0,f=0,s=t.bitLength()%26;for(0===s&&(s=26),n=t.length-1;n>=0;n--){for(var d=t.words[n],c=s-1;c>=0;c--){var h=d>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4==++f||0===n&&0===c)&&(i=this.mul(i,r[o]),f=0,o=0)):f=0}s=26}return i},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new I(e)},i(I,A),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},I.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},I.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},5037:(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var a=r(3776);if("function"!=typeof a.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return a.randomBytes(e)}}catch(e){}},6729:(e,t,r)=>{"use strict";var n=t;n.version=r(1636).rE,n.utils=r(7011),n.rand=r(5037),n.curve=r(894),n.curves=r(480),n.ec=r(7447),n.eddsa=r(8650)},6677:(e,t,r)=>{"use strict";var n=r(9404),i=r(7011),a=i.getNAF,o=i.getJSF,f=i.assert;function s(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function d(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=s,s.prototype.point=function(){throw new Error("Not implemented")},s.prototype.validate=function(){throw new Error("Not implemented")},s.prototype._fixedNafMul=function(e,t){f(e.precomputed);var r=e._getDoubles(),n=a(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,s,d=[];for(o=0;o<n.length;o+=r.step){s=0;for(var c=o+r.step-1;c>=o;c--)s=(s<<1)+n[c];d.push(s)}for(var h=this.jpoint(null,null,null),u=this.jpoint(null,null,null),l=i;l>0;l--){for(o=0;o<d.length;o++)(s=d[o])===l?u=u.mixedAdd(r.points[o]):s===-l&&(u=u.mixedAdd(r.points[o].neg()));h=h.add(u)}return h.toP()},s.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=a(t,r,this._bitLength),s=this.jpoint(null,null,null),d=o.length-1;d>=0;d--){for(var c=0;d>=0&&0===o[d];d--)c++;if(d>=0&&c++,s=s.dblp(c),d<0)break;var h=o[d];f(0!==h),s="affine"===e.type?h>0?s.mixedAdd(i[h-1>>1]):s.mixedAdd(i[-h-1>>1].neg()):h>0?s.add(i[h-1>>1]):s.add(i[-h-1>>1].neg())}return"affine"===e.type?s.toP():s},s.prototype._wnafMulAdd=function(e,t,r,n,i){var f,s,d,c=this._wnafT1,h=this._wnafT2,u=this._wnafT3,l=0;for(f=0;f<n;f++){var b=(d=t[f])._getNAFPoints(e);c[f]=b.wnd,h[f]=b.points}for(f=n-1;f>=1;f-=2){var p=f-1,v=f;if(1===c[p]&&1===c[v]){var m=[t[p],null,null,t[v]];0===t[p].y.cmp(t[v].y)?(m[1]=t[p].add(t[v]),m[2]=t[p].toJ().mixedAdd(t[v].neg())):0===t[p].y.cmp(t[v].y.redNeg())?(m[1]=t[p].toJ().mixedAdd(t[v]),m[2]=t[p].add(t[v].neg())):(m[1]=t[p].toJ().mixedAdd(t[v]),m[2]=t[p].toJ().mixedAdd(t[v].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=o(r[p],r[v]);for(l=Math.max(y[0].length,l),u[p]=new Array(l),u[v]=new Array(l),s=0;s<l;s++){var w=0|y[0][s],M=0|y[1][s];u[p][s]=g[3*(w+1)+(M+1)],u[v][s]=0,h[p]=m}}else u[p]=a(r[p],c[p],this._bitLength),u[v]=a(r[v],c[v],this._bitLength),l=Math.max(u[p].length,l),l=Math.max(u[v].length,l)}var S=this.jpoint(null,null,null),A=this._wnafT4;for(f=l;f>=0;f--){for(var I=0;f>=0;){var _=!0;for(s=0;s<n;s++)A[s]=0|u[s][f],0!==A[s]&&(_=!1);if(!_)break;I++,f--}if(f>=0&&I++,S=S.dblp(I),f<0)break;for(s=0;s<n;s++){var x=A[s];0!==x&&(x>0?d=h[s][x-1>>1]:x<0&&(d=h[s][-x-1>>1].neg()),S="affine"===d.type?S.mixedAdd(d):S.add(d))}}for(f=0;f<n;f++)h[f]=null;return i?S:S.toP()},s.BasePoint=d,d.prototype.eq=function(){throw new Error("Not implemented")},d.prototype.validate=function(){return this.curve.validate(this)},s.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?f(e[e.length-1]%2==0):7===e[0]&&f(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},d.prototype.encodeCompressed=function(e){return this.encode(e,!0)},d.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},d.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},d.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},d.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},d.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var a=0;a<e;a++)n=n.dbl();r.push(n)}return{step:e,points:r}},d.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},d.prototype._getBeta=function(){return null},d.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},1298:(e,t,r)=>{"use strict";var n=r(7011),i=r(9404),a=r(6698),o=r(6677),f=n.assert;function s(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),f(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function d(e,t,r,n,a){o.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=a&&new i(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}a(s,o),e.exports=s,s.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},s.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},s.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},s.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),a=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(a.redInvm()),f=o.redSqrt();if(0!==f.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=f.fromRed().isOdd();return(t&&!s||!t&&s)&&(f=f.redNeg()),this.point(e,f)},s.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),a=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(a.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var f=o.redSqrt();if(0!==f.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return f.fromRed().isOdd()!==t&&(f=f.redNeg()),this.point(f,e)},s.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},a(d,o.BasePoint),s.prototype.pointFromJSON=function(e){return d.fromJSON(this,e)},s.prototype.point=function(e,t,r,n){return new d(this,e,t,r,n)},d.fromJSON=function(e,t){return new d(e,t[0],t[1],t[2])},d.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},d.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},d.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=n.redAdd(t),o=a.redSub(r),f=n.redSub(t),s=i.redMul(o),d=a.redMul(f),c=i.redMul(f),h=o.redMul(a);return this.curve.point(s,d,h,c)},d.prototype._projDbl=function(){var e,t,r,n,i,a,o=this.x.redAdd(this.y).redSqr(),f=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var d=(n=this.curve._mulA(f)).redAdd(s);this.zOne?(e=o.redSub(f).redSub(s).redMul(d.redSub(this.curve.two)),t=d.redMul(n.redSub(s)),r=d.redSqr().redSub(d).redSub(d)):(i=this.z.redSqr(),a=d.redSub(i).redISub(i),e=o.redSub(f).redISub(s).redMul(a),t=d.redMul(n.redSub(s)),r=d.redMul(a))}else n=f.redAdd(s),i=this.curve._mulC(this.z).redSqr(),a=n.redSub(i).redSub(i),e=this.curve._mulC(o.redISub(n)).redMul(a),t=this.curve._mulC(n).redMul(f.redISub(s)),r=n.redMul(a);return this.curve.point(e,t,r)},d.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},d.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),o=i.redSub(n),f=i.redAdd(n),s=r.redAdd(t),d=a.redMul(o),c=f.redMul(s),h=a.redMul(s),u=o.redMul(f);return this.curve.point(d,c,u,h)},d.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),f=this.curve.d.redMul(a).redMul(o),s=i.redSub(f),d=i.redAdd(f),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),h=n.redMul(s).redMul(c);return this.curve.twisted?(t=n.redMul(d).redMul(o.redSub(this.curve._mulA(a))),r=s.redMul(d)):(t=n.redMul(d).redMul(o.redSub(a)),r=this.curve._mulC(s).redMul(d)),this.curve.point(h,t,r)},d.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},d.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},d.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},d.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},d.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},d.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},d.prototype.getX=function(){return this.normalize(),this.x.fromRed()},d.prototype.getY=function(){return this.normalize(),this.y.fromRed()},d.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},d.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},d.prototype.toP=d.prototype.normalize,d.prototype.mixedAdd=d.prototype.add},894:(e,t,r)=>{"use strict";var n=t;n.base=r(6677),n.short=r(9188),n.mont=r(370),n.edwards=r(1298)},370:(e,t,r)=>{"use strict";var n=r(9404),i=r(6698),a=r(6677),o=r(7011);function f(e){a.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function s(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(f,a),e.exports=f,f.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(s,a.BasePoint),f.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},f.prototype.point=function(e,t){return new s(this,e,t)},f.prototype.pointFromJSON=function(e){return s.fromJSON(this,e)},s.prototype.precompute=function(){},s.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},s.fromJSON=function(e,t){return new s(e,t[0],t[1]||e.one)},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},s.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},s.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=i.redMul(n),f=t.z.redMul(a.redAdd(o).redSqr()),s=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(f,s)},s.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var a=i.length-1;a>=0;a--)0===i[a]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},s.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},s.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},s.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},9188:(e,t,r)=>{"use strict";var n=r(7011),i=r(9404),a=r(6698),o=r(6677),f=n.assert;function s(e){o.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function d(e,t,r,n){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(e,t,r,n){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(s,o),e.exports=s,s.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))?r=a[0]:(r=a[1],f(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},s.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),a=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(a).fromRed(),n.redSub(a).fromRed()]},s.prototype._getEndoBasis=function(e){for(var t,r,n,a,o,f,s,d,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=e,l=this.n.clone(),b=new i(1),p=new i(0),v=new i(0),m=new i(1),g=0;0!==u.cmpn(0);){var y=l.div(u);d=l.sub(y.mul(u)),c=v.sub(y.mul(b));var w=m.sub(y.mul(p));if(!n&&d.cmp(h)<0)t=s.neg(),r=b,n=d.neg(),a=c;else if(n&&2==++g)break;s=d,l=u,u=d,v=b,b=c,m=p,p=w}o=d.neg(),f=c;var M=n.sqr().add(a.sqr());return o.sqr().add(f.sqr()).cmp(M)>=0&&(o=t,f=r),n.negative&&(n=n.neg(),a=a.neg()),o.negative&&(o=o.neg(),f=f.neg()),[{a:n,b:a},{a:o,b:f}]},s.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=i.mul(r.a),f=a.mul(n.a),s=i.mul(r.b),d=a.mul(n.b);return{k1:e.sub(o).sub(f),k2:s.add(d).neg()}},s.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var a=n.fromRed().isOdd();return(t&&!a||!t&&a)&&(n=n.redNeg()),this.point(e,n)},s.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},s.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a<e.length;a++){var o=this._endoSplit(t[a]),f=e[a],s=f._getBeta();o.k1.negative&&(o.k1.ineg(),f=f.neg(!0)),o.k2.negative&&(o.k2.ineg(),s=s.neg(!0)),n[2*a]=f,n[2*a+1]=s,i[2*a]=o.k1,i[2*a+1]=o.k2}for(var d=this._wnafMulAdd(1,n,i,2*a,r),c=0;c<2*a;c++)n[c]=null,i[c]=null;return d},a(d,o.BasePoint),s.prototype.point=function(e,t,r){return new d(this,e,t,r)},s.prototype.pointFromJSON=function(e,t){return d.fromJSON(this,e,t)},d.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},d.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},d.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var a=t[2];return n.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[n].concat(a.doubles.points.map(i))},naf:a.naf&&{wnd:a.naf.wnd,points:[n].concat(a.naf.points.map(i))}},n},d.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},d.prototype.isInfinity=function(){return this.inf},d.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},d.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},d.prototype.getX=function(){return this.x.fromRed()},d.prototype.getY=function(){return this.y.fromRed()},d.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},d.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},d.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},d.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},d.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},d.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(c,o.BasePoint),s.prototype.jpoint=function(e,t,r){return new c(this,e,t,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),f=n.redSub(i),s=a.redSub(o);if(0===f.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=f.redSqr(),c=d.redMul(f),h=n.redMul(d),u=s.redSqr().redIAdd(c).redISub(h).redISub(h),l=s.redMul(h.redISub(u)).redISub(a.redMul(c)),b=this.z.redMul(e.z).redMul(f);return this.curve.jpoint(u,l,b)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=r.redSub(n),f=i.redSub(a);if(0===o.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=o.redSqr(),d=s.redMul(o),c=r.redMul(s),h=f.redSqr().redIAdd(d).redISub(c).redISub(c),u=f.redMul(c.redISub(h)).redISub(i.redMul(d)),l=this.z.redMul(o);return this.curve.jpoint(h,u,l)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,a=this.x,o=this.y,f=this.z,s=f.redSqr().redSqr(),d=o.redAdd(o);for(t=0;t<e;t++){var c=a.redSqr(),h=d.redSqr(),u=h.redSqr(),l=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(s)),b=a.redMul(h),p=l.redSqr().redISub(b.redAdd(b)),v=b.redISub(p),m=l.redMul(v);m=m.redIAdd(m).redISub(u);var g=d.redMul(f);t+1<e&&(s=s.redMul(u)),a=p,f=g,d=m}return this.curve.jpoint(a,d.redMul(i),f)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(a);o=o.redIAdd(o);var f=n.redAdd(n).redIAdd(n),s=f.redSqr().redISub(o).redISub(o),d=a.redIAdd(a);d=(d=d.redIAdd(d)).redIAdd(d),e=s,t=f.redMul(o.redISub(s)).redISub(d),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),u=h.redSqr(),l=this.x.redAdd(h).redSqr().redISub(c).redISub(u);l=l.redIAdd(l);var b=c.redAdd(c).redIAdd(c),p=b.redSqr(),v=u.redIAdd(u);v=(v=v.redIAdd(v)).redIAdd(v),e=p.redISub(l).redISub(l),t=b.redMul(l.redISub(e)).redISub(v),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},c.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(a);o=o.redIAdd(o);var f=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),s=f.redSqr().redISub(o).redISub(o);e=s;var d=a.redIAdd(a);d=(d=d.redIAdd(d)).redIAdd(d),t=f.redMul(o.redISub(s)).redISub(d),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),u=this.x.redMul(h),l=this.x.redSub(c).redMul(this.x.redAdd(c));l=l.redAdd(l).redIAdd(l);var b=u.redIAdd(u),p=(b=b.redIAdd(b)).redAdd(b);e=l.redSqr().redISub(p),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var v=h.redSqr();v=(v=(v=v.redIAdd(v)).redIAdd(v)).redIAdd(v),t=l.redMul(b.redISub(e)).redISub(v)}return this.curve.jpoint(e,t,r)},c.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),a=t.redSqr(),o=r.redSqr(),f=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(i)),s=t.redAdd(t),d=(s=s.redIAdd(s)).redMul(o),c=f.redSqr().redISub(d.redAdd(d)),h=d.redISub(c),u=o.redSqr();u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=f.redMul(h).redISub(u),b=r.redAdd(r).redMul(n);return this.curve.jpoint(c,l,b)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),a=i.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(n),f=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(a)).redSqr(),s=n.redIAdd(n);s=(s=(s=s.redIAdd(s)).redIAdd(s)).redIAdd(s);var d=i.redIAdd(o).redSqr().redISub(a).redISub(f).redISub(s),c=t.redMul(d);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.x.redMul(f).redISub(c);h=(h=h.redIAdd(h)).redIAdd(h);var u=this.y.redMul(d.redMul(s.redISub(d)).redISub(o.redMul(f)));u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var l=this.z.redAdd(o).redSqr().redISub(r).redISub(f);return this.curve.jpoint(h,u,l)},c.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},c.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},c.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},480:(e,t,r)=>{"use strict";var n,i=t,a=r(7952),o=r(894),f=r(7011).assert;function s(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function d(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new s(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=s,d("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),d("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),d("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),d("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),d("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),d("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),d("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(4011)}catch(e){n=void 0}d("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},7447:(e,t,r)=>{"use strict";var n=r(9404),i=r(2723),a=r(7011),o=r(480),f=r(5037),s=a.assert,d=r(1200),c=r(8545);function h(e){if(!(this instanceof h))return new h(e);"string"==typeof e&&(s(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=h,h.prototype.keyPair=function(e){return new d(this,e)},h.prototype.keyFromPrivate=function(e,t){return d.fromPrivate(this,e,t)},h.prototype.keyFromPublic=function(e,t){return d.fromPublic(this,e,t)},h.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||f(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),a=this.n.sub(new n(2));;){var o=new n(t.generate(r));if(!(o.cmp(a)>0))return o.iaddn(1),this.keyFromPrivate(o)}},h.prototype._truncateToN=function(e,t,r){var i;if(n.isBN(e)||"number"==typeof e)i=(e=new n(e,16)).byteLength();else if("object"==typeof e)i=e.length,e=new n(e,16);else{var a=e.toString();i=a.length+1>>>1,e=new n(a,16)}"number"!=typeof r&&(r=8*i);var o=r-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},h.prototype.sign=function(e,t,r,a){if("object"==typeof r&&(a=r,r=null),a||(a={}),"string"!=typeof e&&"number"!=typeof e&&!n.isBN(e)){s("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),s(e.length>>>0===e.length);for(var o=0;o<e.length;o++)s((255&e[o])===e[o])}t=this.keyFromPrivate(t,r),e=this._truncateToN(e,!1,a.msgBitLength),s(!e.isNeg(),"Can not sign a negative message");var f=this.n.byteLength(),d=t.getPrivate().toArray("be",f),h=e.toArray("be",f);s(new n(h).eq(e),"Can not sign message");for(var u=new i({hash:this.hash,entropy:d,nonce:h,pers:a.pers,persEnc:a.persEnc||"utf8"}),l=this.n.sub(new n(1)),b=0;;b++){var p=a.k?a.k(b):new n(u.generate(this.n.byteLength()));if(!((p=this._truncateToN(p,!0)).cmpn(1)<=0||p.cmp(l)>=0)){var v=this.g.mul(p);if(!v.isInfinity()){var m=v.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var y=p.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var w=(v.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return a.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),w^=1),new c({r:g,s:y,recoveryParam:w})}}}}}},h.prototype.verify=function(e,t,r,n,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),r=this.keyFromPublic(r,n);var a=(t=new c(t,"hex")).r,o=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var f,s=o.invm(this.n),d=s.mul(e).umod(this.n),h=s.mul(a).umod(this.n);return this.curve._maxwellTrick?!(f=this.g.jmulAdd(d,r.getPublic(),h)).isInfinity()&&f.eqXToP(a):!(f=this.g.mulAdd(d,r.getPublic(),h)).isInfinity()&&0===f.getX().umod(this.n).cmp(a)},h.prototype.recoverPubKey=function(e,t,r,i){s((3&r)===r,"The recovery param is more than two bits"),t=new c(t,i);var a=this.n,o=new n(e),f=t.r,d=t.s,h=1&r,u=r>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");f=u?this.curve.pointFromX(f.add(this.curve.n),h):this.curve.pointFromX(f,h);var l=t.r.invm(a),b=a.sub(o).mul(l).umod(a),p=d.mul(l).umod(a);return this.g.mulAdd(b,f,p)},h.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new c(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},1200:(e,t,r)=>{"use strict";var n=r(9404),i=r(7011).assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=a,a.fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},a.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},8545:(e,t,r)=>{"use strict";var n=r(9404),i=r(7011),a=i.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(a(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function f(){this.place=0}function s(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var i=0,a=0,o=t.place;a<n;a++,o++)i<<=8,i|=e[o],i>>>=0;return!(i<=127)&&(t.place=o,i)}function d(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function c(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=o,o.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new f;if(48!==e[r.place++])return!1;var a=s(e,r);if(!1===a)return!1;if(a+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=s(e,r);if(!1===o)return!1;if(128&e[r.place])return!1;var d=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var c=s(e,r);if(!1===c)return!1;if(e.length!==c+r.place)return!1;if(128&e[r.place])return!1;var h=e.slice(r.place,c+r.place);if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new n(d),this.s=new n(h),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=d(t),r=d(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,t.length),(n=n.concat(t)).push(2),c(n,r.length);var a=n.concat(r),o=[48];return c(o,a.length),o=o.concat(a),i.encode(o,e)}},8650:(e,t,r)=>{"use strict";var n=r(7952),i=r(480),a=r(7011),o=a.assert,f=a.parseBytes,s=r(6661),d=r(220);function c(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=c,c.prototype.sign=function(e,t){e=f(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),a=this.encodePoint(i),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:a})},c.prototype.verify=function(e,t,r){if(e=f(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(a)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return a.intFromLE(e.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(e){return s.fromPublic(this,e)},c.prototype.keyFromSecret=function(e){return s.fromSecret(this,e)},c.prototype.makeSignature=function(e){return e instanceof d?e:new d(this,e)},c.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},c.prototype.decodePoint=function(e){var t=(e=a.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=!!(128&e[t]),i=a.intFromLE(r);return this.curve.pointFromY(i,n)},c.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(e){return a.intFromLE(e)},c.prototype.isPoint=function(e){return e instanceof this.pointClass}},6661:(e,t,r)=>{"use strict";var n=r(7011),i=n.assert,a=n.parseBytes,o=n.cachedProperty;function f(e,t){this.eddsa=e,this._secret=a(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=a(t.pub)}f.fromPublic=function(e,t){return t instanceof f?t:new f(e,{pub:t})},f.fromSecret=function(e,t){return t instanceof f?t:new f(e,{secret:t})},f.prototype.secret=function(){return this._secret},o(f,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),o(f,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),o(f,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),o(f,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),o(f,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),o(f,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),f.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},f.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},f.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},f.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=f},220:(e,t,r)=>{"use strict";var n=r(9404),i=r(7011),a=i.assert,o=i.cachedProperty,f=i.parseBytes;function s(e,t){this.eddsa=e,"object"!=typeof t&&(t=f(t)),Array.isArray(t)&&(a(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),a(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}o(s,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),o(s,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),o(s,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),o(s,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),s.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},s.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=s},4011:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},7011:(e,t,r)=>{"use strict";var n=t,i=r(9404),a=r(3349),o=r(4367);n.assert=a,n.toArray=o.toArray,n.zero2=o.zero2,n.toHex=o.toHex,n.encode=o.encode,n.getNAF=function(e,t,r){var n,i=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<i.length;n+=1)i[n]=0;var a=1<<t+1,o=e.clone();for(n=0;n<i.length;n++){var f,s=o.andln(a-1);o.isOdd()?(f=s>(a>>1)-1?(a>>1)-s:s,o.isubn(f)):f=0,i[n]=f,o.iushrn(1)}return i},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,a=0;e.cmpn(-i)>0||t.cmpn(-a)>0;){var o,f,s=e.andln(3)+i&3,d=t.andln(3)+a&3;3===s&&(s=-1),3===d&&(d=-1),o=1&s?3!=(n=e.andln(7)+i&7)&&5!==n||2!==d?s:-s:0,r[0].push(o),f=1&d?3!=(n=t.andln(7)+a&7)&&5!==n||2!==s?d:-d:0,r[1].push(f),2*i===o+1&&(i=1-i),2*a===f+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},7952:(e,t,r)=>{var n=t;n.utils=r(7426),n.common=r(6166),n.sha=r(6229),n.ripemd=r(6784),n.hmac=r(8948),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},6166:(e,t,r)=>{"use strict";var n=r(7426),i=r(3349);function a(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=a,a.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},a.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},a.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a<this.padLength;a++)n[i++]=0;return n}},8948:(e,t,r)=>{"use strict";var n=r(7426),i=r(3349);function a(e,t,r){if(!(this instanceof a))return new a(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=a,a.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},a.prototype.update=function(e,t){return this.inner.update(e,t),this},a.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},6784:(e,t,r)=>{"use strict";var n=r(7426),i=r(6166),a=n.rotl32,o=n.sum32,f=n.sum32_3,s=n.sum32_4,d=i.BlockHash;function c(){if(!(this instanceof c))return new c;d.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function u(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(c,d),t.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],d=this.h[3],c=this.h[4],g=r,y=n,w=i,M=d,S=c,A=0;A<80;A++){var I=o(a(s(r,h(A,n,i,d),e[b[A]+t],u(A)),v[A]),c);r=c,c=d,d=a(i,10),i=n,n=I,I=o(a(s(g,h(79-A,y,w,M),e[p[A]+t],l(A)),m[A]),S),g=S,S=M,M=a(w,10),w=y,y=I}I=f(this.h[1],i,M),this.h[1]=f(this.h[2],d,S),this.h[2]=f(this.h[3],c,g),this.h[3]=f(this.h[4],r,y),this.h[4]=f(this.h[0],n,w),this.h[0]=I},c.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var b=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],p=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],v=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},6229:(e,t,r)=>{"use strict";t.sha1=r(3917),t.sha224=r(7714),t.sha256=r(2287),t.sha384=r(1911),t.sha512=r(7766)},3917:(e,t,r)=>{"use strict";var n=r(7426),i=r(6166),a=r(6225),o=n.rotl32,f=n.sum32,s=n.sum32_5,d=a.ft_1,c=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function u(){if(!(this instanceof u))return new u;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(u,c),e.exports=u,u.blockSize=512,u.outSize=160,u.hmacStrength=80,u.padLength=64,u.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=o(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],a=this.h[1],c=this.h[2],u=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var b=~~(n/20),p=s(o(i,5),d(b,a,c,u),l,r[n],h[b]);l=u,u=c,c=o(a,30),a=i,i=p}this.h[0]=f(this.h[0],i),this.h[1]=f(this.h[1],a),this.h[2]=f(this.h[2],c),this.h[3]=f(this.h[3],u),this.h[4]=f(this.h[4],l)},u.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},7714:(e,t,r)=>{"use strict";var n=r(7426),i=r(2287);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(a,i),e.exports=a,a.blockSize=512,a.outSize=224,a.hmacStrength=192,a.padLength=64,a.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},2287:(e,t,r)=>{"use strict";var n=r(7426),i=r(6166),a=r(6225),o=r(3349),f=n.sum32,s=n.sum32_4,d=n.sum32_5,c=a.ch32,h=a.maj32,u=a.s0_256,l=a.s1_256,b=a.g0_256,p=a.g1_256,v=i.BlockHash,m=[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 g(){if(!(this instanceof g))return new g;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(g,v),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(p(r[n-2]),r[n-7],b(r[n-15]),r[n-16]);var i=this.h[0],a=this.h[1],v=this.h[2],m=this.h[3],g=this.h[4],y=this.h[5],w=this.h[6],M=this.h[7];for(o(this.k.length===r.length),n=0;n<r.length;n++){var S=d(M,l(g),c(g,y,w),this.k[n],r[n]),A=f(u(i),h(i,a,v));M=w,w=y,y=g,g=f(m,S),m=v,v=a,a=i,i=f(S,A)}this.h[0]=f(this.h[0],i),this.h[1]=f(this.h[1],a),this.h[2]=f(this.h[2],v),this.h[3]=f(this.h[3],m),this.h[4]=f(this.h[4],g),this.h[5]=f(this.h[5],y),this.h[6]=f(this.h[6],w),this.h[7]=f(this.h[7],M)},g.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},1911:(e,t,r)=>{"use strict";var n=r(7426),i=r(7766);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(a,i),e.exports=a,a.blockSize=1024,a.outSize=384,a.hmacStrength=192,a.padLength=128,a.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},7766:(e,t,r)=>{"use strict";var n=r(7426),i=r(6166),a=r(3349),o=n.rotr64_hi,f=n.rotr64_lo,s=n.shr64_hi,d=n.shr64_lo,c=n.sum64,h=n.sum64_hi,u=n.sum64_lo,l=n.sum64_4_hi,b=n.sum64_4_lo,p=n.sum64_5_hi,v=n.sum64_5_lo,m=i.BlockHash,g=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function w(e,t,r,n,i){var a=e&r^~e&i;return a<0&&(a+=4294967296),a}function M(e,t,r,n,i,a){var o=t&n^~t&a;return o<0&&(o+=4294967296),o}function S(e,t,r,n,i){var a=e&r^e&i^r&i;return a<0&&(a+=4294967296),a}function A(e,t,r,n,i,a){var o=t&n^t&a^n&a;return o<0&&(o+=4294967296),o}function I(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function _(e,t){var r=f(e,t,28)^f(t,e,2)^f(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=f(e,t,14)^f(e,t,18)^f(t,e,9);return r<0&&(r+=4294967296),r}function E(e,t){var r=o(e,t,1)^o(e,t,8)^s(e,t,7);return r<0&&(r+=4294967296),r}function P(e,t){var r=f(e,t,1)^f(e,t,8)^d(e,t,7);return r<0&&(r+=4294967296),r}function k(e,t){var r=f(e,t,19)^f(t,e,29)^d(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(y,m),e.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=(v=r[n-4],m=r[n-3],g=void 0,(g=o(v,m,19)^o(m,v,29)^s(v,m,6))<0&&(g+=4294967296),g),a=k(r[n-4],r[n-3]),f=r[n-14],d=r[n-13],c=E(r[n-30],r[n-29]),h=P(r[n-30],r[n-29]),u=r[n-32],p=r[n-31];r[n]=l(i,a,f,d,c,h,u,p),r[n+1]=b(i,a,f,d,c,h,u,p)}var v,m,g},y.prototype._update=function(e,t){this._prepareBlock(e,t);var r,n,i,f=this.W,s=this.h[0],d=this.h[1],l=this.h[2],b=this.h[3],m=this.h[4],g=this.h[5],y=this.h[6],E=this.h[7],P=this.h[8],k=this.h[9],R=this.h[10],z=this.h[11],N=this.h[12],q=this.h[13],O=this.h[14],L=this.h[15];a(this.k.length===f.length);for(var F=0;F<f.length;F+=2){var T=O,j=L,C=(i=void 0,(i=o(r=P,n=k,14)^o(r,n,18)^o(n,r,9))<0&&(i+=4294967296),i),V=x(P,k),B=w(P,0,R,0,N),K=M(0,k,0,z,0,q),D=this.k[F],J=this.k[F+1],H=f[F],U=f[F+1],Y=p(T,j,C,V,B,K,D,J,H,U),X=v(T,j,C,V,B,K,D,J,H,U);T=I(s,d),j=_(s,d),C=S(s,0,l,0,m),V=A(0,d,0,b,0,g);var W=h(T,j,C,V),Z=u(T,j,C,V);O=N,L=q,N=R,q=z,R=P,z=k,P=h(y,E,Y,X),k=u(E,E,Y,X),y=m,E=g,m=l,g=b,l=s,b=d,s=h(Y,X,W,Z),d=u(Y,X,W,Z)}c(this.h,0,s,d),c(this.h,2,l,b),c(this.h,4,m,g),c(this.h,6,y,E),c(this.h,8,P,k),c(this.h,10,R,z),c(this.h,12,N,q),c(this.h,14,O,L)},y.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},6225:(e,t,r)=>{"use strict";var n=r(7426).rotr32;function i(e,t,r){return e&t^~e&r}function a(e,t,r){return e&t^e&r^t&r}function o(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?o(t,r,n):2===e?a(t,r,n):void 0},t.ch32=i,t.maj32=a,t.p32=o,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},7426:(e,t,r)=>{"use strict";var n=r(3349),i=r(6698);function a(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function f(e){return 1===e.length?"0"+e:e}function s(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):a(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=f(e[r].toString(16));return t},t.htonl=o,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=o(i)),r+=s(i.toString(16))}return r},t.zero2=f,t.zero8=s,t.join32=function(e,t,r,i){var a=r-t;n(a%4==0);for(var o=new Array(a/4),f=0,s=t;f<o.length;f++,s+=4){var d;d="big"===i?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],o[f]=d>>>0}return o},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var a=e[n];"big"===t?(r[i]=a>>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],a=n+e[t+1]>>>0,o=(a<n?1:0)+r+i;e[t]=o>>>0,e[t+1]=a},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,a,o,f){var s=0,d=t;return s+=(d=d+n>>>0)<t?1:0,s+=(d=d+a>>>0)<a?1:0,e+r+i+o+(s+=(d=d+f>>>0)<f?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,a,o,f){return t+n+a+f>>>0},t.sum64_5_hi=function(e,t,r,n,i,a,o,f,s,d){var c=0,h=t;return c+=(h=h+n>>>0)<t?1:0,c+=(h=h+a>>>0)<a?1:0,c+=(h=h+f>>>0)<f?1:0,e+r+i+o+s+(c+=(h=h+d>>>0)<d?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,a,o,f,s,d){return t+n+a+f+d>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},2723:(e,t,r)=>{"use strict";var n=r(7952),i=r(4367),a=r(3349);function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=o,o.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},o.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),a(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var o=a.slice(0,e);return this._update(r),this._reseed++,i.encode(o,t)}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},3349:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},4367:(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),a=i>>8,o=255&i;a?r.push(a,o):r.push(o)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},669:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AvoBatcher=void 0;var n=r(3611),i=function(){function e(t){var r=this;this.events=[],this.networkCallsHandler=t,this.batchFlushAttemptTimestamp=Date.now(),n.AvoInspector.avoStorage.getItemAsync(e.cacheKey).then((function(e){if(null!==e){var t=e.filter((function(e){return null!==e}));r.events=r.events.concat(t),r.checkIfBatchNeedsToBeSent()}})).catch((function(e){console.error("Avo Inspector: error getting events from cache",e)}))}return e.prototype.handleSessionStarted=function(){this.events.push(this.networkCallsHandler.bodyForSessionStartedCall()),this.saveEvents(),this.checkIfBatchNeedsToBeSent()},e.prototype.handleTrackSchema=function(e,t,r,i,a){this.events.push(this.networkCallsHandler.bodyForEventSchemaCall(e,t,r,i,a)),this.saveEvents(),n.AvoInspector.shouldLog&&console.log("Avo Inspector: saved event "+e+" with schema "+JSON.stringify(t)),this.checkIfBatchNeedsToBeSent()},e.prototype.checkIfBatchNeedsToBeSent=function(){var e=this.events.length,t=Date.now(),r=t-this.batchFlushAttemptTimestamp,i=e%n.AvoInspector.batchSize==0,a=r>=1e3*n.AvoInspector.batchFlushSeconds,o=this;if(i||a){this.batchFlushAttemptTimestamp=t;var f=o.events;o.events=[],this.networkCallsHandler.callInspectorWithBatchBody(f,(function(e){null!=e?(o.events=o.events.concat(f),n.AvoInspector.shouldLog&&console.log("Avo Inspector: batch sending failed: "+e.message+". We will attempt to send your schemas with next batch")):n.AvoInspector.shouldLog&&console.log("Avo Inspector: batch sent successfully."),o.saveEvents()}))}},e.prototype.saveEvents=function(){if(this.events.length>1e3){var t=this.events.length-1e3;this.events.splice(0,t)}n.AvoInspector.avoStorage.setItem(e.cacheKey,this.events)},Object.defineProperty(e,"cacheKey",{get:function(){return"AvoInspectorEvents"},enumerable:!1,configurable:!0}),e}();t.AvoBatcher=i},3492:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{s(n.next(e))}catch(e){a(e)}}function f(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,f)}s((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:f(0),throw:f(1),return:f(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function f(f){return function(s){return function(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&f[0]?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[2&f[0],i.value]),f[0]){case 0:case 1:i=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,n=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==f[0]&&2!==f[0])){o=0;continue}if(3===f[0]&&(!i||f[1]>i[0]&&f[1]<i[3])){o.label=f[1];break}if(6===f[0]&&o.label<i[1]){o.label=i[1],i=f;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(f);break}i[2]&&o.ops.pop(),o.trys.pop();continue}f=t.call(e,o)}catch(e){f=[6,e],n=0}finally{r=i=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([f,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoDeduplicator=void 0;var a=r(924),o=r(6185),f=function(){function e(){this.avoFunctionsEvents={},this.manualEvents={},this.avoFunctionsEventsParams={},this.manualEventsParams={}}return e.prototype.shouldRegisterEvent=function(e,t,r){this.clearOldEvents(),r?(this.avoFunctionsEvents[Date.now()]=e,this.avoFunctionsEventsParams[e]=t):(this.manualEvents[Date.now()]=e,this.manualEventsParams[e]=t);var n=!r;return!this.hasSameEventAs(e,t,n)},e.prototype.hasSameEventAs=function(e,t,r){var n=!1;return r?this.lookForEventIn(e,t,this.avoFunctionsEventsParams)&&(n=!0):this.lookForEventIn(e,t,this.manualEventsParams)&&(n=!0),n&&(delete this.avoFunctionsEventsParams[e],delete this.manualEventsParams[e]),n},e.prototype.lookForEventIn=function(e,t,r){for(var n in r)if(r.hasOwnProperty(n)&&n===e){var i=r[e];if(i&&(0,o.deepEquals)(t,i))return!0}return!1},e.prototype.hasSeenEventParams=function(e,t){var r=!1;return t?this.lookForEventParamsIn(e,this.avoFunctionsEventsParams)&&(r=!0):this.lookForEventParamsIn(e,this.manualEventsParams)&&(r=!0),r},e.prototype.lookForEventParamsIn=function(e,t){for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];if(n&&(0,o.deepEquals)(e,n))return!0}return!1},e.prototype.shouldRegisterSchemaFromManually=function(e,t){return n(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return this.clearOldEvents(),[4,this.hasSameShapeInAvoFunctionsAs(e,t)];case 1:return[2,!r.sent()]}}))}))},e.prototype.hasSameShapeInAvoFunctionsAs=function(e,t){return n(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return r=!1,[4,this.lookForEventSchemaIn(e,t,this.avoFunctionsEventsParams)];case 1:return n.sent()&&(r=!0),r&&delete this.avoFunctionsEventsParams[e],[2,r]}}))}))},e.prototype.lookForEventSchemaIn=function(e,t,r){return n(this,void 0,void 0,(function(){var n,f,s,d,c,h;return i(this,(function(i){switch(i.label){case 0:for(s in f=[],n=r)f.push(s);d=0,i.label=1;case 1:return d<f.length?(s=f[d])in n?(c=s,r.hasOwnProperty(c)?c!==e?[3,3]:[4,a.AvoSchemaParser.extractSchema(r[e])]:[3,3]):[3,3]:[3,4];case 2:if((h=i.sent())&&(0,o.deepEquals)(t,h))return[2,!0];i.label=3;case 3:return d++,[3,1];case 4:return[2,!1]}}))}))},e.prototype.clearOldEvents=function(){var e=Date.now();for(var t in this.avoFunctionsEvents)if(this.avoFunctionsEvents.hasOwnProperty(t)&&e-(Number(t)||0)>300){var r=this.avoFunctionsEvents[t];delete this.avoFunctionsEvents[t],delete this.avoFunctionsEventsParams[r]}for(var t in this.manualEvents)this.manualEvents.hasOwnProperty(t)&&e-(Number(t)||0)>300&&(r=this.manualEvents[t],delete this.manualEvents[t],delete this.manualEventsParams[r])},e.prototype._clearEvents=function(){this.avoFunctionsEvents={},this.manualEvents={},this.avoFunctionsEventsParams={},this.manualEventsParams={}},e}();t.AvoDeduplicator=f},8945:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{s(n.next(e))}catch(e){a(e)}}function f(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,f)}s((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:f(0),throw:f(1),return:f(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function f(f){return function(s){return function(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&f[0]?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[2&f[0],i.value]),f[0]){case 0:case 1:i=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,n=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==f[0]&&2!==f[0])){o=0;continue}if(3===f[0]&&(!i||f[1]>i[0]&&f[1]<i[3])){o.label=f[1];break}if(6===f[0]&&o.label<i[1]){o.label=i[1],i=f;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(f);break}i[2]&&o.ops.pop(),o.trys.pop();continue}f=t.call(e,o)}catch(e){f=[6,e],n=0}finally{r=i=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([f,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.decryptValue=t.encryptValue=t.generateKeyPair=void 0;var a=new(r(6729).ec)("p256"),o=function(){if("undefined"!=typeof globalThis&&globalThis.crypto){var e=globalThis.crypto;if(e&&e.subtle)return e}if("undefined"!=typeof window&&window.crypto){var t=window.crypto;if(t&&t.subtle)return t}if(void 0!==r.g&&r.g.crypto){var n=r.g.crypto;if(n&&n.subtle)return n}var i={hasGlobalThis:"undefined"!=typeof globalThis,hasGlobalThisCrypto:"undefined"!=typeof globalThis&&!!globalThis.crypto,hasGlobalThisCryptoSubtle:"undefined"!=typeof globalThis&&!!globalThis.crypto&&!!globalThis.crypto.subtle,hasWindow:"undefined"!=typeof window,hasWindowCrypto:"undefined"!=typeof window&&!!window.crypto,hasGlobal:void 0!==r.g,hasGlobalCrypto:void 0!==r.g&&!!r.g.crypto,hasGlobalCryptoSubtle:void 0!==r.g&&!!r.g.crypto&&!!r.g.crypto.subtle};throw new Error("crypto.subtle not available. Debug: "+JSON.stringify(i))};function f(e){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,o().subtle.digest("SHA-256",e)];case 1:return[2,t.sent()]}}))}))}t.generateKeyPair=function(){var e=a.genKeyPair();return{privateKey:e.getPrivate("hex").padStart(64,"0"),publicKey:e.getPublic("hex")}},t.encryptValue=function(e,t){return n(this,void 0,void 0,(function(){var r,n,s,d,c,h,u,l,b,p,v,m,g,y,w,M,S,A,I,_,x,E,P,k;return i(this,(function(i){switch(i.label){case 0:if(i.trys.push([0,4,,5]),void 0===(r=void 0===e?"null":JSON.stringify(e)))throw new Error("Cannot encrypt undefined value");return n="string"==typeof t?t:String(t),s=a.keyFromPublic(n,"hex"),d=a.genKeyPair(),c=d.getPublic("hex"),h=function(e){for(var t=new Uint8Array(e.length/2),r=0;r<e.length;r+=2)t[r/2]=parseInt(e.substr(r,2),16);return t}(c),u=s.getPublic(),l=d.derive(u),b=l.toArray("be",32),[4,f(new Uint8Array(b))];case 1:return p=i.sent(),[4,(v=o()).subtle.importKey("raw",p,{name:"AES-GCM"},!1,["encrypt"])];case 2:return m=i.sent(),g=v.getRandomValues(new Uint8Array(16)),y=(new TextEncoder).encode(r),[4,v.subtle.encrypt({name:"AES-GCM",iv:g,tagLength:128},m,y)];case 3:return w=i.sent(),M=new Uint8Array(w),S=M.length-16,A=M.slice(0,S),I=M.slice(S),_=new Uint8Array([0]),x=1+h.length+16+16+A.length,E=new Uint8Array(x),P=0,E.set(_,P),P+=1,E.set(h,P),P+=h.length,E.set(g,P),P+=16,E.set(I,P),P+=16,E.set(A,P),[2,btoa(String.fromCharCode.apply(null,Array.from(E)))];case 4:throw k=i.sent(),new Error("Failed to encrypt value. Please check that the public key is valid. Error: ".concat(k instanceof Error?k.message:String(k)));case 5:return[2]}}))}))},t.decryptValue=function(e,t){return n(this,void 0,void 0,(function(){var r,n,s,d,c,h,u,l,b,p,v,m,g,y,w,M,S,A,I,_,x,E,P,k,R,z;return i(this,(function(i){switch(i.label){case 0:for(i.trys.push([0,4,,5]),r=atob(e),n=new Uint8Array(r.length),s=0;s<r.length;s++)n[s]=r.charCodeAt(s);if(d="string"==typeof t?t:String(t),h=n[c=0],c+=1,0!==h)throw new Error("Unsupported encryption version: ".concat(h));return u=n[c],l=2===u||3===u?33:65,b=n.slice(c,c+l),c+=l,p=n.slice(c,c+16),c+=16,v=n.slice(c,c+16),c+=16,m=n.slice(c),g=a.keyFromPrivate(d,"hex"),y=a.keyFromPublic(b),w=y.getPublic(),M=g.derive(w),S=M.toArray("be",32),[4,f(new Uint8Array(S))];case 1:return A=i.sent(),[4,(I=o()).subtle.importKey("raw",A,{name:"AES-GCM"},!1,["decrypt"])];case 2:return _=i.sent(),x=m.length+v.length,(E=new Uint8Array(x)).set(m,0),E.set(v,m.length),[4,I.subtle.decrypt({name:"AES-GCM",iv:p,tagLength:128},_,E)];case 3:return P=i.sent(),k=new TextDecoder,R=k.decode(P),[2,JSON.parse(R)];case 4:throw z=i.sent(),new Error("Failed to decrypt value. Please check that the private key is valid and matches the public key used for encryption. Error: ".concat(z instanceof Error?z.message:String(z)));case 5:return[2]}}))}))}},7249:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},e}();t.default=r},3611:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{s(n.next(e))}catch(e){a(e)}}function f(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,f)}s((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:f(0),throw:f(1),return:f(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function f(f){return function(s){return function(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&f[0]?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[2&f[0],i.value]),f[0]){case 0:case 1:i=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,n=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==f[0]&&2!==f[0])){o=0;continue}if(3===f[0]&&(!i||f[1]>i[0]&&f[1]<i[3])){o.label=f[1];break}if(6===f[0]&&o.label<i[1]){o.label=i[1],i=f;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(f);break}i[2]&&o.ops.pop(),o.trys.pop();continue}f=t.call(e,o)}catch(e){f=[6,e],n=0}finally{r=i=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([f,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoInspector=void 0;var a=r(6844),o=r(924),f=r(669),s=r(4243),d=r(3491),c=r(3492),h=r(1499),u=r(4190),l=r(4829),b=r(5916),p=r(6185),v=r(8330).rE,m=function(){function e(t){if((0,p.isValueEmpty)(t.env)?(this.environment=a.AvoInspectorEnv.Dev,console.warn("[Avo Inspector] No environment provided. Defaulting to dev.")):Object.values(a.AvoInspectorEnv).includes(t.env)?this.environment=t.env:(this.environment=a.AvoInspectorEnv.Dev,console.warn("[Avo Inspector] Unsupported environment provided. Defaulting to dev. Supported environments - Dev, Staging, Prod.")),(0,p.isValueEmpty)(t.apiKey))throw new Error("[Avo Inspector] No API key provided. Inspector can't operate without API key.");if(this.apiKey=t.apiKey,(0,p.isValueEmpty)(t.version))throw new Error("[Avo Inspector] No version provided. Many features of Inspector rely on versioning. Please provide comparable string version, i.e. integer or semantic.");this.version=t.version,this.environment===a.AvoInspectorEnv.Dev?(e._batchSize=1,e._shouldLog=!0):(e._batchSize=30,e._batchFlushSeconds=30,e._shouldLog=!1),e.avoStorage=new d.AvoStorage(e._shouldLog,null!=t.suffix?t.suffix:""),this.publicEncryptionKey=t.publicEncryptionKey,this.avoNetworkCallsHandler=new s.AvoNetworkCallsHandler(this.apiKey,this.environment.toString(),t.appName||"",this.version,v,this.publicEncryptionKey),this.avoBatcher=new f.AvoBatcher(this.avoNetworkCallsHandler),this.avoDeduplicator=new c.AvoDeduplicator,this.streamId=l.AvoStreamId.streamId,this.streamId&&(this.eventSpecCache=new h.EventSpecCache(e._shouldLog),this.eventSpecFetcher=new u.AvoEventSpecFetcher(e._networkTimeout,e._shouldLog,this.environment),e._shouldLog&&(console.log("[Avo Inspector] Event spec fetching and validation enabled"),this.publicEncryptionKey&&console.log("[Avo Inspector] Property value encryption enabled")))}return Object.defineProperty(e,"batchSize",{get:function(){return this._batchSize},set:function(e){this._batchSize=e<1?1:e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"batchFlushSeconds",{get:function(){return this._batchFlushSeconds},enumerable:!1,configurable:!0}),Object.defineProperty(e,"shouldLog",{get:function(){return this._shouldLog},set:function(e){this._shouldLog=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"networkTimeout",{get:function(){return this._networkTimeout},set:function(e){this._networkTimeout=e},enumerable:!1,configurable:!0}),e.prototype.trackSchemaFromEvent=function(t,r){return n(this,void 0,void 0,(function(){var n,a,o,f;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),this.avoDeduplicator.shouldRegisterEvent(t,r,!1)?(e.shouldLog&&console.log("Avo Inspector: supplied event "+t+" with params "+JSON.stringify(r)),[4,this.extractSchema(r,!1)]):[3,3];case 1:return n=i.sent(),[4,this.fetchAndValidateEvent(t,r)];case 2:return(a=i.sent())?(o=this.mergeValidationResults(n,a),this.sendEventWithValidation(t,o,null,null,a)):this.trackSchemaInternal(t,n,null,null),[2,n];case 3:return e.shouldLog&&console.log("Avo Inspector: Deduplicated event: "+t),[2,[]];case 4:return[3,6];case 5:return f=i.sent(),console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",f),[2,[]];case 6:return[2]}}))}))},e.prototype._avoFunctionTrackSchemaFromEvent=function(t,r,a,o){return n(this,void 0,void 0,(function(){var n,f,s,d;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),this.avoDeduplicator.shouldRegisterEvent(t,r,!0)?(e.shouldLog&&console.log("Avo Inspector: supplied event "+t+" with params "+JSON.stringify(r)),[4,this.extractSchema(r,!1)]):[3,3];case 1:return n=i.sent(),[4,this.fetchAndValidateEvent(t,r)];case 2:return(f=i.sent())?(s=this.mergeValidationResults(n,f),this.sendEventWithValidation(t,s,a,o,f)):this.trackSchemaInternal(t,n,a,o),[2,n];case 3:return e.shouldLog&&console.log("Avo Inspector: Deduplicated event: "+t),[2,[]];case 4:return[3,6];case 5:return d=i.sent(),console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",d),[2,[]];case 6:return[2]}}))}))},e.prototype.trackSchema=function(t,r){return n(this,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),[4,this.avoDeduplicator.shouldRegisterSchemaFromManually(t,r)];case 1:return i.sent()?(e.shouldLog&&console.log("Avo Inspector: supplied event "+t+" with schema "+JSON.stringify(r)),[4,this.fetchEventSpecIfNeeded(t)]):[3,3];case 2:return i.sent(),this.trackSchemaInternal(t,r,null,null),[3,4];case 3:e.shouldLog&&console.log("Avo Inspector: Deduplicated event: "+t),i.label=4;case 4:return[3,6];case 5:return n=i.sent(),console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",n),[3,6];case 6:return[2]}}))}))},e.prototype.trackSchemaInternal=function(e,t,r,n){try{this.avoBatcher.handleTrackSchema(e,t,r,n)}catch(e){console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",e)}},e.prototype.enableLogging=function(t){e._shouldLog=t},e.prototype.extractSchema=function(t,r){return void 0===r&&(r=!0),n(this,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.avoDeduplicator.hasSeenEventParams(t,!0)&&r&&e.shouldLog&&console.warn("Avo Inspector: WARNING! You are trying to extract schema shape that was just reported by your Avo Codegen. This is an indicator of duplicate inspector reporting. Please reach out to support@avo.app for advice if you are not sure how to handle this."),e.shouldLog&&console.log("Avo Inspector: extracting schema from "+JSON.stringify(t)),[4,o.AvoSchemaParser.extractSchema(t,this.publicEncryptionKey,this.environment)];case 1:return[2,i.sent()];case 2:return n=i.sent(),console.error("Avo Inspector: something went wrong in extractSchema. Please report to support@avo.app.",n),[2,[]];case 3:return[2]}}))}))},e.prototype.setBatchSize=function(t){e._batchSize=t},e.prototype.setBatchFlushSeconds=function(t){e._batchFlushSeconds=t},e.prototype.fetchEventSpecIfNeeded=function(t){return n(this,void 0,void 0,(function(){var r,n;return i(this,(function(i){switch(i.label){case 0:if(this.environment===a.AvoInspectorEnv.Prod)return[2];if(!this.eventSpecCache||!this.eventSpecFetcher||!this.streamId)return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),this.eventSpecCache.get(this.apiKey,this.streamId,t)?[2]:[4,this.eventSpecFetcher.fetch({apiKey:this.apiKey,streamId:this.streamId,eventName:t})];case 2:return(r=i.sent())&&this.eventSpecCache&&this.streamId&&this.eventSpecCache.set(this.apiKey,this.streamId,t,r),[3,4];case 3:return n=i.sent(),e.shouldLog&&console.error("[Avo Inspector] Error fetching event spec for ".concat(t,":"),n),[3,4];case 4:return[2]}}))}))},e.prototype.fetchAndValidateEvent=function(t,r){return n(this,void 0,void 0,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:if(this.environment===a.AvoInspectorEnv.Prod)return[2,null];if(!this.eventSpecCache||!this.eventSpecFetcher||!this.streamId)return[2,null];i.label=1;case 1:return i.trys.push([1,4,,5]),(n=this.eventSpecCache.get(this.apiKey,this.streamId,t))?[3,3]:[4,this.eventSpecFetcher.fetch({apiKey:this.apiKey,streamId:this.streamId,eventName:t})];case 2:(n=i.sent())&&this.eventSpecCache&&this.streamId&&this.eventSpecCache.set(this.apiKey,this.streamId,t,n),i.label=3;case 3:return n?[2,(0,b.validateEvent)(r,n)]:[2,null];case 4:return o=i.sent(),e.shouldLog&&console.error("[Avo Inspector] Error validating event ".concat(t,":"),o),[2,null];case 5:return[2]}}))}))},e.prototype.mergeValidationResults=function(e,t){var r=this;return e.map((function(e){var n=t.propertyResults[e.propertyName];return r.mergePropertyValidation(e,n)}))},e.prototype.mergePropertyValidation=function(e,t){var r=this,n={propertyName:e.propertyName,propertyType:e.propertyType};return e.encryptedPropertyValue&&(n.encryptedPropertyValue=e.encryptedPropertyValue),e.children&&Array.isArray(e.children)&&(n.children=e.children.map((function(e){var n;if("string"==typeof e)return e;if(e&&"object"==typeof e&&e.propertyName){var i=null===(n=null==t?void 0:t.children)||void 0===n?void 0:n[e.propertyName];return r.mergePropertyValidation(e,i)}return e}))),t&&(t.failedEventIds&&(n.failedEventIds=t.failedEventIds),t.passedEventIds&&(n.passedEventIds=t.passedEventIds)),n},e.prototype.sendEventWithValidation=function(t,r,n,i,a){var o,f,s=this;e.shouldLog&&r.some((function(e){return e.failedEventIds&&e.failedEventIds.length>0}))&&console.log('[Avo Inspector] Validation failures for event "'.concat(t,'":'),r.filter((function(e){return e.failedEventIds&&e.failedEventIds.length>0})).map((function(e){return{property:e.propertyName,failedEventIds:e.failedEventIds}})));var d=this.avoNetworkCallsHandler.bodyForEventSchemaCall(t,r,n,i,null!==(o=a.metadata)&&void 0!==o?o:void 0,null===(f=a.metadata)||void 0===f?void 0:f.branchId);this.avoNetworkCallsHandler.callInspectorImmediately(d,(function(a){a?(e.shouldLog&&console.error('[Avo Inspector] Failed to send event "'.concat(t,'" with validation:'),a),s.avoBatcher.handleTrackSchema(t,r,n,i)):e.shouldLog&&console.log('[Avo Inspector] Event "'.concat(t,'" sent successfully with validation'))}))},e._batchSize=30,e._batchFlushSeconds=30,e._shouldLog=!1,e._networkTimeout=2e3,e}();t.AvoInspector=m},6844:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AvoInspectorEnv=void 0,t.AvoInspectorEnv={Prod:"prod",Dev:"dev",Staging:"staging"}},4243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AvoNetworkCallsHandler=void 0;var n=r(7249),i=r(3611),a=r(4829),o=function(){function e(e,t,r,n,i,a){this.samplingRate=1,this.sending=!1,this.apiKey=e,this.envName=t,this.appName=r,this.appVersion=n,this.libVersion=i,this.publicEncryptionKey=a}return e.prototype.callInspectorWithBatchBody=function(e,t){var r=this;if(this.sending)t(new Error("Batch sending cancelled because another batch sending is in progress. Your events will be sent with next batch."));else{var n=e.filter((function(e){return null!=e}));this.fixStreamIds(n),0!==n.length&&(this.shouldDropBySampling()?i.AvoInspector.shouldLog&&console.log("Avo Inspector: last event schema dropped due to sampling rate."):(i.AvoInspector.shouldLog&&(console.log("Avo Inspector: events",n),n.forEach((function(e){"sessionStarted"===e.type?console.log("Avo Inspector: sending session started event."):"event"===e.type&&console.log("Avo Inspector: sending event "+e.eventName+" with schema "+JSON.stringify(e.eventProperties))}))),this.sending=!0,this.callInspectorApi(n,(function(e){r.sending=!1,t(e)}))))}},e.prototype.fixStreamIds=function(e){var t=null;e.forEach((function(e){null!==e.streamId&&void 0!==e.streamId&&"unknown"!==e.streamId&&(t=e.streamId)})),e.forEach((function(e){"unknown"===e.streamId&&(e.streamId=null!=t?t:a.AvoStreamId.streamId)}))},e.prototype.bodyForSessionStartedCall=function(){var e=this.createBaseCallBody();return e.type="sessionStarted",e},e.prototype.bodyForEventSchemaCall=function(e,t,r,n,i,a){var o=this.createBaseCallBody();return o.type="event",o.eventName=e,o.eventProperties=t,null!=r?(o.avoFunction=!0,o.eventId=r,o.eventHash=n):(o.avoFunction=!1,o.eventId=null,o.eventHash=null),i&&(o.eventSpecMetadata=i),a&&(o.validatedBranchId=a),o},e.prototype.createBaseCallBody=function(){var e={apiKey:this.apiKey,appName:this.appName,appVersion:this.appVersion,libVersion:this.libVersion,env:this.envName,libPlatform:"web",messageId:n.default.newGuid(),trackingId:"",createdAt:(new Date).toISOString(),sessionId:"",streamId:a.AvoStreamId.streamId,samplingRate:this.samplingRate};return this.publicEncryptionKey&&(e.publicEncryptionKey=this.publicEncryptionKey),e},e.prototype.callInspectorImmediately=function(e,t){"unknown"===e.streamId&&(e.streamId=a.AvoStreamId.streamId),i.AvoInspector.shouldLog&&(console.log("Avo Inspector: calling inspector immediately (with validation)",e.eventName),console.log("Avo Inspector: event body",e)),this.callInspectorApi([e],t)},e.prototype.shouldDropBySampling=function(){return Math.random()>this.samplingRate},e.prototype.callInspectorApi=function(t,r){var n=this,a=new XMLHttpRequest;a.open("POST",e.trackingEndpoint,!0),a.setRequestHeader("Content-Type","text/plain"),a.timeout=i.AvoInspector.networkTimeout,a.send(JSON.stringify(t)),a.onload=function(){if(200!==a.status)r(new Error("Error ".concat(a.status,": ").concat(a.statusText)));else{var e=void 0;try{e=JSON.parse(a.response)}catch(e){return void r(new Error("Failed to parse response: ".concat(e instanceof Error?e.message:String(e))))}null==e||"number"!=typeof e.samplingRate||isNaN(e.samplingRate)||(n.samplingRate=e.samplingRate),r(null)}},a.onerror=function(){r(new Error("Request failed"))},a.ontimeout=function(){r(new Error("Request timed out"))}},e.trackingEndpoint="https://api.avo.app/inspector/v1/track",e}();t.AvoNetworkCallsHandler=o},924:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{s(n.next(e))}catch(e){a(e)}}function f(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,f)}s((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:f(0),throw:f(1),return:f(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function f(f){return function(s){return function(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&f[0]?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[2&f[0],i.value]),f[0]){case 0:case 1:i=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,n=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==f[0]&&2!==f[0])){o=0;continue}if(3===f[0]&&(!i||f[1]>i[0]&&f[1]<i[3])){o.label=f[1];break}if(6===f[0]&&o.label<i[1]){o.label=i[1],i=f;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(f);break}i[2]&&o.ops.pop(),o.trys.pop();continue}f=t.call(e,o)}catch(e){f=[6,e],n=0}finally{r=i=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([f,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoSchemaParser=void 0;var a=r(8945),o=function(e){return"[object Array]"===Object.prototype.toString.call(e)},f=function(){function e(){}return e.canSendEncryptedValues=function(e,t){return null!=e&&""!==e&&("dev"===t||"staging"===t)},e.getEncryptedPropertyValueIfEnabled=function(e,t,r){return n(this,void 0,void 0,(function(){var n;return i(this,(function(i){switch(i.label){case 0:if(!t||!r)return[2,void 0];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,(0,a.encryptValue)(e,r)];case 2:return[2,i.sent()];case 3:return n=i.sent(),console.error("[Avo Inspector] Failed to encrypt property value:",n instanceof Error?n.message:String(n)),[2,void 0];case 4:return[2]}}))}))},e.extractSchema=function(e,t,r){return n(this,void 0,void 0,(function(){var a,f,s=this;return i(this,(function(d){switch(d.label){case 0:return null==e?[2,[]]:(a=this.canSendEncryptedValues(t,r),f=function(e){return n(s,void 0,void 0,(function(){var r,s,d,c,h,u,l,b,p,v,m,g=this;return i(this,(function(y){switch(y.label){case 0:return o(e)?[4,Promise.all(e.map((function(e){return n(g,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,f(e)];case 1:return[2,t.sent()]}}))}))})))]:[3,2];case 1:return r=y.sent(),[2,this.removeDuplicates(r)];case 2:if("object"!=typeof e)return[3,10];for(h in s=[],c=[],d=e)c.push(h);u=0,y.label=3;case 3:return u<c.length?(h=c[u])in d?(l=h,e.hasOwnProperty(l)?(b=e[l],p={propertyName:l,propertyType:this.getPropValueType(b)},"object"!=typeof b||null==b?[3,5]:(v=p,[4,f(b)])):[3,8]):[3,8]:[3,9];case 4:return v.children=y.sent(),[3,7];case 5:return void 0===b?[3,7]:[4,this.getEncryptedPropertyValueIfEnabled(b,a,t)];case 6:void 0!==(m=y.sent())&&(p.encryptedPropertyValue=m),y.label=7;case 7:s.push(p),y.label=8;case 8:return u++,[3,3];case 9:return[2,s];case 10:return[2,this.getPropValueType(e)]}}))}))},[4,f(e)]);case 1:return[2,d.sent()]}}))}))},e.removeDuplicates=function(e){var t={boolean:{},number:{},string:{}},r=[];return e.filter((function(e){var n=typeof e;return n in t&&"string"==typeof e?!t[n].hasOwnProperty(e)&&(t[n][e]=!0):!r.includes(e)&&r.push(e)}))},e.getPropValueType=function(e){var t=typeof e;return null==e?"null":"string"===t?"string":"number"===t||"bigint"===t?(e+"").includes(".")?"float":"int":"boolean"===t?"boolean":"object"===t?o(e)?"list":"object":"unknown"},e}();t.AvoSchemaParser=f},3491:function(e,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{s(n.next(e))}catch(e){a(e)}}function f(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,f)}s((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:f(0),throw:f(1),return:f(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function f(f){return function(s){return function(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&f[0]?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[2&f[0],i.value]),f[0]){case 0:case 1:i=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,n=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==f[0]&&2!==f[0])){o=0;continue}if(3===f[0]&&(!i||f[1]>i[0]&&f[1]<i[3])){o.label=f[1];break}if(6===f[0]&&o.label<i[1]){o.label=i[1],i=f;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(f);break}i[2]&&o.ops.pop(),o.trys.pop();continue}f=t.call(e,o)}catch(e){f=[6,e],n=0}finally{r=i=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([f,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoStorage=void 0;var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.useFallbackStorage=!1,t.fallbackStorage={},t.storageInitialized=!1,t.onStorageInitFuncs=[],t.shouldLog=!1,t.suffix="",t}return n(t,e),t.prototype.init=function(e,t){this.shouldLog=e,this.suffix=t,this.initializeStorageWeb(this.isLocalStorageAvailable())},t.prototype.initializeStorageWeb=function(e){this.storageInitialized=!0,e||(this.useFallbackStorage=!0),this.onStorageInitFuncs.forEach((function(e){e()}))},t.prototype.isLocalStorageAvailable=function(){var e=(new Date).toISOString();try{return window.localStorage.setItem(e,e),window.localStorage.getItem(e)===e&&(window.localStorage.removeItem(e),!0)}catch(e){return!1}},t.prototype.isInitialized=function(){return this.storageInitialized},t.prototype.getItemAsync=function(e){return i(this,void 0,void 0,(function(){var t=this;return a(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(r,n){t.runAfterInit((function(){if(t.useFallbackStorage){var n=t.fallbackStorage[e+t.suffix];r(t.parseJson(n))}else if("undefined"!=typeof window){n=void 0;try{n=window.localStorage.getItem(e+t.suffix)}catch(e){t.shouldLog&&console.error("Avo Inspector Storage getItemAsync error:",e),r(null)}r(t.parseJson(n))}else r(null)}))}))];case 1:return[2,r.sent()]}}))}))},t.prototype.getItem=function(e){var t;if(this.storageInitialized){if(this.useFallbackStorage)t=this.fallbackStorage[e+this.suffix];else if("undefined"!=typeof window)try{t=window.localStorage.getItem(e+this.suffix)}catch(e){this.shouldLog&&console.error("Avo Inspector Storage getItem error:",e)}}else t=null;return this.parseJson(t)},t.prototype.setItem=function(e,t){var r=this;this.runAfterInit((function(){if(r.useFallbackStorage)r.fallbackStorage[e+r.suffix]=JSON.stringify(t);else if("undefined"!=typeof window)try{window.localStorage.setItem(e+r.suffix,JSON.stringify(t))}catch(e){r.shouldLog&&console.error("Avo Inspector Storage setItem error:",e)}}))},t.prototype.removeItem=function(e){var t=this;this.runAfterInit((function(){if(t.useFallbackStorage)t.fallbackStorage[e+t.suffix]=null;else if("undefined"!=typeof window)try{window.localStorage.removeItem(e+t.suffix)}catch(e){t.shouldLog&&console.error("Avo Inspector Storage removeItem error:",e)}}))},t.prototype.runAfterInit=function(e){this.storageInitialized?e():this.onStorageInitFuncs.push(e)},t}(function(){function e(){}return e.prototype.parseJson=function(e){return null!=e?JSON.parse(e):null},e}()),f=function(){function e(e,t){void 0===t&&(t=""),this.Platform=null,this.Platform="browser",this.storageImpl=new o,this.storageImpl.init(e,t)}return e.prototype.isInitialized=function(){return this.storageImpl.isInitialized()},e.prototype.getItemAsync=function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.storageImpl.getItemAsync(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.getItem=function(e){return this.storageImpl.getItem(e)},e.prototype.setItem=function(e,t){this.storageImpl.setItem(e,t)},e.prototype.removeItem=function(e){this.storageImpl.removeItem(e)},e.prototype.runAfterInit=function(e){this.storageImpl.runAfterInit(e)},e}();t.AvoStorage=f},4829:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AvoStreamId=void 0;var n=r(7249),i=r(3611),a=function(){function e(){}return Object.defineProperty(e,"streamId",{get:function(){return null===e._streamId||e.shouldReset()?i.AvoInspector.avoStorage.isInitialized()?(e.loadFromStorage(),null!==e._streamId&&e.shouldReset()||null===e._streamId?e.generateAndStoreNew():(e.updateLastActivity(),e._streamId)):"unknown":(e.updateLastActivity(),e._streamId)},enumerable:!1,configurable:!0}),e.shouldReset=function(){if(null===e._createdAt||null===e._lastActivityAt)return!1;var t=Date.now(),r=t-e._createdAt,n=t-e._lastActivityAt;return r>e.MAX_AGE_MS&&n>e.IDLE_THRESHOLD_MS},e.loadFromStorage=function(){try{var t=i.AvoInspector.avoStorage.getItem(e.STREAM_ID_KEY),r=i.AvoInspector.avoStorage.getItem(e.CREATED_AT_KEY),n=i.AvoInspector.avoStorage.getItem(e.LAST_ACTIVITY_KEY);null!=t&&(e._streamId=t,e._createdAt=null!=r?r:Date.now(),e._lastActivityAt=null!=n?n:Date.now())}catch(e){console.error("Avo Inspector: Error reading stream ID from storage. Please report to support@avo.app.",e)}},e.generateAndStoreNew=function(){var t=Date.now();e._streamId=n.default.newGuid(),e._createdAt=t,e._lastActivityAt=t;try{i.AvoInspector.avoStorage.setItem(e.STREAM_ID_KEY,e._streamId),i.AvoInspector.avoStorage.setItem(e.CREATED_AT_KEY,e._createdAt),i.AvoInspector.avoStorage.setItem(e.LAST_ACTIVITY_KEY,e._lastActivityAt)}catch(e){console.error("Avo Inspector: Error saving stream ID to storage. Please report to support@avo.app.",e)}return e._streamId},e.updateLastActivity=function(){var t=Date.now();e._lastActivityAt=t;try{i.AvoInspector.avoStorage.setItem(e.LAST_ACTIVITY_KEY,t)}catch(e){}},Object.defineProperty(e,"storageKey",{get:function(){return e.STREAM_ID_KEY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"createdAtKey",{get:function(){return e.CREATED_AT_KEY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"lastActivityKey",{get:function(){return e.LAST_ACTIVITY_KEY},enumerable:!1,configurable:!0}),e.clearCache=function(){e._streamId=null,e._createdAt=null,e._lastActivityAt=null},e._streamId=null,e._createdAt=null,e._lastActivityAt=null,e.MAX_AGE_MS=144e5,e.IDLE_THRESHOLD_MS=72e5,e.STREAM_ID_KEY="AvoInspectorStreamId",e.CREATED_AT_KEY="AvoInspectorStreamIdCreatedAt",e.LAST_ACTIVITY_KEY="AvoInspectorStreamIdLastActivityAt",e}();t.AvoStreamId=a},1499:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventSpecCache=void 0;var r=function(){function e(e){void 0===e&&(e=!1),this.TTL_MS=3e5,this.MAX_EVENT_COUNT=50,this.globalEventCount=0,this.cache=new Map,this.shouldLog=e}return e.prototype.generateKey=function(e,t,r){return"".concat(e,":").concat(t,":").concat(r)},e.prototype.get=function(e,t,r){var n=this.generateKey(e,t,r),i=this.cache.get(n);return i?this.shouldEvict(i)?(this.shouldLog&&console.log("[EventSpecCache] Cache entry expired for key: ".concat(n)),this.cache.delete(n),null):(this.shouldLog&&console.log("[EventSpecCache] Cache hit for key: ".concat(n)),i.lastAccessed=Date.now(),i.eventCount++,this.globalEventCount++,this.globalEventCount>=this.MAX_EVENT_COUNT&&(this.evictOldest(),this.globalEventCount=0),i.spec):(this.shouldLog&&console.log("[EventSpecCache] Cache miss for key: ".concat(n)),null)},e.prototype.set=function(e,t,r,n){var i=this.generateKey(e,t,r),a=Date.now(),o={spec:n,timestamp:a,lastAccessed:a,eventCount:0};this.cache.set(i,o),this.shouldLog&&console.log("[EventSpecCache] Cached spec for key: ".concat(i))},e.prototype.shouldEvict=function(e){var t=Date.now()-e.timestamp>this.TTL_MS,r=e.eventCount>=this.MAX_EVENT_COUNT;return t||r},e.prototype.evictOldest=function(){if(0!==this.cache.size){var e=null,t=1/0;this.cache.forEach((function(r,n){r.lastAccessed<t&&(t=r.lastAccessed,e=n)})),null!==e&&(this.cache.delete(e),this.shouldLog&&console.log("[EventSpecCache] Evicted LRU entry: ".concat(e)))}},e.prototype.clear=function(){this.cache.clear(),this.globalEventCount=0,this.shouldLog&&console.log("[EventSpecCache] Cache cleared")},e.prototype.size=function(){return this.cache.size},e.prototype.getStats=function(){var e=[],t=Date.now();return this.cache.forEach((function(r,n){e.push({key:n,age:t-r.timestamp,lastAccessedAgo:t-r.lastAccessed,eventCount:r.eventCount})})),{size:this.cache.size,globalEventCount:this.globalEventCount,entries:e}},e}();t.EventSpecCache=r},4190:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{s(n.next(e))}catch(e){a(e)}}function f(e){try{s(n.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,f)}s((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:f(0),throw:f(1),return:f(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function f(f){return function(s){return function(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&f[0]?n.return:f[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,f[1])).done)return i;switch(n=0,i&&(f=[2&f[0],i.value]),f[0]){case 0:case 1:i=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,n=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==f[0]&&2!==f[0])){o=0;continue}if(3===f[0]&&(!i||f[1]>i[0]&&f[1]<i[3])){o.label=f[1];break}if(6===f[0]&&o.label<i[1]){o.label=i[1],i=f;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(f);break}i[2]&&o.ops.pop(),o.trys.pop();continue}f=t.call(e,o)}catch(e){f=[6,e],n=0}finally{r=i=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([f,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoEventSpecFetcher=void 0;var i=function(){function e(e,t,r,n){void 0===e&&(e=2e3),void 0===t&&(t=!1),void 0===n&&(n="https://api.avo.app"),this.baseUrl=n,this.timeout=e,this.shouldLog=t,this.env=r,this.inFlightRequests=new Map}return e.prototype.generateRequestKey=function(e){return"".concat(e.streamId,":").concat(e.eventName)},e.prototype.fetch=function(e){return r(this,void 0,void 0,(function(){var t,r,i;return n(this,(function(n){switch(n.label){case 0:if(t=this.generateRequestKey(e),r=this.inFlightRequests.get(t))return this.shouldLog&&console.log("[EventSpecFetcher] Returning existing in-flight request for streamId=".concat(e.streamId,", eventName=").concat(e.eventName)),[2,r];i=this.fetchInternal(e),this.inFlightRequests.set(t,i),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,i];case 2:return[2,n.sent()];case 3:return this.inFlightRequests.delete(t),[7];case 4:return[2]}}))}))},e.prototype.fetchInternal=function(t){return r(this,void 0,void 0,(function(){var r,i,a,o;return n(this,(function(n){switch(n.label){case 0:if("dev"!==this.env&&"staging"!==this.env)return[2,null];r=this.buildUrl(t),this.shouldLog&&(console.log("[EventSpecFetcher] Fetching event spec for: ".concat(t.eventName)),console.log("[EventSpecFetcher] Using base URL: ".concat(this.baseUrl))),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.makeRequest(r)];case 2:return(i=n.sent())?this.hasExpectedShape(i)?(a=e.parseEventSpecResponse(i),this.shouldLog&&console.log("[EventSpecFetcher] Successfully fetched event spec for: ".concat(t.eventName)),[2,a]):(this.shouldLog&&console.warn("[EventSpecFetcher] Invalid event spec response for: ".concat(t.eventName)),[2,null]):(this.shouldLog&&console.warn("[EventSpecFetcher] Failed to fetch event spec for: ".concat(t.eventName)),[2,null]);case 3:return o=n.sent(),this.shouldLog&&console.error("[EventSpecFetcher] Error fetching event spec for: ".concat(t.eventName),o),[2,null];case 4:return[2]}}))}))},e.prototype.buildUrl=function(e){var t=new URLSearchParams({apiKey:e.apiKey,streamId:e.streamId,eventName:e.eventName});return"".concat(this.baseUrl,"/trackingPlan/eventSpec?").concat(t.toString())},e.prototype.makeRequest=function(e){var t=this;return new Promise((function(r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.timeout=t.timeout,n.onload=function(){if(200===n.status)try{var e=JSON.parse(n.responseText);r(e)}catch(e){t.shouldLog&&console.error("[EventSpecFetcher] Failed to parse response:",e),r(null)}else t.shouldLog&&console.warn("[EventSpecFetcher] Request failed with status: ".concat(n.status)),r(null)},n.onerror=function(){t.shouldLog&&console.error("[EventSpecFetcher] Network error occurred"),r(null)},n.ontimeout=function(){t.shouldLog&&console.error("[EventSpecFetcher] Request timed out after ".concat(t.timeout,"ms")),r(null)},n.send()}))},e.prototype.hasExpectedShape=function(e){return e&&"object"==typeof e&&Array.isArray(e.events)&&e.metadata&&"object"==typeof e.metadata&&"string"==typeof e.metadata.schemaId&&"string"==typeof e.metadata.branchId&&"string"==typeof e.metadata.latestActionId},e.parseEventSpecResponse=function(t){return{events:t.events.map(e.parseEventSpecEntry),metadata:t.metadata}},e.parseEventSpecEntry=function(t){for(var r={},n=0,i=Object.entries(t.p);n<i.length;n++){var a=i[n],o=Reflect.get(a,"0"),f=Reflect.get(a,"1");Reflect.set(r,o,e.parsePropertyConstraints(f))}return{branchId:t.b,baseEventId:t.id,variantIds:t.vids,props:r}},e.parsePropertyConstraints=function(t){var r={type:t.t,required:t.r};if(t.l&&(r.isList=t.l),t.p&&(r.pinnedValues=t.p),t.v&&(r.allowedValues=t.v),t.rx&&(r.regexPatterns=t.rx),t.minmax&&(r.minMaxRanges=t.minmax),t.children){r.children={};for(var n=0,i=Object.entries(t.children);n<i.length;n++){var a=i[n],o=a[0],f=a[1];r.children[o]=e.parsePropertyConstraints(f)}}return r},e}();t.AvoEventSpecFetcher=i},5916:function(e,t){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},n=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))};function i(e){for(var t={},r=0,i=Object.entries(e);r<i.length;r++){var a=i[r],o=a[0],f=a[1];t[o]=n([],f,!0)}return t}function a(e){for(var t={},r=0,n=Object.entries(e);r<n.length;r++){var o=n[r],f=o[0],s=o[1];t[f]={type:s.type,required:s.required,pinnedValues:s.pinnedValues?i(s.pinnedValues):void 0,allowedValues:s.allowedValues?i(s.allowedValues):void 0,regexPatterns:s.regexPatterns?i(s.regexPatterns):void 0,minMaxRanges:s.minMaxRanges?i(s.minMaxRanges):void 0,children:s.children?a(s.children):void 0}}return t}function o(e,t){for(var r=0,n=Object.entries(t);r<n.length;r++){var s=n[r],d=s[0],c=s[1];if(e[d]){var h=e[d];f(h,c),c.children&&(h.children?o(h.children,c.children):h.children=a(c.children))}else e[d]={type:c.type,required:c.required,pinnedValues:c.pinnedValues?i(c.pinnedValues):void 0,allowedValues:c.allowedValues?i(c.allowedValues):void 0,regexPatterns:c.regexPatterns?i(c.regexPatterns):void 0,minMaxRanges:c.minMaxRanges?i(c.minMaxRanges):void 0,children:c.children?a(c.children):void 0}}}function f(e,t){if(t.pinnedValues){e.pinnedValues||(e.pinnedValues={});for(var r=0,i=Object.keys(t.pinnedValues);r<i.length;r++){var a=i[r];if(e.pinnedValues[a]){for(var o=new Set(e.pinnedValues[a]),f=0,s=t.pinnedValues[a];f<s.length;f++){var d=s[f];o.add(d)}e.pinnedValues[a]=Array.from(o)}else e.pinnedValues[a]=n([],t.pinnedValues[a],!0)}}if(t.allowedValues){e.allowedValues||(e.allowedValues={});for(var c=0,h=Object.keys(t.allowedValues);c<h.length;c++)if(a=h[c],e.allowedValues[a]){o=new Set(e.allowedValues[a]);for(var u=0,l=t.allowedValues[a];u<l.length;u++)d=l[u],o.add(d);e.allowedValues[a]=Array.from(o)}else e.allowedValues[a]=n([],t.allowedValues[a],!0)}if(t.regexPatterns){e.regexPatterns||(e.regexPatterns={});for(var b=0,p=Object.keys(t.regexPatterns);b<p.length;b++)if(a=p[b],e.regexPatterns[a]){o=new Set(e.regexPatterns[a]);for(var v=0,m=t.regexPatterns[a];v<m.length;v++)d=m[v],o.add(d);e.regexPatterns[a]=Array.from(o)}else e.regexPatterns[a]=n([],t.regexPatterns[a],!0)}if(t.minMaxRanges){e.minMaxRanges||(e.minMaxRanges={});for(var g=0,y=Object.keys(t.minMaxRanges);g<y.length;g++)if(a=y[g],e.minMaxRanges[a]){o=new Set(e.minMaxRanges[a]);for(var w=0,M=t.minMaxRanges[a];w<M.length;w++)d=M[w],o.add(d);e.minMaxRanges[a]=Array.from(o)}else e.minMaxRanges[a]=n([],t.minMaxRanges[a],!0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.validateEvent=void 0;var s=new Map;function d(e){var t=s.get(e);return t||(t=new RegExp(e),s.set(e,t)),t}var c=new Map;function h(e){var t=c.get(e);if(!t)try{var r=JSON.parse(e);t=new Set(r),c.set(e,t)}catch(e){return null}return t}t.validateEvent=function(e,t){for(var n=function(e){for(var t=[],r=0,n=e;r<n.length;r++){var i=n[r];t.push(i.baseEventId);for(var a=0;a<i.variantIds.length;a++)t.push(i.variantIds[a])}return t}(t.events),i=function(e){if(0===e.length)return{};if(1===e.length)return e[0].props;for(var t={},n=0,i=e;n<i.length;n++)for(var s=i[n],d=0,c=Object.entries(s.props);d<c.length;d++){var h=c[d],u=h[0],l=h[1];if(t[u]){var b=t[u];f(b,l),l.children&&(b.children?o(b.children,l.children):b.children=a(l.children))}else t[u]={type:l.type,required:l.required,pinnedValues:l.pinnedValues?r({},l.pinnedValues):void 0,allowedValues:l.allowedValues?r({},l.allowedValues):void 0,regexPatterns:l.regexPatterns?r({},l.regexPatterns):void 0,minMaxRanges:l.minMaxRanges?r({},l.minMaxRanges):void 0,children:l.children?a(l.children):void 0}}return t}(t.events),s={},d=0,c=Object.keys(e);d<c.length;d++){var h=c[d],u=e[h],b=i[h];if(b){var p=l(u,b,n);s[h]=p}else s[h]={}}return{metadata:t.metadata,propertyResults:s}};var u=2;function l(e,t,r,n){void 0===n&&(n=0);var i={};return n>=u?i:t.isList?function(e,t,r,n){var i={};if(!Array.isArray(e))return i;if(t.children){for(var a={},o=function(t,i){for(var o=new Set,f=0,s=e;f<s.length;f++){var d=s[f],c=l(("object"!=typeof d||null===d||Array.isArray(d)?{}:d)[t],i,r,n+1);if(c.failedEventIds)for(var h=0,u=c.failedEventIds;h<u.length;h++){var b=u[h];o.add(b)}if(c.passedEventIds)for(var p=new Set(c.passedEventIds),v=0,m=r;v<m.length;v++)b=m[v],p.has(b)||o.add(b)}if(o.size>0){var g=Array.from(o),y=r.filter((function(e){return!o.has(e)}));y.length<g.length&&y.length>0?a[t]={passedEventIds:y}:a[t]={failedEventIds:g}}},f=0,s=Object.entries(t.children);f<s.length;f++){var d=s[f];o(d[0],d[1])}return Object.keys(a).length>0&&(i.children=a),i}for(var c=new Set,h=0,u=e;h<u.length;h++){var p=u[h];t.pinnedValues&&m(p,t.pinnedValues,c),t.allowedValues&&g(p,t.allowedValues,c),t.regexPatterns&&y(p,t.regexPatterns,c),t.minMaxRanges&&w(p,t.minMaxRanges,c)}return b(c,r)}(e,t,r,n):t.children?function(e,t,r,n){for(var i={},a={},o="object"!=typeof e||null===e||Array.isArray(e)?{}:e,f=0,s=Object.entries(t.children);f<s.length;f++){var d=s[f],c=d[0],h=d[1],u=l(o[c],h,r,n+1);(u.failedEventIds||u.passedEventIds||u.children)&&(a[c]=u)}return Object.keys(a).length>0&&(i.children=a),i}(e,t,r,n):null!=e||t.required?function(e,t,r){var n=new Set;return t.pinnedValues&&m(e,t.pinnedValues,n),t.allowedValues&&g(e,t.allowedValues,n),t.regexPatterns&&y(e,t.regexPatterns,n),t.minMaxRanges&&w(e,t.minMaxRanges,n),b(n,r)}(e,t,r):i}function b(e,t){var r=t.filter((function(t){return!e.has(t)})),n=Array.from(e);return 0===n.length&&0===r.length?{}:r.length<n.length&&r.length>0?{passedEventIds:r}:n.length>0?{failedEventIds:n}:{}}function p(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];t.add(i)}}function v(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e)return String(e);if(Array.isArray(e)||"object"==typeof e)try{return JSON.stringify(e)}catch(t){return console.warn("[Avo Inspector] Failed to stringify value: ".concat(t)),String(e)}return String(e)}function m(e,t,r){for(var n=v(e),i=0,a=Object.entries(t);i<a.length;i++){var o=a[i],f=o[0],s=o[1];n!==f&&p(s,r)}}function g(e,t,r){for(var n=v(e),i=0,a=Object.entries(t);i<a.length;i++){var o=a[i],f=o[0],s=o[1],d=h(f);null!==d?d.has(n)||p(s,r):console.warn("[Avo Inspector] Invalid allowed values JSON: ".concat(f))}}function y(e,t,r){if("string"==typeof e)for(var n=0,i=Object.entries(t);n<i.length;n++){var a=i[n],o=a[0];c=a[1];try{d(o).test(e)||p(c,r)}catch(e){console.warn("[Avo Inspector] Invalid regex pattern: ".concat(o))}}else for(var f=0,s=Object.values(t);f<s.length;f++){var c;p(c=s[f],r)}}function w(e,t,r){if("number"==typeof e)if(Number.isNaN(e)){console.warn("[Avo Inspector] NaN value fails min/max constraint");for(var n=0,i=Object.values(t);n<i.length;n++)p(y=i[n],r)}else for(var a=0,o=Object.entries(t);a<o.length;a++){var f=o[a],s=f[0],d=(y=f[1],s.split(",")),c=d[0],h=d[1],u=""!==c&&void 0!==c,l=""!==h&&void 0!==h,b=u?parseFloat(c):-1/0,v=l?parseFloat(h):1/0;u&&isNaN(b)||l&&isNaN(v)?console.warn("[Avo Inspector] Invalid min/max range: ".concat(s)):(e<b||e>v)&&p(y,r)}else for(var m=0,g=Object.values(t);m<g.length;m++){var y;p(y=g[m],r)}}},6185:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deepEquals=t.isValueEmpty=void 0,t.isValueEmpty=function(e){return null==e||0==e.trim().length},t.deepEquals=function e(t,r){if(t===r)return!0;if(!(t instanceof Object&&r instanceof Object))return!1;if(t.constructor!==r.constructor)return!1;for(var n in t)if(t.hasOwnProperty(n)){if(!r.hasOwnProperty(n))return!1;if(t[n]!==r[n]){if("object"!=typeof t[n])return!1;if(!e(t[n],r[n]))return!1}}for(n in r)if(r.hasOwnProperty(n)&&!t.hasOwnProperty(n))return!1;return!0}},7790:()=>{},3776:()=>{},1636:e=>{"use strict";e.exports={rE:"6.6.1"}},8330:e=>{"use strict";e.exports=JSON.parse('{"rE":"3.0.0-alpha.1"}')}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};return(()=>{"use strict";var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.AvoInspectorEnv=e.AvoInspector=void 0;var t=r(3611);Object.defineProperty(e,"AvoInspector",{enumerable:!0,get:function(){return t.AvoInspector}});var i=r(6844);Object.defineProperty(e,"AvoInspectorEnv",{enumerable:!0,get:function(){return i.AvoInspectorEnv}})})(),n})()));
1
+ /*! For license information please see index.js.LICENSE.txt */
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(()=>(()=>{"use strict";var e={562:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getHash=function(e){return{hash:e}},t.createCurve=function(e,t){const n=t=>(0,r.weierstrass)({...e,hash:t});return{...n(t),create:n}};const r=n(705)},422:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wNAF=void 0,t.negateCt=a,t.normalizeZ=function(e,t){const n=(0,o.FpInvertBatch)(e.Fp,t.map((e=>e.Z)));return t.map(((t,r)=>e.fromAffine(t.toAffine(n[r]))))},t.mulEndoUnsafe=function(e,t,n,r){let o=t,a=e.ZERO,c=e.ZERO;for(;n>s||r>s;)n&i&&(a=a.add(o)),r&i&&(c=c.add(o)),o=o.double(),n>>=i,r>>=i;return{p1:a,p2:c}},t.pippenger=function(e,t,n,o){u(n,e),h(o,t);const s=n.length,i=o.length;if(s!==i)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,c=(0,r.bitLen)(BigInt(s));let f=1;c>12?f=c-3:c>4?f=c-2:c>0&&(f=2);const l=(0,r.bitMask)(f),d=new Array(Number(l)+1).fill(a);let p=a;for(let e=Math.floor((t.BITS-1)/f)*f;e>=0;e-=f){d.fill(a);for(let t=0;t<i;t++){const r=o[t],s=Number(r>>BigInt(e)&l);d[s]=d[s].add(n[t])}let t=a;for(let e=d.length-1,n=a;e>0;e--)n=n.add(d[e]),t=t.add(n);if(p=p.add(t),0!==e)for(let e=0;e<f;e++)p=p.double()}return p},t.precomputeMSMUnsafe=function(e,t,n,o){c(o,t.BITS),u(n,e);const s=e.ZERO,i=2**o-1,a=Math.ceil(t.BITS/o),f=(0,r.bitMask)(o),l=n.map((e=>{const t=[];for(let n=0,r=e;n<i;n++)t.push(r),r=r.add(e);return t}));return e=>{if(h(e,t),e.length>n.length)throw new Error("array of scalars must be smaller than array of points");let r=s;for(let t=0;t<a;t++){if(r!==s)for(let e=0;e<o;e++)r=r.double();const n=BigInt(a*o-(t+1)*o);for(let t=0;t<e.length;t++){const o=e[t],s=Number(o>>n&f);s&&(r=r.add(l[t][s-1]))}}return r}},t.validateBasic=function(e){return(0,o.validateField)(e.Fp),(0,r.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,o.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})},t._createCurveFields=function(e,t,n={},r){if(void 0===r&&(r="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const n=t[e];if(!("bigint"==typeof n&&n>s))throw new Error(`CURVE.${e} must be positive bigint`)}const o=g(t.p,n.Fp,r),i=g(t.n,n.Fn,r),a=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of a)if(!o.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:o,Fn:i}};const r=n(627),o=n(967),s=BigInt(0),i=BigInt(1);function a(e,t){const n=t.negate();return e?n:t}function c(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function f(e,t){c(e,t);const n=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:(0,r.bitMask)(e),maxNumber:n,shiftBy:BigInt(e)}}function l(e,t,n){const{windowSize:r,mask:o,maxNumber:s,shiftBy:a}=n;let c=Number(e&o),f=e>>a;c>r&&(c-=s,f+=i);const l=t*r;return{nextN:f,offset:l+Math.abs(c)-1,isZero:0===c,isNeg:c<0,isNegF:t%2!=0,offsetF:l}}function u(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach(((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)}))}function h(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach(((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)}))}const d=new WeakMap,p=new WeakMap;function v(e){return p.get(e)||1}function y(e){if(e!==s)throw new Error("invalid wNAF")}function g(e,t,n){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return(0,o.validateField)(t),t}return(0,o.Field)(e,{isLE:n})}t.wNAF=class{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,n=this.ZERO){let r=e;for(;t>s;)t&i&&(n=n.add(r)),r=r.double(),t>>=i;return n}precomputeWindow(e,t){const{windows:n,windowSize:r}=f(t,this.bits),o=[];let s=e,i=s;for(let e=0;e<n;e++){i=s,o.push(i);for(let e=1;e<r;e++)i=i.add(s),o.push(i);s=i.double()}return o}wNAF(e,t,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let r=this.ZERO,o=this.BASE;const s=f(e,this.bits);for(let e=0;e<s.windows;e++){const{nextN:i,offset:c,isZero:f,isNeg:u,isNegF:h,offsetF:d}=l(n,e,s);n=i,f?o=o.add(a(h,t[d])):r=r.add(a(u,t[c]))}return y(n),{p:r,f:o}}wNAFUnsafe(e,t,n,r=this.ZERO){const o=f(e,this.bits);for(let e=0;e<o.windows&&n!==s;e++){const{nextN:s,offset:i,isZero:a,isNeg:c}=l(n,e,o);if(n=s,!a){const e=t[i];r=r.add(c?e.negate():e)}}return y(n),r}getPrecomputes(e,t,n){let r=d.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&("function"==typeof n&&(r=n(r)),d.set(t,r))),r}cached(e,t,n){const r=v(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)}unsafe(e,t,n,r){const o=v(e);return 1===o?this._unsafeLadder(e,t,r):this.wNAFUnsafe(o,this.getPrecomputes(o,e,n),t,r)}createCache(e,t){c(t,this.bits),p.set(e,t),d.delete(e)}hasCache(e){return 1!==v(e)}}},761:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._DST_scalar=void 0,t.expand_message_xmd=l,t.expand_message_xof=u,t.hash_to_field=h,t.isogenyMap=function(e,t){const n=t.map((e=>Array.from(e).reverse()));return(t,r)=>{const[s,i,a,c]=n.map((n=>n.reduce(((n,r)=>e.add(e.mul(n,t),r))))),[f,l]=(0,o.FpInvertBatch)(e,[i,c],!0);return t=e.mul(s,f),r=e.mul(r,e.mul(a,l)),{x:t,y:r}}},t.createHasher=function(e,n,r){if("function"!=typeof n)throw new Error("mapToCurve() must be defined");function o(t){return e.fromAffine(n(t))}function s(t){const n=t.clearCofactor();return n.equals(e.ZERO)?e.ZERO:(n.assertValidity(),n)}return{defaults:r,hashToCurve(e,t){const n=h(e,2,Object.assign({},r,t)),i=o(n[0]),a=o(n[1]);return s(i.add(a))},encodeToCurve(e,t){const n=r.encodeDST?{DST:r.encodeDST}:{};return s(o(h(e,1,Object.assign({},r,n,t))[0]))},mapToCurve(e){if(!Array.isArray(e))throw new Error("expected array of bigints");for(const t of e)if("bigint"!=typeof t)throw new Error("expected array of bigints");return s(o(e))},hashToScalar(n,o){const s=e.Fn.ORDER;return h(n,1,Object.assign({},r,{p:s,m:1,DST:t._DST_scalar},o))[0][0]}}};const r=n(627),o=n(967),s=r.bytesToNumberBE;function i(e,t){if(c(e),c(t),e<0||e>=1<<8*t)throw new Error("invalid I2OSP input: "+e);const n=Array.from({length:t}).fill(0);for(let r=t-1;r>=0;r--)n[r]=255&e,e>>>=8;return new Uint8Array(n)}function a(e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r]^t[r];return n}function c(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function f(e){if(!(0,r.isBytes)(e)&&"string"!=typeof e)throw new Error("DST must be Uint8Array or string");return"string"==typeof e?(0,r.utf8ToBytes)(e):e}function l(e,t,n,o){(0,r.abytes)(e),c(n),(t=f(t)).length>255&&(t=o((0,r.concatBytes)((0,r.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:s,blockLen:l}=o,u=Math.ceil(n/s);if(n>65535||u>255)throw new Error("expand_message_xmd: invalid lenInBytes");const h=(0,r.concatBytes)(t,i(t.length,1)),d=i(0,l),p=i(n,2),v=new Array(u),y=o((0,r.concatBytes)(d,e,p,i(0,1),h));v[0]=o((0,r.concatBytes)(y,i(1,1),h));for(let e=1;e<=u;e++){const t=[a(y,v[e-1]),i(e+1,1),h];v[e]=o((0,r.concatBytes)(...t))}return(0,r.concatBytes)(...v).slice(0,n)}function u(e,t,n,o,s){if((0,r.abytes)(e),c(n),(t=f(t)).length>255){const e=Math.ceil(2*o/8);t=s.create({dkLen:e}).update((0,r.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(n>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:n}).update(e).update(i(n,2)).update(t).update(i(t.length,1)).digest()}function h(e,t,n){(0,r._validateObject)(n,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:i,k:a,m:f,hash:h,expand:d,DST:p}=n;if(!(0,r.isHash)(n.hash))throw new Error("expected valid hash");(0,r.abytes)(e),c(t);const v=i.toString(2).length,y=Math.ceil((v+a)/8),g=t*f*y;let b;if("xmd"===d)b=l(e,p,g,h);else if("xof"===d)b=u(e,p,g,a,h);else{if("_internal_pass"!==d)throw new Error('expand must be "xmd" or "xof"');b=e}const m=new Array(t);for(let e=0;e<t;e++){const t=new Array(f);for(let n=0;n<f;n++){const r=y*(n+e*f),a=b.subarray(r,r+y);t[n]=(0,o.mod)(s(a),i)}m[e]=t}return m}t._DST_scalar=(0,r.utf8ToBytes)("HashToScalar-")},967:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNegativeLE=void 0,t.mod=p,t.pow=function(e,t,n){return S(B(n),e,t)},t.pow2=function(e,t,n){let r=e;for(;t-- >o;)r*=r,r%=n;return r},t.invert=v,t.tonelliShanks=m,t.FpSqrt=w,t.validateField=function(e){const t=E.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});return(0,r._validateObject)(e,t),e},t.FpPow=S,t.FpInvertBatch=I,t.FpDiv=function(e,t,n){return e.mul(t,"bigint"==typeof n?v(n,e.ORDER):e.inv(n))},t.FpLegendre=A,t.FpIsSquare=function(e,t){return 1===A(e,t)},t.nLength=x,t.Field=B,t.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?n:e.neg(n)},t.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?e.neg(n):n},t.hashToPrivateScalar=function(e,t,n=!1){const o=(e=(0,r.ensureBytes)("privateHash",e)).length,i=x(t).nByteLength+8;if(i<24||o<i||o>1024)throw new Error("hashToPrivateScalar: expected "+i+"-1024 bytes of input, got "+o);return p(n?(0,r.bytesToNumberLE)(e):(0,r.bytesToNumberBE)(e),t-s)+s},t.getFieldBytesLength=_,t.getMinHashLength=O,t.mapHashToField=function(e,t,n=!1){const o=e.length,i=_(t),a=O(t);if(o<16||o<a||o>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+o);const c=p(n?(0,r.bytesToNumberLE)(e):(0,r.bytesToNumberBE)(e),t-s)+s;return n?(0,r.numberToBytesLE)(c,i):(0,r.numberToBytesBE)(c,i)};const r=n(627),o=BigInt(0),s=BigInt(1),i=BigInt(2),a=BigInt(3),c=BigInt(4),f=BigInt(5),l=BigInt(7),u=BigInt(8),h=BigInt(9),d=BigInt(16);function p(e,t){const n=e%t;return n>=o?n:t+n}function v(e,t){if(e===o)throw new Error("invert: expected non-zero number");if(t<=o)throw new Error("invert: expected positive modulus, got "+t);let n=p(e,t),r=t,i=o,a=s,c=s,f=o;for(;n!==o;){const e=r/n,t=r%n,o=i-c*e,s=a-f*e;r=n,n=t,i=c,a=f,c=o,f=s}if(r!==s)throw new Error("invert: does not exist");return p(i,t)}function y(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error("Cannot find square root")}function g(e,t){const n=(e.ORDER+s)/c,r=e.pow(t,n);return y(e,r,t),r}function b(e,t){const n=(e.ORDER-f)/u,r=e.mul(t,i),o=e.pow(r,n),s=e.mul(t,o),a=e.mul(e.mul(s,i),o),c=e.mul(s,e.sub(a,e.ONE));return y(e,c,t),c}function m(e){if(e<a)throw new Error("sqrt is not defined for small field");let t=e-s,n=0;for(;t%i===o;)t/=i,n++;let r=i;const c=B(e);for(;1===A(c,r);)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===n)return g;let f=c.pow(r,t);const l=(t+s)/i;return function(e,r){if(e.is0(r))return r;if(1!==A(e,r))throw new Error("Cannot find square root");let o=n,i=e.mul(e.ONE,f),a=e.pow(r,t),c=e.pow(r,l);for(;!e.eql(a,e.ONE);){if(e.is0(a))return e.ZERO;let t=1,n=e.sqr(a);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===o)throw new Error("Cannot find square root");const r=s<<BigInt(o-t-1),f=e.pow(i,r);o=t,i=e.sqr(f),a=e.mul(a,i),c=e.mul(c,f)}return c}}function w(e){return e%c===a?g:e%u===f?b:e%d===h?function(e){const t=B(e),n=m(e),r=n(t,t.neg(t.ONE)),o=n(t,r),s=n(t,t.neg(r)),i=(e+l)/d;return(e,t)=>{let n=e.pow(t,i),a=e.mul(n,r);const c=e.mul(n,o),f=e.mul(n,s),l=e.eql(e.sqr(a),t),u=e.eql(e.sqr(c),t);n=e.cmov(n,a,l),a=e.cmov(f,c,u);const h=e.eql(e.sqr(a),t),d=e.cmov(n,a,h);return y(e,d,t),d}}(e):m(e)}t.isNegativeLE=(e,t)=>(p(e,t)&s)===s;const E=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function S(e,t,n){if(n<o)throw new Error("invalid exponent, negatives unsupported");if(n===o)return e.ONE;if(n===s)return t;let r=e.ONE,i=t;for(;n>o;)n&s&&(r=e.mul(r,i)),i=e.sqr(i),n>>=s;return r}function I(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce(((t,n,o)=>e.is0(n)?t:(r[o]=t,e.mul(t,n))),e.ONE),s=e.inv(o);return t.reduceRight(((t,n,o)=>e.is0(n)?t:(r[o]=e.mul(t,r[o]),e.mul(t,n))),s),r}function A(e,t){const n=(e.ORDER-s)/i,r=e.pow(t,n),o=e.eql(r,e.ONE),a=e.eql(r,e.ZERO),c=e.eql(r,e.neg(e.ONE));if(!o&&!a&&!c)throw new Error("invalid Legendre symbol result");return o?1:a?0:-1}function x(e,t){void 0!==t&&(0,r.anumber)(t);const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function B(e,t,n=!1,i={}){if(e<=o)throw new Error("invalid field: expected ORDER > 0, got "+e);let a,c,f,l=!1;if("object"==typeof t&&null!=t){if(i.sqrt||n)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(a=e.BITS),e.sqrt&&(c=e.sqrt),"boolean"==typeof e.isLE&&(n=e.isLE),"boolean"==typeof e.modFromBytes&&(l=e.modFromBytes),f=e.allowedLengths}else"number"==typeof t&&(a=t),i.sqrt&&(c=i.sqrt);const{nBitLength:u,nByteLength:h}=x(e,a);if(h>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let d;const y=Object.freeze({ORDER:e,isLE:n,BITS:u,BYTES:h,MASK:(0,r.bitMask)(u),ZERO:o,ONE:s,allowedLengths:f,create:t=>p(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return o<=t&&t<e},is0:e=>e===o,isValidNot0:e=>!y.is0(e)&&y.isValid(e),isOdd:e=>(e&s)===s,neg:t=>p(-t,e),eql:(e,t)=>e===t,sqr:t=>p(t*t,e),add:(t,n)=>p(t+n,e),sub:(t,n)=>p(t-n,e),mul:(t,n)=>p(t*n,e),pow:(e,t)=>S(y,e,t),div:(t,n)=>p(t*v(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>v(t,e),sqrt:c||(t=>(d||(d=w(e)),d(y,t))),toBytes:e=>n?(0,r.numberToBytesLE)(e,h):(0,r.numberToBytesBE)(e,h),fromBytes:(t,o=!0)=>{if(f){if(!f.includes(t.length)||t.length>h)throw new Error("Field.fromBytes: expected "+f+" bytes, got "+t.length);const e=new Uint8Array(h);e.set(t,n?0:e.length-t.length),t=e}if(t.length!==h)throw new Error("Field.fromBytes: expected "+h+" bytes, got "+t.length);let s=n?(0,r.bytesToNumberLE)(t):(0,r.bytesToNumberBE)(t);if(l&&(s=p(s,e)),!o&&!y.isValid(s))throw new Error("invalid field element: outside of range 0..ORDER");return s},invertBatch:e=>I(y,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(y)}function _(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function O(e){const t=_(e);return t+Math.ceil(t/2)}},705:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DER=t.DERErr=void 0,t._splitEndoScalar=f,t._normFnElement=b,t.weierstrassN=m,t.SWUFpSqrtRatio=E,t.mapToCurveSimpleSWU=function(e,t){(0,a.validateField)(e);const{A:n,B:r,Z:o}=t;if(!e.isValid(n)||!e.isValid(r)||!e.isValid(o))throw new Error("mapToCurveSimpleSWU: invalid opts");const s=E(e,o);if(!e.isOdd)throw new Error("Field does not have .isOdd()");return t=>{let i,c,f,l,u,h,d,p;i=e.sqr(t),i=e.mul(i,o),c=e.sqr(i),c=e.add(c,i),f=e.add(c,e.ONE),f=e.mul(f,r),l=e.cmov(o,e.neg(c),!e.eql(c,e.ZERO)),l=e.mul(l,n),c=e.sqr(f),h=e.sqr(l),u=e.mul(h,n),c=e.add(c,u),c=e.mul(c,f),h=e.mul(h,l),u=e.mul(h,r),c=e.add(c,u),d=e.mul(i,f);const{isValid:v,value:y}=s(c,h);p=e.mul(i,t),p=e.mul(p,y),d=e.cmov(d,f,v),p=e.cmov(p,y,v);const g=e.isOdd(t)===e.isOdd(p);p=e.cmov(e.neg(p),p,g);const b=(0,a.FpInvertBatch)(e,[l],!0)[0];return d=e.mul(d,b),{x:d,y:p}}},t.ecdh=I,t.ecdsa=A,t.weierstrassPoints=function(e){const{CURVE:t,curveOpts:n}=x(e);return function(e,t){const{Fp:n,Fn:r}=t;const o=B(n,e.a,e.b);return Object.assign({},{CURVE:e,Point:t,ProjectivePoint:t,normPrivateKeyToScalar:e=>b(r,e),weierstrassEquation:o,isWithinCurveOrder:function(e){return(0,s.inRange)(e,p,r.ORDER)}})}(e,m(t,n))},t._legacyHelperEquat=B,t.weierstrass=function(e){const{CURVE:t,curveOpts:n,hash:r,ecdsaOpts:o}=function(e){const{CURVE:t,curveOpts:n}=x(e),r={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,hash:e.hash,ecdsaOpts:r}}(e);return function(e,t){const n=t.Point;return Object.assign({},t,{ProjectivePoint:n,CURVE:Object.assign({},e,(0,a.nLength)(n.Fn.ORDER,n.Fn.BITS))})}(e,A(m(t,n),r,o))};const r=n(615),o=n(175),s=n(627),i=n(422),a=n(967),c=(e,t)=>(e+(e>=0?t:-t)/v)/t;function f(e,t,n){const[[r,o],[i,a]]=t,f=c(a*e,n),l=c(-o*e,n);let u=e-f*r-l*i,h=-f*o-l*a;const v=u<d,y=h<d;v&&(u=-u),y&&(h=-h);const g=(0,s.bitMask)(Math.ceil((0,s.bitLen)(n)/2))+p;if(u<d||u>=g||h<d||h>=g)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:v,k1:u,k2neg:y,k2:h}}function l(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function u(e,t){const n={};for(let r of Object.keys(t))n[r]=void 0===e[r]?t[r]:e[r];return(0,s._abool2)(n.lowS,"lowS"),(0,s._abool2)(n.prehash,"prehash"),void 0!==n.format&&l(n.format),n}class h extends Error{constructor(e=""){super(e)}}t.DERErr=h,t.DER={Err:h,_tlv:{encode:(e,n)=>{const{Err:r}=t.DER;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&n.length)throw new r("tlv.encode: unpadded data");const o=n.length/2,i=(0,s.numberToHexUnpadded)(o);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const a=o>127?(0,s.numberToHexUnpadded)(i.length/2|128):"";return(0,s.numberToHexUnpadded)(e)+a+i+n},decode(e,n){const{Err:r}=t.DER;let o=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(n.length<2||n[o++]!==e)throw new r("tlv.decode: wrong tlv");const s=n[o++];let i=0;if(128&s){const e=127&s;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const t=n.subarray(o,o+e);if(t.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===t[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of t)i=i<<8|e;if(o+=e,i<128)throw new r("tlv.decode(long): not minimal encoding")}else i=s;const a=n.subarray(o,o+i);if(a.length!==i)throw new r("tlv.decode: wrong value length");return{v:a,l:n.subarray(o+i)}}},_int:{encode(e){const{Err:n}=t.DER;if(e<d)throw new n("integer: negative integers are not allowed");let r=(0,s.numberToHexUnpadded)(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new n("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:n}=t.DER;if(128&e[0])throw new n("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new n("invalid signature integer: unnecessary leading zero");return(0,s.bytesToNumberBE)(e)}},toSig(e){const{Err:n,_int:r,_tlv:o}=t.DER,i=(0,s.ensureBytes)("signature",e),{v:a,l:c}=o.decode(48,i);if(c.length)throw new n("invalid signature: left bytes after parsing");const{v:f,l}=o.decode(2,a),{v:u,l:h}=o.decode(2,l);if(h.length)throw new n("invalid signature: left bytes after parsing");return{r:r.decode(f),s:r.decode(u)}},hexFromSig(e){const{_tlv:n,_int:r}=t.DER,o=n.encode(2,r.encode(e.r))+n.encode(2,r.encode(e.s));return n.encode(48,o)}};const d=BigInt(0),p=BigInt(1),v=BigInt(2),y=BigInt(3),g=BigInt(4);function b(e,t){const{BYTES:n}=e;let r;if("bigint"==typeof t)r=t;else{let o=(0,s.ensureBytes)("private key",t);try{r=e.fromBytes(o)}catch(e){throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`)}}if(!e.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function m(e,t={}){const n=(0,i._createCurveFields)("weierstrass",e,t),{Fp:r,Fn:o}=n;let a=n.CURVE;const{h:c,n:l}=a;(0,s._validateObject)(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:u}=t;if(u&&(!r.is0(a.a)||"bigint"!=typeof u.beta||!Array.isArray(u.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const h=S(r,o);function v(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const m=t.toBytes||function(e,t,n){const{x:o,y:i}=t.toAffine(),a=r.toBytes(o);if((0,s._abool2)(n,"isCompressed"),n){v();const e=!r.isOdd(i);return(0,s.concatBytes)(w(e),a)}return(0,s.concatBytes)(Uint8Array.of(4),a,r.toBytes(i))},E=t.fromBytes||function(e){(0,s._abytes2)(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:n}=h,o=e.length,i=e[0],a=e.subarray(1);if(o!==t||2!==i&&3!==i){if(o===n&&4===i){const e=r.BYTES,t=r.fromBytes(a.subarray(0,e)),n=r.fromBytes(a.subarray(e,2*e));if(!A(t,n))throw new Error("bad point: is not on curve");return{x:t,y:n}}throw new Error(`bad point: got length ${o}, expected compressed=${t} or uncompressed=${n}`)}{const e=r.fromBytes(a);if(!r.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=I(e);let n;try{n=r.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}return v(),!(1&~i)!==r.isOdd(n)&&(n=r.neg(n)),{x:e,y:n}}};function I(e){const t=r.sqr(e),n=r.mul(t,e);return r.add(r.add(n,r.mul(e,a.a)),a.b)}function A(e,t){const n=r.sqr(t),o=I(e);return r.eql(n,o)}if(!A(a.Gx,a.Gy))throw new Error("bad curve params: generator point");const x=r.mul(r.pow(a.a,y),g),B=r.mul(r.sqr(a.b),BigInt(27));if(r.is0(r.add(x,B)))throw new Error("bad curve params: a or b");function _(e,t,n=!1){if(!r.isValid(t)||n&&r.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function O(e){if(!(e instanceof L))throw new Error("ProjectivePoint expected")}function H(e){if(!u||!u.basises)throw new Error("no endo");return f(e,u.basises,o.ORDER)}const P=(0,s.memoized)(((e,t)=>{const{X:n,Y:o,Z:s}=e;if(r.eql(s,r.ONE))return{x:n,y:o};const i=e.is0();null==t&&(t=i?r.ONE:r.inv(s));const a=r.mul(n,t),c=r.mul(o,t),f=r.mul(s,t);if(i)return{x:r.ZERO,y:r.ZERO};if(!r.eql(f,r.ONE))throw new Error("invZ was invalid");return{x:a,y:c}})),T=(0,s.memoized)((e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.Y))return;throw new Error("bad point: ZERO")}const{x:n,y:o}=e.toAffine();if(!r.isValid(n)||!r.isValid(o))throw new Error("bad point: x or y not field elements");if(!A(n,o))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0}));function F(e,t,n,o,s){return n=new L(r.mul(n.X,e),n.Y,n.Z),t=(0,i.negateCt)(o,t),n=(0,i.negateCt)(s,n),t.add(n)}class L{constructor(e,t,n){this.X=_("x",e),this.Y=_("y",t,!0),this.Z=_("z",n),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof L)throw new Error("projective point not allowed");return r.is0(t)&&r.is0(n)?L.ZERO:new L(t,n,r.ONE)}static fromBytes(e){const t=L.fromAffine(E((0,s._abytes2)(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return L.fromBytes((0,s.ensureBytes)("pointHex",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return R.createCache(this,e),t||this.multiply(y),this}assertValidity(){T(this)}hasEvenY(){const{y:e}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(e)}equals(e){O(e);const{X:t,Y:n,Z:o}=this,{X:s,Y:i,Z:a}=e,c=r.eql(r.mul(t,a),r.mul(s,o)),f=r.eql(r.mul(n,a),r.mul(i,o));return c&&f}negate(){return new L(this.X,r.neg(this.Y),this.Z)}double(){const{a:e,b:t}=a,n=r.mul(t,y),{X:o,Y:s,Z:i}=this;let c=r.ZERO,f=r.ZERO,l=r.ZERO,u=r.mul(o,o),h=r.mul(s,s),d=r.mul(i,i),p=r.mul(o,s);return p=r.add(p,p),l=r.mul(o,i),l=r.add(l,l),c=r.mul(e,l),f=r.mul(n,d),f=r.add(c,f),c=r.sub(h,f),f=r.add(h,f),f=r.mul(c,f),c=r.mul(p,c),l=r.mul(n,l),d=r.mul(e,d),p=r.sub(u,d),p=r.mul(e,p),p=r.add(p,l),l=r.add(u,u),u=r.add(l,u),u=r.add(u,d),u=r.mul(u,p),f=r.add(f,u),d=r.mul(s,i),d=r.add(d,d),u=r.mul(d,p),c=r.sub(c,u),l=r.mul(d,h),l=r.add(l,l),l=r.add(l,l),new L(c,f,l)}add(e){O(e);const{X:t,Y:n,Z:o}=this,{X:s,Y:i,Z:c}=e;let f=r.ZERO,l=r.ZERO,u=r.ZERO;const h=a.a,d=r.mul(a.b,y);let p=r.mul(t,s),v=r.mul(n,i),g=r.mul(o,c),b=r.add(t,n),m=r.add(s,i);b=r.mul(b,m),m=r.add(p,v),b=r.sub(b,m),m=r.add(t,o);let w=r.add(s,c);return m=r.mul(m,w),w=r.add(p,g),m=r.sub(m,w),w=r.add(n,o),f=r.add(i,c),w=r.mul(w,f),f=r.add(v,g),w=r.sub(w,f),u=r.mul(h,m),f=r.mul(d,g),u=r.add(f,u),f=r.sub(v,u),u=r.add(v,u),l=r.mul(f,u),v=r.add(p,p),v=r.add(v,p),g=r.mul(h,g),m=r.mul(d,m),v=r.add(v,g),g=r.sub(p,g),g=r.mul(h,g),m=r.add(m,g),p=r.mul(v,m),l=r.add(l,p),p=r.mul(w,m),f=r.mul(b,f),f=r.sub(f,p),p=r.mul(b,v),u=r.mul(w,u),u=r.add(u,p),new L(f,l,u)}subtract(e){return this.add(e.negate())}is0(){return this.equals(L.ZERO)}multiply(e){const{endo:n}=t;if(!o.isValidNot0(e))throw new Error("invalid scalar: out of range");let r,s;const a=e=>R.cached(this,e,(e=>(0,i.normalizeZ)(L,e)));if(n){const{k1neg:t,k1:o,k2neg:i,k2:c}=H(e),{p:f,f:l}=a(o),{p:u,f:h}=a(c);s=l.add(h),r=F(n.beta,f,u,t,i)}else{const{p:t,f:n}=a(e);r=t,s=n}return(0,i.normalizeZ)(L,[r,s])[0]}multiplyUnsafe(e){const{endo:n}=t,r=this;if(!o.isValid(e))throw new Error("invalid scalar: out of range");if(e===d||r.is0())return L.ZERO;if(e===p)return r;if(R.hasCache(this))return this.multiply(e);if(n){const{k1neg:t,k1:o,k2neg:s,k2:a}=H(e),{p1:c,p2:f}=(0,i.mulEndoUnsafe)(L,r,o,a);return F(n.beta,c,f,t,s)}return R.unsafe(r,e)}multiplyAndAddUnsafe(e,t,n){const r=this.multiplyUnsafe(t).add(e.multiplyUnsafe(n));return r.is0()?void 0:r}toAffine(e){return P(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return c===p||(e?e(L,this):R.unsafe(this,l).is0())}clearCofactor(){const{clearCofactor:e}=t;return c===p?this:e?e(L,this):this.multiplyUnsafe(c)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}toBytes(e=!0){return(0,s._abool2)(e,"isCompressed"),this.assertValidity(),m(L,this,e)}toHex(e=!0){return(0,s.bytesToHex)(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return(0,i.normalizeZ)(L,e)}static msm(e,t){return(0,i.pippenger)(L,o,e,t)}static fromPrivateKey(e){return L.BASE.multiply(b(o,e))}}L.BASE=new L(a.Gx,a.Gy,r.ONE),L.ZERO=new L(r.ZERO,r.ONE,r.ZERO),L.Fp=r,L.Fn=o;const V=o.BITS,R=new i.wNAF(L,t.endo?Math.ceil(V/2):V);return L.BASE.precompute(8),L}function w(e){return Uint8Array.of(e?2:3)}function E(e,t){const n=e.ORDER;let r=d;for(let e=n-p;e%v===d;e/=v)r+=p;const o=r,s=v<<o-p-p,i=s*v,a=(n-p)/i,c=(a-p)/v,f=i-p,l=s,u=e.pow(t,a),h=e.pow(t,(a+p)/v);let b=(t,n)=>{let r=u,s=e.pow(n,f),i=e.sqr(s);i=e.mul(i,n);let a=e.mul(t,i);a=e.pow(a,c),a=e.mul(a,s),s=e.mul(a,n),i=e.mul(a,t);let d=e.mul(i,s);a=e.pow(d,l);let y=e.eql(a,e.ONE);s=e.mul(i,h),a=e.mul(d,r),i=e.cmov(s,i,y),d=e.cmov(a,d,y);for(let t=o;t>p;t--){let n=t-v;n=v<<n-p;let o=e.pow(d,n);const a=e.eql(o,e.ONE);s=e.mul(i,r),r=e.mul(r,r),o=e.mul(d,r),i=e.cmov(s,i,a),d=e.cmov(o,d,a)}return{isValid:y,value:i}};if(e.ORDER%g===y){const n=(e.ORDER-y)/g,r=e.sqrt(e.neg(t));b=(t,o)=>{let s=e.sqr(o);const i=e.mul(t,o);s=e.mul(s,i);let a=e.pow(s,n);a=e.mul(a,i);const c=e.mul(a,r),f=e.mul(e.sqr(a),o),l=e.eql(f,t);return{isValid:l,value:e.cmov(c,a,l)}}}return b}function S(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function I(e,t={}){const{Fn:n}=e,r=t.randomBytes||s.randomBytes,o=Object.assign(S(e.Fp,n),{seed:(0,a.getMinHashLength)(n.ORDER)});function i(e){try{return!!b(n,e)}catch(e){return!1}}function c(e=r(o.seed)){return(0,a.mapHashToField)((0,s._abytes2)(e,o.seed,"seed"),n.ORDER)}function f(t,r=!0){return e.BASE.multiply(b(n,t)).toBytes(r)}function l(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;const{secretKey:r,publicKey:i,publicKeyUncompressed:a}=o;if(n.allowedLengths||r===i)return;const c=(0,s.ensureBytes)("key",t).length;return c===i||c===a}const u={isValidSecretKey:i,isValidPublicKey:function(t,n){const{publicKey:r,publicKeyUncompressed:s}=o;try{const o=t.length;return!(!0===n&&o!==r||!1===n&&o!==s||!e.fromBytes(t))}catch(e){return!1}},randomSecretKey:c,isValidPrivateKey:i,randomPrivateKey:c,normPrivateKeyToScalar:e=>b(n,e),precompute:(t=8,n=e.BASE)=>n.precompute(t,!1)};return Object.freeze({getPublicKey:f,getSharedSecret:function(t,r,o=!0){if(!0===l(t))throw new Error("first arg must be private key");if(!1===l(r))throw new Error("second arg must be public key");const s=b(n,t);return e.fromHex(r).multiply(s).toBytes(o)},keygen:function(e){const t=c(e);return{secretKey:t,publicKey:f(t)}},Point:e,utils:u,lengths:o})}function A(e,n,i={}){(0,o.ahash)(n),(0,s._validateObject)(i,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const a=i.randomBytes||s.randomBytes,c=i.hmac||((e,...t)=>(0,r.hmac)(n,e,(0,s.concatBytes)(...t))),{Fp:f,Fn:h}=e,{ORDER:y,BITS:g}=h,{keygen:m,getPublicKey:E,getSharedSecret:S,utils:A,lengths:x}=I(e,i),B={prehash:!1,lowS:"boolean"==typeof i.lowS&&i.lowS,format:void 0,extraEntropy:!1},_="compact";function O(e){return e>y>>p}function H(e,t){if(!h.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class P{constructor(e,t,n){this.r=H("r",e),this.s=H("s",t),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(e,n=_){let r;if(function(e,t){l(t);const n=x.signature,r="compact"===t?n:"recovered"===t?n+1:void 0;(0,s._abytes2)(e,r,`${t} signature`)}(e,n),"der"===n){const{r:n,s:r}=t.DER.toSig((0,s._abytes2)(e));return new P(n,r)}"recovered"===n&&(r=e[0],n="compact",e=e.subarray(1));const o=h.BYTES,i=e.subarray(0,o),a=e.subarray(o,2*o);return new P(h.fromBytes(i),h.fromBytes(a),r)}static fromHex(e,t){return this.fromBytes((0,s.hexToBytes)(e),t)}addRecoveryBit(e){return new P(this.r,this.s,e)}recoverPublicKey(t){const n=f.ORDER,{r,s:o,recovery:i}=this;if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");if(y*v<n&&i>1)throw new Error("recovery id is ambiguous for h>1 curve");const a=2===i||3===i?r+y:r;if(!f.isValid(a))throw new Error("recovery id 2 or 3 invalid");const c=f.toBytes(a),l=e.fromBytes((0,s.concatBytes)(w(!(1&i)),c)),u=h.inv(a),d=F((0,s.ensureBytes)("msgHash",t)),p=h.create(-d*u),g=h.create(o*u),b=e.BASE.multiplyUnsafe(p).add(l.multiplyUnsafe(g));if(b.is0())throw new Error("point at infinify");return b.assertValidity(),b}hasHighS(){return O(this.s)}toBytes(e=_){if(l(e),"der"===e)return(0,s.hexToBytes)(t.DER.hexFromSig(this));const n=h.toBytes(this.r),r=h.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw new Error("recovery bit must be present");return(0,s.concatBytes)(Uint8Array.of(this.recovery),n,r)}return(0,s.concatBytes)(n,r)}toHex(e){return(0,s.bytesToHex)(this.toBytes(e))}assertValidity(){}static fromCompact(e){return P.fromBytes((0,s.ensureBytes)("sig",e),"compact")}static fromDER(e){return P.fromBytes((0,s.ensureBytes)("sig",e),"der")}normalizeS(){return this.hasHighS()?new P(this.r,h.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return(0,s.bytesToHex)(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return(0,s.bytesToHex)(this.toBytes("compact"))}}const T=i.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=(0,s.bytesToNumberBE)(e),n=8*e.length-g;return n>0?t>>BigInt(n):t},F=i.bits2int_modN||function(e){return h.create(T(e))},L=(0,s.bitMask)(g);function V(e){return(0,s.aInRange)("num < 2^"+g,e,d,L),h.toBytes(e)}function R(e,t){return(0,s._abytes2)(e,void 0,"message"),t?(0,s._abytes2)(n(e),void 0,"prehashed message"):e}return Object.freeze({keygen:m,getPublicKey:E,getSharedSecret:S,utils:A,lengths:x,Point:e,sign:function(t,r,o={}){t=(0,s.ensureBytes)("message",t);const{seed:i,k2sig:f}=function(t,n,r){if(["recovered","canonical"].some((e=>e in r)))throw new Error("sign() legacy options not supported");const{lowS:o,prehash:i,extraEntropy:c}=u(r,B);t=R(t,i);const f=F(t),l=b(h,n),v=[V(l),V(f)];if(null!=c&&!1!==c){const e=!0===c?a(x.secretKey):c;v.push((0,s.ensureBytes)("extraEntropy",e))}const y=(0,s.concatBytes)(...v),g=f;return{seed:y,k2sig:function(t){const n=T(t);if(!h.isValidNot0(n))return;const r=h.inv(n),s=e.BASE.multiply(n).toAffine(),i=h.create(s.x);if(i===d)return;const a=h.create(r*h.create(g+i*l));if(a===d)return;let c=(s.x===i?0:2)|Number(s.y&p),f=a;return o&&O(a)&&(f=h.neg(a),c^=1),new P(i,f,c)}}}(t,r,o);return(0,s.createHmacDrbg)(n.outputLen,h.BYTES,c)(i,f)},verify:function(n,r,o,i={}){const{lowS:a,prehash:c,format:f}=u(i,B);if(o=(0,s.ensureBytes)("publicKey",o),r=R((0,s.ensureBytes)("message",r),c),"strict"in i)throw new Error("options.strict was renamed to lowS");const l=void 0===f?function(e){let n;const r="string"==typeof e||(0,s.isBytes)(e),o=!r&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!r&&!o)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(o)n=new P(e.r,e.s);else if(r){try{n=P.fromBytes((0,s.ensureBytes)("sig",e),"der")}catch(e){if(!(e instanceof t.DER.Err))throw e}if(!n)try{n=P.fromBytes((0,s.ensureBytes)("sig",e),"compact")}catch(e){return!1}}return n||!1}(n):P.fromBytes((0,s.ensureBytes)("sig",n),f);if(!1===l)return!1;try{const t=e.fromBytes(o);if(a&&l.hasHighS())return!1;const{r:n,s}=l,i=F(r),c=h.inv(s),f=h.create(i*c),u=h.create(n*c),d=e.BASE.multiplyUnsafe(f).add(t.multiplyUnsafe(u));return!d.is0()&&h.create(d.x)===n}catch(e){return!1}},recoverPublicKey:function(e,t,n={}){const{prehash:r}=u(n,B);return t=R(t,r),P.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:P,hash:n})}function x(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp;let r=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map((e=>Math.ceil(e/2))))):void 0;return{CURVE:t,curveOpts:{Fp:n,Fn:(0,a.Field)(t.n,{BITS:e.nBitLength,allowedLengths:r,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}function B(e,t,n){return function(r){const o=e.sqr(r),s=e.mul(o,r);return e.add(e.add(s,e.mul(r,t)),n)}}},54:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.p521_hasher=t.secp521r1=t.secp384r1=t.secp256r1=t.p521=t.p384_hasher=t.p384=t.p256_hasher=t.p256=void 0;const r=n(76),o=n(562),s=n(761),i=n(967),a=n(705),c={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},f={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},l={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},u=(0,i.Field)(c.p),h=(0,i.Field)(f.p),d=(0,i.Field)(l.p);function p(e,t){const n=(0,a.mapToCurveSimpleSWU)(e.Fp,t);return e=>n(e[0])}t.p256=(0,o.createCurve)({...c,Fp:u,lowS:!1},r.sha256),t.p256_hasher=(0,s.createHasher)(t.p256.Point,p(t.p256.Point,{A:c.a,B:c.b,Z:t.p256.Point.Fp.create(BigInt("-10"))}),{DST:"P256_XMD:SHA-256_SSWU_RO_",encodeDST:"P256_XMD:SHA-256_SSWU_NU_",p:c.p,m:1,k:128,expand:"xmd",hash:r.sha256}),t.p384=(0,o.createCurve)({...f,Fp:h,lowS:!1},r.sha384),t.p384_hasher=(0,s.createHasher)(t.p384.Point,p(t.p384.Point,{A:f.a,B:f.b,Z:t.p384.Point.Fp.create(BigInt("-12"))}),{DST:"P384_XMD:SHA-384_SSWU_RO_",encodeDST:"P384_XMD:SHA-384_SSWU_NU_",p:f.p,m:1,k:192,expand:"xmd",hash:r.sha384}),t.p521=(0,o.createCurve)({...l,Fp:d,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},r.sha512),t.secp256r1=t.p256,t.secp384r1=t.p384,t.secp521r1=t.p521,t.p521_hasher=(0,s.createHasher)(t.p521.Point,p(t.p521.Point,{A:l.a,B:l.b,Z:t.p521.Point.Fp.create(BigInt("-4"))}),{DST:"P521_XMD:SHA-512_SSWU_RO_",encodeDST:"P521_XMD:SHA-512_SSWU_NU_",p:l.p,m:1,k:256,expand:"xmd",hash:r.sha512})},897:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeToCurve=t.hashToCurve=t.secp256r1=t.p256=void 0;const r=n(54);t.p256=r.p256,t.secp256r1=r.p256,t.hashToCurve=r.p256_hasher.hashToCurve,t.encodeToCurve=r.p256_hasher.encodeToCurve},627:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.notImplemented=t.bitMask=t.utf8ToBytes=t.randomBytes=t.isBytes=t.hexToBytes=t.concatBytes=t.bytesToUtf8=t.bytesToHex=t.anumber=t.abytes=void 0,t.abool=function(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)},t._abool2=function(e,t=""){if("boolean"!=typeof e)throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e);return e},t._abytes2=function(e,t,n=""){const o=(0,r.isBytes)(e),s=e?.length,i=void 0!==t;if(!o||i&&s!==t)throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(i?` of length ${t}`:"")+", got "+(o?`length=${s}`:"type="+typeof e));return e},t.numberToHexUnpadded=a,t.hexToNumber=c,t.bytesToNumberBE=function(e){return c((0,r.bytesToHex)(e))},t.bytesToNumberLE=function(e){return(0,r.abytes)(e),c((0,r.bytesToHex)(Uint8Array.from(e).reverse()))},t.numberToBytesBE=f,t.numberToBytesLE=function(e,t){return f(e,t).reverse()},t.numberToVarBytesBE=function(e){return(0,r.hexToBytes)(a(e))},t.ensureBytes=function(e,t,n){let o;if("string"==typeof t)try{o=(0,r.hexToBytes)(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!(0,r.isBytes)(t))throw new Error(e+" must be hex string or Uint8Array");o=Uint8Array.from(t)}const s=o.length;if("number"==typeof n&&s!==n)throw new Error(e+" of length "+n+" expected, got "+s);return o},t.equalBytes=function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},t.copyBytes=function(e){return Uint8Array.from(e)},t.asciiToBytes=function(e){return Uint8Array.from(e,((t,n)=>{const r=t.charCodeAt(0);if(1!==t.length||r>127)throw new Error(`string contains non-ASCII character "${e[n]}" with code ${r} at position ${n}`);return r}))},t.inRange=u,t.aInRange=function(e,t,n,r){if(!u(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)},t.bitLen=function(e){let t;for(t=0;e>s;e>>=i,t+=1);return t},t.bitGet=function(e,t){return e>>BigInt(t)&i},t.bitSet=function(e,t,n){return e|(n?i:s)<<BigInt(t)},t.createHmacDrbg=function(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");const o=e=>new Uint8Array(e),s=e=>Uint8Array.of(e);let i=o(e),a=o(e),c=0;const f=()=>{i.fill(1),a.fill(0),c=0},l=(...e)=>n(a,i,...e),u=(e=o(0))=>{a=l(s(0),e),i=l(),0!==e.length&&(a=l(s(1),e),i=l())},h=()=>{if(c++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){i=l();const t=i.slice();n.push(t),e+=i.length}return(0,r.concatBytes)(...n)};return(e,t)=>{let n;for(f(),u(e);!(n=t(h()));)u();return f(),n}},t.validateObject=function(e,t,n={}){const r=(t,n,r)=>{const o=h[n];if("function"!=typeof o)throw new Error("invalid validator function");const s=e[t];if(!(r&&void 0===s||o(s,e)))throw new Error("param "+String(t)+" is invalid. Expected "+n+", got "+s)};for(const[e,n]of Object.entries(t))r(e,n,!1);for(const[e,t]of Object.entries(n))r(e,t,!0);return e},t.isHash=function(e){return"function"==typeof e&&Number.isSafeInteger(e.outputLen)},t._validateObject=function(e,t,n={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function r(t,n,r){const o=e[t];if(r&&void 0===o)return;const s=typeof o;if(s!==n||null===o)throw new Error(`param "${t}" is invalid: expected ${n}, got ${s}`)}Object.entries(t).forEach((([e,t])=>r(e,t,!1))),Object.entries(n).forEach((([e,t])=>r(e,t,!0)))},t.memoized=function(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(void 0!==o)return o;const s=e(n,...r);return t.set(n,s),s}};const r=n(175);var o=n(175);Object.defineProperty(t,"abytes",{enumerable:!0,get:function(){return o.abytes}}),Object.defineProperty(t,"anumber",{enumerable:!0,get:function(){return o.anumber}}),Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(t,"bytesToUtf8",{enumerable:!0,get:function(){return o.bytesToUtf8}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return o.concatBytes}}),Object.defineProperty(t,"hexToBytes",{enumerable:!0,get:function(){return o.hexToBytes}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return o.isBytes}}),Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return o.randomBytes}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return o.utf8ToBytes}});const s=BigInt(0),i=BigInt(1);function a(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function c(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?s:BigInt("0x"+e)}function f(e,t){return(0,r.hexToBytes)(e.toString(16).padStart(2*t,"0"))}const l=e=>"bigint"==typeof e&&s<=e;function u(e,t,n){return l(e)&&l(t)&&l(n)&&t<=e&&e<n}t.bitMask=e=>(i<<BigInt(e))-i;const h={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||(0,r.isBytes)(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};t.notImplemented=()=>{throw new Error("not implemented")}},202:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SHA512_IV=t.SHA384_IV=t.SHA224_IV=t.SHA256_IV=t.HashMD=void 0,t.setBigUint64=o,t.Chi=function(e,t,n){return e&t^~e&n},t.Maj=function(e,t,n){return e&t^e&n^t&n};const r=n(175);function o(e,t,n,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,r);const o=BigInt(32),s=BigInt(4294967295),i=Number(n>>o&s),a=Number(n&s),c=r?4:0,f=r?0:4;e.setUint32(t+c,i,r),e.setUint32(t+f,a,r)}class s extends r.Hash{constructor(e,t,n,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=o,this.buffer=new Uint8Array(e),this.view=(0,r.createView)(this.buffer)}update(e){(0,r.aexists)(this),e=(0,r.toBytes)(e),(0,r.abytes)(e);const{view:t,buffer:n,blockLen:o}=this,s=e.length;for(let i=0;i<s;){const a=Math.min(o-this.pos,s-i);if(a!==o)n.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===o&&(this.process(t,0),this.pos=0);else{const t=(0,r.createView)(e);for(;o<=s-i;i+=o)this.process(t,i)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,r.aexists)(this),(0,r.aoutput)(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:s,isLE:i}=this;let{pos:a}=this;t[a++]=128,(0,r.clean)(this.buffer.subarray(a)),this.padOffset>s-a&&(this.process(n,0),a=0);for(let e=a;e<s;e++)t[e]=0;o(n,s-8,BigInt(8*this.length),i),this.process(n,0);const c=(0,r.createView)(e),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=f/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)c.setUint32(4*e,u[e],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:r,finished:o,destroyed:s,pos:i}=this;return e.destroyed=s,e.finished=o,e.length=r,e.pos=i,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}}t.HashMD=s,t.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),t.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),t.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),t.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])},318:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toBig=t.shrSL=t.shrSH=t.rotrSL=t.rotrSH=t.rotrBL=t.rotrBH=t.rotr32L=t.rotr32H=t.rotlSL=t.rotlSH=t.rotlBL=t.rotlBH=t.add5L=t.add5H=t.add4L=t.add4H=t.add3L=t.add3H=void 0,t.add=m,t.fromBig=o,t.split=s;const n=BigInt(2**32-1),r=BigInt(32);function o(e,t=!1){return t?{h:Number(e&n),l:Number(e>>r&n)}:{h:0|Number(e>>r&n),l:0|Number(e&n)}}function s(e,t=!1){const n=e.length;let r=new Uint32Array(n),s=new Uint32Array(n);for(let i=0;i<n;i++){const{h:n,l:a}=o(e[i],t);[r[i],s[i]]=[n,a]}return[r,s]}const i=(e,t)=>BigInt(e>>>0)<<r|BigInt(t>>>0);t.toBig=i;const a=(e,t,n)=>e>>>n;t.shrSH=a;const c=(e,t,n)=>e<<32-n|t>>>n;t.shrSL=c;const f=(e,t,n)=>e>>>n|t<<32-n;t.rotrSH=f;const l=(e,t,n)=>e<<32-n|t>>>n;t.rotrSL=l;const u=(e,t,n)=>e<<64-n|t>>>n-32;t.rotrBH=u;const h=(e,t,n)=>e>>>n-32|t<<64-n;t.rotrBL=h;const d=(e,t)=>t;t.rotr32H=d;const p=(e,t)=>e;t.rotr32L=p;const v=(e,t,n)=>e<<n|t>>>32-n;t.rotlSH=v;const y=(e,t,n)=>t<<n|e>>>32-n;t.rotlSL=y;const g=(e,t,n)=>t<<n-32|e>>>64-n;t.rotlBH=g;const b=(e,t,n)=>e<<n-32|t>>>64-n;function m(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}}t.rotlBL=b;const w=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);t.add3L=w;const E=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;t.add3H=E;const S=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);t.add4L=S;const I=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0;t.add4H=I;const A=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0);t.add5L=A;const x=(e,t,n,r,o,s)=>t+n+r+o+s+(e/2**32|0)|0;t.add5H=x;const B={fromBig:o,split:s,toBig:i,shrSH:a,shrSL:c,rotrSH:f,rotrSL:l,rotrBH:u,rotrBL:h,rotr32H:d,rotr32L:p,rotlSH:v,rotlSL:y,rotlBH:g,rotlBL:b,add:m,add3L:w,add3H:E,add4L:S,add4H:I,add5H:x,add5L:A};t.default=B},145:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},615:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const r=n(175);class o extends r.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,r.ahash)(e);const n=(0,r.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?e.create().update(n).digest():n);for(let e=0;e<s.length;e++)s[e]^=54;this.iHash.update(s),this.oHash=e.create();for(let e=0;e<s.length;e++)s[e]^=106;this.oHash.update(s),(0,r.clean)(s)}update(e){return(0,r.aexists)(this),this.iHash.update(e),this}digestInto(e){(0,r.aexists)(this),(0,r.abytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:r,destroyed:o,blockLen:s,outputLen:i}=this;return e.finished=r,e.destroyed=o,e.blockLen=s,e.outputLen=i,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=o,t.hmac=(e,t,n)=>new o(e,t).update(n).digest(),t.hmac.create=(e,t)=>new o(e,t)},76:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sha512_224=t.sha512_256=t.sha384=t.sha512=t.sha224=t.sha256=t.SHA512_256=t.SHA512_224=t.SHA384=t.SHA512=t.SHA224=t.SHA256=void 0;const r=n(202),o=n(318),s=n(175),i=Uint32Array.from([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]),a=new Uint32Array(64);class c extends r.HashMD{constructor(e=32){super(64,e,8,!1),this.A=0|r.SHA256_IV[0],this.B=0|r.SHA256_IV[1],this.C=0|r.SHA256_IV[2],this.D=0|r.SHA256_IV[3],this.E=0|r.SHA256_IV[4],this.F=0|r.SHA256_IV[5],this.G=0|r.SHA256_IV[6],this.H=0|r.SHA256_IV[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:s,G:i,H:a}=this;return[e,t,n,r,o,s,i,a]}set(e,t,n,r,o,s,i,a){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|s,this.G=0|i,this.H=0|a}process(e,t){for(let n=0;n<16;n++,t+=4)a[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=a[e-15],n=a[e-2],r=(0,s.rotr)(t,7)^(0,s.rotr)(t,18)^t>>>3,o=(0,s.rotr)(n,17)^(0,s.rotr)(n,19)^n>>>10;a[e]=o+a[e-7]+r+a[e-16]|0}let{A:n,B:o,C:c,D:f,E:l,F:u,G:h,H:d}=this;for(let e=0;e<64;e++){const t=d+((0,s.rotr)(l,6)^(0,s.rotr)(l,11)^(0,s.rotr)(l,25))+(0,r.Chi)(l,u,h)+i[e]+a[e]|0,p=((0,s.rotr)(n,2)^(0,s.rotr)(n,13)^(0,s.rotr)(n,22))+(0,r.Maj)(n,o,c)|0;d=h,h=u,u=l,l=f+t|0,f=c,c=o,o=n,n=t+p|0}n=n+this.A|0,o=o+this.B|0,c=c+this.C|0,f=f+this.D|0,l=l+this.E|0,u=u+this.F|0,h=h+this.G|0,d=d+this.H|0,this.set(n,o,c,f,l,u,h,d)}roundClean(){(0,s.clean)(a)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,s.clean)(this.buffer)}}t.SHA256=c;class f extends c{constructor(){super(28),this.A=0|r.SHA224_IV[0],this.B=0|r.SHA224_IV[1],this.C=0|r.SHA224_IV[2],this.D=0|r.SHA224_IV[3],this.E=0|r.SHA224_IV[4],this.F=0|r.SHA224_IV[5],this.G=0|r.SHA224_IV[6],this.H=0|r.SHA224_IV[7]}}t.SHA224=f;const l=(()=>o.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),u=(()=>l[0])(),h=(()=>l[1])(),d=new Uint32Array(80),p=new Uint32Array(80);class v extends r.HashMD{constructor(e=64){super(128,e,16,!1),this.Ah=0|r.SHA512_IV[0],this.Al=0|r.SHA512_IV[1],this.Bh=0|r.SHA512_IV[2],this.Bl=0|r.SHA512_IV[3],this.Ch=0|r.SHA512_IV[4],this.Cl=0|r.SHA512_IV[5],this.Dh=0|r.SHA512_IV[6],this.Dl=0|r.SHA512_IV[7],this.Eh=0|r.SHA512_IV[8],this.El=0|r.SHA512_IV[9],this.Fh=0|r.SHA512_IV[10],this.Fl=0|r.SHA512_IV[11],this.Gh=0|r.SHA512_IV[12],this.Gl=0|r.SHA512_IV[13],this.Hh=0|r.SHA512_IV[14],this.Hl=0|r.SHA512_IV[15]}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:o,Cl:s,Dh:i,Dl:a,Eh:c,El:f,Fh:l,Fl:u,Gh:h,Gl:d,Hh:p,Hl:v}=this;return[e,t,n,r,o,s,i,a,c,f,l,u,h,d,p,v]}set(e,t,n,r,o,s,i,a,c,f,l,u,h,d,p,v){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|o,this.Cl=0|s,this.Dh=0|i,this.Dl=0|a,this.Eh=0|c,this.El=0|f,this.Fh=0|l,this.Fl=0|u,this.Gh=0|h,this.Gl=0|d,this.Hh=0|p,this.Hl=0|v}process(e,t){for(let n=0;n<16;n++,t+=4)d[n]=e.getUint32(t),p[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|d[e-15],n=0|p[e-15],r=o.rotrSH(t,n,1)^o.rotrSH(t,n,8)^o.shrSH(t,n,7),s=o.rotrSL(t,n,1)^o.rotrSL(t,n,8)^o.shrSL(t,n,7),i=0|d[e-2],a=0|p[e-2],c=o.rotrSH(i,a,19)^o.rotrBH(i,a,61)^o.shrSH(i,a,6),f=o.rotrSL(i,a,19)^o.rotrBL(i,a,61)^o.shrSL(i,a,6),l=o.add4L(s,f,p[e-7],p[e-16]),u=o.add4H(l,r,c,d[e-7],d[e-16]);d[e]=0|u,p[e]=0|l}let{Ah:n,Al:r,Bh:s,Bl:i,Ch:a,Cl:c,Dh:f,Dl:l,Eh:v,El:y,Fh:g,Fl:b,Gh:m,Gl:w,Hh:E,Hl:S}=this;for(let e=0;e<80;e++){const t=o.rotrSH(v,y,14)^o.rotrSH(v,y,18)^o.rotrBH(v,y,41),I=o.rotrSL(v,y,14)^o.rotrSL(v,y,18)^o.rotrBL(v,y,41),A=v&g^~v&m,x=y&b^~y&w,B=o.add5L(S,I,x,h[e],p[e]),_=o.add5H(B,E,t,A,u[e],d[e]),O=0|B,H=o.rotrSH(n,r,28)^o.rotrBH(n,r,34)^o.rotrBH(n,r,39),P=o.rotrSL(n,r,28)^o.rotrBL(n,r,34)^o.rotrBL(n,r,39),T=n&s^n&a^s&a,F=r&i^r&c^i&c;E=0|m,S=0|w,m=0|g,w=0|b,g=0|v,b=0|y,({h:v,l:y}=o.add(0|f,0|l,0|_,0|O)),f=0|a,l=0|c,a=0|s,c=0|i,s=0|n,i=0|r;const L=o.add3L(O,P,F);n=o.add3H(L,_,H,T),r=0|L}({h:n,l:r}=o.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:s,l:i}=o.add(0|this.Bh,0|this.Bl,0|s,0|i)),({h:a,l:c}=o.add(0|this.Ch,0|this.Cl,0|a,0|c)),({h:f,l}=o.add(0|this.Dh,0|this.Dl,0|f,0|l)),({h:v,l:y}=o.add(0|this.Eh,0|this.El,0|v,0|y)),({h:g,l:b}=o.add(0|this.Fh,0|this.Fl,0|g,0|b)),({h:m,l:w}=o.add(0|this.Gh,0|this.Gl,0|m,0|w)),({h:E,l:S}=o.add(0|this.Hh,0|this.Hl,0|E,0|S)),this.set(n,r,s,i,a,c,f,l,v,y,g,b,m,w,E,S)}roundClean(){(0,s.clean)(d,p)}destroy(){(0,s.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=v;class y extends v{constructor(){super(48),this.Ah=0|r.SHA384_IV[0],this.Al=0|r.SHA384_IV[1],this.Bh=0|r.SHA384_IV[2],this.Bl=0|r.SHA384_IV[3],this.Ch=0|r.SHA384_IV[4],this.Cl=0|r.SHA384_IV[5],this.Dh=0|r.SHA384_IV[6],this.Dl=0|r.SHA384_IV[7],this.Eh=0|r.SHA384_IV[8],this.El=0|r.SHA384_IV[9],this.Fh=0|r.SHA384_IV[10],this.Fl=0|r.SHA384_IV[11],this.Gh=0|r.SHA384_IV[12],this.Gl=0|r.SHA384_IV[13],this.Hh=0|r.SHA384_IV[14],this.Hl=0|r.SHA384_IV[15]}}t.SHA384=y;const g=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),b=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class m extends v{constructor(){super(28),this.Ah=0|g[0],this.Al=0|g[1],this.Bh=0|g[2],this.Bl=0|g[3],this.Ch=0|g[4],this.Cl=0|g[5],this.Dh=0|g[6],this.Dl=0|g[7],this.Eh=0|g[8],this.El=0|g[9],this.Fh=0|g[10],this.Fl=0|g[11],this.Gh=0|g[12],this.Gl=0|g[13],this.Hh=0|g[14],this.Hl=0|g[15]}}t.SHA512_224=m;class w extends v{constructor(){super(32),this.Ah=0|b[0],this.Al=0|b[1],this.Bh=0|b[2],this.Bl=0|b[3],this.Ch=0|b[4],this.Cl=0|b[5],this.Dh=0|b[6],this.Dl=0|b[7],this.Eh=0|b[8],this.El=0|b[9],this.Fh=0|b[10],this.Fl=0|b[11],this.Gh=0|b[12],this.Gl=0|b[13],this.Hh=0|b[14],this.Hl=0|b[15]}}t.SHA512_256=w,t.sha256=(0,s.createHasher)((()=>new c)),t.sha224=(0,s.createHasher)((()=>new f)),t.sha512=(0,s.createHasher)((()=>new v)),t.sha384=(0,s.createHasher)((()=>new y)),t.sha512_256=(0,s.createHasher)((()=>new w)),t.sha512_224=(0,s.createHasher)((()=>new m))},175:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.Hash=t.nextTick=t.swap32IfBE=t.byteSwapIfBE=t.swap8IfBE=t.isLE=void 0,t.isBytes=o,t.anumber=s,t.abytes=i,t.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");s(e.outputLen),s(e.blockLen)},t.aexists=function(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},t.aoutput=function(e,t){i(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)},t.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},t.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},t.clean=function(...e){for(let t=0;t<e.length;t++)e[t].fill(0)},t.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},t.rotr=function(e,t){return e<<32-t|e>>>t},t.rotl=function(e,t){return e<<t|e>>>32-t>>>0},t.byteSwap=a,t.byteSwap32=c,t.bytesToHex=function(e){if(i(e),f)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=l[e[n]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(f)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,o=0;t<n;t++,o+=2){const n=h(e.charCodeAt(o)),s=h(e.charCodeAt(o+1));if(void 0===n||void 0===s){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}r[t]=16*n+s}return r},t.asyncLoop=async function(e,n,r){let o=Date.now();for(let s=0;s<e;s++){r(s);const e=Date.now()-o;e>=0&&e<n||(await(0,t.nextTick)(),o+=e)}},t.utf8ToBytes=d,t.bytesToUtf8=function(e){return(new TextDecoder).decode(e)},t.toBytes=p,t.kdfInputToBytes=function(e){return"string"==typeof e&&(e=d(e)),i(e),e},t.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];i(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const o=e[t];n.set(o,r),r+=o.length}return n},t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("options should be object or undefined");return Object.assign(e,t)},t.createHasher=v,t.createOptHasher=y,t.createXOFer=g,t.randomBytes=function(e=32){if(r.crypto&&"function"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(e));if(r.crypto&&"function"==typeof r.crypto.randomBytes)return Uint8Array.from(r.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")};const r=n(145);function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function i(e,...t){if(!o(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function a(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function c(e){for(let t=0;t<e.length;t++)e[t]=a(e[t]);return e}t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.swap8IfBE=t.isLE?e=>e:e=>a(e),t.byteSwapIfBE=t.swap8IfBE,t.swap32IfBE=t.isLE?e=>e:c;const f=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),l=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0"))),u={_0:48,_9:57,A:65,F:70,a:97,f:102};function h(e){return e>=u._0&&e<=u._9?e-u._0:e>=u.A&&e<=u.F?e-(u.A-10):e>=u.a&&e<=u.f?e-(u.a-10):void 0}function d(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function p(e){return"string"==typeof e&&(e=d(e)),i(e),e}function v(e){const t=t=>e().update(p(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function y(e){const t=(t,n)=>e(n).update(p(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}function g(e){const t=(t,n)=>e(n).update(p(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t}t.nextTick=async()=>{},t.Hash=class{},t.wrapConstructor=v,t.wrapConstructorWithOpts=y,t.wrapXOFConstructorWithOpts=g},669:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AvoBatcher=void 0;var r=n(611),o=function(){function e(t){var n=this;this.events=[],this.networkCallsHandler=t,this.batchFlushAttemptTimestamp=Date.now(),r.AvoInspector.avoStorage.getItemAsync(e.cacheKey).then((function(e){if(null!==e){var t=e.filter((function(e){return null!==e}));n.events=n.events.concat(t),n.checkIfBatchNeedsToBeSent()}})).catch((function(e){console.error("Avo Inspector: error getting events from cache",e)}))}return e.prototype.handleSessionStarted=function(){this.events.push(this.networkCallsHandler.bodyForSessionStartedCall()),this.saveEvents(),this.checkIfBatchNeedsToBeSent()},e.prototype.handleTrackSchema=function(e,t,n,o,s){this.events.push(this.networkCallsHandler.bodyForEventSchemaCall(e,t,n,o,s)),this.saveEvents(),r.AvoInspector.shouldLog&&console.log("Avo Inspector: saved event "+e+" with schema "+JSON.stringify(t)),this.checkIfBatchNeedsToBeSent()},e.prototype.checkIfBatchNeedsToBeSent=function(){var e=this.events.length,t=Date.now(),n=t-this.batchFlushAttemptTimestamp,o=e%r.AvoInspector.batchSize==0,s=n>=1e3*r.AvoInspector.batchFlushSeconds,i=this;if(o||s){this.batchFlushAttemptTimestamp=t;var a=i.events;i.events=[],this.networkCallsHandler.callInspectorWithBatchBody(a,(function(e){null!=e?(i.events=i.events.concat(a),r.AvoInspector.shouldLog&&console.log("Avo Inspector: batch sending failed: "+e.message+". We will attempt to send your schemas with next batch")):r.AvoInspector.shouldLog&&console.log("Avo Inspector: batch sent successfully."),i.saveEvents()}))}},e.prototype.saveEvents=function(){if(this.events.length>1e3){var t=this.events.length-1e3;this.events.splice(0,t)}r.AvoInspector.avoStorage.setItem(e.cacheKey,this.events)},Object.defineProperty(e,"cacheKey",{get:function(){return"AvoInspectorEvents"},enumerable:!1,configurable:!0}),e}();t.AvoBatcher=o},492:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoDeduplicator=void 0;var s=n(924),i=n(185),a=function(){function e(){this.avoFunctionsEvents={},this.manualEvents={},this.avoFunctionsEventsParams={},this.manualEventsParams={}}return e.prototype.shouldRegisterEvent=function(e,t,n){this.clearOldEvents(),n?(this.avoFunctionsEvents[Date.now()]=e,this.avoFunctionsEventsParams[e]=t):(this.manualEvents[Date.now()]=e,this.manualEventsParams[e]=t);var r=!n;return!this.hasSameEventAs(e,t,r)},e.prototype.hasSameEventAs=function(e,t,n){var r=!1;return n?this.lookForEventIn(e,t,this.avoFunctionsEventsParams)&&(r=!0):this.lookForEventIn(e,t,this.manualEventsParams)&&(r=!0),r&&(delete this.avoFunctionsEventsParams[e],delete this.manualEventsParams[e]),r},e.prototype.lookForEventIn=function(e,t,n){for(var r in n)if(n.hasOwnProperty(r)&&r===e){var o=n[e];if(o&&(0,i.deepEquals)(t,o))return!0}return!1},e.prototype.hasSeenEventParams=function(e,t){var n=!1;return t?this.lookForEventParamsIn(e,this.avoFunctionsEventsParams)&&(n=!0):this.lookForEventParamsIn(e,this.manualEventsParams)&&(n=!0),n},e.prototype.lookForEventParamsIn=function(e,t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(r&&(0,i.deepEquals)(e,r))return!0}return!1},e.prototype.shouldRegisterSchemaFromManually=function(e,t){return r(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return this.clearOldEvents(),[4,this.hasSameShapeInAvoFunctionsAs(e,t)];case 1:return[2,!n.sent()]}}))}))},e.prototype.hasSameShapeInAvoFunctionsAs=function(e,t){return r(this,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return n=!1,[4,this.lookForEventSchemaIn(e,t,this.avoFunctionsEventsParams)];case 1:return r.sent()&&(n=!0),n&&delete this.avoFunctionsEventsParams[e],[2,n]}}))}))},e.prototype.lookForEventSchemaIn=function(e,t,n){return r(this,void 0,void 0,(function(){var r,a,c,f,l,u;return o(this,(function(o){switch(o.label){case 0:for(c in a=[],r=n)a.push(c);f=0,o.label=1;case 1:return f<a.length?(c=a[f])in r?(l=c,n.hasOwnProperty(l)?l!==e?[3,3]:[4,s.AvoSchemaParser.extractSchema(n[e])]:[3,3]):[3,3]:[3,4];case 2:if((u=o.sent())&&(0,i.deepEquals)(t,u))return[2,!0];o.label=3;case 3:return f++,[3,1];case 4:return[2,!1]}}))}))},e.prototype.clearOldEvents=function(){var e=Date.now();for(var t in this.avoFunctionsEvents)if(this.avoFunctionsEvents.hasOwnProperty(t)&&e-(Number(t)||0)>300){var n=this.avoFunctionsEvents[t];delete this.avoFunctionsEvents[t],delete this.avoFunctionsEventsParams[n]}for(var t in this.manualEvents)this.manualEvents.hasOwnProperty(t)&&e-(Number(t)||0)>300&&(n=this.manualEvents[t],delete this.manualEvents[t],delete this.manualEventsParams[n])},e.prototype._clearEvents=function(){this.avoFunctionsEvents={},this.manualEvents={},this.avoFunctionsEventsParams={},this.manualEventsParams={}},e}();t.AvoDeduplicator=a},945:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.decryptValue=t.encryptValue=t.generateKeyPair=void 0;var s=n(897);function i(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}function a(e){for(var t=new Uint8Array(e.length/2),n=0;n<e.length;n+=2)t[n/2]=parseInt(e.substr(n,2),16);return t}var c=function(){if("undefined"!=typeof globalThis&&globalThis.crypto){var e=globalThis.crypto;if(e&&e.subtle)return e}if("undefined"!=typeof window&&window.crypto){var t=window.crypto;if(t&&t.subtle)return t}if(void 0!==n.g&&n.g.crypto){var r=n.g.crypto;if(r&&r.subtle)return r}var o={hasGlobalThis:"undefined"!=typeof globalThis,hasGlobalThisCrypto:"undefined"!=typeof globalThis&&!!globalThis.crypto,hasGlobalThisCryptoSubtle:"undefined"!=typeof globalThis&&!!globalThis.crypto&&!!globalThis.crypto.subtle,hasWindow:"undefined"!=typeof window,hasWindowCrypto:"undefined"!=typeof window&&!!window.crypto,hasGlobal:void 0!==n.g,hasGlobalCrypto:void 0!==n.g&&!!n.g.crypto,hasGlobalCryptoSubtle:void 0!==n.g&&!!n.g.crypto&&!!n.g.crypto.subtle};throw new Error("crypto.subtle not available. Debug: "+JSON.stringify(o))};function f(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,c().subtle.digest("SHA-256",e)];case 1:return[2,t.sent()]}}))}))}t.generateKeyPair=function(){var e=s.p256.utils.randomPrivateKey(),t=s.p256.getPublicKey(e,!1);return{privateKey:i(e).padStart(64,"0"),publicKey:i(t)}},t.encryptValue=function(e,t){return r(this,void 0,void 0,(function(){var n,r,i,l,u,h,d,p,v,y,g,b,m,w,E,S,I,A,x,B;return o(this,(function(o){switch(o.label){case 0:if(o.trys.push([0,4,,5]),void 0===(n=void 0===e?"null":JSON.stringify(e)))throw new Error("Cannot encrypt undefined value");return r="string"==typeof t?t:String(t),i=a(r),l=s.p256.utils.randomPrivateKey(),u=s.p256.getPublicKey(l,!1),[4,f(s.p256.getSharedSecret(l,i))];case 1:return h=o.sent(),[4,(d=c()).subtle.importKey("raw",h,{name:"AES-GCM"},!1,["encrypt"])];case 2:return p=o.sent(),v=d.getRandomValues(new Uint8Array(16)),y=(new TextEncoder).encode(n),[4,d.subtle.encrypt({name:"AES-GCM",iv:v,tagLength:128},p,y)];case 3:return g=o.sent(),b=new Uint8Array(g),m=b.length-16,w=b.slice(0,m),E=b.slice(m),S=new Uint8Array([0]),I=1+u.length+16+16+w.length,A=new Uint8Array(I),x=0,A.set(S,x),x+=1,A.set(u,x),x+=u.length,A.set(v,x),x+=16,A.set(E,x),x+=16,A.set(w,x),[2,btoa(String.fromCharCode.apply(null,Array.from(A)))];case 4:throw B=o.sent(),new Error("Failed to encrypt value. Please check that the public key is valid. Error: ".concat(B instanceof Error?B.message:String(B)));case 5:return[2]}}))}))},t.decryptValue=function(e,t){return r(this,void 0,void 0,(function(){var n,r,i,l,u,h,d,p,v,y,g,b,m,w,E,S,I,A,x,B,_,O,H;return o(this,(function(o){switch(o.label){case 0:for(o.trys.push([0,4,,5]),n=atob(e),r=new Uint8Array(n.length),i=0;i<n.length;i++)r[i]=n.charCodeAt(i);if(r.length<67)throw new Error("Invalid encrypted data: payload too short");if(l="string"==typeof t?t:String(t),h=r[u=0],u+=1,0!==h)throw new Error("Unsupported encryption version: ".concat(h));if(d=r[u],v=1+(p=2===d||3===d?33:65)+16+16+1,r.length<v)throw new Error("Invalid encrypted data: expected at least ".concat(v," bytes, got ").concat(r.length));return y=r.slice(u,u+p),u+=p,g=r.slice(u,u+16),u+=16,b=r.slice(u,u+16),u+=16,m=r.slice(u),w=a(l),[4,f(s.p256.getSharedSecret(w,y))];case 1:return E=o.sent(),[4,(S=c()).subtle.importKey("raw",E,{name:"AES-GCM"},!1,["decrypt"])];case 2:return I=o.sent(),A=m.length+b.length,(x=new Uint8Array(A)).set(m,0),x.set(b,m.length),[4,S.subtle.decrypt({name:"AES-GCM",iv:g,tagLength:128},I,x)];case 3:return B=o.sent(),_=new TextDecoder,O=_.decode(B),[2,JSON.parse(O)];case 4:throw H=o.sent(),new Error("Failed to decrypt value. Please check that the private key is valid and matches the public key used for encryption. Error: ".concat(H instanceof Error?H.message:String(H)));case 5:return[2]}}))}))}},249:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},e}();t.default=n},611:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoInspector=void 0;var s=n(844),i=n(924),a=n(669),c=n(243),f=n(491),l=n(492),u=n(499),h=n(190),d=n(829),p=n(916),v=n(185),y=n(330).rE,g=function(){function e(t){if((0,v.isValueEmpty)(t.env)?(this.environment=s.AvoInspectorEnv.Dev,console.warn("[Avo Inspector] No environment provided. Defaulting to dev.")):Object.values(s.AvoInspectorEnv).includes(t.env)?this.environment=t.env:(this.environment=s.AvoInspectorEnv.Dev,console.warn("[Avo Inspector] Unsupported environment provided. Defaulting to dev. Supported environments - Dev, Staging, Prod.")),(0,v.isValueEmpty)(t.apiKey))throw new Error("[Avo Inspector] No API key provided. Inspector can't operate without API key.");if(this.apiKey=t.apiKey,(0,v.isValueEmpty)(t.version))throw new Error("[Avo Inspector] No version provided. Many features of Inspector rely on versioning. Please provide comparable string version, i.e. integer or semantic.");this.version=t.version,this.environment===s.AvoInspectorEnv.Dev?(e._batchSize=1,e._shouldLog=!0):(e._batchSize=30,e._batchFlushSeconds=30,e._shouldLog=!1),e.avoStorage=new f.AvoStorage(e._shouldLog,null!=t.suffix?t.suffix:""),this.publicEncryptionKey=t.publicEncryptionKey,this.avoNetworkCallsHandler=new c.AvoNetworkCallsHandler(this.apiKey,this.environment.toString(),t.appName||"",this.version,y,this.publicEncryptionKey),this.avoBatcher=new a.AvoBatcher(this.avoNetworkCallsHandler),this.avoDeduplicator=new l.AvoDeduplicator,this.streamId=d.AvoStreamId.streamId,this.streamId&&(this.eventSpecCache=new u.EventSpecCache(e._shouldLog),this.eventSpecFetcher=new h.AvoEventSpecFetcher(e._networkTimeout,e._shouldLog,this.environment),e._shouldLog&&(console.log("[Avo Inspector] Event spec fetching and validation enabled"),this.publicEncryptionKey&&console.log("[Avo Inspector] Property value encryption enabled")))}return Object.defineProperty(e,"batchSize",{get:function(){return this._batchSize},set:function(e){this._batchSize=e<1?1:e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"batchFlushSeconds",{get:function(){return this._batchFlushSeconds},enumerable:!1,configurable:!0}),Object.defineProperty(e,"shouldLog",{get:function(){return this._shouldLog},set:function(e){this._shouldLog=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"networkTimeout",{get:function(){return this._networkTimeout},set:function(e){this._networkTimeout=e},enumerable:!1,configurable:!0}),e.prototype.trackSchemaFromEvent=function(t,n){return r(this,void 0,void 0,(function(){var r,s,i,a;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),this.avoDeduplicator.shouldRegisterEvent(t,n,!1)?(e.shouldLog&&console.log("Avo Inspector: supplied event "+t+" with params "+JSON.stringify(n)),[4,this.extractSchema(n,!1)]):[3,3];case 1:return r=o.sent(),[4,this.fetchAndValidateEvent(t,n)];case 2:return(s=o.sent())?(i=this.mergeValidationResults(r,s),this.sendEventWithValidation(t,i,null,null,s)):this.trackSchemaInternal(t,r,null,null),[2,r];case 3:return e.shouldLog&&console.log("Avo Inspector: Deduplicated event: "+t),[2,[]];case 4:return[3,6];case 5:return a=o.sent(),console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",a),[2,[]];case 6:return[2]}}))}))},e.prototype._avoFunctionTrackSchemaFromEvent=function(t,n,s,i){return r(this,void 0,void 0,(function(){var r,a,c,f;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),this.avoDeduplicator.shouldRegisterEvent(t,n,!0)?(e.shouldLog&&console.log("Avo Inspector: supplied event "+t+" with params "+JSON.stringify(n)),[4,this.extractSchema(n,!1)]):[3,3];case 1:return r=o.sent(),[4,this.fetchAndValidateEvent(t,n)];case 2:return(a=o.sent())?(c=this.mergeValidationResults(r,a),this.sendEventWithValidation(t,c,s,i,a)):this.trackSchemaInternal(t,r,s,i),[2,r];case 3:return e.shouldLog&&console.log("Avo Inspector: Deduplicated event: "+t),[2,[]];case 4:return[3,6];case 5:return f=o.sent(),console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",f),[2,[]];case 6:return[2]}}))}))},e.prototype.trackSchema=function(t,n){return r(this,void 0,void 0,(function(){var r;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),[4,this.avoDeduplicator.shouldRegisterSchemaFromManually(t,n)];case 1:return o.sent()?(e.shouldLog&&console.log("Avo Inspector: supplied event "+t+" with schema "+JSON.stringify(n)),[4,this.fetchEventSpecIfNeeded(t)]):[3,3];case 2:return o.sent(),this.trackSchemaInternal(t,n,null,null),[3,4];case 3:e.shouldLog&&console.log("Avo Inspector: Deduplicated event: "+t),o.label=4;case 4:return[3,6];case 5:return r=o.sent(),console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",r),[3,6];case 6:return[2]}}))}))},e.prototype.trackSchemaInternal=function(e,t,n,r){try{this.avoBatcher.handleTrackSchema(e,t,n,r)}catch(e){console.error("Avo Inspector: something went wrong. Please report to support@avo.app.",e)}},e.prototype.enableLogging=function(t){e._shouldLog=t},e.prototype.extractSchema=function(t,n){return void 0===n&&(n=!0),r(this,void 0,void 0,(function(){var r;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.avoDeduplicator.hasSeenEventParams(t,!0)&&n&&e.shouldLog&&console.warn("Avo Inspector: WARNING! You are trying to extract schema shape that was just reported by your Avo Codegen. This is an indicator of duplicate inspector reporting. Please reach out to support@avo.app for advice if you are not sure how to handle this."),e.shouldLog&&console.log("Avo Inspector: extracting schema from "+JSON.stringify(t)),[4,i.AvoSchemaParser.extractSchema(t,this.publicEncryptionKey,this.environment)];case 1:return[2,o.sent()];case 2:return r=o.sent(),console.error("Avo Inspector: something went wrong in extractSchema. Please report to support@avo.app.",r),[2,[]];case 3:return[2]}}))}))},e.prototype.setBatchSize=function(t){e._batchSize=t},e.prototype.setBatchFlushSeconds=function(t){e._batchFlushSeconds=t},e.prototype.fetchEventSpecIfNeeded=function(t){return r(this,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:if(this.environment===s.AvoInspectorEnv.Prod)return[2];if(!this.eventSpecCache||!this.eventSpecFetcher||!this.streamId)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),this.eventSpecCache.get(this.apiKey,this.streamId,t)?[2]:[4,this.eventSpecFetcher.fetch({apiKey:this.apiKey,streamId:this.streamId,eventName:t})];case 2:return(n=o.sent())&&this.eventSpecCache&&this.streamId&&this.eventSpecCache.set(this.apiKey,this.streamId,t,n),[3,4];case 3:return r=o.sent(),e.shouldLog&&console.error("[Avo Inspector] Error fetching event spec for ".concat(t,":"),r),[3,4];case 4:return[2]}}))}))},e.prototype.fetchAndValidateEvent=function(t,n){return r(this,void 0,void 0,(function(){var r,i;return o(this,(function(o){switch(o.label){case 0:if(this.environment===s.AvoInspectorEnv.Prod)return[2,null];if(!this.eventSpecCache||!this.eventSpecFetcher||!this.streamId)return[2,null];o.label=1;case 1:return o.trys.push([1,4,,5]),(r=this.eventSpecCache.get(this.apiKey,this.streamId,t))?[3,3]:[4,this.eventSpecFetcher.fetch({apiKey:this.apiKey,streamId:this.streamId,eventName:t})];case 2:(r=o.sent())&&this.eventSpecCache&&this.streamId&&this.eventSpecCache.set(this.apiKey,this.streamId,t,r),o.label=3;case 3:return r?[2,(0,p.validateEvent)(n,r)]:[2,null];case 4:return i=o.sent(),e.shouldLog&&console.error("[Avo Inspector] Error validating event ".concat(t,":"),i),[2,null];case 5:return[2]}}))}))},e.prototype.mergeValidationResults=function(e,t){var n=this;return e.map((function(e){var r=t.propertyResults[e.propertyName];return n.mergePropertyValidation(e,r)}))},e.prototype.mergePropertyValidation=function(e,t){var n=this,r={propertyName:e.propertyName,propertyType:e.propertyType};return e.encryptedPropertyValue&&(r.encryptedPropertyValue=e.encryptedPropertyValue),e.children&&Array.isArray(e.children)&&(r.children=e.children.map((function(e){var r;if("string"==typeof e)return e;if(e&&"object"==typeof e&&e.propertyName){var o=null===(r=null==t?void 0:t.children)||void 0===r?void 0:r[e.propertyName];return n.mergePropertyValidation(e,o)}return e}))),t&&(t.failedEventIds&&(r.failedEventIds=t.failedEventIds),t.passedEventIds&&(r.passedEventIds=t.passedEventIds)),r},e.prototype.sendEventWithValidation=function(t,n,r,o,s){var i,a,c=this;e.shouldLog&&n.some((function(e){return e.failedEventIds&&e.failedEventIds.length>0}))&&console.log('[Avo Inspector] Validation failures for event "'.concat(t,'":'),n.filter((function(e){return e.failedEventIds&&e.failedEventIds.length>0})).map((function(e){return{property:e.propertyName,failedEventIds:e.failedEventIds}})));var f=this.avoNetworkCallsHandler.bodyForEventSchemaCall(t,n,r,o,null!==(i=s.metadata)&&void 0!==i?i:void 0,null===(a=s.metadata)||void 0===a?void 0:a.branchId);this.avoNetworkCallsHandler.callInspectorImmediately(f,(function(s){s?(e.shouldLog&&console.error('[Avo Inspector] Failed to send event "'.concat(t,'" with validation:'),s),c.avoBatcher.handleTrackSchema(t,n,r,o)):e.shouldLog&&console.log('[Avo Inspector] Event "'.concat(t,'" sent successfully with validation'))}))},e._batchSize=30,e._batchFlushSeconds=30,e._shouldLog=!1,e._networkTimeout=2e3,e}();t.AvoInspector=g},844:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AvoInspectorEnv=void 0,t.AvoInspectorEnv={Prod:"prod",Dev:"dev",Staging:"staging"}},243:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AvoNetworkCallsHandler=void 0;var r=n(249),o=n(611),s=n(829),i=function(){function e(e,t,n,r,o,s){this.samplingRate=1,this.sending=!1,this.apiKey=e,this.envName=t,this.appName=n,this.appVersion=r,this.libVersion=o,this.publicEncryptionKey=s}return e.prototype.callInspectorWithBatchBody=function(e,t){var n=this;if(this.sending)t(new Error("Batch sending cancelled because another batch sending is in progress. Your events will be sent with next batch."));else{var r=e.filter((function(e){return null!=e}));this.fixStreamIds(r),0!==r.length&&(this.shouldDropBySampling()?o.AvoInspector.shouldLog&&console.log("Avo Inspector: last event schema dropped due to sampling rate."):(o.AvoInspector.shouldLog&&(console.log("Avo Inspector: events",r),r.forEach((function(e){"sessionStarted"===e.type?console.log("Avo Inspector: sending session started event."):"event"===e.type&&console.log("Avo Inspector: sending event "+e.eventName+" with schema "+JSON.stringify(e.eventProperties))}))),this.sending=!0,this.callInspectorApi(r,(function(e){n.sending=!1,t(e)}))))}},e.prototype.fixStreamIds=function(e){var t=null;e.forEach((function(e){null!==e.streamId&&void 0!==e.streamId&&"unknown"!==e.streamId&&(t=e.streamId)})),e.forEach((function(e){"unknown"===e.streamId&&(e.streamId=null!=t?t:s.AvoStreamId.streamId)}))},e.prototype.bodyForSessionStartedCall=function(){var e=this.createBaseCallBody();return e.type="sessionStarted",e},e.prototype.bodyForEventSchemaCall=function(e,t,n,r,o,s){var i=this.createBaseCallBody();return i.type="event",i.eventName=e,i.eventProperties=t,null!=n?(i.avoFunction=!0,i.eventId=n,i.eventHash=r):(i.avoFunction=!1,i.eventId=null,i.eventHash=null),o&&(i.eventSpecMetadata=o),s&&(i.validatedBranchId=s),i},e.prototype.createBaseCallBody=function(){var e={apiKey:this.apiKey,appName:this.appName,appVersion:this.appVersion,libVersion:this.libVersion,env:this.envName,libPlatform:"web",messageId:r.default.newGuid(),trackingId:"",createdAt:(new Date).toISOString(),sessionId:"",streamId:s.AvoStreamId.streamId,samplingRate:this.samplingRate};return this.publicEncryptionKey&&(e.publicEncryptionKey=this.publicEncryptionKey),e},e.prototype.callInspectorImmediately=function(e,t){"unknown"===e.streamId&&(e.streamId=s.AvoStreamId.streamId),o.AvoInspector.shouldLog&&(console.log("Avo Inspector: calling inspector immediately (with validation)",e.eventName),console.log("Avo Inspector: event body",e)),this.callInspectorApi([e],t)},e.prototype.shouldDropBySampling=function(){return Math.random()>this.samplingRate},e.prototype.callInspectorApi=function(t,n){var r=this,s=new XMLHttpRequest;s.open("POST",e.trackingEndpoint,!0),s.setRequestHeader("Content-Type","text/plain"),s.timeout=o.AvoInspector.networkTimeout,s.send(JSON.stringify(t)),s.onload=function(){if(200!==s.status)n(new Error("Error ".concat(s.status,": ").concat(s.statusText)));else{var e=void 0;try{e=JSON.parse(s.response)}catch(e){return void n(new Error("Failed to parse response: ".concat(e instanceof Error?e.message:String(e))))}null==e||"number"!=typeof e.samplingRate||isNaN(e.samplingRate)||(r.samplingRate=e.samplingRate),n(null)}},s.onerror=function(){n(new Error("Request failed"))},s.ontimeout=function(){n(new Error("Request timed out"))}},e.trackingEndpoint="https://api.avo.app/inspector/v1/track",e}();t.AvoNetworkCallsHandler=i},924:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoSchemaParser=void 0;var s=n(945),i=function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(){function e(){}return e.canSendEncryptedValues=function(e,t){return null!=e&&""!==e&&("dev"===t||"staging"===t)},e.getEncryptedPropertyValueIfEnabled=function(e,t,n){return r(this,void 0,void 0,(function(){var r;return o(this,(function(o){switch(o.label){case 0:if(!t||!n)return[2,void 0];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,(0,s.encryptValue)(e,n)];case 2:return[2,o.sent()];case 3:return r=o.sent(),console.error("[Avo Inspector] Failed to encrypt property value:",r instanceof Error?r.message:String(r)),[2,void 0];case 4:return[2]}}))}))},e.extractSchema=function(e,t,n){return r(this,void 0,void 0,(function(){var s,a,c=this;return o(this,(function(f){switch(f.label){case 0:return null==e?[2,[]]:(s=this.canSendEncryptedValues(t,n),a=function(e){return r(c,void 0,void 0,(function(){var n,c,f,l,u,h,d,p,v,y,g,b=this;return o(this,(function(m){switch(m.label){case 0:return i(e)?[4,Promise.all(e.map((function(e){return r(b,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,a(e)];case 1:return[2,t.sent()]}}))}))})))]:[3,2];case 1:return n=m.sent(),[2,this.removeDuplicates(n)];case 2:if("object"!=typeof e)return[3,10];for(u in c=[],l=[],f=e)l.push(u);h=0,m.label=3;case 3:return h<l.length?(u=l[h])in f?(d=u,e.hasOwnProperty(d)?(p=e[d],v={propertyName:d,propertyType:this.getPropValueType(p)},"object"!=typeof p||null==p?[3,5]:(y=v,[4,a(p)])):[3,8]):[3,8]:[3,9];case 4:return y.children=m.sent(),[3,7];case 5:return void 0===p?[3,7]:[4,this.getEncryptedPropertyValueIfEnabled(p,s,t)];case 6:void 0!==(g=m.sent())&&(v.encryptedPropertyValue=g),m.label=7;case 7:c.push(v),m.label=8;case 8:return h++,[3,3];case 9:return[2,c];case 10:return[2,this.getPropValueType(e)]}}))}))},[4,a(e)]);case 1:return[2,f.sent()]}}))}))},e.removeDuplicates=function(e){var t={boolean:{},number:{},string:{}},n=[];return e.filter((function(e){var r=typeof e;return r in t&&"string"==typeof e?!t[r].hasOwnProperty(e)&&(t[r][e]=!0):!n.includes(e)&&n.push(e)}))},e.getPropValueType=function(e){var t=typeof e;return null==e?"null":"string"===t?"string":"number"===t||"bigint"===t?(e+"").includes(".")?"float":"int":"boolean"===t?"boolean":"object"===t?i(e)?"list":"object":"unknown"},e}();t.AvoSchemaParser=a},491:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoStorage=void 0;var i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.useFallbackStorage=!1,t.fallbackStorage={},t.storageInitialized=!1,t.onStorageInitFuncs=[],t.shouldLog=!1,t.suffix="",t}return r(t,e),t.prototype.init=function(e,t){this.shouldLog=e,this.suffix=t,this.initializeStorageWeb(this.isLocalStorageAvailable())},t.prototype.initializeStorageWeb=function(e){this.storageInitialized=!0,e||(this.useFallbackStorage=!0),this.onStorageInitFuncs.forEach((function(e){e()}))},t.prototype.isLocalStorageAvailable=function(){var e=(new Date).toISOString();try{return window.localStorage.setItem(e,e),window.localStorage.getItem(e)===e&&(window.localStorage.removeItem(e),!0)}catch(e){return!1}},t.prototype.isInitialized=function(){return this.storageInitialized},t.prototype.getItemAsync=function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(n,r){t.runAfterInit((function(){if(t.useFallbackStorage){var r=t.fallbackStorage[e+t.suffix];n(t.parseJson(r))}else if("undefined"!=typeof window){r=void 0;try{r=window.localStorage.getItem(e+t.suffix)}catch(e){t.shouldLog&&console.error("Avo Inspector Storage getItemAsync error:",e),n(null)}n(t.parseJson(r))}else n(null)}))}))];case 1:return[2,n.sent()]}}))}))},t.prototype.getItem=function(e){var t;if(this.storageInitialized){if(this.useFallbackStorage)t=this.fallbackStorage[e+this.suffix];else if("undefined"!=typeof window)try{t=window.localStorage.getItem(e+this.suffix)}catch(e){this.shouldLog&&console.error("Avo Inspector Storage getItem error:",e)}}else t=null;return this.parseJson(t)},t.prototype.setItem=function(e,t){var n=this;this.runAfterInit((function(){if(n.useFallbackStorage)n.fallbackStorage[e+n.suffix]=JSON.stringify(t);else if("undefined"!=typeof window)try{window.localStorage.setItem(e+n.suffix,JSON.stringify(t))}catch(e){n.shouldLog&&console.error("Avo Inspector Storage setItem error:",e)}}))},t.prototype.removeItem=function(e){var t=this;this.runAfterInit((function(){if(t.useFallbackStorage)t.fallbackStorage[e+t.suffix]=null;else if("undefined"!=typeof window)try{window.localStorage.removeItem(e+t.suffix)}catch(e){t.shouldLog&&console.error("Avo Inspector Storage removeItem error:",e)}}))},t.prototype.runAfterInit=function(e){this.storageInitialized?e():this.onStorageInitFuncs.push(e)},t}(function(){function e(){}return e.prototype.parseJson=function(e){return null!=e?JSON.parse(e):null},e}()),a=function(){function e(e,t){void 0===t&&(t=""),this.Platform=null,this.Platform="browser",this.storageImpl=new i,this.storageImpl.init(e,t)}return e.prototype.isInitialized=function(){return this.storageImpl.isInitialized()},e.prototype.getItemAsync=function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.storageImpl.getItemAsync(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.getItem=function(e){return this.storageImpl.getItem(e)},e.prototype.setItem=function(e,t){this.storageImpl.setItem(e,t)},e.prototype.removeItem=function(e){this.storageImpl.removeItem(e)},e.prototype.runAfterInit=function(e){this.storageImpl.runAfterInit(e)},e}();t.AvoStorage=a},829:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AvoStreamId=void 0;var r=n(249),o=n(611),s=function(){function e(){}return Object.defineProperty(e,"streamId",{get:function(){return null===e._streamId||e.shouldReset()?o.AvoInspector.avoStorage.isInitialized()?(e.loadFromStorage(),null!==e._streamId&&e.shouldReset()||null===e._streamId?e.generateAndStoreNew():(e.updateLastActivity(),e._streamId)):"unknown":(e.updateLastActivity(),e._streamId)},enumerable:!1,configurable:!0}),e.shouldReset=function(){if(null===e._createdAt||null===e._lastActivityAt)return!1;var t=Date.now(),n=t-e._createdAt,r=t-e._lastActivityAt;return n>e.MAX_AGE_MS&&r>e.IDLE_THRESHOLD_MS},e.loadFromStorage=function(){try{var t=o.AvoInspector.avoStorage.getItem(e.STREAM_ID_KEY),n=o.AvoInspector.avoStorage.getItem(e.CREATED_AT_KEY),r=o.AvoInspector.avoStorage.getItem(e.LAST_ACTIVITY_KEY);null!=t&&(e._streamId=t,e._createdAt=null!=n?n:Date.now(),e._lastActivityAt=null!=r?r:Date.now())}catch(e){console.error("Avo Inspector: Error reading stream ID from storage. Please report to support@avo.app.",e)}},e.generateAndStoreNew=function(){var t=Date.now();e._streamId=r.default.newGuid(),e._createdAt=t,e._lastActivityAt=t;try{o.AvoInspector.avoStorage.setItem(e.STREAM_ID_KEY,e._streamId),o.AvoInspector.avoStorage.setItem(e.CREATED_AT_KEY,e._createdAt),o.AvoInspector.avoStorage.setItem(e.LAST_ACTIVITY_KEY,e._lastActivityAt)}catch(e){console.error("Avo Inspector: Error saving stream ID to storage. Please report to support@avo.app.",e)}return e._streamId},e.updateLastActivity=function(){var t=Date.now();e._lastActivityAt=t;try{o.AvoInspector.avoStorage.setItem(e.LAST_ACTIVITY_KEY,t)}catch(e){}},Object.defineProperty(e,"storageKey",{get:function(){return e.STREAM_ID_KEY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"createdAtKey",{get:function(){return e.CREATED_AT_KEY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"lastActivityKey",{get:function(){return e.LAST_ACTIVITY_KEY},enumerable:!1,configurable:!0}),e.clearCache=function(){e._streamId=null,e._createdAt=null,e._lastActivityAt=null},e._streamId=null,e._createdAt=null,e._lastActivityAt=null,e.MAX_AGE_MS=144e5,e.IDLE_THRESHOLD_MS=72e5,e.STREAM_ID_KEY="AvoInspectorStreamId",e.CREATED_AT_KEY="AvoInspectorStreamIdCreatedAt",e.LAST_ACTIVITY_KEY="AvoInspectorStreamIdLastActivityAt",e}();t.AvoStreamId=s},499:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EventSpecCache=void 0;var n=function(){function e(e){void 0===e&&(e=!1),this.TTL_MS=3e5,this.MAX_EVENT_COUNT=50,this.globalEventCount=0,this.cache=new Map,this.shouldLog=e}return e.prototype.generateKey=function(e,t,n){return"".concat(e,":").concat(t,":").concat(n)},e.prototype.get=function(e,t,n){var r=this.generateKey(e,t,n),o=this.cache.get(r);return o?this.shouldEvict(o)?(this.shouldLog&&console.log("[EventSpecCache] Cache entry expired for key: ".concat(r)),this.cache.delete(r),null):(this.shouldLog&&console.log("[EventSpecCache] Cache hit for key: ".concat(r)),o.lastAccessed=Date.now(),o.eventCount++,this.globalEventCount++,this.globalEventCount>=this.MAX_EVENT_COUNT&&(this.evictOldest(),this.globalEventCount=0),o.spec):(this.shouldLog&&console.log("[EventSpecCache] Cache miss for key: ".concat(r)),null)},e.prototype.set=function(e,t,n,r){var o=this.generateKey(e,t,n),s=Date.now(),i={spec:r,timestamp:s,lastAccessed:s,eventCount:0};this.cache.set(o,i),this.shouldLog&&console.log("[EventSpecCache] Cached spec for key: ".concat(o))},e.prototype.shouldEvict=function(e){var t=Date.now()-e.timestamp>this.TTL_MS,n=e.eventCount>=this.MAX_EVENT_COUNT;return t||n},e.prototype.evictOldest=function(){if(0!==this.cache.size){var e=null,t=1/0;this.cache.forEach((function(n,r){n.lastAccessed<t&&(t=n.lastAccessed,e=r)})),null!==e&&(this.cache.delete(e),this.shouldLog&&console.log("[EventSpecCache] Evicted LRU entry: ".concat(e)))}},e.prototype.clear=function(){this.cache.clear(),this.globalEventCount=0,this.shouldLog&&console.log("[EventSpecCache] Cache cleared")},e.prototype.size=function(){return this.cache.size},e.prototype.getStats=function(){var e=[],t=Date.now();return this.cache.forEach((function(n,r){e.push({key:r,age:t-n.timestamp,lastAccessedAgo:t-n.lastAccessed,eventCount:n.eventCount})})),{size:this.cache.size,globalEventCount:this.globalEventCount,entries:e}},e}();t.EventSpecCache=n},190:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.AvoEventSpecFetcher=void 0;var o=function(){function e(e,t,n,r){void 0===e&&(e=2e3),void 0===t&&(t=!1),void 0===r&&(r="https://api.avo.app"),this.baseUrl=r,this.timeout=e,this.shouldLog=t,this.env=n,this.inFlightRequests=new Map}return e.prototype.generateRequestKey=function(e){return"".concat(e.streamId,":").concat(e.eventName)},e.prototype.fetch=function(e){return n(this,void 0,void 0,(function(){var t,n,o;return r(this,(function(r){switch(r.label){case 0:if(t=this.generateRequestKey(e),n=this.inFlightRequests.get(t))return this.shouldLog&&console.log("[EventSpecFetcher] Returning existing in-flight request for streamId=".concat(e.streamId,", eventName=").concat(e.eventName)),[2,n];o=this.fetchInternal(e),this.inFlightRequests.set(t,o),r.label=1;case 1:return r.trys.push([1,,3,4]),[4,o];case 2:return[2,r.sent()];case 3:return this.inFlightRequests.delete(t),[7];case 4:return[2]}}))}))},e.prototype.fetchInternal=function(t){return n(this,void 0,void 0,(function(){var n,o,s,i;return r(this,(function(r){switch(r.label){case 0:if("dev"!==this.env&&"staging"!==this.env)return[2,null];n=this.buildUrl(t),this.shouldLog&&(console.log("[EventSpecFetcher] Fetching event spec for: ".concat(t.eventName)),console.log("[EventSpecFetcher] Using base URL: ".concat(this.baseUrl))),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.makeRequest(n)];case 2:return(o=r.sent())?this.hasExpectedShape(o)?(s=e.parseEventSpecResponse(o),this.shouldLog&&console.log("[EventSpecFetcher] Successfully fetched event spec for: ".concat(t.eventName)),[2,s]):(this.shouldLog&&console.warn("[EventSpecFetcher] Invalid event spec response for: ".concat(t.eventName)),[2,null]):(this.shouldLog&&console.warn("[EventSpecFetcher] Failed to fetch event spec for: ".concat(t.eventName)),[2,null]);case 3:return i=r.sent(),this.shouldLog&&console.error("[EventSpecFetcher] Error fetching event spec for: ".concat(t.eventName),i),[2,null];case 4:return[2]}}))}))},e.prototype.buildUrl=function(e){var t=new URLSearchParams({apiKey:e.apiKey,streamId:e.streamId,eventName:e.eventName});return"".concat(this.baseUrl,"/trackingPlan/eventSpec?").concat(t.toString())},e.prototype.makeRequest=function(e){var t=this;return new Promise((function(n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.timeout=t.timeout,r.onload=function(){if(200===r.status)try{var e=JSON.parse(r.responseText);n(e)}catch(e){t.shouldLog&&console.error("[EventSpecFetcher] Failed to parse response:",e),n(null)}else t.shouldLog&&console.warn("[EventSpecFetcher] Request failed with status: ".concat(r.status)),n(null)},r.onerror=function(){t.shouldLog&&console.error("[EventSpecFetcher] Network error occurred"),n(null)},r.ontimeout=function(){t.shouldLog&&console.error("[EventSpecFetcher] Request timed out after ".concat(t.timeout,"ms")),n(null)},r.send()}))},e.prototype.hasExpectedShape=function(e){return e&&"object"==typeof e&&Array.isArray(e.events)&&e.metadata&&"object"==typeof e.metadata&&"string"==typeof e.metadata.schemaId&&"string"==typeof e.metadata.branchId&&"string"==typeof e.metadata.latestActionId},e.parseEventSpecResponse=function(t){return{events:t.events.map(e.parseEventSpecEntry),metadata:t.metadata}},e.parseEventSpecEntry=function(t){for(var n={},r=0,o=Object.entries(t.p);r<o.length;r++){var s=o[r],i=Reflect.get(s,"0"),a=Reflect.get(s,"1");Reflect.set(n,i,e.parsePropertyConstraints(a))}return{branchId:t.b,baseEventId:t.id,variantIds:t.vids,props:n}},e.parsePropertyConstraints=function(t){var n={type:t.t,required:t.r};if(t.l&&(n.isList=t.l),t.p&&(n.pinnedValues=t.p),t.v&&(n.allowedValues=t.v),t.rx&&(n.regexPatterns=t.rx),t.minmax&&(n.minMaxRanges=t.minmax),t.children){n.children={};for(var r=0,o=Object.entries(t.children);r<o.length;r++){var s=o[r],i=s[0],a=s[1];n.children[i]=e.parsePropertyConstraints(a)}}return n},e}();t.AvoEventSpecFetcher=o},916:function(e,t){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function o(e){for(var t={},n=0,o=Object.entries(e);n<o.length;n++){var s=o[n],i=s[0],a=s[1];t[i]=r([],a,!0)}return t}function s(e){for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=r[n],a=i[0],c=i[1];t[a]={type:c.type,required:c.required,pinnedValues:c.pinnedValues?o(c.pinnedValues):void 0,allowedValues:c.allowedValues?o(c.allowedValues):void 0,regexPatterns:c.regexPatterns?o(c.regexPatterns):void 0,minMaxRanges:c.minMaxRanges?o(c.minMaxRanges):void 0,children:c.children?s(c.children):void 0}}return t}function i(e,t){for(var n=0,r=Object.entries(t);n<r.length;n++){var c=r[n],f=c[0],l=c[1];if(e[f]){var u=e[f];a(u,l),l.children&&(u.children?i(u.children,l.children):u.children=s(l.children))}else e[f]={type:l.type,required:l.required,pinnedValues:l.pinnedValues?o(l.pinnedValues):void 0,allowedValues:l.allowedValues?o(l.allowedValues):void 0,regexPatterns:l.regexPatterns?o(l.regexPatterns):void 0,minMaxRanges:l.minMaxRanges?o(l.minMaxRanges):void 0,children:l.children?s(l.children):void 0}}}function a(e,t){if(t.pinnedValues){e.pinnedValues||(e.pinnedValues={});for(var n=0,o=Object.keys(t.pinnedValues);n<o.length;n++){var s=o[n];if(e.pinnedValues[s]){for(var i=new Set(e.pinnedValues[s]),a=0,c=t.pinnedValues[s];a<c.length;a++){var f=c[a];i.add(f)}e.pinnedValues[s]=Array.from(i)}else e.pinnedValues[s]=r([],t.pinnedValues[s],!0)}}if(t.allowedValues){e.allowedValues||(e.allowedValues={});for(var l=0,u=Object.keys(t.allowedValues);l<u.length;l++)if(s=u[l],e.allowedValues[s]){i=new Set(e.allowedValues[s]);for(var h=0,d=t.allowedValues[s];h<d.length;h++)f=d[h],i.add(f);e.allowedValues[s]=Array.from(i)}else e.allowedValues[s]=r([],t.allowedValues[s],!0)}if(t.regexPatterns){e.regexPatterns||(e.regexPatterns={});for(var p=0,v=Object.keys(t.regexPatterns);p<v.length;p++)if(s=v[p],e.regexPatterns[s]){i=new Set(e.regexPatterns[s]);for(var y=0,g=t.regexPatterns[s];y<g.length;y++)f=g[y],i.add(f);e.regexPatterns[s]=Array.from(i)}else e.regexPatterns[s]=r([],t.regexPatterns[s],!0)}if(t.minMaxRanges){e.minMaxRanges||(e.minMaxRanges={});for(var b=0,m=Object.keys(t.minMaxRanges);b<m.length;b++)if(s=m[b],e.minMaxRanges[s]){i=new Set(e.minMaxRanges[s]);for(var w=0,E=t.minMaxRanges[s];w<E.length;w++)f=E[w],i.add(f);e.minMaxRanges[s]=Array.from(i)}else e.minMaxRanges[s]=r([],t.minMaxRanges[s],!0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.validateEvent=void 0;var c=new Map;function f(e){var t=c.get(e);return t||(t=new RegExp(e),c.set(e,t)),t}var l=new Map;function u(e){var t=l.get(e);if(!t)try{var n=JSON.parse(e);t=new Set(n),l.set(e,t)}catch(e){return null}return t}t.validateEvent=function(e,t){for(var r=function(e){for(var t=[],n=0,r=e;n<r.length;n++){var o=r[n];t.push(o.baseEventId);for(var s=0;s<o.variantIds.length;s++)t.push(o.variantIds[s])}return t}(t.events),o=function(e){if(0===e.length)return{};if(1===e.length)return e[0].props;for(var t={},r=0,o=e;r<o.length;r++)for(var c=o[r],f=0,l=Object.entries(c.props);f<l.length;f++){var u=l[f],h=u[0],d=u[1];if(t[h]){var p=t[h];a(p,d),d.children&&(p.children?i(p.children,d.children):p.children=s(d.children))}else t[h]={type:d.type,required:d.required,pinnedValues:d.pinnedValues?n({},d.pinnedValues):void 0,allowedValues:d.allowedValues?n({},d.allowedValues):void 0,regexPatterns:d.regexPatterns?n({},d.regexPatterns):void 0,minMaxRanges:d.minMaxRanges?n({},d.minMaxRanges):void 0,children:d.children?s(d.children):void 0}}return t}(t.events),c={},f=0,l=Object.keys(e);f<l.length;f++){var u=l[f],h=e[u],p=o[u];if(p){var v=d(h,p,r);c[u]=v}else c[u]={}}return{metadata:t.metadata,propertyResults:c}};var h=2;function d(e,t,n,r){void 0===r&&(r=0);var o={};return r>=h?o:t.isList?function(e,t,n,r){var o={};if(!Array.isArray(e))return o;if(t.children){for(var s={},i=function(t,o){for(var i=new Set,a=0,c=e;a<c.length;a++){var f=c[a],l=d(("object"!=typeof f||null===f||Array.isArray(f)?{}:f)[t],o,n,r+1);if(l.failedEventIds)for(var u=0,h=l.failedEventIds;u<h.length;u++){var p=h[u];i.add(p)}if(l.passedEventIds)for(var v=new Set(l.passedEventIds),y=0,g=n;y<g.length;y++)p=g[y],v.has(p)||i.add(p)}if(i.size>0){var b=Array.from(i),m=n.filter((function(e){return!i.has(e)}));m.length<b.length&&m.length>0?s[t]={passedEventIds:m}:s[t]={failedEventIds:b}}},a=0,c=Object.entries(t.children);a<c.length;a++){var f=c[a];i(f[0],f[1])}return Object.keys(s).length>0&&(o.children=s),o}for(var l=new Set,u=0,h=e;u<h.length;u++){var v=h[u];t.pinnedValues&&g(v,t.pinnedValues,l),t.allowedValues&&b(v,t.allowedValues,l),t.regexPatterns&&m(v,t.regexPatterns,l),t.minMaxRanges&&w(v,t.minMaxRanges,l)}return p(l,n)}(e,t,n,r):t.children?function(e,t,n,r){for(var o={},s={},i="object"!=typeof e||null===e||Array.isArray(e)?{}:e,a=0,c=Object.entries(t.children);a<c.length;a++){var f=c[a],l=f[0],u=f[1],h=d(i[l],u,n,r+1);(h.failedEventIds||h.passedEventIds||h.children)&&(s[l]=h)}return Object.keys(s).length>0&&(o.children=s),o}(e,t,n,r):null!=e||t.required?function(e,t,n){var r=new Set;return t.pinnedValues&&g(e,t.pinnedValues,r),t.allowedValues&&b(e,t.allowedValues,r),t.regexPatterns&&m(e,t.regexPatterns,r),t.minMaxRanges&&w(e,t.minMaxRanges,r),p(r,n)}(e,t,n):o}function p(e,t){var n=t.filter((function(t){return!e.has(t)})),r=Array.from(e);return 0===r.length&&0===n.length?{}:n.length<r.length&&n.length>0?{passedEventIds:n}:r.length>0?{failedEventIds:r}:{}}function v(e,t){for(var n=0,r=e;n<r.length;n++){var o=r[n];t.add(o)}}function y(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e)return String(e);if(Array.isArray(e)||"object"==typeof e)try{return JSON.stringify(e)}catch(t){return console.warn("[Avo Inspector] Failed to stringify value: ".concat(t)),String(e)}return String(e)}function g(e,t,n){for(var r=y(e),o=0,s=Object.entries(t);o<s.length;o++){var i=s[o],a=i[0],c=i[1];r!==a&&v(c,n)}}function b(e,t,n){for(var r=y(e),o=0,s=Object.entries(t);o<s.length;o++){var i=s[o],a=i[0],c=i[1],f=u(a);null!==f?f.has(r)||v(c,n):console.warn("[Avo Inspector] Invalid allowed values JSON: ".concat(a))}}function m(e,t,n){if("string"==typeof e)for(var r=0,o=Object.entries(t);r<o.length;r++){var s=o[r],i=s[0];l=s[1];try{f(i).test(e)||v(l,n)}catch(e){console.warn("[Avo Inspector] Invalid regex pattern: ".concat(i))}}else for(var a=0,c=Object.values(t);a<c.length;a++){var l;v(l=c[a],n)}}function w(e,t,n){if("number"==typeof e)if(Number.isNaN(e)){console.warn("[Avo Inspector] NaN value fails min/max constraint");for(var r=0,o=Object.values(t);r<o.length;r++)v(m=o[r],n)}else for(var s=0,i=Object.entries(t);s<i.length;s++){var a=i[s],c=a[0],f=(m=a[1],c.split(",")),l=f[0],u=f[1],h=""!==l&&void 0!==l,d=""!==u&&void 0!==u,p=h?parseFloat(l):-1/0,y=d?parseFloat(u):1/0;h&&isNaN(p)||d&&isNaN(y)?console.warn("[Avo Inspector] Invalid min/max range: ".concat(c)):(e<p||e>y)&&v(m,n)}else for(var g=0,b=Object.values(t);g<b.length;g++){var m;v(m=b[g],n)}}},185:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deepEquals=t.isValueEmpty=void 0,t.isValueEmpty=function(e){return null==e||0==e.trim().length},t.deepEquals=function e(t,n){if(t===n)return!0;if(!(t instanceof Object&&n instanceof Object))return!1;if(t.constructor!==n.constructor)return!1;for(var r in t)if(t.hasOwnProperty(r)){if(!n.hasOwnProperty(r))return!1;if(t[r]!==n[r]){if("object"!=typeof t[r])return!1;if(!e(t[r],n[r]))return!1}}for(r in n)if(n.hasOwnProperty(r)&&!t.hasOwnProperty(r))return!1;return!0}},330:e=>{e.exports=JSON.parse('{"rE":"3.0.0-alpha.2"}')}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.AvoInspectorEnv=e.AvoInspector=void 0;var t=n(611);Object.defineProperty(e,"AvoInspector",{enumerable:!0,get:function(){return t.AvoInspector}});var o=n(844);Object.defineProperty(e,"AvoInspectorEnv",{enumerable:!0,get:function(){return o.AvoInspectorEnv}})})(),r})()));
@@ -1,5 +1,3 @@
1
- /*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
2
-
3
1
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
4
2
 
5
3
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "avo-inspector",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-alpha.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "browser": "dist/index.js",
@@ -36,12 +36,11 @@
36
36
  },
37
37
  "homepage": "https://github.com/avohq/web-avo-inspector#readme",
38
38
  "dependencies": {
39
- "elliptic": "^6.6.1"
39
+ "@noble/curves": "^1.4.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@babel/core": "^7.25.2",
43
43
  "@babel/preset-env": "^7.25.3",
44
- "@types/elliptic": "^6.4.18",
45
44
  "@types/jest": "^29.5.12",
46
45
  "@types/node": "^22.3.0",
47
46
  "@typescript-eslint/eslint-plugin": "^8.1.0",