bringid-sdk 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.BringSDK=e(require("react"),require("react-dom")):t.BringSDK=e(t.react,t["react-dom"])}(this,((t,e)=>(()=>{var n={768:(t,e)=>{"use strict";e.byteLength=function(t){var e=c(t),n=e[0],o=e[1];return 3*(n+o)/4-o},e.toByteArray=function(t){var e,n,r=c(t),a=r[0],s=r[1],l=new i(function(t,e,n){return 3*(e+n)/4-n}(0,a,s)),d=0,u=s>0?a-4:a;for(n=0;n<u;n+=4)e=o[t.charCodeAt(n)]<<18|o[t.charCodeAt(n+1)]<<12|o[t.charCodeAt(n+2)]<<6|o[t.charCodeAt(n+3)],l[d++]=e>>16&255,l[d++]=e>>8&255,l[d++]=255&e;return 2===s&&(e=o[t.charCodeAt(n)]<<2|o[t.charCodeAt(n+1)]>>4,l[d++]=255&e),1===s&&(e=o[t.charCodeAt(n)]<<10|o[t.charCodeAt(n+1)]<<4|o[t.charCodeAt(n+2)]>>2,l[d++]=e>>8&255,l[d++]=255&e),l},e.fromByteArray=function(t){for(var e,o=t.length,i=o%3,r=[],a=16383,c=0,l=o-i;c<l;c+=a)r.push(s(t,c,c+a>l?l:c+a));return 1===i?(e=t[o-1],r.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[o-2]<<8)+t[o-1],r.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),r.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=r[a],o[r.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function s(t,e,o){for(var i,r,a=[],c=e;c<o;c+=3)i=(t[c]<<16&16711680)+(t[c+1]<<8&65280)+(255&t[c+2]),a.push(n[(r=i)>>18&63]+n[r>>12&63]+n[r>>6&63]+n[63&r]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},545:(t,e,n)=>{"use strict";const o=n(768),i=n(773),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=s,e.IS=50;const a=2147483647;function c(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return l(t,e,n)}function l(t,e,n){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|p(t,e);let o=c(n);const i=o.write(t,e);return i!==n&&(o=o.slice(0,i)),o}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return g(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return g(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return g(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const o=t.valueOf&&t.valueOf();if(null!=o&&o!==t)return s.from(o,e,n);const i=function(t){if(s.isBuffer(t)){const e=0|h(t.length),n=c(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||W(t.length)?c(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function d(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return d(t),c(t<0?0:0|h(t))}function f(t){const e=t.length<0?0:0|h(t.length),n=c(e);for(let o=0;o<e;o+=1)n[o]=255&t[o];return n}function g(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let o;return o=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(o,s.prototype),o}function h(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(t).length;default:if(i)return o?-1:V(t).length;e=(""+e).toLowerCase(),i=!0}}function _(t,e,n){let o=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,n);case"utf8":case"utf-8":return v(this,e,n);case"ascii":return B(this,e,n);case"latin1":case"binary":return F(this,e,n);case"base64":return x(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,n);default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function m(t,e,n){const o=t[e];t[e]=t[n],t[n]=o}function y(t,e,n,o,i){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),W(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=s.from(e,o)),s.isBuffer(e))return 0===e.length?-1:L(t,e,n,o,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):L(t,[e],n,o,i);throw new TypeError("val must be string, number or Buffer")}function L(t,e,n,o,i){let r,a=1,c=t.length,s=e.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(t.length<2||e.length<2)return-1;a=2,c/=2,s/=2,n/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){let o=-1;for(r=n;r<c;r++)if(l(t,r)===l(e,-1===o?0:r-o)){if(-1===o&&(o=r),r-o+1===s)return o*a}else-1!==o&&(r-=r-o),o=-1}else for(n+s>c&&(n=c-s),r=n;r>=0;r--){let n=!0;for(let o=0;o<s;o++)if(l(t,r+o)!==l(e,o)){n=!1;break}if(n)return r}return-1}function b(t,e,n,o){n=Number(n)||0;const i=t.length-n;o?(o=Number(o))>i&&(o=i):o=i;const r=e.length;let a;for(o>r/2&&(o=r/2),a=0;a<o;++a){const o=parseInt(e.substr(2*a,2),16);if(W(o))return a;t[n+a]=o}return a}function A(t,e,n,o){return Y(V(e,t.length-n),t,n,o)}function w(t,e,n,o){return Y(function(t){const e=[];for(let n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,o)}function I(t,e,n,o){return Y(H(e),t,n,o)}function C(t,e,n,o){return Y(function(t,e){let n,o,i;const r=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),o=n>>8,i=n%256,r.push(i),r.push(o);return r}(e,t.length-n),t,n,o)}function x(t,e,n){return 0===e&&n===t.length?o.fromByteArray(t):o.fromByteArray(t.slice(e,n))}function v(t,e,n){n=Math.min(t.length,n);const o=[];let i=e;for(;i<n;){const e=t[i];let r=null,a=e>239?4:e>223?3:e>191?2:1;if(i+a<=n){let n,o,c,s;switch(a){case 1:e<128&&(r=e);break;case 2:n=t[i+1],128==(192&n)&&(s=(31&e)<<6|63&n,s>127&&(r=s));break;case 3:n=t[i+1],o=t[i+2],128==(192&n)&&128==(192&o)&&(s=(15&e)<<12|(63&n)<<6|63&o,s>2047&&(s<55296||s>57343)&&(r=s));break;case 4:n=t[i+1],o=t[i+2],c=t[i+3],128==(192&n)&&128==(192&o)&&128==(192&c)&&(s=(15&e)<<18|(63&n)<<12|(63&o)<<6|63&c,s>65535&&s<1114112&&(r=s))}}null===r?(r=65533,a=1):r>65535&&(r-=65536,o.push(r>>>10&1023|55296),r=56320|1023&r),o.push(r),i+=a}return function(t){const e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);let n="",o=0;for(;o<e;)n+=String.fromCharCode.apply(String,t.slice(o,o+=E));return n}(o)}s.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,n){return l(t,e,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,n){return function(t,e,n){return d(t),t<=0?c(t):void 0!==e?"string"==typeof n?c(t).fill(e,n):c(t).fill(e):c(t)}(t,e,n)},s.allocUnsafe=function(t){return u(t)},s.allocUnsafeSlow=function(t){return u(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(J(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),J(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,o=e.length;for(let i=0,r=Math.min(n,o);i<r;++i)if(t[i]!==e[i]){n=t[i],o=e[i];break}return n<o?-1:o<n?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const o=s.allocUnsafe(e);let i=0;for(n=0;n<t.length;++n){let e=t[n];if(J(e,Uint8Array))i+e.length>o.length?(s.isBuffer(e)||(e=s.from(e)),e.copy(o,i)):Uint8Array.prototype.set.call(o,e,i);else{if(!s.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(o,i)}i+=e.length}return o},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},s.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},s.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},s.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?v(this,0,t):_.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){let t="";const n=e.IS;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(t,e,n,o,i){if(J(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),e<0||n>t.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(this===t)return 0;let r=(i>>>=0)-(o>>>=0),a=(n>>>=0)-(e>>>=0);const c=Math.min(r,a),l=this.slice(o,i),d=t.slice(e,n);for(let t=0;t<c;++t)if(l[t]!==d[t]){r=l[t],a=d[t];break}return r<a?-1:a<r?1:0},s.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},s.prototype.indexOf=function(t,e,n){return y(this,t,e,n,!0)},s.prototype.lastIndexOf=function(t,e,n){return y(this,t,e,n,!1)},s.prototype.write=function(t,e,n,o){if(void 0===e)o="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)o=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===o&&(o="utf8")):(o=n,n=void 0)}const i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let r=!1;for(;;)switch(o){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return A(this,t,e,n);case"ascii":case"latin1":case"binary":return w(this,t,e,n);case"base64":return I(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,e,n);default:if(r)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),r=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const E=4096;function B(t,e,n){let o="";n=Math.min(t.length,n);for(let i=e;i<n;++i)o+=String.fromCharCode(127&t[i]);return o}function F(t,e,n){let o="";n=Math.min(t.length,n);for(let i=e;i<n;++i)o+=String.fromCharCode(t[i]);return o}function O(t,e,n){const o=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>o)&&(n=o);let i="";for(let o=e;o<n;++o)i+=X[t[o]];return i}function S(t,e,n){const o=t.slice(e,n);let i="";for(let t=0;t<o.length-1;t+=2)i+=String.fromCharCode(o[t]+256*o[t+1]);return i}function P(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,n,o,i,r){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<r)throw new RangeError('"value" argument is out of bounds');if(n+o>t.length)throw new RangeError("Index out of range")}function U(t,e,n,o,i){R(e,o,i,t,n,7);let r=Number(e&BigInt(4294967295));t[n++]=r,r>>=8,t[n++]=r,r>>=8,t[n++]=r,r>>=8,t[n++]=r;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,n}function k(t,e,n,o,i){R(e,o,i,t,n,7);let r=Number(e&BigInt(4294967295));t[n+7]=r,r>>=8,t[n+6]=r,r>>=8,t[n+5]=r,r>>=8,t[n+4]=r;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=a,a>>=8,t[n+2]=a,a>>=8,t[n+1]=a,a>>=8,t[n]=a,n+8}function M(t,e,n,o,i,r){if(n+o>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function T(t,e,n,o,r){return e=+e,n>>>=0,r||M(t,0,n,4),i.write(t,e,n,o,23,4),n+4}function z(t,e,n,o,r){return e=+e,n>>>=0,r||M(t,0,n,8),i.write(t,e,n,o,52,8),n+8}s.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);const o=this.subarray(t,e);return Object.setPrototypeOf(o,s.prototype),o},s.prototype.readUintLE=s.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||P(t,e,this.length);let o=this[t],i=1,r=0;for(;++r<e&&(i*=256);)o+=this[t+r]*i;return o},s.prototype.readUintBE=s.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||P(t,e,this.length);let o=this[t+--e],i=1;for(;e>0&&(i*=256);)o+=this[t+--e]*i;return o},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readBigUInt64LE=Z((function(t){q(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const o=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(o)+(BigInt(i)<<BigInt(32))})),s.prototype.readBigUInt64BE=Z((function(t){q(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const o=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(o)<<BigInt(32))+BigInt(i)})),s.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||P(t,e,this.length);let o=this[t],i=1,r=0;for(;++r<e&&(i*=256);)o+=this[t+r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},s.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||P(t,e,this.length);let o=e,i=1,r=this[t+--o];for(;o>0&&(i*=256);)r+=this[t+--o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},s.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readBigInt64LE=Z((function(t){q(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const o=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(o)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),s.prototype.readBigInt64BE=Z((function(t){q(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const o=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(o)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+n)})),s.prototype.readFloatLE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,n,o){t=+t,e>>>=0,n>>>=0,o||j(this,t,e,n,Math.pow(2,8*n)-1,0);let i=1,r=0;for(this[e]=255&t;++r<n&&(i*=256);)this[e+r]=t/i&255;return e+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(t,e,n,o){t=+t,e>>>=0,n>>>=0,o||j(this,t,e,n,Math.pow(2,8*n)-1,0);let i=n-1,r=1;for(this[e+i]=255&t;--i>=0&&(r*=256);)this[e+i]=t/r&255;return e+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigUInt64LE=Z((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeBigUInt64BE=Z((function(t){return k(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeIntLE=function(t,e,n,o){if(t=+t,e>>>=0,!o){const o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}let i=0,r=1,a=0;for(this[e]=255&t;++i<n&&(r*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/r|0)-a&255;return e+n},s.prototype.writeIntBE=function(t,e,n,o){if(t=+t,e>>>=0,!o){const o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}let i=n-1,r=1,a=0;for(this[e+i]=255&t;--i>=0&&(r*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/r|0)-a&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigInt64LE=Z((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeBigInt64BE=Z((function(t){return k(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeFloatLE=function(t,e,n){return T(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return T(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return z(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return z(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,o){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o<n&&(o=n),o===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e<o-n&&(o=t.length-e+n);const i=o-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,o):Uint8Array.prototype.set.call(t,this.subarray(n,o),e),i},s.prototype.fill=function(t,e,n,o){if("string"==typeof t){if("string"==typeof e?(o=e,e=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(1===t.length){const e=t.charCodeAt(0);("utf8"===o&&e<128||"latin1"===o)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{const r=s.isBuffer(t)?t:s.from(t,o),a=r.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<n-e;++i)this[i+e]=r[i%a]}return this};const Q={};function N(t,e,n){Q[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name="".concat(this.name," [").concat(t,"]"),this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return"".concat(this.name," [").concat(t,"]: ").concat(this.message)}}}function D(t){let e="",n=t.length;const o="-"===t[0]?1:0;for(;n>=o+4;n-=3)e="_".concat(t.slice(n-3,n)).concat(e);return"".concat(t.slice(0,n)).concat(e)}function R(t,e,n,o,i,r){if(t>n||t<e){const o="bigint"==typeof e?"n":"";let i;throw i=r>3?0===e||e===BigInt(0)?">= 0".concat(o," and < 2").concat(o," ** ").concat(8*(r+1)).concat(o):">= -(2".concat(o," ** ").concat(8*(r+1)-1).concat(o,") and < 2 ** ")+"".concat(8*(r+1)-1).concat(o):">= ".concat(e).concat(o," and <= ").concat(n).concat(o),new Q.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,n){q(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||G(e,t.length-(n+1))}(o,i,r)}function q(t,e){if("number"!=typeof t)throw new Q.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,n){if(Math.floor(t)!==t)throw q(t,n),new Q.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new Q.ERR_BUFFER_OUT_OF_BOUNDS;throw new Q.ERR_OUT_OF_RANGE(n||"offset",">= ".concat(n?1:0," and <= ").concat(e),t)}N("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),N("ERR_INVALID_ARG_TYPE",(function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(typeof e)}),TypeError),N("ERR_OUT_OF_RANGE",(function(t,e,n){let o='The value of "'.concat(t,'" is out of range.'),i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=D(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),o+=" It must be ".concat(e,". Received ").concat(i),o}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function V(t,e){let n;e=e||1/0;const o=t.length;let i=null;const r=[];for(let a=0;a<o;++a){if(n=t.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&r.push(239,191,189);continue}if(a+1===o){(e-=3)>-1&&r.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&r.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&r.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;r.push(n)}else if(n<2048){if((e-=2)<0)break;r.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function H(t){return o.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Y(t,e,n,o){let i;for(i=0;i<o&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function W(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const o=16*n;for(let i=0;i<16;++i)e[o+i]=t[n]+t[i]}return e}();function Z(t){return"undefined"==typeof BigInt?$:t}function $(){throw new Error("BigInt not supported")}},532:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,o,i,r){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(o)for(var c=0;c<this.length;c++){var s=this[c][0];null!=s&&(a[s]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);o&&a[d[0]]||(void 0!==r&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),e.push(d))}},e}},151:t=>{"use strict";t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},547:t=>{"use strict";t.exports=function(t){return t[1]}},495:t=>{"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var o,i,r;if(Array.isArray(e)){if((o=e.length)!=n.length)return!1;for(i=o;0!=i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((o=(r=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=o;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,r[i]))return!1;for(i=o;0!=i--;){var a=r[i];if(!t(e[a],n[a]))return!1}return!0}return e!=e&&n!=n}},416:(t,e,n)=>{"use strict";var o=n(386),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};function s(t){return o.isMemo(t)?a:c[t.$$typeof]||i}c[o.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},c[o.Memo]=a;var l=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,h=Object.prototype;t.exports=function t(e,n,o){if("string"!=typeof n){if(h){var i=g(n);i&&i!==h&&t(e,i,o)}var a=d(n);u&&(a=a.concat(u(n)));for(var c=s(e),p=s(n),_=0;_<a.length;++_){var m=a[_];if(!(r[m]||o&&o[m]||p&&p[m]||c&&c[m])){var y=f(n,m);try{l(e,m,y)}catch(t){}}}}return e}},518:(t,e)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,o=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,d=n?Symbol.for("react.async_mode"):60111,u=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,g=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,p=n?Symbol.for("react.memo"):60115,_=n?Symbol.for("react.lazy"):60116,m=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,L=n?Symbol.for("react.responder"):60118,b=n?Symbol.for("react.scope"):60119;function A(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case o:switch(t=t.type){case d:case u:case r:case c:case a:case g:return t;default:switch(t=t&&t.$$typeof){case l:case f:case _:case p:case s:return t;default:return e}}case i:return e}}}function w(t){return A(t)===u}e.AsyncMode=d,e.ConcurrentMode=u,e.ContextConsumer=l,e.ContextProvider=s,e.Element=o,e.ForwardRef=f,e.Fragment=r,e.Lazy=_,e.Memo=p,e.Portal=i,e.Profiler=c,e.StrictMode=a,e.Suspense=g,e.isAsyncMode=function(t){return w(t)||A(t)===d},e.isConcurrentMode=w,e.isContextConsumer=function(t){return A(t)===l},e.isContextProvider=function(t){return A(t)===s},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===o},e.isForwardRef=function(t){return A(t)===f},e.isFragment=function(t){return A(t)===r},e.isLazy=function(t){return A(t)===_},e.isMemo=function(t){return A(t)===p},e.isPortal=function(t){return A(t)===i},e.isProfiler=function(t){return A(t)===c},e.isStrictMode=function(t){return A(t)===a},e.isSuspense=function(t){return A(t)===g},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===u||t===c||t===a||t===g||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===_||t.$$typeof===p||t.$$typeof===s||t.$$typeof===l||t.$$typeof===f||t.$$typeof===y||t.$$typeof===L||t.$$typeof===b||t.$$typeof===m)},e.typeOf=A},386:(t,e,n)=>{"use strict";t.exports=n(518)},773:(t,e)=>{e.read=function(t,e,n,o,i){var r,a,c=8*i-o-1,s=(1<<c)-1,l=s>>1,d=-7,u=n?i-1:0,f=n?-1:1,g=t[e+u];for(u+=f,r=g&(1<<-d)-1,g>>=-d,d+=c;d>0;r=256*r+t[e+u],u+=f,d-=8);for(a=r&(1<<-d)-1,r>>=-d,d+=o;d>0;a=256*a+t[e+u],u+=f,d-=8);if(0===r)r=1-l;else{if(r===s)return a?NaN:1/0*(g?-1:1);a+=Math.pow(2,o),r-=l}return(g?-1:1)*a*Math.pow(2,r-o)},e.write=function(t,e,n,o,i,r){var a,c,s,l=8*r-i-1,d=(1<<l)-1,u=d>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,g=o?0:r-1,h=o?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),(e+=a+u>=1?f/s:f*Math.pow(2,1-u))*s>=2&&(a++,s/=2),a+u>=d?(c=0,a=d):a+u>=1?(c=(e*s-1)*Math.pow(2,i),a+=u):(c=e*Math.pow(2,u-1)*Math.pow(2,i),a=0));i>=8;t[n+g]=255&c,g+=h,c/=256,i-=8);for(a=a<<i|c,l+=i;l>0;t[n+g]=255&a,g+=h,a/=256,l-=8);t[n+g-h]|=128*p}},53:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default={C:["DumlkrqalRjQWYbWVvQMIRTEmTwRuymTjSHUcwTNjm4=","APFEUjXyFIxZhlhxafwbzYh7CNTQCGjfVpb/9AlW6GQ=","CN/zSH6KyZ4fKaBY0PqAuTDHKHMLerNs6HnziQ7Pc/U=","Lye+aQ/a7kbDzij3UysTyFbDU0LIS9puIJZjEPrcAdA=","KyrhrPaLe40kFr6/PU9iNLdj/gS4BD7ki4MnvryhbPI=","AxnQYgcr737MperAb5fU1VlSwXWrawPq5ktEx9vxHPo=","KIE9yuuuqoKKN234evSmO8i3vyetScYpjvezh78oUm0=","JydnOyzLyQPxgb844cHUDSAzhlIAw1K8FQkord35y3g=","I07EXKJ3J8LnSr0rKhSUzW771D40BYfWuPueMeZcxjI=","FbUlNAMa4Y9/hiyyz3z3YKsQqBUKM3sczZn/boeX1Cg=","Dcj61tnks19e2aPRhrec444Oio0bWLEy1wHU7s9o0fY=","G82V/8IR+8pgD3BfrT+1Z+pOs3j2Lh/sl4BVGKR+TZw=","EFILCrchyt/p7/gbAW/DTcdto2wleJN4F8uXjQad5Vk=","H21IFJuOf32bJX2O1fu69CkySYB1/tCs6IqeuB9WJ/Y=","HZZV9lIwkBTSngDvNaIIm//43ByBbw3JyjS9tUYMhwU=","BN9aVv+VvK+wUfexzUOpm6cx/2fkcDIFj+PUGFaXzH0=","BnLZlfj/9kAVGz0pDO2vFIaQoQqMhCSn9uwoK25L6Cg=","CZlStBSIRFSyEgDX/6/dXwyancwG8nCOn8HYIJtcdbk=","BSy6IlXf0Ax8SDFDuo1GlEjkNYaptM2Rg/0OhDprn6Y=","C4ut7mkK246wvXRxK3mZr4LeVXByUa13Fgd8uTxGTdw=","EZsVkPEzB69aHuZRAgwHx0nBXWBoOoBQuWPQqOSyvdE=","AxULfNbV0XslKdNr4PZ7gyxKz8iE707lzhW+C/tKjQk=","LMYYLF4UVG488ZUfFzkSNVN077g9gImKvmnLMXyepWU=","AFAyVR5jeMRQz+EppASzdkIYyt7awU4rktLNcxEb8Pk=","IzI34yibqjS7FH6XLry5UWRpw5n8wGn7iPnaLMKCdrU=","Bcj09OvUpuPJgNMWdL++YyMDfyGzSuWk6AwtTCTWAoA=","CnsdsTBC05a6BdgYoxnyUlK8817zru2R7h8JslkPxls=","KnO3H5shDPWxQpZXLJ0y2/FW4rCG/0fcXfVCNlpATsA=","GsmwQXq8yaGTUQfp/8kdw+wY8sTb5/Ipdqdgu1xQxGA=","EsAzmuCDdII/q7B2cH70eSafPk1ssQQ0kBXuBG3JP8A=","C3R1sQKhZa1/WxjbTh5wT1KQCqMlO6rGgkZoLlbpoo4=","A3woSeGRyj7bHF5J9ui4kXyEPjeTZvLqMqs6qI1/hEg=","BaaBH4VW8BTpJnRmHiF+m9UgbFyToH3BRf2xdqcWNG8=","KaeV59mAKJRulHt11U6fBEB26Hp7KIO0e2de9fOL1m4=","IEOaDISzIutFo4V6/Bj1gm6Mc4LIoVhcUHvhmZgf0i8=","Lguo2U2ez0qU7CBQxzcf8btQ8neZqEttSipvKgmCyIc=","FD/RFc4I+yfKOOt8zoIrRReCLNIQkEjS5tDdzKF9ccg=","DGTL7LHHNLhXlo273PgTzfhhFlkyPby/yEMjYjvpyvE=","AoowWEfGg/ZG/KklwWP/WudPNI1iwrZw8UJs75QD2lM=","Lk71EP8Lb9pfqUCrTEOA8mpry2TYlCe4JNZ1W1254ww=","AIHJW8QzhOZj15JwyVbOO4kltPbQM7B4uWOE9QV5QA4=","LtXwyRy9l0kYfi+t5ofgXuJJGzScA5oLuoqfQCOguzg=","MFCZkfiNo1BLvzdO1ari8DRIoix2I0yMmQ8B8zpzUgY=","HD8g/VVAmlMiG3xNSaNWufChEZ+yBntBp1KQlEJOxq0=","ELTn86td8AMElRRFm24Y7sRrsiE+jhMeFwiHtH3cuWw=","KhmCl5w/9/Q93VQ9iRwqvd2A+ATAd9d1A5qjUC5Dre8=","HHTuZPFeHbb+3b6tVtbVXbpDHrw5bJr5XK0PExW9XJE=","B1M+yFC6f5jquTA8rOAbS55PLouCcIz6nC/kWgrhRqA=","IVdrQ45QBEmhUeTurxexVChcaPQtQsGAihGr83ZMB1A=","LxfAVZuP55YIrVyhk9YvELzoOEyBXwkGdD1pMINtSp4=","LUd+OGLQdwinnoqulGFwvJd1pCATGEdK5mWwsbficw4=","Fi9SQ5ZwZMOQ4JVXeYTyka+6ImbDj1q82Jvg9bJ0fqs=","K0yyM+3pukgmTs0siuUNGteoWWqH8p+Kd3enAJI5MxE=","LI+8st2Fc9wduvj0YihUd22y7s5thcTPQlTnw14DsHo=","HW80dyXkgWry/0U/DNVrGZ4bYen2Aemt5eiNuHCUnak=","IEsMOX9OvnHrwtiz31uRPfnmrAK2jTEyTNSa9cRWVSk=","DEy53DxP2BdPEUmzxjw8L57LgnzX3CVTT/j7dbx5xQI=","F0rWGhRIyJmiVBZHT0kwMB5cSUdSeeBjmmFt3EW8e1Q=","GpYXe89NjYn3Wd9OwvPN4uqqKMF3zA+hOpgW1Jo40u8=","Bm0EskMx1xzQ74BUvGDE/wUgLBJqIzwagkKs42C4owo=","KkxPxuwLDPUhlXgoccbdOzgcxl9y4CrVJwN6Yqob2AQ=","E6stE2zPN9RH6fLhSnztyV5yf4RG9tnX5Vr8ASGf1kk=","ESFVL8omBhYZ0k2EPcgnacGwT87Cb1UZTC4+hprMapo=","AO9lMyKxPWyIm8gXFcN9d6bNJn1ZXEqJCaVUbHyXz/E=","DiVIPkWmZSCLJh2Lp0BR5kAMd21lJZXZhFrKNdijl9M=","KfU23LnddoIkUmRlnhXYjjlaw9Td6S2MRkSNuXnuuok=","KlbvnyxT/rrf2jNXXb29iFoSTieAu+oXDkVrqs4Ppb4=","HINhx461z13s+3otF7XECfKuKZmkZ2Lo7kFiQKjLmvE=","FRr/XziyCg/ARzCJqvAga4Po5op2RQe/09CrS+dDGcU=","BMYYfkHtiB3BsjnIj3+dQ6n1L8jIts3R525HYVtR8QA=","E7N72A9NJ/sQ2EMx9vttU0uBxh7RV3ZEnoAbfdycKWc=","AaXFNic8LZ31eL+9MsF7eizjZkwqUgMskyHOscToqOQ=","KrNWGDTKc4Na0F9desuVC0qaLGZrlybagyI5Blt8OwI=","HU2OwpHnINsgD+bWhsDWE6yvavTpXTv2n37VFqWXtkY=","BBKU0sxITSKPV4T+eRn9K7klNRJAoEtxFRTJyAtlrx0=","FUrJjgFwjGEcT6cVmR8ASJj1eTnRJuOSBClx3ZDoH8Y=","CzOdisyn1Pg+7dhAk671EFCzaEyI+LCwRSRWO8bqTaQ=","CVXknmYQyUJUpPhM+6s0RZjw5x6v9Kfdge2VtQg5yC4=","BnRqYVbrpUQmueIiBvFavKmm9B5vU1xvNSVAHqBlRiY=","Dxj1oOzRQjxJbzggxUnCeDjleQ4r0KGWrJF8f/Mgd/s=","BPbuyhdR9zCKxZ7/W+smHku1Y1g+3nvJKnOCI9b3bhM=","K1aXM2TExPXBo+xNo83OA4gR6xFvs+RbwXaNJvwLN1g=","Ejdp3UnVsFTc12uJgEsby44TkrOFcWpdg/62XUN/Ke8=","IUe0JPxIyAqI7lK5EWmqzqmJ9kRkcRUJlCV7L7AcY+k=","D9wfWFSLhXAabFUF6jMqKWR+bzStQkPC6lStiXzr5U0=","Ejc6glH+oATfaKvPD3eG1Lzv8oxdu+DDlE9oXMCgsfI=","IeT06l81+FutfqUv90LJ6KZCdWtq9EID3YofNcGpADU=","FiQ5FtadLKPftHIiJNTEYrVzZkkvRekNioGTTxvDsUc=","HvvkbdeleLT2b5rbyItDeKvCFWbhoEU8oTpBWcrASsI=","B+pehTfPXdCIhgIOI6fzh9Ro1VJb5m+FO2csyWqIlpo=","BajE+ZaLiqO3tHijD5pbY2UPGadefOEcqf4WwLdsALw=","IPBXcSzCFlT7/lm9NF6NrD94GMcBuceILZ1Xtyoy6D8=","BKEu3tqd/WiWcvjGf+4xY23NjojQHUkBm9kLM+sz22k=","J+iNjBXzfc7kTx5UJaUd7L0TbOUJGmdn5J7JVEzNEBo=","L+7Re4QoXtm4pcjF6VpB9m4JZhmncDIjF2xB7kM95NE=","HtfMdu30XHxAQkFCD3Kc85TllCkRMSoNaXK4vVOv8rg=","FXQumbm/oyMVf/jFhvVmDqxng0dhRM3K3yh0vkVGaxo=","GqwoU4f2XoLIlfxoh930BXcQdFTG7AMXKE8DPyfQx4U=","JYUcPIRdR5D53a29tgVzV4MuLnpJd19x7HWpZVTWfHc=","FaWCFWXMLsLOeEV9sZft81O367osVSM3DdzMPZ8Uamc=","JBHVekgTuZgO+n4xodtZZtz2TzYEQndQLxVIXyjHFyc=","AC5vjWUgzUcT4zW4wLbS5kfpqY4S9M0lWIKLXvbLTJs=","L/e8j0OAzemX2gC2FrD80a+PDpHi/h7XOYg0YJ4DFdI=","ALmDG5SFJVle4CckRxvNGC6VIfa3u2jx6Tvk/rsNPL4=","Ci9TdouOv2qGkTsOV8BOARykCGSKR0OofXetvwycNRI=","ACSBVhQv0Dc6R5+R/yOelg9Zn/fpS+abfyopAwXhGY0=","Fx1WILh7+xMoz4wCqz8MmjlxlqpqVCwjUOtRKisrzak=","FwpPVVNvfclwCHx8ENb612DJUhct1U3ZnRBF5Ow0qAg=","KaujP3mf5mwu8xNK6gQzbsw344wc0hG6SC7KF+Lb+uE=","HpvBeaT911j90bsZRQiNR+cNEUoD9qDotbplA2nmSXM=","HdJpeZtmD61Y9/SJLfsLWv6q2GmpxLRPnJ4cQ72vjwk=","Is28i3ARetFAEYHQLhVFnnzNQm/oacfJXR3Syw8krzg=","DvBC5FR3HFM6n1elXFA/zv0xUPUu2Up81bqTucfazv0=","EWCeBq1sj+Lyh/MDYDfohRMY6LCKA1mgOzBP/KYugoQ=","EWbZ5VRhbbqedT7qQnwXt/7NWMB23+QnCLCPW3g6qa8=","LeUpiUMahZWTQTAmNUQT2xd/v0zSrAtW+FWoiDV+5GY=","MAbrT/x6hYGabaSS86isHfUa7lsXuOiddL8Bz19x6a0=","KvQfu2G6ioD9z2//nj9vQimT/o8KRjn5YjRMgiUUUIY=","EZ5oTeR2FV/lprQajryF24cYqyeInoXngbIUus5IJ8M=","GDW3huLokl4Yi+pZrjY1N7USSMI4KPBHz/eEuXs/2AA=","KCAaNMWU36NNeUmWxkM6INFSusKnkFySbEDihasy7rY=","CD79eifRdRCU6A/vr3iwAIZMgutXEYdySnYfiMIsxOc=","C2+Io1dxmVJhWOYc7qJ76BHBbfd3TdhRngeVZPYf0Ts=","Dsho5tFeUdlkT2bh1kcalFiVEcoA0p4QFDkObuQlT1s=","KvM+P4ZncScawMmz7S4RQuzT50uTnNQNANk3q4TJhZE=","C1ICEfkEtefQm12WHGrOdzRWjFR91oWLNkzl5HlR8Xg=","Cy1yLQkZoarY21jxAGKpLqDFasQnDoIsyiKGIBiKHUA=","H3kNTX+M8JTZgM6zfCRT6Ve1SpmRyji74AYdHtblYtQ=","AXHrld+/fR6uqXzThfeAFQiFwWI1oqao2pLOsB5QQjM=","DC0OO1/VdUkym/aIXaZrm3kLQN79LIZQdiMFOBsWiHM=","EWL7KGicJxVOWoIotOcrN3y8r6WJ4oPDXTgDBUQHoY0=","LxRZtl3uRBtkrThqkegxDygsWpKonhmSFiPvgklxG8A=","Hm/zIWtojD2ZbXQ2fVzUwbxInUZ1TrcSwkP3DRtTz7s=","AcqL5zgyuNBoFIfSfRV4AtdBpvNs3CoFdogfkyZHiHU=","H3c1cG/+n8WG+XbVvfIj3GgChggLEM6gC5td4xX5ZQ4=","JSK2D06jMHZAoMLc4EH7qSGsEKPV8JbvR0XKg4KF8Bk=","I/C+4AGxAp1SVQdd3JV/gzQYytT1K2w/jOFsI1VyV1s=","K8Gui43buB/KrC1EVV7VaF0UJjPp35BfZtlAEJMILVk=","D5QGuCllZKNzBFB7jbo+0WI3EnOgex/JgBH81q1yIF8=","I2Co6wzH3vpntymY3pBxThfnWxdKUu5KyxJsjNmV8Kg=","FYcaXN3q2XaATIA8uu8lXrSBWl6W34sAbcu8J2f4iUg=","GTpWdmmY7p4KhlLdLzsdoDYvT1T3I3lUT5V8ze77Qg8=","KjlKQ5NPhpgvm+Vv9PqxcDsuY8itM0g05DCYBed3rg8=","GFmVTP64aV8+i2NdyzRRkoks0RIjRDuntBZuiHbA0UI=","BOEYF2MFDlgBNETby5nxkCsRvCXZC73KQI04GfT+0ys=","D9slPe6Dhp1AwzXqZN6MW7EOuC2wi16LH15VUr/QXyM=","BYy+ippQJ72qTvtiOt6tYnXwhobxwImEqdfFuum08cA=","E4Ltzplx4YZJfq2xrrH1KyO0uDvvAjqw0VIotMzspZo=","A0ZJkPBFxu4IGcpR/RGwvn9huOuZ8Ut34eZjRgHZ6LU=","I/e/yHINwpb/8ztB+Y/4PG/KtGBdsutaqlvBN663Clg=","ClmhWOPuwhF+bpTn8OnezxjD/9XhUxqSGWNhWLuvYvI=","BuxUyAOBwFK1i/I7MS/9POLE66BlQgr49MI+0Adf0Hs=","EYhy3IMuDrVHa1ZkjoZ+yLCTQPenvLG0li8P+e0fnQE=","E9afoSfYNBZa1cfLp61Z7VLgsPDkLX/qleGQa1IJIbE=","FpoXf2PqaBJwscaHenPSG94UOUL7cdxV/YpJ8Z8Qx3s=","BO9RWRxurZfvQvKHrc5A2Tq+sDK5IvZv+36aWnRQVE0=","JW4XWh3AeTkOzXynA/suOxnsYYBdTwPO1fRe5t0Paew=","MBAtKGNqvV/l8q9BL/YAT3XMNg0yBd0toAKBPT4s7rI=","EJmOQt/NO78cBxS8c+sb9ARDo/qZvvSjH9Mb4YL8x5I=","GT7djp/PPXYl+n0ktZih2J8zYur01YLv7K12+HnjaGA=","GBaK/TTy2RXQNozoC3szR9HHpWHOYRQl8mZNeqUfC10=","KTg8AevTtqsMAXZW6+ZYtqMo7He8M2JuKeLpWzPqYRE=","EGRtLyYD3jmh9K5ed3GmSnAttuhvt2q2AL9XP5AQxxE=","C+teB9GycUX1dfE5WlW/Ey+QwltA2ns4ZNAkLcsRF/s=","FtaFJSB4wTPcDT7K1itciDD5W7LlS1mr3/vwGNlvozY=","Cmq9HYM5OPM8dBVOBAS0tApVW7vsId36/Wct1iBH8Bo=","GmefXTbre1yOoSpMLe3I/rEt/+7EUDFycKbxmzTPGGA=","CYD7IzvUVsI5dNUODr/eRyakI+raTo9v+8dZLj8bk9Y=","FhtCIy5huEy/GBCvk6OPwM7OPVYoySggA+ustcMSxys=","CtoQqQx/BSCVD31Hpg1eakk/CXh/FWTl0JID20feGgs=","GnMNNyMQuoIyA0WimsQjjtPweoorThIbtQ3bmvQH9FE=","LIEg8mjvBU+BcGTDad2n6pCDd/6rpcTf+9oQ71joxVY=","HHyIJPdYdT+lfAB4nGhCF7kw6VMTvLc+bnuGSaSWj3A=","LNntMfX4aRyOOeQHenT6oPQArYtJHrP3tHsn+j/Rz3c=","I/9PnUaBNFfPYNkvV2GDmaXgIqwyHKVQhUriORiiLuo=","CZRaXRR6T2bO7OZAXd3Z0K9aLFEDUpQH3/HqWPGAQm0=","GI2cUoAl1MK2dmDGt3G5D3x9puqinT8mim3SI+xvxjA=","MFDjeZZZa3+B9oMRQx2HNNun2SbTYzWV4MDY3fTw9H8=","Fa8RaTloMKkWAMqBAsNcQmzq5UYeP5XYnYKVGNMK/Xg=","HabQmIVDLqmgbZ83+HPZhdrpM+NRRmspBChNozINisw=","J5bqkNJpryn1+KzzOSESTk5PrT2+ZYlF5UbuQR3aqcs=","IC190doPa0sDJcizMHdC8B4VYS7I6TBKfLAxngHTLWA=","CW1nkNBbt1kVapUromPWcqLX+ceI9Mgxop2s5MD4vl8=","BU76H2Ww/OKDgIllJ12He0ONojzlsT4ZY3mMsUR9JaQ=","GxYvg9kX6T7bMwjCmALeudiqaQETsuFIZMz24Y5BZfE=","IeUkHhJWTdb9nxzdKg3jnu3+/BRmzFaOxc63RaBQbtw=","HPtWYujPWskiaoDuF7Nqvstzq1+H4WGSe0NJ4Q5L3wg=","DyEXfjAqdxu65tjR7LNztiyZrzRiIKwBKcU/Zm6yQQA=","FnFSI3RgaZKv+w3X9xsSvsQjau3mKQVGvO9+H1FcIyA=","D6PsW5SIJZwutM8kUBv62b4uyeQsXMjM1BnSppLK2HA=","GTwOBOC9KYNXyyZsFQYIDtNu3OhcZIzAhejFexq1S7o=","ECrfjvdHNaJ+kSgwbcvDyZ9vcpHNQGV4zhTqKtq6aPg=","D+CveFjkmFnipU1vGtlFsTFqokv73SOuQKbQy3DD6rE=","IW9nF7vH3tsIU2oiIIQ/Ti2l8dqp69796KXqc0R5jSI=","HaVcyQDw0h9KPmlDkZGKGzwjsqx3PGs++I4uQigyUWE="],M:[["EJt/QRug5MmytwyvXDansZS+fBGtJDeL/ttoWSuoEYs=","Fu1B4Tu5wMZq4RlCT928vJMU3J/b3upV1sZFQ9xJA+A=","K5C7oA/KBYn2F+fcv+guDfcGq2QM6yR7eRqTt042c20="],["KWnyfu0xpIC5w2x2Q3nbyizI/dFBXD3e1ilAvN4L13E=","LiQZ+ewC7DlMmHHIMpY9wbiddDyMe5ZAKbIxFoex/iM=","EBBx8AMjebaXMVh2aQ8FPRSNThCfX7BlyKrMVaD4m/o="],["FDAh7GhqPzMNX55lRjgGXObNeeKMWzdTMmJE7mWhsac=","F2zAKWla0CWCpw7/CKb9mdBX4S5Y59e2sWzfq8juKRE=","GaP8ClZwK/QXun/uOAJZP6ZERwMHBD93cyec1x0l1eA="]]}},552:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default={C:["FEhhRZjgD5jnrn3qRfvYO9loZT74OQzeLoa3Bq1AxlE=","CreykTiOXJ5DwNwfWR+4Ps22UCLhtwr0O4p7QMHf98M=","K3y7IXiW9SyajAiOZUryHoTN51SjzvWxXE1UZmEtat8=","K8aw3b4dcBtlcEKL3Byhvw2ln/O7u5X8K8ccDG5nplw=","EjpVoxmAOE89ILLOy8RO1gw4wR99IOknHvq5qQXu/Tw=","A3UBzIydyBkwmnafTfCY5YiwGFi8jrfieeKIO+n7jFM=","HCEW5H4DqGuxFpWwpfbatrmkYLHrlRqwHCWeyj/UfVE=","LBghNIkDLoWpyMuOmmWDm/rtE+V7wPrknb2uv1T1b5M=","Luj+09TSxxoEKer9jl2xcY8p4iJ5hf3yrYcDyDW54DE=","KMZNj17XqsAEySAp2em/kbqUNtHM6UuTFtERxwoMFxQ=","GKAdn/t0euDePoPHB/iyT2gshPFav1cbNCVKA0eGZeA=","HCHZK+8ZfnOyNOR3e2DbFOZCpWzucVFdVOGscc3nK9M=","CtQEzLyx4ZWJfLYMgJgeu51mpmd9u+2ti2RV/mLYB7E=","Cptt6DMGT5O2rbma9sAFlFy2VMt70UyLl6+LYMwfs4c=","ExKeP5MK7W1HaQMx/wncUWDvpY3c4sPmGA1FvsOqOm8=","DXphTImRUIqxzkiVgTuxyC8Yv3v8nigMzKGAeYOTh/E=","BTL37DbjAEGwSGmGh1yROkm93y9a9f6+jDHy9AlP/qU=","BrvLjo4YAgEpPnEvSVDxsLvugIydZCY8hNnYrhVcuJI=","D1WKTbGjrAf2Hi5r7pR/c1hr9A8hHOtPaHylZ4qdyzM=","K+FApgtbXy+O3XioGKlpsgxkPkGbzwtXfCSg0Oes/pg=","HEnEuanwn3ua1fdOusxxBRK46Ge6zifLDeoG6JuW9jE=","FwwacychsSzefzPkdqOaGqd6gcBuLqxQOEewDVl2Uts=","GcJ9DlL2XKNPTjGgaOSTMca/w52SQfnUwwIEFhXPJ/E=","LxvcUlT5Igwacx/FJ2lk2rJrOF+kC2sEvtmWDiVDugg=","BbQtL7zL9NOdK+kznKvp0Nxtkh6FXNkRVLY50o1KHPA=","EiAEBxWkGtWfT0EODAWkLF/TKsUv6dBviBiNcfYeCTU=","JflSZSYVW4OUZgn3u5UH3Ukl74cd7pFtkUTrtOzhNDw=","AXv+QoQpmud0C20OIElR4xSopdBFJBkUeXipWzR0JEQ=","Kl1HZAIcpx14qWdMtnCPFYjSzq81eMQRHPizWe7wic8=","F/Atq3RfvjwIEyH+XO+EXnuNBwslFNKbKnt9icwIFdo=","GdpiYm23GZtl9K3PV/pKPbqhdkp70VVwjubzeMie8BM=","D4jilfou2BtCbJH6aTZqc+33Xzm/GGNM0mbsQDiCngU=","H+McVUhUbHlI/k7hvXQS4ygO/30gywmqhfSfJ2YUgBc=","EP3BYTvb9n84vd5WGy+R5MxItZ+Y1kNjj9wK+tv+Em4=","HyYYwuvpV0UIucUvAADjPr/drRoD/da8pu9/AJMSe+8=","Ep/n/D76xqirI9um2IbzlNoR9ZU8+Y4oJpoNuip0XdM=","Fa/UzfHk+CDBYx1KuFykujuvz+5yvq3p+uYFIxAkSOM=","Hyx0ulw2fjcNco5x4VsmiFGnu4tFUoy3NJVgeayZsBI=","ETDhhy128vk2nPWble35zhnwH6icnDaybgne9nhtrTw=","E1I9Fz9+a623O2P8HJu9vuJCxhvGhlZJMydTOlwbHco=","FNpA0K9CemXxhBta3JZThlM2j3JUy1Zn3a27rXpXTNQ=","AJH5ZADkKX6oW7GGwXswToJjjlf9Yx/2MVl24aXdi4Y=","MDMpv5AxxVFbmjTUmmS7agJnvHtUoN7KXEUCd6ACzcs=","FO1H5VwdocLwXTwaGy5sGFCfyDNuz+nbc3kW4oP6ghs=","EWHxCzV3ddgQrVO8xKINWt0rAyUcdH3rBO6UxWXljWs=","F6ilCucs5wfyK8Bw65koUcqRTrlMxo6vu4qWpxTrgiE=","Gmxh15Xbr2L5klCzfsXfiGRaHBU3kdtjErky3CUOT2I=","H4vSq4qoQGZMTu4ZjEaE3EsFdyuyoIadpnIrFfRHoTM=","H/y4UqTwAnqXmfExzXS5jM+4y8BjSdj+/MYvEMj7Pi8=","A150LsUvGbNtSJxyD0Z/+td81TvC213dskayMCH3nxg=","Hfqu5BvflNeDqin8Yrfse1VnOqgY0wX9QtF1oF8uPYY=","KCE3hHegLplQBaVjUIhUCUW9Mz8tFFXwOKIZuMR5azo=","HbSk0PI4pXCxBhxu7IHALzH/3Up8GedjF08jjQSJdCE=","FL94iUV7ILehNns0o6U4IX1pO1JCav9ApLtyiTsXhMo=","LO1Swr8pb4fldBDD7JqUg6eW0WT2BJEnEJ/w06nAhGU=","Hd6sWAWn9K2k0EQe0QjjFJ1M5lhPSa5b39RtZ2buozQ=","Lja05enJe0YjBOjitfnciOHJ8hYboEBnP5ERI/BCrnA=","DGhA0csGZtxZ6JsYZSddihZLRHxe1kNHyu5jUCwjjV4=","E34uPonnHUYfTJvD6PEhgyYqTR21XFibLK6qwBI49Yw=","JQky57CtzyyE7Uv7YKNra4LlWqlHURV7HUV5Swgciq0=","FwpykvVjTAbdO/CatcnE7NSwDVzi81+XK0VVOR8WtC0=","DWjLvnconnjVy/UdcPG3W6IV30570BSdELLFDypPO4E=","DK90VjuQUl9kWm0gNuzRMG+h3GgLSdnOTtJMl0mXMXg=","IKfRwKJ/zOeP/jcvTFgwaxZvlFbtRs3rJV45W30w1Co=","BiPzImtUcLJ4m4pTBA5ERDOF6Wuc+gvk01AVFYpGhGU=","FjIwhojCXnkPV9aKU1AkEkKlYwU0feSlAJzka4zcuR8=","LeR5Om+ZzRTj9mQiEfTQt7z6NhWXxUT/y1pWfpB29H8=","HU0G0Z6hsJyteQhtUb3hFyWlVPqZVZyi8J87tz1yjGY=","BIDnR5pmp82ephyLKJdDiZCDUKvEqvwYzXXjPdEwwUQ=","MEMLAzaOvKqRJGlgSQvPkX14aBRj4ufXRL+0QzXawk0=","C1ezcyASfUxQ8mkSSw29yysfE1IkGl0SEDKD4InAx0I=","LPSJBlDSckDhlfYKT2mO2iSbjdYUsjN2tQF40t9tK48=","HiIcVSaJi/0S3oaFGg2XA3UaLyOQCKtfm307aRHGQYQ=","KOB0ha19mS7RpY8ynKEq3OTsaT6927KVLlTTOfLuvaU=","L0TWT4TeFtxnvV6tUe+x3IOByEUgwShU3V7zoHms1OA=","BQp2vDLr0d/ivjMPME7ces5xZ6t7oVFvQCHGLPDU+sI=","L1jEXl1lmmfXgTZyQfbDXYy0Y2HZeyiUfSlCHCcFlKk=","JejamuDkLoQOBLIwNw54K9tnU0hEMlujb8fl4WDGanQ=","L+xzTaIP4yAD6gTxJ/hEck84o2i6EMKVRCUr55YED38=","KIpnePOoOYio7Rcn8V6TtMsU9OOju7kd1tH6yv/9Xu8=","INzGx1/Yklm+f0BnULPbZ5olqM0nFdJFuRdTkKySLIQ=","F/QroQlC3yXLilQXgqGLb9Mc+WXREXjHsErEW03qXdM=","Ao7rhdEVqQQCDgxhSO7GYD6c7avGZKvudkqv1FWYa6U=","Cx187POnmyrT+imPbOp66V2AwCmezJGOn4ycPTjVnUA=","BEAznJdkzsecFu/bg0omJh244/Es4c9yLSPA4R/0zwc=","BspkfClyfBlioAIXfaLVBPSwel9+tXx5uI5reru9rVw=","LqEgqGT1xAk90ali6PATx7jvd4sE0rpb/DyrKGGbqeM=","K7c3VGxK7nwMwrqHwRV+KnfEeev7Xcdq27Oc+Gl2M/0=","DjDaZJBiXTPnnNUBdvVo+aLCjC9EmivVGiXRVoaAOpM=","DffKcnihNlC5GdhUl7LrsPcQNafCBDDUEx2QOrf1dSE=","J8xYn1v1hXlKus5Yn7inSi94TAmQuA/KppRAl/hw4tU=","IlXDajjIc13kXO30Uq+oQjMtMwQveOYMQ8dFVCGzJb8=","Ez2WAr0zeNafaBwnsFvf/Ji32GzKY9c6YMrtSFeE0Ic=","DhVI6UKunT4mhgaZuTcnyBeplIYWyT70rM2YGx3D14o=","DyDw5V2TaJ/gnsMS9q9HYnSC5L3goWAqjiyNboTopq4=","LlIyhIPLW3/y605FsS5RsmIyybwXtykpVMCp9r+lG7k=","ArIWLVM+BZpu2iq7dHEu2zp4YL7qld2KSr/JV2YIBPQ=","GeCSdxXRzG04lCmUf7Nzfa1zOXTGsuE+Wz1DJRlRbHQ=","DTqABFfXd4VjYwO4uU8X3P/LRgSIcqyfdO9/J+5XNwU=","LJdNGVJVehqsX3uuSZZhbaYZtz9EHE5QTcj+nPtVnjI=","B2a/7u3izPNwjhtP8wcUwiwdQ0zb6PVVFLq8LdXZe+8=","I9rI6lQIL8Ex4XOuVeRjDNTKfIcbKgpHnB505/GR5iw=","F9X7bCyzcBDj41irLVdTdocO0zGGuOrkmtO0fjQKjX8=","F13Kx22KgSYTm1g644hTKQJG5D54P6aQPsgAfxeMACM=","DE/Qj+3l0iGtt6v1SYmMkeW+foW/H9KmEb8YLMLnFlU=","J3k0uQnnLTo0dbsex2arejitWbEoMD/FAC8Cplvf5yk=","Dog0mZjf5wPxsYRST5w5TWAEzKz5y5UolujP2wsHi2g=","HxsgeLYLD84Hgk4qK8jK6O5nNRSwBwqLRXEMx4y7mUI=","LrFVlWbFNt28MW9kgtUfo0BVdldwD1uKhG6BKg7TNNE=","HE29wzXPZ2Q1Ugi0ydJD00VB1iPGad7Cw7oGa76vZ3M=","I3SmstpvjKuOXP6NgF3Tot/KHot+ul3IV0Ah/RJB47Q=","Gd00JTPMxgOplzjj+1pWm5TvcbPkn5D7h09hYXMwcvQ=","IX1m22x/s+/6UIgAWH0us8bQPYOFEy8vzOfzXycFzM8=","CBX7hZH+AQOM06OziyNvnvynfGGNO/xsKn+okpbH5k8=","K7lDtAwr1FamwXhTscqI6w/zb1l0sv+aX1CT6b9joW8=","EaUVP85llRPufLmXSubLpYHjtM0UVwxXCf7D2NP8guk=","G3K/0HY12FAbLv+HhaJJW650x2U8+Q5tXJ8URCaDbfQ=","FJAsBwDuyJeuF4uoyvhQ15Px2HUSvqDs6jnPax/uIz0=","CcE4xuCmFqSf+Q1DprBD87dFt4hlhW3EwaReL9hMs/Q=","BbWKPc5XsoGicdaYlQUtiHRYpxV4PoMX4CSmGjXsELw=","K+jSlSXAz91eazEl473jv1WOVfvoZ/AkRXqWdlR00Dc=","Bh1y948bqdxrTX93hCJdaoG9/Bta1sJDafnAVgUj2a0=","C/GK78rP+r30ES7drcphRXOLSAOzYUW7lRbbUBoGkuk=","LnPdEF+osuyTHYzfKexnnjqYAakwcafV6jBlklXwO8Y=","D4RA72Z8mugTN7pdjJJ6U0fecpaGCyEcrR7L+101mO8=","AE0wOy3qYnsnMb6D+TrDTn0U0XihOABVjKc5Y5XrEY8=","I0VBrXIECnDaKZajUmkjDJRpnu8xOk1IBQgAjLw9N8E=","DRI/HnLSa5K92P1z0UKGwxKtTCOstGsuCMFXEEQJ4XQ=","L7Ngd28N551wmO56pBI8Be5rBai+Rgp3TzoEjhOFRbs=","A2hcB5Q04WcnbFfTzHlwO339xBwVbqHot/mbaValUyY=","Jgrw4P/8yXcsFjGxeTRFZrR6qto2geuQNMb3XDcFwcc=","KGK0E3T4m2lSdLM7dz8lVJFuK/+f9nJUX8L0lWP2J2c=","AqmRL+FwMQInGJ6h5pHQNi8Ys4tACw7/GSyllRPrqNU=","COUTreaUoNisHz6/GpZEDTLHE9UFjhIk4HA0jCgfSm8=","FApKQx4u55QA7XRll42EdzITxigmT/gPIax6a2c9Cas=","KWr00BnLXffZWbKdVJw/BxICtOuotT3F7pee0UM3eSc=","AYMuKEp/TIFhSIK2k5/A8YVXO9ICPj5QV2VHC7gSs0k=","GoTVame/3T2WWr3NMpqnjU/pNDRJby0QOGH9GdZtcmA=","BAy4KEd3OSfSrv3AdIkDep0fdjHsp1yfsN2gy5294UM=","AQ3PCEzCnLfK7PJqpjO85O0rAZ8oh87nsaePidP6vi8=","B+3CKgkR6iFEJe9UK3dtsjsP5YF4ENQMcsqYqr2a+oM=","LupKsIrsd18hSEeeo2+7lpNtpYuki9HS06zUgXOqq+c=","HkDA6CV/5KYQBc3PrRSM9/R9G1z936oIJzhpVRgkXxk=","I6J4CVg70epR9DbeVEPhCPadRM31HcHwPiGUi0mAuHY=","LkZSsETb/kDmO2sjL81fPzmr+9IFHuaK3HVAgNSSUKk=","Eeer227Lr8Ln2M3v6ce5xQR160dds8LK9/fWf0hXdfI=","GZ1SNQzDDoxzgh+AIJbw5UehNVGye/a4mTlvY6xc+Oc=","D1ddbuZ8vs2YNFYk4DKjfIWafL7zCz/dyUnNCXhIQQE=","HEtvmiritBjmJlrLqclrBhhNBwKOX7eE80da53cv8Fc=","Lctc+Ilt458ijhV8DFWT9GJvubwiUgY4PbIDYKvwySU=","E0CrufThExhr3CbL30vMpQtTGhB/hjylRFdePPhw+OE=","I2jmkrcnh8uIcOqIjnFOAG9Z0rRGDPt0xIqMxzsdGls=","H6ua3ZuqSk9W8jFld1xvLZIqdjKpT5Y3S33IUnVvVLY=","DH97gjANPGzj+JV7oeSt1UxMAV4g2XZdIgVxwWq4aA8=","FdY+hr6s2Txgg2iOXZyPPGlHkp+fH5mrV4pMOpIu/wM=","C+hDrl+bB+UlcheK99ro7QXTaxLAYHhikpNV6nQCPZ4=","EzJ0nFI2lMtpNeCWOgfoGwWWfOHZUMC3MQWOySp6DJo=","JUOUCIEOB0wL3UWYuYFf7okruVylECns8Am/+lubloI=","BX6NGd2ZmpGNopsJQLODup/RXbCw9kmW3/Z/61X5p0I=","HgFON+mxF887SHDZmfK1XTU00Ka+mOnjV/pD8B5wop0=","Gk7STm4DrrzWvbEAUz3JZll6/hXIUbS4Y/boiQhMZHk=","JTQgAHCD8aqGOtR2CQXBA57UERyfBT8ncQRS+DzjapA=","InahRBlxcJr/5tKpkyAAHsRexyFVxXXd7srA4ydZqwY=","KJV90SGOp5n9NBHrGTJYU633rorhKB91MwL+fTHfp7A=","L9klcmq3lMiL11eWqj5/HmaS8pFM+AImfd8B43kCoAg=","HPilycdqhLFHyCONklPNVbR8DEPYKWbEY2ooZ0cF/Zo=","A3PLvDBuG6uecHc2hxXmIwtLLi5KHbnGdLjDWaQekQg=","BgKD0v5/I9/1E9kRCz3GJEi8SPUxzgweq1kgvyMpCkA=","DatGXW2RB0DzPvbMDq3HG/gRm9/Vo1J9yLv636pAJjw=","DLp7y8giSyqOSroXl3IwpobNZCHcDKU0bzRGtiQ5xMM=","HkNl2weQycT0RbBlPEZv8h25bDi0B2uovWi8tN6mkR0=","G7LbohmamrO8hu9fnef2xcoT1g6rQs7WjemPxkOACo0=","CtPBhwxtbvQO661SEjzRopE9nWLoC/usroEuCCAh+co=","AbCYyR57DLtcNFiAd8Dd+VMA3fYUk1YwwM46JickUwg=","Gf1cDqwU+udZi9TO6jseKZiwwWhJO21yrkG1duVbnD8=","DUdJ15zBY/FxEKQEpG/kJ8ZDTz/me357TM+mq5W9fhg=","Hrv+gRSkG7gJ4LMzmSQSMuuUCthyjIpRbUCtpEDb/c8=","JwTlthM9l2TW0/F9SdgzIj45N/gOufrqu/upuvS0wbg=","IWXhyAJzBbGuDjI1cWNeXVQNE9cQw/mjkLaRPxTQNeM=","LjSX5NNf2llsBq+mO8Og8uVdTuukrOtg5lCBrWOqi4o=","Ax2kNF7s1ttsD3sHx4Fdet0f4FRtc49NeatcV6qEHt8=","CJ7OVOR6pckI5D5fCHN8FDaWcIkAasqxyc0Z6sSiCHY=","L1PBXire0zxH9VoHBIPmzH84Ifv4qkBnfQVS7Z0Q2Ec=","FCqjT0suitDfeiGz45wAyLCqKFcJSAHqr9cr7+0Hf5M=","F66k2kx7zw11iLAU64tAl53Scl7aTmrOMxmCRnx/8r8=","DpcMGdGXSNjEZRBNjwIgA2P5pBeG8C8YJ3QrINwNFyc=","BLytnlU3lWQvWbr3FKa9tDL8RaCgt38aujqYI0dt+bk=","JCwL+82qdvcV29S6glxx/P7WccGxkB+khMh/gQMV0M4=","JdsTQ8JBBAcQI/tu002ZCQeDEeHv6FrwoRsZEU+p55A=","L/5NnEIKWenNx8Masr81GHyhR8uJijlC3rNnd4YDaoA=","EluwOvPizxi75vW1kOs7+NDRumO+aWSD6Y8oO8fNB6M=","CBa+QnRbfbtM7/5bjiTqYP2LcZ3rpQA3rHt1lIdFxrw=","ERFg+az27DYNG2pxIxOg28viPmRCAFVHHS7kxd7bNdQ=","E3eXjhsfaokl+o57eUG9+PtZq5VCNCQZKD2CA0Nck5E=","De/B2IghZu88zeU6TyNvuoPThGIZN87lfkIaUT0NM5c=","L4+lx4xwbjpdSgPyp6OVMEbX6Uy4in7zUOZ7W6Dw3r8=","GiqVfsCnI9phwhNLqwvxe+sA5tzYRpDCMNy55Y2pSCc=","HN+HEJlfXgNBK0p/aZUy+f0B8OoWeo38Hd834oBa3e8=","Jv0xRxgow2rjbCe3SAVLDAxP5SObMBaZ43Ze6+zBiUY=","B3XZlswsRFbzA6LB+QB2R+Eakh2f6j97kmFDuZ0voL4=","AW+5M3cIymOM39qRvQ2uprlyJO97IGJnKt3RvRi7iQA=","LDkvvn0/3kL8pPlHi7Q5MxJYJVNW8YSvb3bxGQVBF9c=","GHoqO/eaafo+UInvnx/Vb9tHxV7s53qiKKo94bSGvLE=","AnGoY6KAoyZB/6M1ELLt0njJhjA1lTLz5Qaydf1dIM4=","FVdFnJx0yUqgDlr2mh4xEvtpU3zol+wMcYlY2WUW8qs=","Ko4myo1kfZpjiFFuqdz/iQg9U55YFowqUMba4w8QnyE=","Ict1IZTPQ/O1GULrAEDrqd4rz7HCo/rpeSS3EPJoMs0=","LCba+Za+JHrNbdSsrWDTi1pHHmMiGI0CwTfny0hDd+w=","AkAXbuDnmC7r6Spo0+OjjCaCGswPXQWM+ME3vKLSbxs=","JjbglzyGXBvZdN142qqNCoTNr2vhrUfs8qDRjxFzGPI=","GehPTyWnmUlgQWYdxdl1toH24GdEzuibe+XZ/eF0SsA=","Dr+JBko68kfKHzb281cBiOJx4LMmxPsmZk6J4UVMoRA=","Jcfpe0db4A6LVZo4xFI2T0ycUx/suKxpj3/XPOIucew=","BETJnlkjU+WuyqMCrdkBwU2MVScKFgr+1EKe9VmK108=","E424iHgwVl8mk9Dg8C5OeeFEln8LpTsDUZq6dktcmUo=","JNQPRiEU/p7gKq/PdLT8ok4a42XcdcO1K7E8u7LyHt0=","IeZdbY7kN2C8pA5zC130xM86inMtsUj0spUbTGHWjow=","JI3XlmnsCdvwNQoV1sdcapvarO/KFNUTAJePE9GrbRw=","K4I4wVSPnL4p/TXPkee0jw69p+Y57faf6NWrp5JNU2I=","JDn9I5JX84GBx7489RPxv3I166lPa4lCqUy93s9vYvc=","IAlYI1KBphuixL4KoygqGMdLbSYvXefC4z0rs+iT3+w=","Dh7KXfiO5fYM+n4f5b77txn62CEfqbLQL8wjMZDBfxI=","JrU0J/mz6ix2nZxmD8YIgaFpwScy0AG3FY7ksbhCyiQ=","IPOz9Kyv6fivPgZmGzqPd4+igSUiudcKZ0As/42ysbQ=","IR5dKznWJSCnpifs6MrLrJ+XUG3vTsKGkoumwn1GOxc=","C7dD7jSAISnFVnMa7Z0wLc0IUxPOVy9iQtE4MuU2tLQ=","I8smYbSI7nHkx1P/I65L0l2KRAlPZrZTKXfiIUDrpcs=","A6NaoxI5Ec20U1uu0zWfX2pSBbnJPvMdNTI6R4B7i8k=","J4A4SKCu2WqT+pQ7ZjXkUCF+E39K3nSmLXkXMicUtpc=","DLN4OcLJp/95iEy+x19B6b5eR8dtYVOCMb2BYpltb2c=","HwAm0L8fjh3VQjzC/sH7XNqh7NxMPLIY287vd8ANL5M=","AqfXu5cLim7S7mb6u7qVa22jsQD1tfuSju9C+XCCc8k=","DP1/QhXkNMjaF+wyWLC8YFrRqy6QqklDUeTuQLvEkfo=","GAsRtyBiKhVoSdxvf25/VxZZvmloIjDF7ZrDOXAKfN4=","BOlqllvOPToKJKSkV8lRWCyHE0nOfu4aq/5XipTGUBE=","FZMfeCtF9/tlbyzb0fdwXDU6I/4dMKWkahUi7RYN860=","LiluV8l6Uwms0m/r9VrJY6VETBxfcDrYig17l7ndOLE=","JhV7zreOhGu7Ji+aHgbUJxveWlvOjwQZlS+X/9E+rKg=","IZTriYR9aw8Yl/Z18ZwMVrYbEySO/zyjbjT7nRx57kM=","I1C/NUd2VomRUa193pbqeFfhVQFEcAjatrPSfI/6J08=","GkhvCuWRys2vCcWKScTReVQFQ1NAgZ4APwRp0RC3dSs=","G1bc92+yPMSoNNRVpAZeEzVxQCt98wnVm8MQXUKowwE=","GnSdeWSvC3ICkT7yBMZT8rS/tlzqt7aFIzq1nOO7aSU=","GK5ZAHP5aWlq92L/pOjw67+X+Mx4fjfN3R8yG+O+rbs=","IcR7J12C3eZGDV52mplCEUSxxanaWSlK3py7MXED8kk=","BHPdvVLnN+UnNk6OtjIHl1w41f1swysnIQKwgs0VGPs=","CxL6yVttOogdiSZXyEJOZFrE5rAFFfkC1ZRXQwKybgI=","CK52FqJgz2ZX+Pc6woRYjSxfB/9CXYN6p83O9j4+IQM=","A52vaHYoC4Doc78qMv0oNKg8aXV7rdWKiI74Gekmzig=","Jeex10cKPHXxPwtWVGyOCfLY7+/wbvdm+ceDyoadEw0=","Ho/TY0w/92QYTQNDX5hYSxG1sVrrnHUmLaPx6iwqnno=","JB3MUaw3gIpBXdHjwoHwWv8ReJ3Ayv3XejVITgmT+aQ=","H/wxU8Vu+XVZMs6ivgVzdJva/hxPoHgaS4tAeM6ddUc=","F2MNYtmj5RDIik1Dw2D5K8D6ALZgMa3sKb2VQ/06F+4=","KYBADt0ddOPWnbVFjSzNX6vbI27BaoKkMBoKtZ6kpuk=","MDT7JDZhI+xtyvytNXJtv7FhlMA23NZI+mlDm/zQDNQ=","Gqfo9Bicqd/z2yq3ZIvgojkplc5GBB4EaA3KitcjLfA=","H6GV+DSmnmI3L2DrSX2hZ2RurhQVPYA7OdxdEfXXgAs=","DyPxx01fv2GVrVpq7l5WmTxUd+hFP1uToNe6/TMwNtM=","AWVW+sk0inNatQqgiclxUbPKrwogo0+52TcFBaFRVyk=","I9kreTZIEQ/Fru8GM/DHfKyw27yhh5uKb25d9EXl9ws=","LkwQ7F5l4vI5u8Q8EwMd8mhqtA/XmjBLBdYRuCPyO3M=","EkGLv9d7Y61eFoZK2cMv+/xaPdm3jsK3kyn+XgqNKVM=","HkqKrOFavB1bdqnoSEMdLAanj3K2vrsSk+bFjlGFaW0=","Dz6WEH3s29aHLCDqCaz5LN8Xo+4dEzFIgJLZYXbet1U=","ASw3gCB/OVzCHesKvZUWge6jJJjdumzol6j58MI1cGc=","E+qxtOZyuhscG7kBdpMB8eVlnQPqEMYd4kd/8KwiFCE=","INxmSrsgt0VsBmKc43oeyxonpOiyTjG0i5xGNaowMj4=","LGseLP6njiw2eF52qM+xsFfpRx8k9bORF1w97LAeAA8=","GIySYlX1t689qWNVcpwqhnCrTCxwQASBsqyQN0Dgxas=","L5kTII4J49bp5vumOE/QdquJ8mYpduPjDghwuzDrVPI=","KzOAPZCIlwbnFPcgtWKNJvtgtUWh8+nOSaaukSsCQIY=","JsyrwQ6wQyfLXMPd4quzbwlwhsl+c4wTPJ9XB350iwk=","GxauDXxUQIy3X9kx8kZ1HysMPcINeegqJTG3bCK01d8=","EdC7RhvYryhE9J8PhAyU75UYslETRHQtH1Q4/j1BWuQ=","IzAxhHtHa+rQEY09szjokTPsQg1nPlBK1kclnfZVVx4=","H4TpeJW+5DjrPJLcmxhGya0pwWQ4ewautu0YQe2MTco=","J39/m1QvDCu19FvtBU8JYkU2AQw8+UUtInMZMyf4AdY=","HvyckGnlBouqwT0uZkVkG30n6A/CMHcWFTXERoLuV6k=","DW7Ed3YeLvusTxSzvz1SV6meZMPyX+EE+vmIsg/l/0Q=","Dg59fFUBmZt9Fhc7WbfK4fIDvvIa6/ACUYgUOcz5MBM=","IXvvL08SxtzJHCBYojORy3feU8puRNzcbqPTb+oybqY=","BXgMiK3wFTG1D4F+P+RER9KbNaqKOJxx6M8SJqzvaLo=","GHM4h6ays7TJDY5JkBluI0ReR9fqWTnr+4mj7j1ntL0=","ILrOY6z8rgscnyvuJLjp2oW6WX03sJBXIMTxXbIxsHo=","Fm6llTdaZ4asUn7p7O1z7Wv1UIdqvK86yStCyAiwDY8=","MEJiqe/0BArPQ+Mi1vUmdq4vhT7C56gNsAxIjPkXx04=","ImuscFAWbl9tt4zQsS028wW26MmgVRFK13Ceb1ckW2s=","JrL1OcVzgp9qypG6qVRQW8XD604d8dY4WCcX+98jiMw=","BqD79M1S6Tul5MbEr2XbAu6WKX+K0gDy8c/yUudptVE=","LLnCQRLTU0Gs6siDYPtSiSTli27KwyG5+ynmqjNo/yM=","IOiKTWB1Jt0H/gijVSpEZpEp64f8wLE6rI/or9kwFSE=","FURkmivXPjunLzlt+R3WVAHdj69R3jJfuu251TatlPw=","GYAHdFeZVxLETafhdxMljj+Os1S/2A7Z6vPsuvaWAQU=","JdHSL/E+dwXTwIX5f8Tk9pFLgv+qXSCR7GTaxCN2Xvc=","L+yZDvVW7+EDWkZP9VgedAZ0Rc1Uq8r2uMA5n+DSTPw=","G9lWNQbZVE7z5IMOE1RQEsV5N5wtzBMwQWxK5JvE7GE=","AK/80XumADxW36hVcfwpc3siWoDUgOfdft7AHxTyMBA=","I2cNuu+WaIHwf5GaLYgxKMeyPPdnpHeysuB2K8DbwYs=","H5OlMpFzlMfiL9F6vupjicZv164t2fAvhg9tlpR/Dt0=","LeQun1N7fWGwITdxwOdPVVUSvge2pQk0c04sW+tAvjc=","JcVX9FuZeBzTfTuyKTFmKmf3izd4LIhbRWu5bVXohAQ=","IHTItwlwXJiIU4p/ijxK/2R3Mb0W+OJU+nTqnyvnZiw=","Jzg1WVYpgTiUnkQhcdak5LdO8gZXQNt8/DoLYP1XOss=","E9Nq0KTr64GWl3hkllnGXLfQxBzFGYcf23Gp6moMqlY=","CKLBi6QTgTSMGs+/lhdxaAa0YqFpG8LjQ7ebgIXjdrA=","BZCS/Dla7ShYB7v1V62aEEH1nAeYIrEIhFeIL+57YSw=","FhkkFRtaWtLYysEZUiqZGpBvFehTHccFZ/ayg3HMJOM=","HGjKj3qhdlkHVAXvY0G45popi5pNcvO7hUswnkuoehs=","J/XQO8ocggf3I5pLLPc65VmhWqN+e93fOqsF7sXOVZI=","Dsv/SEaWKpddNH6pqPxGX7RoYVV2IvLCVkp+Y5gzwWk=","J3xN4jY9i1tFbPxaf/jkb/LsjapZhV9a1kvAUh86xWc=","GxGGLFKs01G3pGR5P0+7V/7Jn4MrYyJvldF1yNL8CLI=","BqcZxYTHT/vdchjrVly0yL2GyS49+zxz4VJyAapRI04=","Iw5K3uy3mYd/fOmljINrmdUzWEoZXB13oxOr4cfRJr0=","ELEJuGSAnEdnoTPM5sutbIhigXO46lHozKhYMMp95SI=","DiEReXDc+9SxUmslNjbzd1ONO0+q61qLJL9iANFMxZE=","Jmc0mXhAE2L2sXk57rDmT/VWB+vbNccHHbRrs+e6R3g=","BQAPpf2lBeApoTv+MEwmew2GxywDm6v20/8C7iRr4C4=","Jk2eCUrtX0GmAkIiCjSihAiQh7JDapv86BdMyb6MLiA=","CAdvnEdD3mEw/2Is9AHt0skvJL/hFPPF5ySJF0YxXEc=","EyNwq927Cx3VfypSDCUza9fO3pS5W79cIVHW2I5kG2Q=","CP8RFreiJ7/f1EZaZ4kIgrYVyMTBfyjY0klY7fYC3cs=","K8sLDbi54+ArfpwclGD92cbNmFYjMuZI2KPgq5RZdSA=","EupozmiBvsrX+KaxF7A6uXb3q9WX+QOwvyMNINIalDo=","J0OcmKdmiAZ6CXsZtv3X141fiOJ04Nj+peprdAb92n8=","AvQNCtBfVlLjHvlECtcevIQZ45NJOTfwXwBJnQKpnjY=","L78EKEMn7k9oDwa9OQ4wnQ0TrMdLnFsUtjBZuMx6v/U=","G+aG1T4qitV6gosGUUJc/Gl4xwJ+2/JH9rZyPCHfhuc=","JoO0JehaUI+WhS8UtCIPz+n3rYsXv+/A40jEfKeLtX8=","FtrOmy6AEuMdscfr5nLYa75hoao+FpPg7d/A3gqd2VE=","J6Mh+MfTyQIuli9/7y48hItFOdu3WqE58wQw/lRbzts=","BszXIQ3uHWsOIreeEtGQgtgHi3iNcQB7leendO2GplE=","CkHdQiIWU3Ur7zUPbXSpF7bLsf12o6EhZvTQvpeOQCY=","IgoCiB5NR6yU2VDN+DhidNF4LifL0NhFl43uyRKY8WU=","DiFVpUX+Xzy7Y5dgZYnqwZzZJjkznGsBcpikrTQItLk=","Dw8ZxikeUVRqJnxgzHdOX7nQiLrFMHgtiR7Br0uEcHM=","DpJbzRxt20o6HGfsje771AxTwNM+eu7xtGeVrtWUPJ0=","KtAAsXSKu4Es1uVBEoa5/z7wpb09JZo25F7wW561vus=","CmWqIy0y7W6N5j0c3/68Lz+mFkZcJ6r5fozT3P9khlI=","AmPYRwq0scYddNjoliQvTyYdyxZ6OgaSOJPXyyyT1qE=","KQHZRq3clLBA/VgATZpfjNGSZUDHqGEs7BxYy2DCs6U=","GInPqCCfSVLfkCLbncWDtXF6BpbaQc7mSTfQzWMh5pM=","I2Bk1xy2xkyEdHrCX8+NiBUC5fA7/4dWG4WhFrHzmso=","L/ehdP/Owphi4E9dvcc+vzZhVwAzV2KQwMH2zYztJ64=","GeckoddCyrEDRV8AQO33RaJpanEITJPjInFUUN1Nb1s=","A+7TiStvDmxdoQWcXzeTmFg1qig1AKgSmQSpTIfxYb8=","COK4Jzv6MMGshQMG2R5Gip6NBQkq7ky8gMaHJIRjujA=","B63Mp22DN3KIOaG2rDs+1Cr7h9cq+Y9S9Bby7FiyjOw=","Fx7zeJa64rECCgpYOb1ReEzhG7QjfVSMFxFp0y+hm0A=","IP/fy4b00AUGTtvClpGMMy0y++/xcp3lBWomq7w6Nfo=","COzXpvFzXu2GuqCU5gj0iPONuzmPz+1LmUODoMqORkc=","HD9dhuWSH96YkBifHYxhh1QohgDmkovBgqxNXkyfDMs=","KcYRhO2dRg8zdVihr2Oap+PAl15AFO2OvK1KJdUeq/M=","De/UWyiVhygiituy29rval6bGmSQKnNPQCuM77irO1Y=","CnTqItigkzYGBhAXmsHYL/+pSS33be7U6mDgEzsIEag=","A6N78S2vFADSl6xKwTuiTBfcJi2xbIUj3u5ODM3ppoA=","Ef4XkNWrv1k1/yIxjk9//mmWatovkTa1T4MOrLCmU2g=","AYFlhC9AY3XyNGaGkVr7FL8f4FZMiFjuO94Kuj3l9o8=","Jh2yXnz/Wp+3LydrH5JgtmcwD7fTYbUP1cDotplbBfk=","KjrDMUsrZueW++Nt93jF5GlyMgzEPsgHBIgmtnBLp8Q=","I8qkuA7PqZ6dP+orvB2782nRv8iTfQPQdAYcMP2M12s=","J9smAIXiJImN8UXyP2NfIGbY5OEk5YHoxiYZKbHf4Qc=","J09sX9NKeE1rkV7wXUJO5sC6u/Np55qxOLgWe1YY7H8=","LDop4TqE0moJEckona8apM9YQKraBwHVfiPfx5babaE=","HqIQ8gAaM00+gB9OUycNQtp6rzF6VTtCgqp46qIoLm0=","JU2+tSiEtpnBun+g1ugNYQkDsYo+UJw2NRzMOwJJRuM=","BZ54HWWJbr4OS6JtwvKZB/R7ze2kososcT2FBeox/V0=","C1sc7GPULV5hXcJpuIWiTO8wPseMly3RfNuz6RXMT/s=","KnwBXpw7LFfKi30m05obzIXW/6y32fvWbSqPHWTtDJI=","Kbc2uRHXGnnPY9im94bxG9Wr7iQWHcVnp8hR6uHkO1E=","KFdFqQp/49Ca9agIcEvGnG8XAeVzkS31zB4mXVlsQUE=","LZAbgZXDyWyMNuuZ/sATTsK4MEroEL0w2lVOMICCZxU=","GQXTUYNV6rp4WbWR7XuMnCU5gPBFDb31TXp3groFg5I=","I+gTAm/AuABk0ZtcVCiUL99+/qgL+o7ECVJyv9t7TJ8=","I8ChmiUsh+axwcIbGnmAAgDD+/8+MwDn5VaAcd6e+4E=","EcSuYHuuSSQTv2LNqiwoaO0f7G3AYxsGfKYPqxJbnio=","LNBV67fuRoY2XepFDwRv9iQF+uGxr8n7AXB8+B2g47k=","BTyf7y4CH6miD62iL96hUFtYoxWbu0czfb95GyFbFFI=","CjW9dOh8urqr6JrRMZ0snoY7TGMcIZOMmlOVv5eHKp8=","HBFQVlOc4gzVoE0aXEPisA++g7JZAb429d3EZm/Dg/4=","JClUBH5Xcv073tWQ7IvrTFQvLiZMjD4oTNxHNQXFGpA=","Diq9MVtHwNyThJwM3yZ+gRy9vbIApufCtn7ffLAXQhQ=","KCs3AgwIkNdRw/12lQ2AaGaOHf6uYh3VUtLeiH2i6nU=","KJM4UiZrUtnqa1u5I9nZTy5aW+XHeOdeB5QsI0tkO9k=","CZq2dlUFuhGY7xQOd7eVTU++eaBWznK6zjnASMANo88=","KvIR2OCsLY/af4SbjyKaIlxhhrVXYsensq4tHdhcV8s=","DNBw8jQBSigJq5DHHB2mHpipYyL+3Zm2qq4coQTz+s8=","Jnk+KryNPDDGBib7qhWPJjWH1r0Vgz1EixFiZLkwJWo=","IlvjbtDuheH4Ra2oTldIpWaZFSET/2G1BWtti95gwZ0=","AhdPSe2wLVFU0r7KLckrnMWVOD2h/ejwnkte4+paBl4=","D2SJHCyLAg5Gw1lMt1jwvdzb0JvQMIgW+0FzSoaYcsM=","GSqEyi+Z02mR4tKx3v85idHBVsI54Q6fVhQOGFRXYGc=","Kd/Ne2PwWr8nU6jDQda3pgxiQ7BMmhuLMyC7oEpNR4c=","HuJ61rm1qGdzOvxhorPnalK6PkvV5let6R/AOIGduls=","CrR3PxUMP4rTvJU49DzsOVp+NzGulz/v62I6CSF+ZMc=","E8NSoC9ZUYYgLLC5n6WMVUKrZ/m206Cv0QPe7/bYD0E=","KpfPLBDEv7/SmfZ8UqFp+SwFt9rFakHE3U/ofIJGzhQ=","AL7LtHBCvX+Mn2u0IhYtGu0ImihIL3/RarBqEyhf5wI=","AI5E2iHXOGkbiBdX7zftKcW9n3pEUPz1MpCpLMLKIXY=","KyBai21LcGPZMfO7XTRkBThD/n++S4PBeIP4ZSeIKhg=","LZ4yp8kFVv4QjSVawB513zOPzWOyv4TBkoDUJymIY/w=","KaMiqEwlvS3fbi5CACKNlavWNJoCJmrB27pSBzjOypc=","BnjJv8by3wEvT+VeM7torBTO0d8NAhUnkgidBG2CjEM=","D6/zpedCV5T+IKfg62FbixdgOUt/IwQoajrkAJEk2yM=","H49bYRr5/rnOqGwIQFgSBVPkBBA67iE/WkHR0CVBwNM=","Fgh12EeWAvlvQKzC0ELuUsFYi2op3kKEllptxskw6gc=","Fth6UYOjFqHXCvyVHv4s1mfHcyj8/aRYy/X+MEX0bZ4="],M:[["EkZm+AVh7VkW8vBwsb0kjG1T9E0nPZVqDIe5F2kqTRg=","EZJPAv0ZsJJVqqHPRuoFGOPXv+70dCFglJEBHbC9CwI=","JH+n8CIwShmU/1BUVsIgHvm3FzaUmNP/zkRmAe2d+EU=","A/17Ge8shh8i93/4EPVOJ3vJTrdsAtedmGvj3N8FHD8=","GL1BI5w+cVeaZ3RD7P+9VVqB7u6mk1Kmi2fIVjwMKgY=","LXjDpdKN6f81vwoldjUZblcwyn9ASTJ3B4zXXai069w="],["ClFKXCJ/TOyV36Ap6N0STDSJWqRrsnwJEfN4DVAVVAo=","GS4W0X2VayV7haZS7v3y7glYnqxb6AkVd1cj0ssdoG0=","KYzgweMRO7k1xwWOd3K1M7GqnbDAkmvciRflYFyjrBA=","CUy06DYhr9Jx5BvHFyfwFY69YSI5rJ1pixf+S+Bbf8g=","A9iAOVvpPCfWSa9f0ULnazORjLiEHVooFzvVz30yh5E=","KO6ua1hmrWjkQ7uvkWgNt9fiswN+OP72G0LLzP/OyoE="],["J4u0mntORK6kbrD4gstpKAGm5g/dW1wjxjzWXMzk/go=","Bj7ewb7YMfUGr422SNb96hRTRYh+i9z/EJA1odm2dNc=","G67xy1UJtSakIGH7U2V/mbMjJQDoVRksvoyUDgaMR18=","EyRWSse9+eIhZOmFjX+o42ixZerqPa9Otn7lnA3y5dQ=","AFdhuMauyxqMpOpN/CyDdgZKSoAEzu2iEKVSQFYt3BM=","EMnigxWdWMtMsuNf3oOjuh/cKAAu2ZY9KpnxhheKFI0="],["DDmen2eqQHB6ID/u+wuVi72tzsXKNJAdJT0CaiQZ9qI=","CD8N8/GgNR0DMOw/9gLKjMNTt/bnYscQcYTNe0I0SfY=","Gmdk1ZQ/xKcgtMChn9uMcRmEMHKHpYubX59dWCEssmM=","ARpjom/qv4f6Zr3mbMJakiyWOC12xqf/SPFTe+rtaDo=","CMp7ZGV8NUjzK+9bY60kKIpBwLJRCZrSf5Q0MH4+ZNQ=","AZmCcEcek2GVVEawzbi+qRXsBnXxzWSN3LBDA1B6RIk="],["HWs9X26jacJvgl0jYpM+qjHqNewKd8H72eAcoVI+RDI=","EZ7xiLs90NMjBpdsGZQehmS+aH56aWkton2iFabwbUA=","LZ4KtcBok9/f0DSBOBuoa25ikt9WCdcfLGSy2aefgJ4=","JfFmMb93Bg9+o0CHwCW/E1eEMZ7wjNouMUGe4KUp5lg=","FEx6EdpafF2rrj8z+9A8rYbRi8WUx5pJfsuYlO21VPE=","D5cRYmJ3I/P+rayyiwwQTLj3TeUIdS+o18DbKvE96O4="],["JL5RAJVDYgbdCr0LDLuVyIOrMEqlJZixppMG7JgaaI0=","IRYQ4q1KN3Qm+t9waLDBpsKZoWTBwaYD6u2USHDQubk=","FaZ9mBBBsfbwnz+evv2GTnedOvCBV3hqwHdQXlDsefw=","BJMn+nnSjBKiyCQGlH938Gd1sCh0aLMTaHdwHb58lZg=","IwlA3MUjJlj/nClpej/UFtFw6MmY8aqF3qDELXn5Uao=","GxIcBJzRFZ4okAfgydqZlcxLq0wm+4iOw5cqii5laWQ="]]}},143:t=>{"use strict";const e=BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617"),n=[56,57,56,60,60,63,64,63,60,66,60,65,70,60,64,68],o=t=>{let n=t*t;return t*n*n%e};function i(t,n){const o=[];for(let i=0;i<t.length;i++){let r=0n;for(let e=0;e<t.length;e++)r+=n[i][e]*t[e];o.push(r%e)}return o}t.exports=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const a=t.map((t=>BigInt(t)));if(a.length<=0)throw new Error("poseidon-lite: Not enough inputs");if(a.length>n.length)throw new Error("poseidon-lite: Too many inputs");const c=a.length+1,s=n[c-2],{C:l,M:d}=e;if(d.length!==c)throw new Error("poseidon-lite: Incorrect M length, expected ".concat(c," got ").concat(d.length));let u=[0n,...a];for(let t=0;t<8+s;t++){for(let e=0;e<u.length;e++)u[e]=u[e]+l[t*c+e],(t<4||t>=4+s||0===e)&&(u[e]=o(u[e]));u=i(u,d)}if("number"!=typeof r)throw new Error("poseidon-lite: expected nOuts to be number got ".concat(typeof r));if(1===r)return u[0];if(r<=u.length)return u.slice(0,r);throw new Error("poseidon-lite: Invalid number of outputs requested ".concat(r,", max ").concat(u.length))}},851:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e){if(Array.isArray(e))return e.map(t);if("object"==typeof e){const n={};for(const[o,i]of Object.entries(e))n[o]=t(i);return n}const n=[...Uint8Array.from(atob(e),(t=>t.charCodeAt(0)))].map((t=>t.toString(16).padStart(2,"0"))).join("");return BigInt("0x".concat(n))}},544:(t,e,n)=>{"use strict";e.S=function(t,e){return(0,o.default)(t,c,e)};var o=a(n(143)),i=a(n(851)),r=a(n(53));function a(t){return t&&t.__esModule?t:{default:t}}const c=(0,i.default)(r.default)},869:(t,e,n)=>{"use strict";e.Z=function(t,e){return(0,o.default)(t,c,e)};var o=a(n(143)),i=a(n(851)),r=a(n(552));function a(t){return t&&t.__esModule?t:{default:t}}const c=(0,i.default)(r.default)},493:(t,e)=>{"use strict";Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen");Symbol.for("react.module.reference")},409:(t,e,n)=>{"use strict";n(493)},568:(t,e)=>{"use strict";var n=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function i(t,e,o){var i=null;if(void 0!==o&&(i=""+o),void 0!==e.key&&(i=""+e.key),"key"in e)for(var r in o={},e)"key"!==r&&(o[r]=e[r]);else o=e;return e=o.ref,{$$typeof:n,type:t,key:i,ref:void 0!==e?e:null,props:o}}e.Fragment=o,e.jsx=i,e.jsxs=i},74:(t,e,n)=>{"use strict";t.exports=n(568)},966:function(t,e,n){!function(t){"use strict";function e(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}function o(t,e){Object.defineProperty(this,"kind",{value:t,enumerable:!0}),e&&e.length&&Object.defineProperty(this,"path",{value:e,enumerable:!0})}function i(t,e,n){i.super_.call(this,"E",t),Object.defineProperty(this,"lhs",{value:e,enumerable:!0}),Object.defineProperty(this,"rhs",{value:n,enumerable:!0})}function r(t,e){r.super_.call(this,"N",t),Object.defineProperty(this,"rhs",{value:e,enumerable:!0})}function a(t,e){a.super_.call(this,"D",t),Object.defineProperty(this,"lhs",{value:e,enumerable:!0})}function c(t,e,n){c.super_.call(this,"A",t),Object.defineProperty(this,"index",{value:e,enumerable:!0}),Object.defineProperty(this,"item",{value:n,enumerable:!0})}function s(t,e,n){var o=t.slice((n||e)+1||t.length);return t.length=e<0?t.length+e:e,t.push.apply(t,o),t}function l(t){var e=void 0===t?"undefined":x(t);return"object"!==e?e:t===Math?"math":null===t?"null":Array.isArray(t)?"array":"[object Date]"===Object.prototype.toString.call(t)?"date":"function"==typeof t.toString&&/^\/.*\//.test(t.toString())?"regexp":"object"}function d(t,e,n,o,u,f,g){g=g||[];var h=(u=u||[]).slice(0);if(void 0!==f){if(o){if("function"==typeof o&&o(h,f))return;if("object"===(void 0===o?"undefined":x(o))){if(o.prefilter&&o.prefilter(h,f))return;if(o.normalize){var p=o.normalize(h,f,t,e);p&&(t=p[0],e=p[1])}}}h.push(f)}"regexp"===l(t)&&"regexp"===l(e)&&(t=t.toString(),e=e.toString());var _=void 0===t?"undefined":x(t),m=void 0===e?"undefined":x(e),y="undefined"!==_||g&&g[g.length-1].lhs&&g[g.length-1].lhs.hasOwnProperty(f),L="undefined"!==m||g&&g[g.length-1].rhs&&g[g.length-1].rhs.hasOwnProperty(f);if(!y&&L)n(new r(h,e));else if(!L&&y)n(new a(h,t));else if(l(t)!==l(e))n(new i(h,t,e));else if("date"===l(t)&&t-e!=0)n(new i(h,t,e));else if("object"===_&&null!==t&&null!==e)if(g.filter((function(e){return e.lhs===t})).length)t!==e&&n(new i(h,t,e));else{if(g.push({lhs:t,rhs:e}),Array.isArray(t)){var b;for(t.length,b=0;b<t.length;b++)b>=e.length?n(new c(h,b,new a(void 0,t[b]))):d(t[b],e[b],n,o,h,b,g);for(;b<e.length;)n(new c(h,b,new r(void 0,e[b++])))}else{var A=Object.keys(t),w=Object.keys(e);A.forEach((function(i,r){var a=w.indexOf(i);a>=0?(d(t[i],e[i],n,o,h,i,g),w=s(w,a)):d(t[i],void 0,n,o,h,i,g)})),w.forEach((function(t){d(void 0,e[t],n,o,h,t,g)}))}g.length=g.length-1}else t!==e&&("number"===_&&isNaN(t)&&isNaN(e)||n(new i(h,t,e)))}function u(t,e,n,o){return o=o||[],d(t,e,(function(t){t&&o.push(t)}),n),o.length?o:void 0}function f(t,e,n){if(n.path&&n.path.length){var o,i=t[e],r=n.path.length-1;for(o=0;o<r;o++)i=i[n.path[o]];switch(n.kind){case"A":f(i[n.path[o]],n.index,n.item);break;case"D":delete i[n.path[o]];break;case"E":case"N":i[n.path[o]]=n.rhs}}else switch(n.kind){case"A":f(t[e],n.index,n.item);break;case"D":t=s(t,e);break;case"E":case"N":t[e]=n.rhs}return t}function g(t,e,n){if(t&&e&&n&&n.kind){for(var o=t,i=-1,r=n.path?n.path.length-1:0;++i<r;)void 0===o[n.path[i]]&&(o[n.path[i]]="number"==typeof n.path[i]?[]:{}),o=o[n.path[i]];switch(n.kind){case"A":f(n.path?o[n.path[i]]:o,n.index,n.item);break;case"D":delete o[n.path[i]];break;case"E":case"N":o[n.path[i]]=n.rhs}}}function h(t,e,n){if(n.path&&n.path.length){var o,i=t[e],r=n.path.length-1;for(o=0;o<r;o++)i=i[n.path[o]];switch(n.kind){case"A":h(i[n.path[o]],n.index,n.item);break;case"D":case"E":i[n.path[o]]=n.lhs;break;case"N":delete i[n.path[o]]}}else switch(n.kind){case"A":h(t[e],n.index,n.item);break;case"D":case"E":t[e]=n.lhs;break;case"N":t=s(t,e)}return t}function p(t){return"color: "+B[t].color+"; font-weight: bold"}function _(t,e,n,o){var i=u(t,e);try{o?n.groupCollapsed("diff"):n.group("diff")}catch(t){n.log("diff")}i?i.forEach((function(t){var e=t.kind,o=function(t){var e=t.kind,n=t.path,o=t.lhs,i=t.rhs,r=t.index,a=t.item;switch(e){case"E":return[n.join("."),o,"→",i];case"N":return[n.join("."),i];case"D":return[n.join(".")];case"A":return[n.join(".")+"["+r+"]",a];default:return[]}}(t);n.log.apply(n,["%c "+B[e].text,p(e)].concat(v(o)))})):n.log("—— no diff ——");try{n.groupEnd()}catch(t){n.log("—— diff end —— ")}}function m(t,e,n,o){switch(void 0===t?"undefined":x(t)){case"object":return"function"==typeof t[o]?t[o].apply(t,v(n)):t[o];case"function":return t(e);default:return t}}function y(t,e){var n=e.logger,o=e.actionTransformer,i=e.titleFormatter,r=void 0===i?function(t){var e=t.timestamp,n=t.duration;return function(t,o,i){var r=["action"];return r.push("%c"+String(t.type)),e&&r.push("%c@ "+o),n&&r.push("%c(in "+i.toFixed(2)+" ms)"),r.join(" ")}}(e):i,a=e.collapsed,c=e.colors,s=e.level,l=e.diff,d=void 0===e.titleFormatter;t.forEach((function(i,u){var f=i.started,g=i.startedTime,h=i.action,p=i.prevState,y=i.error,L=i.took,b=i.nextState,A=t[u+1];A&&(b=A.prevState,L=A.started-f);var w=o(h),C="function"==typeof a?a((function(){return b}),h,i):a,x=I(g),v=c.title?"color: "+c.title(w)+";":"",E=["color: gray; font-weight: lighter;"];E.push(v),e.timestamp&&E.push("color: gray; font-weight: lighter;"),e.duration&&E.push("color: gray; font-weight: lighter;");var B=r(w,x,L);try{C?c.title&&d?n.groupCollapsed.apply(n,["%c "+B].concat(E)):n.groupCollapsed(B):c.title&&d?n.group.apply(n,["%c "+B].concat(E)):n.group(B)}catch(t){n.log(B)}var F=m(s,w,[p],"prevState"),O=m(s,w,[w],"action"),S=m(s,w,[y,p],"error"),P=m(s,w,[b],"nextState");if(F)if(c.prevState){var j="color: "+c.prevState(p)+"; font-weight: bold";n[F]("%c prev state",j,p)}else n[F]("prev state",p);if(O)if(c.action){var U="color: "+c.action(w)+"; font-weight: bold";n[O]("%c action ",U,w)}else n[O]("action ",w);if(y&&S)if(c.error){var k="color: "+c.error(y,p)+"; font-weight: bold;";n[S]("%c error ",k,y)}else n[S]("error ",y);if(P)if(c.nextState){var M="color: "+c.nextState(b)+"; font-weight: bold";n[P]("%c next state",M,b)}else n[P]("next state",b);l&&_(p,b,n,C);try{n.groupEnd()}catch(t){n.log("—— log end ——")}}))}function L(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},F,t),n=e.logger,o=e.stateTransformer,i=e.errorTransformer,r=e.predicate,a=e.logErrors,c=e.diffPredicate;if(void 0===n)return function(){return function(t){return function(e){return t(e)}}};if(t.getState&&t.dispatch)return console.error("[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:\n// Logger with default options\nimport { logger } from 'redux-logger'\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n// Or you can create your own logger with custom options http://bit.ly/redux-logger-options\nimport createLogger from 'redux-logger'\nconst logger = createLogger({\n // ...options\n});\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n"),function(){return function(t){return function(e){return t(e)}}};var s=[];return function(t){var n=t.getState;return function(t){return function(l){if("function"==typeof r&&!r(n,l))return t(l);var d={};s.push(d),d.started=C.now(),d.startedTime=new Date,d.prevState=o(n()),d.action=l;var u=void 0;if(a)try{u=t(l)}catch(t){d.error=i(t)}else u=t(l);d.took=C.now()-d.started,d.nextState=o(n());var f=e.diff&&"function"==typeof c?c(n,l):e.diff;if(y(s,Object.assign({},e,{diff:f})),s.length=0,d.error)throw d.error;return u}}}}var b,A,w=function(t,e){return function(t,e){return new Array(e+1).join(t)}("0",e-t.toString().length)+t},I=function(t){return w(t.getHours(),2)+":"+w(t.getMinutes(),2)+":"+w(t.getSeconds(),2)+"."+w(t.getMilliseconds(),3)},C="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance:Date,x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)},E=[];b="object"===(void 0===n.g?"undefined":x(n.g))&&n.g?n.g:"undefined"!=typeof window?window:{},(A=b.DeepDiff)&&E.push((function(){void 0!==A&&b.DeepDiff===u&&(b.DeepDiff=A,A=void 0)})),e(i,o),e(r,o),e(a,o),e(c,o),Object.defineProperties(u,{diff:{value:u,enumerable:!0},observableDiff:{value:d,enumerable:!0},applyDiff:{value:function(t,e,n){t&&e&&d(t,e,(function(o){n&&!n(t,e,o)||g(t,e,o)}))},enumerable:!0},applyChange:{value:g,enumerable:!0},revertChange:{value:function(t,e,n){if(t&&e&&n&&n.kind){var o,i,r=t;for(i=n.path.length-1,o=0;o<i;o++)void 0===r[n.path[o]]&&(r[n.path[o]]={}),r=r[n.path[o]];switch(n.kind){case"A":h(r[n.path[o]],n.index,n.item);break;case"D":case"E":r[n.path[o]]=n.lhs;break;case"N":delete r[n.path[o]]}}},enumerable:!0},isConflict:{value:function(){return void 0!==A},enumerable:!0},noConflict:{value:function(){return E&&(E.forEach((function(t){t()})),E=null),u},enumerable:!0}});var B={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},F={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(t){return t},actionTransformer:function(t){return t},errorTransformer:function(t){return t},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},O=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.dispatch,n=t.getState;return"function"==typeof e||"function"==typeof n?L()({dispatch:e,getState:n}):void console.error("\n[redux-logger v3] BREAKING CHANGE\n[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.\n[redux-logger v3] Change\n[redux-logger v3] import createLogger from 'redux-logger'\n[redux-logger v3] to\n[redux-logger v3] import { createLogger } from 'redux-logger'\n")};t.defaults=F,t.createLogger=L,t.logger=O,t.default=O,Object.defineProperty(t,"__esModule",{value:!0})}(e)},863:t=>{t.exports=function(t,e,n,o){var i=n?n.call(o,t,e):void 0;if(void 0!==i)return!!i;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var r=Object.keys(t),a=Object.keys(e);if(r.length!==a.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(e),s=0;s<r.length;s++){var l=r[s];if(!c(l))return!1;var d=t[l],u=e[l];if(!1===(i=n?n.call(o,d,u,l):void 0)||void 0===i&&d!==u)return!1}return!0}},795:(t,e,n)=>{"use strict";var o=n(155),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},r=o.useState,a=o.useEffect,c=o.useLayoutEffect,s=o.useDebugValue;function l(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!i(t,n)}catch(t){return!0}}var d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),o=r({inst:{value:n,getSnapshot:e}}),i=o[0].inst,d=o[1];return c((function(){i.value=n,i.getSnapshot=e,l(i)&&d({inst:i})}),[t,n,e]),a((function(){return l(i)&&d({inst:i}),t((function(){l(i)&&d({inst:i})}))}),[t]),s(n),n};e.useSyncExternalStore=void 0!==o.useSyncExternalStore?o.useSyncExternalStore:d},120:(t,e,n)=>{"use strict";var o=n(155),i=n(614),r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},a=i.useSyncExternalStore,c=o.useRef,s=o.useEffect,l=o.useMemo,d=o.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,o,i){var u=c(null);if(null===u.current){var f={hasValue:!1,value:null};u.current=f}else f=u.current;u=l((function(){function t(t){if(!s){if(s=!0,a=t,t=o(t),void 0!==i&&f.hasValue){var e=f.value;if(i(e,t))return c=e}return c=t}if(e=c,r(a,t))return e;var n=o(t);return void 0!==i&&i(e,n)?(a=t,e):(a=t,c=n)}var a,c,s=!1,l=void 0===n?null:n;return[function(){return t(e())},null===l?void 0:function(){return t(l())}]}),[e,n,o,i]);var g=a(t,u[0],u[1]);return s((function(){f.hasValue=!0,f.value=g}),[g]),d(g),g}},614:(t,e,n)=>{"use strict";t.exports=n(795)},368:(t,e,n)=>{"use strict";t.exports=n(120)},35:(t,e,n)=>{"use strict";n.d(e,{A:()=>b});var o=n(547),i=n.n(o),r=n(532),a=n.n(r),c=n(151),s=n.n(c),l=new URL(n(76),n.b),d=new URL(n(346),n.b),u=new URL(n(209),n.b),f=new URL(n(729),n.b),g=new URL(n(172),n.b),h=a()(i()),p=s()(l),_=s()(d),m=s()(u),y=s()(f),L=s()(g);h.push([t.id,`@font-face{font-family:"Inter";font-weight:400;src:url(${p}) format("woff2"),url(${_}) format("woff")}@font-face{font-family:"Inter";font-weight:700;src:url(${m}) format("woff2"),url(${y}) format("woff")}@font-face{font-family:"Inter";font-weight:500;src:url(${L}) format("opentype")}`,""]);const b=h},32:t=>{t.exports=[{title:"GitHub",id:"1",service:"GitHub",description:"Authorize you GitHub account",icon:"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/GitHub_Invertocat_Logo.svg/2560px-GitHub_Invertocat_Logo.svg.png",groups:[{points:10,semaphoreGroupId:"110",credentialGroupId:"6"}]}]},704:t=>{t.exports=[{title:"GitHub",id:"1",service:"GitHub",description:"Authorize you GitHub account",icon:"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/GitHub_Invertocat_Logo.svg/2560px-GitHub_Invertocat_Logo.svg.png",groups:[{points:10,semaphoreGroupId:"110",credentialGroupId:"6"}]}]},72:t=>{"use strict";var e=[];function n(t){for(var n=-1,o=0;o<e.length;o++)if(e[o].identifier===t){n=o;break}return n}function o(t,o){for(var r={},a=[],c=0;c<t.length;c++){var s=t[c],l=o.base?s[0]+o.base:s[0],d=r[l]||0,u="".concat(l," ").concat(d);r[l]=d+1;var f=n(u),g={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==f)e[f].references++,e[f].updater(g);else{var h=i(g,o);o.byIndex=c,e.splice(c,0,{identifier:u,updater:h,references:1})}a.push(u)}return a}function i(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,i){var r=o(t=t||[],i=i||{});return function(t){t=t||[];for(var a=0;a<r.length;a++){var c=n(r[a]);e[c].references--}for(var s=o(t,i),l=0;l<r.length;l++){var d=n(r[l]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}r=s}}},659:t=>{"use strict";var e={};t.exports=function(t,n){var o=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},56:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,i&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleTagTransform(o,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},729:(t,e,n)=>{"use strict";t.exports=n.p+"225dac4c8f3394d7770e.woff"},209:(t,e,n)=>{"use strict";t.exports=n.p+"3717db0be15085acc210.woff2"},172:(t,e,n)=>{"use strict";t.exports=n.p+"8386f9c82a1101e6a8d4.otf"},346:(t,e,n)=>{"use strict";t.exports=n.p+"0be946bd9dff2d19df7a.woff"},76:(t,e,n)=>{"use strict";t.exports=n.p+"f80c55a7aedf386182e8.woff2"},155:e=>{"use strict";e.exports=t},514:t=>{"use strict";t.exports=e}},o={};function i(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={id:t,exports:{}};return n[t].call(r.exports,r,r.exports,i),r.exports}i.m=n,i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;i.g.importScripts&&(t=i.g.location+"");var e=i.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=n[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=t})(),i.b=document.baseURI||self.location.href,i.nc=void 0;var r={};return(()=>{"use strict";i.r(r),i.d(r,{BringIDExtensionSDK:()=>Kd,BringIDRequestsSDK:()=>Xo,ConnectDialog:()=>Gd,VerificationsDialog:()=>TL,openModal:()=>BL,requestProofs:()=>FL});const t={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let e;const n=new Uint8Array(16),o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));function a(t,i,r){var a,c,s,l;const d=null!==(a=null!==(c=(t=t||{}).random)&&void 0!==c?c:null===(s=(l=t).rng)||void 0===s?void 0:s.call(l))&&void 0!==a?a:function(){if(!e){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");e=crypto.getRandomValues.bind(crypto)}return e(n)}();if(d.length<16)throw new Error("Random bytes length must be >= 16");if(d[6]=15&d[6]|64,d[8]=63&d[8]|128,i){if((r=r||0)<0||r+16>i.length)throw new RangeError("UUID byte range ".concat(r,":").concat(r+15," is out of buffer bounds"));for(let t=0;t<16;++t)i[r+t]=d[t];return i}return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]).toLowerCase()}(d)}const c=()=>function(e,n,o){return!t.randomUUID||n||e?a(e,n,o):t.randomUUID()}();function s(t,e,n){const o=e.split("|").map((t=>t.trim()));for(let n=0;n<o.length;n++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error("invalid value for type ".concat(e));throw i.code="INVALID_ARGUMENT",i.argument="value.".concat(n),i.value=t,i}function l(t,e,n){for(let o in e){let i=e[o];const r=n?n[o]:null;r&&s(i,r,o),Object.defineProperty(t,o,{enumerable:!0,value:i,writable:!1})}}function d(t){if(null==t)return"null";if(Array.isArray(t))return"[ "+t.map(d).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let o=0;o<t.length;o++)n+=e[t[o]>>4],n+=e[15&t[o]];return n}if("object"==typeof t&&"function"==typeof t.toJSON)return d(t.toJSON());switch(typeof t){case"boolean":case"symbol":case"number":return t.toString();case"bigint":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map((e=>"".concat(d(e),": ").concat(d(t[e])))).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function u(t,e){return t&&t.code===e}function f(t,e,n){let o,i=t;{const o=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error("value will overwrite populated values: ".concat(d(n)));for(const t in n){if("shortMessage"===t)continue;const e=n[t];o.push(t+"="+d(e))}}o.push("code=".concat(e)),o.push("version=".concat("6.13.5")),o.length&&(t+=" ("+o.join(", ")+")")}switch(e){case"INVALID_ARGUMENT":o=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":o=new RangeError(t);break;default:o=new Error(t)}return l(o,{code:e}),n&&Object.assign(o,n),null==o.shortMessage&&l(o,{shortMessage:i}),o}function g(t,e,n,o){if(!t)throw f(e,n,o)}function h(t,e,n,o){g(t,e,"INVALID_ARGUMENT",{argument:n,value:o})}function p(t,e,n){null==n&&(n=""),n&&(n=": "+n),g(t>=e,"missing argument"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),g(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const _=["NFD","NFC","NFKD","NFKC"].reduce(((t,e)=>{try{if("test"!=="test".normalize(e))throw new Error("bad");if("NFD"===e){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}t.push(e)}catch(t){}return t}),[]);function m(t,e,n){if(null==n&&(n=""),t!==e){let t=n,e="new";n&&(t+=".",e+=" "+n),g(!1,"private constructor; use ".concat(t,"from* methods"),"UNSUPPORTED_OPERATION",{operation:e})}}const y=BigInt(0),L=BigInt(1),b=9007199254740991;function A(t,e){const n=I(t,"value"),o=BigInt(v(e,"bits"));return n&(L<<o)-L}function w(t,e){switch(typeof t){case"bigint":return t;case"number":return h(Number.isInteger(t),"underflow",e||"value",t),h(t>=-b&&t<=b,"overflow",e||"value",t),BigInt(t);case"string":try{if(""===t)throw new Error("empty string");return"-"===t[0]&&"-"!==t[1]?-BigInt(t.substring(1)):BigInt(t)}catch(n){h(!1,"invalid BigNumberish string: ".concat(n.message),e||"value",t)}}h(!1,"invalid BigNumberish value",e||"value",t)}function I(t,e){const n=w(t,e);return g(n>=y,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const C="0123456789abcdef";function x(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=C[n>>4],e+=C[15&n];return BigInt(e)}return w(t)}function v(t,e){switch(typeof t){case"bigint":return h(t>=-b&&t<=b,"overflow",e||"value",t),Number(t);case"number":return h(Number.isInteger(t),"underflow",e||"value",t),h(t>=-b&&t<=b,"overflow",e||"value",t),t;case"string":try{if(""===t)throw new Error("empty string");return v(BigInt(t),e)}catch(n){h(!1,"invalid numeric string: ".concat(n.message),e||"value",t)}}h(!1,"invalid numeric value",e||"value",t)}function E(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if("string"==typeof t&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const e=new Uint8Array((t.length-2)/2);let n=2;for(let o=0;o<e.length;o++)e[o]=parseInt(t.substring(n,n+2),16),n+=2;return e}h(!1,"invalid BytesLike value",e||"value",t)}function B(t,e){return E(t,e,!1)}function F(t,e){return E(t,e,!0)}const O="0123456789abcdef";function S(t){const e=B(t);let n="0x";for(let t=0;t<e.length;t++){const o=e[t];n+=O[(240&o)>>4]+O[15&o]}return n}function P(t){return"0x"+t.map((t=>S(t).substring(2))).join("")}function j(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var U=0;function k(t){return"__private_"+U+++"_"+t}const M=32,T=new Uint8Array(M),z=["then"],Q={},N=new WeakMap;function D(t){return N.get(t)}function R(t,e){N.set(t,e)}function q(t,e){const n=new Error("deferred error during ABI decoding triggered accessing ".concat(t));throw n.error=e,n}function G(t,e,n){return t.indexOf(null)>=0?e.map(((t,e)=>t instanceof V?G(D(t),t,n):t)):t.reduce(((t,o,i)=>{let r=e.getValue(o);return o in t||(n&&r instanceof V&&(r=G(D(r),r,n)),t[o]=r),t}),{})}var K=k("names");class V extends Array{constructor(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const o=e[0];let i=e[1],r=(e[2]||[]).slice(),a=!0;o!==Q&&(i=e,r=[],a=!1),super(i.length),Object.defineProperty(this,K,{writable:!0,value:void 0}),i.forEach(((t,e)=>{this[e]=t}));const c=r.reduce(((t,e)=>("string"==typeof e&&t.set(e,(t.get(e)||0)+1),t)),new Map);if(R(this,Object.freeze(i.map(((t,e)=>{const n=r[e];return null!=n&&1===c.get(n)?n:null})))),j(this,K)[K]=[],null==j(this,K)[K]&&j(this,K)[K],!a)return;Object.freeze(this);const s=new Proxy(this,{get:(t,e,n)=>{if("string"==typeof e){if(e.match(/^[0-9]+$/)){const n=v(e,"%index");if(n<0||n>=this.length)throw new RangeError("out of result range");const o=t[n];return o instanceof Error&&q("index ".concat(n),o),o}if(z.indexOf(e)>=0)return Reflect.get(t,e,n);const o=t[e];if(o instanceof Function)return function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return o.apply(this===n?t:this,i)};if(!(e in t))return t.getValue.apply(this===n?t:this,[e])}return Reflect.get(t,e,n)}});return R(s,D(this)),s}toArray(t){const e=[];return this.forEach(((n,o)=>{n instanceof Error&&q("index ".concat(o),n),t&&n instanceof V&&(n=n.toArray(t)),e.push(n)})),e}toObject(t){const e=D(this);return e.reduce(((n,o,i)=>(g(null!=o,"value at index ".concat(i," unnamed"),"UNSUPPORTED_OPERATION",{operation:"toObject()"}),G(e,this,t))),{})}slice(t,e){null==t&&(t=0),t<0&&(t+=this.length)<0&&(t=0),null==e&&(e=this.length),e<0&&(e+=this.length)<0&&(e=0),e>this.length&&(e=this.length);const n=D(this),o=[],i=[];for(let r=t;r<e;r++)o.push(this[r]),i.push(n[r]);return new V(Q,o,i)}filter(t,e){const n=D(this),o=[],i=[];for(let r=0;r<this.length;r++){const a=this[r];a instanceof Error&&q("index ".concat(r),a),t.call(e,a,r,this)&&(o.push(a),i.push(n[r]))}return new V(Q,o,i)}map(t,e){const n=[];for(let o=0;o<this.length;o++){const i=this[o];i instanceof Error&&q("index ".concat(o),i),n.push(t.call(e,i,o,this))}return n}getValue(t){const e=D(this).indexOf(t);if(-1===e)return;const n=this[e];return n instanceof Error&&q("property ".concat(JSON.stringify(t)),n.error),n}static fromItems(t,e){return new V(Q,t,e)}}function H(t){let e=function(t){const e=I(t,"value");if(e===y)return new Uint8Array([]);let n=e.toString(16);n.length%2&&(n="0"+n);const o=new Uint8Array(n.length/2);for(let t=0;t<o.length;t++){const e=2*t;o[t]=parseInt(n.substring(e,e+2),16)}return o}(t);return g(e.length<=M,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:M,offset:e.length}),e.length!==M&&(e=F(P([T.slice(e.length%M),e]))),e}class Y{constructor(t,e,n,o){this.name=void 0,this.type=void 0,this.localName=void 0,this.dynamic=void 0,l(this,{name:t,type:e,localName:n,dynamic:o},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,e){h(!1,t,this.localName,e)}}var J=k("data"),W=k("dataLength"),X=k("writeData");class Z{constructor(){Object.defineProperty(this,X,{value:$}),Object.defineProperty(this,J,{writable:!0,value:void 0}),Object.defineProperty(this,W,{writable:!0,value:void 0}),j(this,J)[J]=[],j(this,W)[W]=0}get data(){return P(j(this,J)[J])}get length(){return j(this,W)[W]}appendWriter(t){return j(this,X)[X](F(t.data))}writeBytes(t){let e=F(t);const n=e.length%M;return n&&(e=F(P([e,T.slice(n)]))),j(this,X)[X](e)}writeValue(t){return j(this,X)[X](H(t))}writeUpdatableValue(){const t=j(this,J)[J].length;return j(this,J)[J].push(T),j(this,W)[W]+=M,e=>{j(this,J)[J][t]=H(e)}}}function $(t){return j(this,J)[J].push(t),j(this,W)[W]+=t.length,t.length}var tt=k("data"),et=k("offset"),nt=k("bytesRead"),ot=k("parent"),it=k("maxInflation"),rt=k("incrementBytesRead"),at=k("peekBytes");class ct{constructor(t,e,n){Object.defineProperty(this,at,{value:lt}),Object.defineProperty(this,rt,{value:st}),this.allowLoose=void 0,Object.defineProperty(this,tt,{writable:!0,value:void 0}),Object.defineProperty(this,et,{writable:!0,value:void 0}),Object.defineProperty(this,nt,{writable:!0,value:void 0}),Object.defineProperty(this,ot,{writable:!0,value:void 0}),Object.defineProperty(this,it,{writable:!0,value:void 0}),l(this,{allowLoose:!!e}),j(this,tt)[tt]=F(t),j(this,nt)[nt]=0,j(this,ot)[ot]=null,j(this,it)[it]=null!=n?n:1024,j(this,et)[et]=0}get data(){return S(j(this,tt)[tt])}get dataLength(){return j(this,tt)[tt].length}get consumed(){return j(this,et)[et]}get bytes(){return new Uint8Array(j(this,tt)[tt])}subReader(t){const e=new ct(j(this,tt)[tt].slice(j(this,et)[et]+t),this.allowLoose,j(this,it)[it]);return j(e,ot)[ot]=this,e}readBytes(t,e){let n=j(this,at)[at](0,t,!!e);return j(this,rt)[rt](t),j(this,et)[et]+=n.length,n.slice(0,t)}readValue(){return x(this.readBytes(M))}readIndex(){return v(x(this.readBytes(M)))}}function st(t){if(j(this,ot)[ot])return j(j(this,ot)[ot],rt)[rt](t);j(this,nt)[nt]+=t,g(j(this,it)[it]<1||j(this,nt)[nt]<=j(this,it)[it]*this.dataLength,"compressed ABI data exceeds inflation ratio of ".concat(j(this,it)[it]," ( see: https://github.com/ethers-io/ethers.js/issues/4537 )"),"BUFFER_OVERRUN",{buffer:F(j(this,tt)[tt]),offset:j(this,et)[et],length:t,info:{bytesRead:j(this,nt)[nt],dataLength:this.dataLength}})}function lt(t,e,n){let o=Math.ceil(e/M)*M;return j(this,et)[et]+o>j(this,tt)[tt].length&&(this.allowLoose&&n&&j(this,et)[et]+e<=j(this,tt)[tt].length?o=e:g(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:F(j(this,tt)[tt]),length:j(this,tt)[tt].length,offset:j(this,et)[et]+o})),j(this,tt)[tt].slice(j(this,et)[et],j(this,et)[et]+o)}function dt(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("Wrong positive integer: ".concat(t))}function ut(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];if(n.length>0&&!n.includes(t.length))throw new Error("Expected Uint8Array of length ".concat(n,", not of length=").concat(t.length))}function ft(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}const gt=BigInt(2**32-1),ht=BigInt(32);function pt(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?{h:Number(t>),l:Number(t>>ht>)}:{h:0|Number(t>>ht>),l:0|Number(t>)}}function _t(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Uint32Array(t.length),o=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:r,l:a}=pt(t[i],e);[n[i],o[i]]=[r,a]}return[n,o]}if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function mt(t){if("string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got ".concat(typeof t));return new Uint8Array((new TextEncoder).encode(t))}(t)),!(t=>t instanceof Uint8Array)(t))throw new Error("expected Uint8Array, got ".concat(typeof t));return t}class yt{clone(){return this._cloneInto()}}const[Lt,bt,At]=[[],[],[]],wt=BigInt(0),It=BigInt(1),Ct=BigInt(2),xt=BigInt(7),vt=BigInt(256),Et=BigInt(113);for(let t=0,e=It,n=1,o=0;t<24;t++){[n,o]=[o,(2*n+3*o)%5],Lt.push(2*(5*o+n)),bt.push((t+1)*(t+2)/2%64);let i=wt;for(let t=0;t<7;t++)e=(e<<It^(e>>xt)*Et)%vt,e&Ct&&(i^=It<<(It<<BigInt(t))-It);At.push(i)}const[Bt,Ft]=_t(At,!0),Ot=(t,e,n)=>n>32?((t,e,n)=>e<<n-32|t>>>64-n)(t,e,n):((t,e,n)=>t<<n|e>>>32-n)(t,e,n),St=(t,e,n)=>n>32?((t,e,n)=>t<<n-32|e>>>64-n)(t,e,n):((t,e,n)=>e<<n|t>>>32-n)(t,e,n);class Pt extends yt{constructor(t,e,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=o,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,dt(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var r;this.state=new Uint8Array(200),this.state32=(r=this.state,new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)))}keccak(){!function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24;const n=new Uint32Array(10);for(let o=24-e;o<24;o++){for(let e=0;e<10;e++)n[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const o=(e+8)%10,i=(e+2)%10,r=n[i],a=n[i+1],c=Ot(r,a,1)^n[o],s=St(r,a,1)^n[o+1];for(let n=0;n<50;n+=10)t[e+n]^=c,t[e+n+1]^=s}let e=t[2],i=t[3];for(let n=0;n<24;n++){const o=bt[n],r=Ot(e,i,o),a=St(e,i,o),c=Lt[n];e=t[c],i=t[c+1],t[c]=r,t[c+1]=a}for(let e=0;e<50;e+=10){for(let o=0;o<10;o++)n[o]=t[e+o];for(let o=0;o<10;o++)t[e+o]^=~n[(o+2)%10]&n[(o+4)%10]}t[0]^=Bt[o],t[1]^=Ft[o]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){ft(this);const{blockLen:e,state:n}=this,o=(t=mt(t)).length;for(let i=0;i<o;){const r=Math.min(e-this.pos,o-i);for(let e=0;e<r;e++)n[this.pos++]^=t[i++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:n,blockLen:o}=this;t[n]^=e,128&e&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){ft(this,!1),ut(t),this.finish();const e=this.state,{blockLen:n}=this;for(let o=0,i=t.length;o<i;){this.posOut>=n&&this.keccak();const r=Math.min(n-this.posOut,i-o);t.set(e.subarray(this.posOut,this.posOut+r),o),this.posOut+=r,o+=r}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return dt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(function(t,e){ut(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least ".concat(n))}(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:n,outputLen:o,rounds:i,enableXOF:r}=this;return t||(t=new Pt(e,n,o,r,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=o,t.enableXOF=r,t.destroyed=this.destroyed,t}}const jt=((t,e,n)=>function(t){const e=e=>t().update(mt(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}((()=>new Pt(e,t,n))))(1,136,32);let Ut=!1;const kt=function(t){return jt(t)};let Mt=kt;function Tt(t){const e=B(t,"data");return S(Mt(e))}Tt._=kt,Tt.lock=function(){Ut=!0},Tt.register=function(t){if(Ut)throw new TypeError("keccak256 is locked");Mt=t},Object.freeze(Tt);const zt=BigInt(0),Qt=BigInt(36);function Nt(t){const e=(t=t.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let t=0;t<40;t++)n[t]=e[t].charCodeAt(0);const o=B(Tt(n));for(let t=0;t<40;t+=2)o[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&o[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const Dt={};for(let t=0;t<10;t++)Dt[String(t)]=String(t);for(let t=0;t<26;t++)Dt[String.fromCharCode(65+t)]=String(10+t);const Rt=function(){const t={};for(let e=0;e<36;e++)t["0123456789abcdefghijklmnopqrstuvwxyz"[e]]=BigInt(e);return t}();function qt(t){if(h("string"==typeof t,"invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=Nt(t);return h(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){h(t.substring(2,4)===function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>Dt[t])).join("");for(;e.length>=15;){let t=e.substring(0,15);e=parseInt(t,10)%97+e.substring(t.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}(t),"bad icap checksum","address",t);let e=function(t){t=t.toLowerCase();let e=zt;for(let n=0;n<t.length;n++)e=e*Qt+Rt[t[n]];return e}(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return Nt("0x"+e)}h(!1,"invalid address","address",t)}function Gt(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Kt=0;function Vt(t){return"__private_"+Kt+++"_"+t}const Ht={};function Yt(t,e){let n=!1;return e<0&&(n=!0,e*=-1),new Zt(Ht,"".concat(n?"":"u","int").concat(e),t,{signed:n,width:e})}function Jt(t,e){return new Zt(Ht,"bytes".concat(e||""),t,{size:e})}const Wt=Symbol.for("_ethers_typed");var Xt=Vt("options");class Zt{constructor(t,e,n,o){this.type=void 0,this.value=void 0,Object.defineProperty(this,Xt,{writable:!0,value:void 0}),this._typedSymbol=void 0,null==o&&(o=null),m(Ht,t,"Typed"),l(this,{_typedSymbol:Wt,type:e,value:n}),Gt(this,Xt)[Xt]=o,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?"tuple(".concat(this.value.map((t=>t.format())).join(","),")"):this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return Gt(this,Xt)[Xt]}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===Gt(this,Xt)[Xt]?-1:!1===Gt(this,Xt)[Xt]?this.value.length:null}static from(t,e){return new Zt(Ht,t,e)}static uint8(t){return Yt(t,8)}static uint16(t){return Yt(t,16)}static uint24(t){return Yt(t,24)}static uint32(t){return Yt(t,32)}static uint40(t){return Yt(t,40)}static uint48(t){return Yt(t,48)}static uint56(t){return Yt(t,56)}static uint64(t){return Yt(t,64)}static uint72(t){return Yt(t,72)}static uint80(t){return Yt(t,80)}static uint88(t){return Yt(t,88)}static uint96(t){return Yt(t,96)}static uint104(t){return Yt(t,104)}static uint112(t){return Yt(t,112)}static uint120(t){return Yt(t,120)}static uint128(t){return Yt(t,128)}static uint136(t){return Yt(t,136)}static uint144(t){return Yt(t,144)}static uint152(t){return Yt(t,152)}static uint160(t){return Yt(t,160)}static uint168(t){return Yt(t,168)}static uint176(t){return Yt(t,176)}static uint184(t){return Yt(t,184)}static uint192(t){return Yt(t,192)}static uint200(t){return Yt(t,200)}static uint208(t){return Yt(t,208)}static uint216(t){return Yt(t,216)}static uint224(t){return Yt(t,224)}static uint232(t){return Yt(t,232)}static uint240(t){return Yt(t,240)}static uint248(t){return Yt(t,248)}static uint256(t){return Yt(t,256)}static uint(t){return Yt(t,256)}static int8(t){return Yt(t,-8)}static int16(t){return Yt(t,-16)}static int24(t){return Yt(t,-24)}static int32(t){return Yt(t,-32)}static int40(t){return Yt(t,-40)}static int48(t){return Yt(t,-48)}static int56(t){return Yt(t,-56)}static int64(t){return Yt(t,-64)}static int72(t){return Yt(t,-72)}static int80(t){return Yt(t,-80)}static int88(t){return Yt(t,-88)}static int96(t){return Yt(t,-96)}static int104(t){return Yt(t,-104)}static int112(t){return Yt(t,-112)}static int120(t){return Yt(t,-120)}static int128(t){return Yt(t,-128)}static int136(t){return Yt(t,-136)}static int144(t){return Yt(t,-144)}static int152(t){return Yt(t,-152)}static int160(t){return Yt(t,-160)}static int168(t){return Yt(t,-168)}static int176(t){return Yt(t,-176)}static int184(t){return Yt(t,-184)}static int192(t){return Yt(t,-192)}static int200(t){return Yt(t,-200)}static int208(t){return Yt(t,-208)}static int216(t){return Yt(t,-216)}static int224(t){return Yt(t,-224)}static int232(t){return Yt(t,-232)}static int240(t){return Yt(t,-240)}static int248(t){return Yt(t,-248)}static int256(t){return Yt(t,-256)}static int(t){return Yt(t,-256)}static bytes1(t){return Jt(t,1)}static bytes2(t){return Jt(t,2)}static bytes3(t){return Jt(t,3)}static bytes4(t){return Jt(t,4)}static bytes5(t){return Jt(t,5)}static bytes6(t){return Jt(t,6)}static bytes7(t){return Jt(t,7)}static bytes8(t){return Jt(t,8)}static bytes9(t){return Jt(t,9)}static bytes10(t){return Jt(t,10)}static bytes11(t){return Jt(t,11)}static bytes12(t){return Jt(t,12)}static bytes13(t){return Jt(t,13)}static bytes14(t){return Jt(t,14)}static bytes15(t){return Jt(t,15)}static bytes16(t){return Jt(t,16)}static bytes17(t){return Jt(t,17)}static bytes18(t){return Jt(t,18)}static bytes19(t){return Jt(t,19)}static bytes20(t){return Jt(t,20)}static bytes21(t){return Jt(t,21)}static bytes22(t){return Jt(t,22)}static bytes23(t){return Jt(t,23)}static bytes24(t){return Jt(t,24)}static bytes25(t){return Jt(t,25)}static bytes26(t){return Jt(t,26)}static bytes27(t){return Jt(t,27)}static bytes28(t){return Jt(t,28)}static bytes29(t){return Jt(t,29)}static bytes30(t){return Jt(t,30)}static bytes31(t){return Jt(t,31)}static bytes32(t){return Jt(t,32)}static address(t){return new Zt(Ht,"address",t)}static bool(t){return new Zt(Ht,"bool",!!t)}static bytes(t){return new Zt(Ht,"bytes",t)}static string(t){return new Zt(Ht,"string",t)}static array(t,e){throw new Error("not implemented yet")}static tuple(t,e){throw new Error("not implemented yet")}static overrides(t){return new Zt(Ht,"overrides",Object.assign({},t))}static isTyped(t){return t&&"object"==typeof t&&"_typedSymbol"in t&&t._typedSymbol===Wt}static dereference(t,e){if(Zt.isTyped(t)){if(t.type!==e)throw new Error("invalid type: expecetd ".concat(e,", got ").concat(t.type));return t.value}return t}}class $t extends Y{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){let n=Zt.dereference(e,"string");try{n=qt(n)}catch(t){return this._throwError(t.message,e)}return t.writeValue(n)}decode(t){return qt(function(t){let e=I(t,"value").toString(16);{const n=v(20,"width");for(g(2*n>=e.length,"value exceeds width (".concat(n," bytes)"),"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});e.length<2*n;)e="0"+e}return"0x"+e}(t.readValue()))}}class te extends Y{constructor(t){super(t.name,t.type,"_",t.dynamic),this.coder=void 0,this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}function ee(t,e,n){let o=[];if(Array.isArray(n))o=n;else if(n&&"object"==typeof n){let t={};o=e.map((e=>{const o=e.localName;return g(o,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:n}),g(!t[o],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:n}),t[o]=!0,n[o]}))}else h(!1,"invalid tuple value","tuple",n);h(e.length===o.length,"types/value length mismatch","tuple",n);let i=new Z,r=new Z,a=[];e.forEach(((t,e)=>{let n=o[e];if(t.dynamic){let e=r.length;t.encode(r,n);let o=i.writeUpdatableValue();a.push((t=>{o(t+e)}))}else t.encode(i,n)})),a.forEach((t=>{t(i.length)}));let c=t.appendWriter(i);return c+=t.appendWriter(r),c}function ne(t,e){let n=[],o=[],i=t.subReader(0);return e.forEach((e=>{let r=null;if(e.dynamic){let n=t.readIndex(),o=i.subReader(n);try{r=e.decode(o)}catch(t){if(u(t,"BUFFER_OVERRUN"))throw t;r=t,r.baseType=e.name,r.name=e.localName,r.type=e.type}}else try{r=e.decode(t)}catch(t){if(u(t,"BUFFER_OVERRUN"))throw t;r=t,r.baseType=e.name,r.name=e.localName,r.type=e.type}if(null==r)throw new Error("investigate");n.push(r),o.push(e.localName||null)})),V.fromItems(n,o)}class oe extends Y{constructor(t,e,n){super("array",t.type+"["+(e>=0?e:"")+"]",n,-1===e||t.dynamic),this.coder=void 0,this.length=void 0,l(this,{coder:t,length:e})}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let n=0;n<this.length;n++)e.push(t);return e}encode(t,e){const n=Zt.dereference(e,"array");Array.isArray(n)||this._throwError("expected array value",n);let o=this.length;-1===o&&(o=n.length,t.writeValue(n.length)),p(n.length,o,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let t=0;t<n.length;t++)i.push(this.coder);return ee(t,i,n)}decode(t){let e=this.length;-1===e&&(e=t.readIndex(),g(e*M<=t.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:t.bytes,offset:e*M,length:t.dataLength}));let n=[];for(let t=0;t<e;t++)n.push(new te(this.coder));return ne(t,n)}}class ie extends Y{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){const n=Zt.dereference(e,"bool");return t.writeValue(n?1:0)}decode(t){return!!t.readValue()}}class re extends Y{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=F(e);let n=t.writeValue(e.length);return n+=t.writeBytes(e),n}decode(t){return t.readBytes(t.readIndex(),!0)}}class ae extends re{constructor(t){super("bytes",t)}decode(t){return S(super.decode(t))}}class ce extends Y{constructor(t,e){let n="bytes"+String(t);super(n,n,e,!1),this.size=void 0,l(this,{size:t},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let n=F(Zt.dereference(e,this.type));return n.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(n)}decode(t){return S(t.readBytes(this.size))}}const se=new Uint8Array([]);class le extends Y{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes(se)}decode(t){return t.readBytes(0),null}}const de=BigInt(0),ue=BigInt(1),fe=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class ge extends Y{constructor(t,e,n){const o=(e?"int":"uint")+8*t;super(o,o,n,!1),this.size=void 0,this.signed=void 0,l(this,{size:t,signed:e},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(t,e){let n=w(Zt.dereference(e,this.type)),o=A(fe,256);if(this.signed){let t=A(o,8*this.size-1);(n>t||n<-(t+ue))&&this._throwError("value out-of-bounds",e),n=function(t){let e=w(t,"value");const n=BigInt(v(256,"width")),o=L<<n-L;return e<y?(e=-e,g(e<=o,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t}),(~e&(L<<n)-L)+L):(g(e<o,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t}),e)}(n)}else(n<de||n>A(o,8*this.size))&&this._throwError("value out-of-bounds",e);return t.writeValue(n)}decode(t){let e=A(t.readValue(),8*this.size);return this.signed&&(e=function(t,e){const n=I(t,"value"),o=BigInt(v(e,"width"));return g(n>>o===y,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>o-L?-((~n&(L<<o)-L)+L):n}(e,8*this.size)),e}}function he(t,e,n,o,i){if("BAD_PREFIX"===t||"UNEXPECTED_CONTINUE"===t){let t=0;for(let o=e+1;o<n.length&&n[o]>>6==2;o++)t++;return t}return"OVERRUN"===t?n.length-e-1:0}const pe=Object.freeze({error:function(t,e,n,o,i){h(!1,"invalid codepoint at offset ".concat(e,"; ").concat(t),"bytes",n)},ignore:he,replace:function(t,e,n,o,i){return"OVERLONG"===t?(h("number"==typeof i,"invalid bad code point for replacement","badCodepoint",i),o.push(i),0):(o.push(65533),he(t,e,n))}});function _e(t,e){return function(t,e){null==e&&(e=pe.error);const n=B(t,"bytes"),o=[];let i=0;for(;i<n.length;){const t=n[i++];if(!(t>>7)){o.push(t);continue}let r=null,a=null;if(192==(224&t))r=1,a=127;else if(224==(240&t))r=2,a=2047;else{if(240!=(248&t)){i+=e(128==(192&t)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",i-1,n,o);continue}r=3,a=65535}if(i-1+r>=n.length){i+=e("OVERRUN",i-1,n,o);continue}let c=t&(1<<8-r-1)-1;for(let t=0;t<r;t++){let t=n[i];if(128!=(192&t)){i+=e("MISSING_CONTINUE",i,n,o),c=null;break}c=c<<6|63&t,i++}null!==c&&(c>1114111?i+=e("OUT_OF_RANGE",i-1-r,n,o,c):c>=55296&&c<=57343?i+=e("UTF16_SURROGATE",i-1-r,n,o,c):c<=a?i+=e("OVERLONG",i-1-r,n,o,c):o.push(c))}return o}(t,e).map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}class me extends re{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,function(t,e){h("string"==typeof t,"invalid string value","str",t),null!=e&&(function(t){g(_.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}(e),t=t.normalize(e));let n=[];for(let e=0;e<t.length;e++){const o=t.charCodeAt(e);if(o<128)n.push(o);else if(o<2048)n.push(o>>6|192),n.push(63&o|128);else if(55296==(64512&o)){e++;const i=t.charCodeAt(e);h(e<t.length&&56320==(64512&i),"invalid surrogate pair","str",t);const r=65536+((1023&o)<<10)+(1023&i);n.push(r>>18|240),n.push(r>>12&63|128),n.push(r>>6&63|128),n.push(63&r|128)}else n.push(o>>12|224),n.push(o>>6&63|128),n.push(63&o|128)}return new Uint8Array(n)}(Zt.dereference(e,"string")))}decode(t){return _e(super.decode(t))}}class ye extends Y{constructor(t,e){let n=!1;const o=[];t.forEach((t=>{t.dynamic&&(n=!0),o.push(t.type)})),super("tuple","tuple("+o.join(",")+")",e,n),this.coders=void 0,l(this,{coders:Object.freeze(t.slice())})}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});return this.coders.forEach(((n,o)=>{let i=n.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[o]))})),Object.freeze(t)}encode(t,e){const n=Zt.dereference(e,"tuple");return ee(t,this.coders,n)}decode(t){return ne(t,this.coders)}}var Le;function be(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Ae=0;function we(t){return"__private_"+Ae+++"_"+t}function Ie(t){const e=new Set;return t.forEach((t=>e.add(t))),Object.freeze(e)}Ie("external public payable override".split(" "));const Ce="constant external internal payable private public pure view override",xe=(Ie(Ce.split(" ")),"constructor error event fallback function receive struct"),ve=(Ie(xe.split(" ")),"calldata memory storage payable indexed"),Ee=Ie(ve.split(" ")),Be=Ie([xe,ve,"tuple returns",Ce].join(" ").split(" ")),Fe={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Oe=new RegExp("^(\\s*)"),Se=new RegExp("^([0-9]+)"),Pe=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),je=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),Ue=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var ke=we("offset"),Me=we("tokens"),Te=we("subTokenString");class ze{get offset(){return be(this,ke)[ke]}get length(){return be(this,Me)[Me].length-be(this,ke)[ke]}constructor(t){Object.defineProperty(this,Te,{value:Qe}),Object.defineProperty(this,ke,{writable:!0,value:void 0}),Object.defineProperty(this,Me,{writable:!0,value:void 0}),be(this,ke)[ke]=0,be(this,Me)[Me]=t.slice()}clone(){return new ze(be(this,Me)[Me])}reset(){be(this,ke)[ke]=0}popKeyword(t){const e=this.peek();if("KEYWORD"!==e.type||!t.has(e.text))throw new Error("expected keyword ".concat(e.text));return this.pop().text}popType(t){if(this.peek().type!==t){const e=this.peek();throw new Error("expected ".concat(t,"; got ").concat(e.type," ").concat(JSON.stringify(e.text)))}return this.pop().text}popParen(){const t=this.peek();if("OPEN_PAREN"!==t.type)throw new Error("bad start");const e=be(this,Te)[Te](be(this,ke)[ke]+1,t.match+1);return be(this,ke)[ke]=t.match+1,e}popParams(){const t=this.peek();if("OPEN_PAREN"!==t.type)throw new Error("bad start");const e=[];for(;be(this,ke)[ke]<t.match-1;){const t=this.peek().linkNext;e.push(be(this,Te)[Te](be(this,ke)[ke]+1,t)),be(this,ke)[ke]=t}return be(this,ke)[ke]=t.match+1,e}peek(){if(be(this,ke)[ke]>=be(this,Me)[Me].length)throw new Error("out-of-bounds");return be(this,Me)[Me][be(this,ke)[ke]]}peekKeyword(t){const e=this.peekType("KEYWORD");return null!=e&&t.has(e)?e:null}peekType(t){if(0===this.length)return null;const e=this.peek();return e.type===t?e.text:null}pop(){const t=this.peek();return be(this,ke)[ke]++,t}toString(){const t=[];for(let e=be(this,ke)[ke];e<be(this,Me)[Me].length;e++){const n=be(this,Me)[Me][e];t.push("".concat(n.type,":").concat(n.text))}return"<TokenString ".concat(t.join(" "),">")}}function Qe(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Le(be(this,Me)[Me].slice(t,e).map((e=>Object.freeze(Object.assign({},e,{match:e.match-t,linkBack:e.linkBack-t,linkNext:e.linkNext-t})))))}function Ne(t,e){const n=new Set;for(;;){const o=t.peekType("KEYWORD");if(null==o||e&&!e.has(o))break;if(t.pop(),n.has(o))throw new Error("duplicate keywords: ".concat(JSON.stringify(o)));n.add(o)}return Object.freeze(n)}Le=ze;const De=new RegExp(/^(.*)\[([0-9]*)\]$/);function Re(t){const e=t.match(Ue);if(h(e,"invalid type","type",t),"uint"===t)return"uint256";if("int"===t)return"int256";if(e[2]){const n=parseInt(e[2]);h(0!==n&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);h(0!==n&&n<=256&&n%8==0,"invalid numeric width","type",t)}return t}const qe={},Ge=Symbol.for("_ethers_internal"),Ke="_ParamTypeInternal";var Ve=we("walkAsync");class He{constructor(t,e,n,o,i,r,a,c){if(Object.defineProperty(this,Ve,{value:Ye}),this.name=void 0,this.type=void 0,this.baseType=void 0,this.indexed=void 0,this.components=void 0,this.arrayLength=void 0,this.arrayChildren=void 0,m(t,qe,"ParamType"),Object.defineProperty(this,Ge,{value:Ke}),r&&(r=Object.freeze(r.slice())),"array"===o){if(null==a||null==c)throw new Error("")}else if(null!=a||null!=c)throw new Error("");if("tuple"===o){if(null==r)throw new Error("")}else if(null!=r)throw new Error("");l(this,{name:e,type:n,baseType:o,indexed:i,components:r,arrayLength:a,arrayChildren:c})}format(t){if(null==t&&(t="sighash"),"json"===t){const e=this.name||"";if(this.isArray()){const t=JSON.parse(this.arrayChildren.format("json"));return t.name=e,t.type+="[".concat(this.arrayLength<0?"":String(this.arrayLength),"]"),JSON.stringify(t)}const n={type:"tuple"===this.baseType?"tuple":this.type,name:e};return"boolean"==typeof this.indexed&&(n.indexed=this.indexed),this.isTuple()&&(n.components=this.components.map((e=>JSON.parse(e.format(t))))),JSON.stringify(n)}let e="";return this.isArray()?(e+=this.arrayChildren.format(t),e+="[".concat(this.arrayLength<0?"":String(this.arrayLength),"]")):this.isTuple()?e+="("+this.components.map((e=>e.format(t))).join("full"===t?", ":",")+")":e+=this.type,"sighash"!==t&&(!0===this.indexed&&(e+=" indexed"),"full"===t&&this.name&&(e+=" "+this.name)),e}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(t,e){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(-1!==this.arrayLength&&t.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return t.map((t=>n.arrayChildren.walk(t,e)))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");const n=this;return t.map(((t,o)=>n.components[o].walk(t,e)))}return e(this.type,t)}async walkAsync(t,e){const n=[],o=[t];return be(this,Ve)[Ve](n,t,e,(t=>{o[0]=t})),n.length&&await Promise.all(n),o[0]}static from(t,e){if(He.isParamType(t))return t;if("string"==typeof t)try{return He.from(function(t){const e=[],n=e=>{const n=r<t.length?JSON.stringify(t[r]):"$EOI";throw new Error("invalid token ".concat(n," at ").concat(r,": ").concat(e))};let o=[],i=[],r=0;for(;r<t.length;){let a=t.substring(r),c=a.match(Oe);c&&(r+=c[1].length,a=t.substring(r));const s={depth:o.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:r,value:-1};e.push(s);let l=Fe[a[0]]||"";if(l){if(s.type=l,s.text=a[0],r++,"OPEN_PAREN"===l)o.push(e.length-1),i.push(e.length-1);else if("CLOSE_PAREN"==l)0===o.length&&n("no matching open bracket"),s.match=o.pop(),e[s.match].match=e.length-1,s.depth--,s.linkBack=i.pop(),e[s.linkBack].linkNext=e.length-1;else if("COMMA"===l)s.linkBack=i.pop(),e[s.linkBack].linkNext=e.length-1,i.push(e.length-1);else if("OPEN_BRACKET"===l)s.type="BRACKET";else if("CLOSE_BRACKET"===l){let t=e.pop().text;if(e.length>0&&"NUMBER"===e[e.length-1].type){const n=e.pop().text;t=n+t,e[e.length-1].value=v(n)}if(0===e.length||"BRACKET"!==e[e.length-1].type)throw new Error("missing opening bracket");e[e.length-1].text+=t}}else if(c=a.match(Pe),c){if(s.text=c[1],r+=s.text.length,Be.has(s.text)){s.type="KEYWORD";continue}if(s.text.match(Ue)){s.type="TYPE";continue}s.type="ID"}else{if(c=a.match(Se),!c)throw new Error("unexpected token ".concat(JSON.stringify(a[0])," at position ").concat(r));s.text=c[1],s.type="NUMBER",r+=s.text.length}}return new ze(e.map((t=>Object.freeze(t))))}(t),e)}catch(e){h(!1,"invalid param type","obj",t)}else if(t instanceof ze){let n="",o="",i=null;Ne(t,Ie(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(o="tuple",i=t.popParams().map((t=>He.from(t))),n="tuple(".concat(i.map((t=>t.format())).join(","),")")):(n=Re(t.popType("TYPE")),o=n);let r=null,a=null;for(;t.length&&t.peekType("BRACKET");){const e=t.pop();r=new He(qe,"",n,o,null,i,a,r),a=e.value,n+=e.text,o="array",i=null}let c=null;if(Ne(t,Ee).has("indexed")){if(!e)throw new Error("");c=!0}const s=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new He(qe,s,n,o,c,i,a,r)}const n=t.name;h(!n||"string"==typeof n&&n.match(je),"invalid name","obj.name",n);let o=t.indexed;null!=o&&(h(e,"parameter cannot be indexed","obj.indexed",t.indexed),o=!!o);let i=t.type,r=i.match(De);if(r){const e=parseInt(r[2]||"-1"),a=He.from({type:r[1],components:t.components});return new He(qe,n||"",i,"array",o,null,e,a)}if("tuple"===i||i.startsWith("tuple(")||i.startsWith("(")){const e=null!=t.components?t.components.map((t=>He.from(t))):null;return new He(qe,n||"",i,"tuple",o,e,null,null)}return i=Re(t.type),new He(qe,n||"",i,i,o,null,null,null)}static isParamType(t){return t&&t[Ge]===Ke}}function Ye(t,e,n,o){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const i=this.arrayChildren,r=e.slice();return r.forEach(((e,o)=>{be(i,Ve)[Ve](t,e,n,(t=>{r[o]=t}))})),void o(r)}if(this.isTuple()){const i=this.components;let r;if(Array.isArray(e))r=e.slice();else{if(null==e||"object"!=typeof e)throw new Error("invalid tuple value");r=i.map((t=>{if(!t.name)throw new Error("cannot use object value with unnamed components");if(!(t.name in e))throw new Error("missing value for component ".concat(t.name));return e[t.name]}))}if(r.length!==this.components.length)throw new Error("array is wrong length");return r.forEach(((e,o)=>{be(i[o],Ve)[Ve](t,e,n,(t=>{r[o]=t}))})),void o(r)}const i=n(this.type,e);i.then?t.push(async function(){o(await i)}()):o(i)}function Je(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var We=0;function Xe(t){return"__private_"+We+++"_"+t}const Ze=new Map;Ze.set(0,"GENERIC_PANIC"),Ze.set(1,"ASSERT_FALSE"),Ze.set(17,"OVERFLOW"),Ze.set(18,"DIVIDE_BY_ZERO"),Ze.set(33,"ENUM_RANGE_ERROR"),Ze.set(34,"BAD_STORAGE_DATA"),Ze.set(49,"STACK_UNDERFLOW"),Ze.set(50,"ARRAY_RANGE_ERROR"),Ze.set(65,"OUT_OF_MEMORY"),Ze.set(81,"UNINITIALIZED_FUNCTION_CALL");const $e=new RegExp(/^bytes([0-9]*)$/),tn=new RegExp(/^(u?int)([0-9]*)$/);let en=null,nn=1024;var on=Xe("getCoder");class rn{constructor(){Object.defineProperty(this,on,{value:an})}getDefaultValue(t){const e=t.map((t=>Je(this,on)[on](He.from(t))));return new ye(e,"_").defaultValue()}encode(t,e){p(e.length,t.length,"types/values length mismatch");const n=t.map((t=>Je(this,on)[on](He.from(t)))),o=new ye(n,"_"),i=new Z;return o.encode(i,e),i.data}decode(t,e,n){const o=t.map((t=>Je(this,on)[on](He.from(t))));return new ye(o,"_").decode(new ct(e,n,nn))}static _setDefaultMaxInflation(t){h("number"==typeof t&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),nn=t}static defaultAbiCoder(){return null==en&&(en=new rn),en}static getBuiltinCallException(t,e,n){return function(t,e,n,o){let i="missing revert data",r=null,a=null;if(n){i="execution reverted";const t=B(n);if(n=S(n),0===t.length)i+=" (no data present; likely require(false) occurred",r="require(false)";else if(t.length%32!=4)i+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===S(t.slice(0,4)))try{r=o.decode(["string"],t.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[r]},i+=": ".concat(JSON.stringify(r))}catch(t){i+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===S(t.slice(0,4)))try{const e=Number(o.decode(["uint256"],t.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[e]},r="Panic due to ".concat(Ze.get(e)||"UNKNOWN","(").concat(e,")"),i+=": ".concat(r)}catch(t){i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const c={to:e.to?qt(e.to):null,data:e.data||"0x"};return e.from&&(c.from=qt(e.from)),f(i,"CALL_EXCEPTION",{action:t,data:n,reason:r,transaction:c,invocation:null,revert:a})}(t,e,n,rn.defaultAbiCoder())}}function an(t){if(t.isArray())return new oe(Je(this,on)[on](t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new ye(t.components.map((t=>Je(this,on)[on](t))),t.name);switch(t.baseType){case"address":return new $t(t.name);case"bool":return new ie(t.name);case"string":return new me(t.name);case"bytes":return new ae(t.name);case"":return new le(t.name)}let e=t.type.match(tn);if(e){let n=parseInt(e[2]||"256");return h(0!==n&&n<=256&&n%8==0,"invalid "+e[1]+" bit length","param",t),new ge(n/8,"int"===e[1],t.name)}if(e=t.type.match($e),e){let n=parseInt(e[1]);return h(0!==n&&n<=32,"invalid bytes length","param",t),new ce(n,t.name)}h(!1,"invalid type","type",t.type)}var cn=i(545);const sn=["number","string","function","Array","Uint8Array","Buffer","object","bigint","stringified-bigint","hexadecimal","bignumber","bignumberish"];function ln(t){return"number"==typeof t}function dn(t){return"string"==typeof t}function un(t){return"object"==typeof t}function fn(t){return t instanceof Uint8Array}function gn(t){return cn.hp.isBuffer(t)}function hn(t){return"bigint"==typeof t}function pn(t){if(!dn(t))return!1;try{return BigInt(t),!0}catch(t){return!1}}function _n(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!!dn(t)&&(e?/^(0x|0X)[0-9a-fA-F]+$/.test(t):/^[0-9a-fA-F]+$/.test(t))}function mn(t,e){switch(e){case"number":return ln(t);case"string":return dn(t);case"function":return function(t){return"function"==typeof t}(t);case"Array":return function(t){return un(t)&&Array.isArray(t)}(t);case"Uint8Array":return fn(t);case"Buffer":return gn(t);case"object":return un(t);case"bigint":return hn(t);case"stringified-bigint":return pn(t);case"hexadecimal":return _n(t);case"bignumber":return function(t){return hn(t)||pn(t)}(t);case"bignumberish":return function(t){return ln(t)||hn(t)||pn(t)||_n(t)||gn(t)||fn(t)}(t);default:return!1}}function yn(t){return sn.includes(t)}function Ln(t){return!t}function bn(t){return(t&BigInt(1))===BigInt(1)}function An(t,e){return t>>e}const wn=BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617"),In=new class{constructor(t){this.one=1n,this.zero=0n,this._order=t,this._half=t>>this.one,this._negone=this._order-this.one}e(t){return(t%=this._order)<0?t+this._order:t}mul(t,e){return t*e%this._order}sub(t,e){return t>=e?t-e:this._order-e+t}add(t,e){const n=t+e;return n>=this._order?n-this._order:n}inv(t){if(t===this.zero)throw new Error("Zero has no inverse");let e=this.zero,n=this._order,o=this.one,i=t%this._order;for(;i;){const t=n/i;[e,o]=[o,e-t*o],[n,i]=[i,n-t*i]}return e<this.zero&&(e+=this._order),e}div(t,e){return this.mul(t,this.inv(e))}eq(t,e){return t===e}square(t){return t*t%this._order}lt(t,e){return(t>this._half?t-this._order:t)<(e>this._half?e-this._order:e)}geq(t,e){return(t>this._half?t-this._order:t)>=(e>this._half?e-this._order:e)}neg(t){return t?this._order-t:t}isZero(t){return t===this.zero}pow(t,e){if(Ln(e))return this.one;e<0n&&(t=this.inv(t),e=-e);const n=function(t){const e=[];let n=t;for(;n;)n&BigInt(1)?e.push(1):e.push(0),n>>=BigInt(1);return e}(e);if(0===n.length)return this.one;let o=t;for(let e=n.length-2;e>=0;e-=1)o=this.square(o),n[e]&&(o=this.mul(o,t));return o}}(wn),Cn=[In.e(BigInt("5299619240641551281634865583518297030282874472190772894086521144482721001553")),In.e(BigInt("16950150798460657717958625567821834550301663161624707787222815936182638968203"))],xn=In.e(BigInt("168700")),vn=In.e(BigInt("168696")),En=An(BigInt("21888242871839275222246405745257275088614511777268538073601725287587578984328"),BigInt(3));function Bn(t,e){const n=In.mul(t[0],e[1]),o=In.mul(t[1],e[0]),i=In.mul(In.sub(t[1],In.mul(xn,t[0])),In.add(e[0],e[1])),r=In.mul(n,o),a=In.mul(vn,r);return[In.div(In.add(n,o),In.add(In.one,a)),In.div(In.add(i,In.sub(In.mul(xn,n),o)),In.sub(In.one,a))]}function Fn(t,e){let n=[In.e(BigInt(0)),In.e(BigInt(1))],o=e,i=t;for(;!Ln(o);)bn(o)&&(n=Bn(n,i)),i=Bn(i,i),o=An(o,BigInt(1));return n}function On(t){const e=BigInt(t[0]),n=BigInt(t[1]),o=In.square(e),i=In.square(n);return In.eq(In.add(In.mul(xn,o),i),In.add(In.one,In.mul(In.mul(o,i),vn)))}function Sn(t){const e=function(t,e){const n=function(t){!function(t){if(!hn(t))throw new TypeError("Parameter '".concat("value","' is not a bigint, received type: ").concat(typeof t))}(t);let e=t.toString(16);return e.length%2!=0&&(e="0".concat(e)),e}(t),o=Math.ceil(n.length/2);if(e){if(e<o)throw Error("Size ".concat(e," is too small, need at least ").concat(o," bytes"))}else e=o;const i=cn.hp.alloc(e,0);return cn.hp.from(n,"hex").reverse().copy(i,0),i}(t[1],32);return In.lt(t[0],In.zero)&&(e[31]|=128),function(t,e,n){for(const t of n)if(!yn(t))throw new Error("Type '".concat(t,"' is not supported"));for(const e of n)if(mn(t,e))return;throw new TypeError("Parameter '".concat("value","' is none of the following types: ").concat(n.join(", ")))}(n=e,0,["Buffer","Uint8Array"]),BigInt("0x".concat(cn.hp.from(n).reverse().toString("hex")));var n}var Pn=Object.freeze({__proto__:null,getRandomValues:function(t){if(t<=0)throw Error("size ".concat(t," is too small, need at least 1"));return crypto.getRandomValues(new Uint8Array(t))}});const jn=["number","string","function","Array","Uint8Array","Buffer","object","bigint","stringified-bigint","hexadecimal","bignumber","bignumberish"];function Un(t){return"number"==typeof t}function kn(t){return"string"==typeof t}function Mn(t){return"object"==typeof t}function Tn(t){return Mn(t)&&Array.isArray(t)}function zn(t){return t instanceof Uint8Array}function Qn(t){return cn.hp.isBuffer(t)}function Nn(t){return"bigint"==typeof t}function Dn(t){if(!kn(t))return!1;try{return BigInt(t),!0}catch(t){return!1}}function Rn(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!!kn(t)&&(e?/^(0x|0X)[0-9a-fA-F]+$/.test(t):/^[0-9a-fA-F]+$/.test(t))}function qn(t){return Nn(t)||Dn(t)}function Gn(t){return Un(t)||Nn(t)||Dn(t)||Rn(t)||Qn(t)||zn(t)}function Kn(t,e){switch(e){case"number":return Un(t);case"string":return kn(t);case"function":return function(t){return"function"==typeof t}(t);case"Array":return Tn(t);case"Uint8Array":return zn(t);case"Buffer":return Qn(t);case"object":return Mn(t);case"bigint":return Nn(t);case"stringified-bigint":return Dn(t);case"hexadecimal":return Rn(t);case"bignumber":return qn(t);case"bignumberish":return Gn(t);default:return!1}}function Vn(t){return jn.includes(t)}function Hn(t,e,n){for(const t of n)if(!Vn(t))throw new Error("Type '".concat(t,"' is not supported"));for(const e of n)if(Kn(t,e))return;throw new TypeError("Parameter '".concat(e,"' is none of the following types: ").concat(n.join(", ")))}function Yn(t){return Hn(t,"value",["Buffer","Uint8Array"]),BigInt("0x".concat(cn.hp.from(t).reverse().toString("hex")))}function Jn(t){return function(t){return Hn(t,"value",["Buffer","Uint8Array"]),BigInt("0x".concat(cn.hp.from(t).toString("hex")))}(t)}function Wn(t,e){return t>>e}class Xn{constructor(t){this.one=1n,this.zero=0n,this._order=t,this._half=t>>this.one,this._negone=this._order-this.one}e(t){return(t%=this._order)<0?t+this._order:t}mul(t,e){return t*e%this._order}sub(t,e){return t>=e?t-e:this._order-e+t}add(t,e){const n=t+e;return n>=this._order?n-this._order:n}inv(t){if(t===this.zero)throw new Error("Zero has no inverse");let e=this.zero,n=this._order,o=this.one,i=t%this._order;for(;i;){const t=n/i;[e,o]=[o,e-t*o],[n,i]=[i,n-t*i]}return e<this.zero&&(e+=this._order),e}div(t,e){return this.mul(t,this.inv(e))}eq(t,e){return t===e}square(t){return t*t%this._order}lt(t,e){return(t>this._half?t-this._order:t)<(e>this._half?e-this._order:e)}geq(t,e){return(t>this._half?t-this._order:t)>=(e>this._half?e-this._order:e)}neg(t){return t?this._order-t:t}isZero(t){return t===this.zero}pow(t,e){if(function(t){return!t}(e))return this.one;e<0n&&(t=this.inv(t),e=-e);const n=function(t){const e=[];let n=t;for(;n;)n&BigInt(1)?e.push(1):e.push(0),n>>=BigInt(1);return e}(e);if(0===n.length)return this.one;let o=t;for(let e=n.length-2;e>=0;e-=1)o=this.square(o),n[e]&&(o=this.mul(o,t));return o}}var Zn=i(869);const $n=cn.hp.from([1]),to=cn.hp.from([129]),eo=[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],[11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4],[7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8],[9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13],[2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9],[12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11],[13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10],[6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5],[10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],[11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4],[7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8],[9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13],[2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]],no=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731,3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113],oo=cn.hp.from([128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function io(t,e,n,o){let i=t[2*e]^t[2*n],r=t[2*e+1]^t[2*n+1];o>=32&&(r^=i,i^=r,r^=i,o-=32),0===o?(t[2*e]=i>>>0,t[2*e+1]=r>>>0):(t[2*e]=(i>>>o|r<<32-o)>>>0,t[2*e+1]=(r>>>o|i<<32-o)>>>0)}function ro(t,e,n,o,i,r,a,c){let s;s=t[2*o+1]+((e[2*eo[n][c]+1]^no[2*eo[n][c+1]+1])>>>0)+t[2*i+1],t[2*o]=t[2*o]+((e[2*eo[n][c]]^no[2*eo[n][c+1]])>>>0)+t[2*i]+~~(s/4294967296)>>>0,t[2*o+1]=s>>>0,io(t,a,o,32),s=t[2*r+1]+t[2*a+1],t[2*r]=t[2*r]+t[2*a]+~~(s/4294967296)>>>0,t[2*r+1]=s>>>0,io(t,i,r,25),s=t[2*o+1]+((e[2*eo[n][c+1]+1]^no[2*eo[n][c]+1])>>>0)+t[2*i+1],t[2*o]=t[2*o]+((e[2*eo[n][c+1]]^no[2*eo[n][c]])>>>0)+t[2*i]+~~(s/4294967296)>>>0,t[2*o+1]=s>>>0,io(t,a,o,16),s=t[2*r+1]+t[2*a+1],t[2*r]=t[2*r]+t[2*a]+~~(s/4294967296)>>>0,t[2*r+1]=s>>>0,io(t,i,r,11)}function ao(t){for(let e=0;e<t.length&&!(t[e]<4294967296);e+=1)t[e]-=4294967296,t[e+1]+=1}class co{constructor(){this._h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this._s=[0,0,0,0,0,0,0,0],this._block=cn.hp.alloc(128),this._blockOffset=0,this._length=[0,0,0,0],this._nullt=!1,this._zo=$n,this._oo=to}_compress(){const t=new Array(32),e=new Array(32);let n;for(n=0;n<32;n+=1)e[n]=this._block.readUInt32BE(4*n);for(n=0;n<16;n+=1)t[n]=this._h[n]>>>0;for(n=16;n<24;n+=1)t[n]=(this._s[n-16]^no[n-16])>>>0;for(n=24;n<32;n+=1)t[n]=no[n-16];for(this._nullt||(t[24]=(t[24]^this._length[1])>>>0,t[25]=(t[25]^this._length[0])>>>0,t[26]=(t[26]^this._length[1])>>>0,t[27]=(t[27]^this._length[0])>>>0,t[28]=(t[28]^this._length[3])>>>0,t[29]=(t[29]^this._length[2])>>>0,t[30]=(t[30]^this._length[3])>>>0,t[31]=(t[31]^this._length[2])>>>0),n=0;n<16;n+=1)ro(t,e,n,0,4,8,12,0),ro(t,e,n,1,5,9,13,2),ro(t,e,n,2,6,10,14,4),ro(t,e,n,3,7,11,15,6),ro(t,e,n,0,5,10,15,8),ro(t,e,n,1,6,11,12,10),ro(t,e,n,2,7,8,13,12),ro(t,e,n,3,4,9,14,14);for(n=0;n<16;n+=1)this._h[n%8*2]=(this._h[n%8*2]^t[2*n])>>>0,this._h[n%8*2+1]=(this._h[n%8*2+1]^t[2*n+1])>>>0;for(n=0;n<8;n+=1)this._h[2*n]=(this._h[2*n]^this._s[n%4*2])>>>0,this._h[2*n+1]=(this._h[2*n+1]^this._s[n%4*2+1])>>>0}_padding(){const t=this._length.slice();t[0]+=8*this._blockOffset,ao(t);const e=cn.hp.alloc(16);for(let n=0;n<4;n+=1)e.writeUInt32BE(t[3-n],4*n);111===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<111?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(111-this._blockOffset),this.update(oo.subarray(0,111-this._blockOffset))):(this._length[0]-=8*(128-this._blockOffset),this.update(oo.subarray(0,128-this._blockOffset)),this._length[0]-=888,this.update(oo.subarray(1,112)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=128,this.update(e)}digest(){this._padding();const t=cn.hp.alloc(64);for(let e=0;e<16;e+=1)t.writeUInt32BE(this._h[e],4*e);return t}update(t){const e=this._block;let n=0;for(;this._blockOffset+t.length-n>=e.length;){for(let o=this._blockOffset;o<e.length;)e[o++]=t[n++];this._length[0]+=8*e.length,ao(this._length),this._compress(),this._blockOffset=0}for(;n<t.length;)e[this._blockOffset++]=t[n++];return this}}function so(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function lo(t){return Tn(t)&&2===t.length&&qn(t[0])&&qn(t[1])}function uo(t){return Hn(t,"privateKey",["Buffer","Uint8Array","string"]),cn.hp.from(t)}function fo(t){return Hn(t,"message",["bignumberish","string"]),Gn(t)?(function(t){if(!Gn(t))throw new TypeError("Parameter '".concat("value","' is not a bignumber-ish"))}(e=t),Qn(e)||zn(e)?Jn(e):BigInt(e)):Jn(cn.hp.from(t));var e}function go(t){const e=new co;return e.update(cn.hp.from(t)),e.digest()}function ho(t){let e=go(t=uo(t));return e=e.slice(0,32),e=so(e),Wn(Yn(e),BigInt(3))%En}function po(t,e){t=uo(t),e=fo(e);const n=go(t),o=Yn(so(n.slice(0,32))),i=Fn(Cn,Wn(o,BigInt(3))),r=function(t,e){const n=function(t){!function(t){if(!Nn(t))throw new TypeError("Parameter '".concat("value","' is not a bigint, received type: ").concat(typeof t))}(t);let e=t.toString(16);return e.length%2!=0&&(e="0".concat(e)),e}(t),o=Math.ceil(n.length/2);if(e){if(e<o)throw Error("Size ".concat(e," is too small, need at least ").concat(o," bytes"))}else e=o;const i=cn.hp.alloc(e,0);return cn.hp.from(n,"hex").reverse().copy(i,0),i}(e,32),a=go(cn.hp.concat([n.slice(32,64),r])),c=new Xn(En),s=c.e(Yn(a)),l=Fn(Cn,s),d=(0,Zn.Z)([l[0],l[1],i[0],i[1],e]);return{R8:l,S:c.add(s,c.mul(d,o))}}function _o(t,e,n){if(!lo(n)||!function(t){return Mn(t)&&Object.prototype.hasOwnProperty.call(t,"R8")&&Object.prototype.hasOwnProperty.call(t,"S")&&lo(t.R8)&&qn(t.S)}(e)||!On(e.R8)||!On(n)||BigInt(e.S)>=En)return!1;t=fo(t);const o={R8:[BigInt(e.R8[0]),BigInt(e.R8[1])],S:BigInt(e.S)},i=[BigInt(n[0]),BigInt(n[1])],r=(0,Zn.Z)([e.R8[0],e.R8[1],n[0],n[1],t]),a=Fn(Cn,BigInt(e.S));let c=Fn(i,function(t){return t*BigInt(8)}(r));return c=Bn(o.R8,c),In.eq(a[0],c[0])&&In.eq(a[1],c[1])}class mo{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pn.getRandomValues(32);this.privateKey=t,this.secretScalar=ho(t),this.publicKey=function(t){const e=ho(t);return Fn(Cn,e)}(t),this.packedPublicKey=function(t){if(!lo(t)||!On(t))throw new Error("Invalid public key");return Sn([BigInt(t[0]),BigInt(t[1])])}(this.publicKey)}signMessage(t){return po(this.privateKey,t)}verifySignature(t,e){return _o(t,e,this.publicKey)}}const yo=["number","boolean","string","function","Array","Uint8Array","Buffer","object","bigint","stringified-bigint","hexadecimal","bignumber","bignumberish"];function Lo(t){return"number"==typeof t}function bo(t){return"string"==typeof t}function Ao(t){return"object"==typeof t}function wo(t){return t instanceof Uint8Array}function Io(t){return cn.hp.isBuffer(t)}function Co(t){return"bigint"==typeof t}function xo(t){if(!bo(t))return!1;try{return BigInt(t),!0}catch(t){return!1}}function vo(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!!bo(t)&&(e?/^(0x|0X)[0-9a-fA-F]+$/.test(t):/^[0-9a-fA-F]+$/.test(t))}function Eo(t,e){switch(e){case"number":return Lo(t);case"boolean":return function(t){return"boolean"==typeof t}(t);case"string":return bo(t);case"function":return function(t){return"function"==typeof t}(t);case"Array":return function(t){return Ao(t)&&Array.isArray(t)}(t);case"Uint8Array":return wo(t);case"Buffer":return Io(t);case"object":return Ao(t);case"bigint":return Co(t);case"stringified-bigint":return xo(t);case"hexadecimal":return vo(t);case"bignumber":return function(t){return Co(t)||xo(t)}(t);case"bignumberish":return function(t){return Lo(t)||Co(t)||xo(t)||vo(t)||Io(t)||wo(t)}(t);default:return!1}}function Bo(t){return yo.includes(t)}function Fo(t,e){if(void 0===t)throw new TypeError("Parameter '".concat(e,"' is not defined"))}function Oo(t,e){if(!bo(t))throw new TypeError("Parameter '".concat(e,"' is not a string, received type: ").concat(typeof t))}function So(t,e){if(!Ao(t))throw new TypeError("Parameter '".concat(e,"' is not an object, received type: ").concat(typeof t))}function Po(t,e,n){for(const t of n)if(!Bo(t))throw new Error("Type '".concat(t,"' is not supported"));for(const e of n)if(Eo(t,e))return;throw new TypeError("Parameter '".concat(e,"' is none of the following types: ").concat(n.join(", ")))}var jo=i(544);class Uo{constructor(t){const e=new mo(t);this._privateKey=e.privateKey,this._secretScalar=e.secretScalar,this._publicKey=e.publicKey,this._commitment=(0,jo.S)(this._publicKey)}get privateKey(){return this._privateKey}get secretScalar(){return this._secretScalar}get publicKey(){return this._publicKey}get commitment(){return this._commitment}export(){return bo(this._privateKey)?(Oo(t=this._privateKey,"value"),cn.hp.from(t,"utf8").toString("base64")):function(t){return Po(t,"value",["Buffer","Uint8Array"]),cn.hp.from(t).toString("base64")}(this.privateKey);var t}static import(t){return new Uo((Oo(e=t,"value"),cn.hp.from(e,"base64")));var e}signMessage(t){return po(this.privateKey,t)}static verifySignature(t,e,n){return _o(t,e,n)}static generateCommitment(t){return(0,jo.S)(t)}}const ko=(t,e)=>{if(!t)throw new Error("MASTER KEY IS NOT PROVIDED");const n=Tt((new rn).encode(["string","string"],[t,e]));return new Uo(n)},Mo=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return t?t.length<=e?t:"".concat(t.slice(0,e),"...").concat(t.slice(-e)):"..."},To="zpka_52e44068bb9745f2be776b343e96cdab_1a60a93b",zo="https://api.bringid.org",Qo="https://oauth-verifier-production.up.railway.app";function No(t){const e=function(t){try{const e=i(t?32:704);return Array.isArray(e)?e.map((t=>{if("string"!=typeof t.title||!t.groups)throw console.warn("Invalid task format:",t),new Error("Invalid task format");return{title:t.title,id:t.id,description:t.description,icon:t.icon,groups:t.groups,service:t.service}})):(console.error("Tasks config is not an array"),[])}catch(t){return console.error("Failed to parse tasks config:",t),[]}}(t);return[...e]}const Do=(t,e)=>{const n=No(e);for(const e of n)for(const n of e.groups)if(n.credentialGroupId===t)return{taskId:e.id,title:e.title,description:e.description,icon:e.icon,group:n}},Ro=function(t){const e=t.toLowerCase().replace("0x","");if(40!==e.length)throw new Error("Invalid contract address length");const n=["0x"+e,0];return w(Tt(rn.defaultAbiCoder().encode(["address","uint256"],n))).toString()};function qo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Go(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qo(Object(n),!0).forEach((function(e){Ko(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ko(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Vo=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return fetch(t,{method:e,body:"GET"===e||"OPTIONS"===e?void 0:JSON.stringify(o),headers:Go(Go({},n),{},{"content-type":"application/json"})}).then((async t=>{if(!t.ok){const e=await t.json();throw new Error(e.error)}return t.json()}))},Ho=t=>Object.entries(t).reduce(((t,e)=>{let[n,o]=e;return o?""===t?"".concat(n,"=").concat(o):"".concat(t,"&").concat(n,"=").concat(o):t}),""),Yo=t=>{switch(t){case"8453":default:return"base";case"84532":return"base-sepolia"}},Jo=function(t,e){let n=0;return t.forEach((t=>{if("completed"!==t.status)return;const o=Do(t.credentialGroupId,e);if(!o)return;const{group:i}=o;n+=i.points||0})),n},Wo=t=>{if(t<=0)return"00:00:00";const e=Math.floor(t/1e3%60),n=Math.floor(t/6e4%60),o=Math.floor(t/36e5%24);return(o<10?"0"+o:o)+":"+(n<10?"0"+n:n)+":"+(e<10?"0"+e:e)},Xo=class{constructor(){this.dialogWindowOrigin=window.location.origin,this.connectDialogReady=!1,this.pendingRequests=new Map,this.handleMessage=t=>{if(console.log("handleMessage: ",{event:t,dialogWindowOrigin:this.dialogWindowOrigin}),t.origin!==this.dialogWindowOrigin)return;const e=t.data;if(!e.requestId)return;const n=this.pendingRequests.get(e.requestId);console.log("handleMessage: ",{pending:n}),n&&(console.log({data:e,pending:n}),n.requestType!==e.type&&(this.pendingRequests.delete(e.requestId),e.error?n.reject(e.error):n.resolve(e.payload)))},this.checkExtensionStatus=async()=>this.request("CHECK_EXTENSION_STATUS_REQUEST"),this.requestProofs=async t=>this.request("PROOFS_REQUEST",t),window.addEventListener("message",this.handleMessage)}markDialogReady(){this.connectDialogReady=!0}sendMessageToDialog(t){if(!this.connectDialogReady)throw new Error("ConnectDialog is not mounted.");console.log("sendMessageToDialog: ",{msg:t,dialogWindowOrigin:this.dialogWindowOrigin}),window.postMessage(t,this.dialogWindowOrigin)}request(t,e){return new Promise(((n,o)=>{const i=c();this.pendingRequests.set(i,{resolve:n,reject:o,requestType:t}),this.sendMessageToDialog({type:t,requestId:i,payload:e})}))}};var Zo=i(155),$o=i.n(Zo),ti=function(){return ti=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ti.apply(this,arguments)};function ei(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var ni=i(863),oi=i.n(ni),ii="-ms-",ri="-moz-",ai="-webkit-",ci="comm",si="rule",li="decl",di="@keyframes",ui=Math.abs,fi=String.fromCharCode,gi=Object.assign;function hi(t){return t.trim()}function pi(t,e){return(t=e.exec(t))?t[0]:t}function _i(t,e,n){return t.replace(e,n)}function mi(t,e,n){return t.indexOf(e,n)}function yi(t,e){return 0|t.charCodeAt(e)}function Li(t,e,n){return t.slice(e,n)}function bi(t){return t.length}function Ai(t){return t.length}function wi(t,e){return e.push(t),t}function Ii(t,e){return t.filter((function(t){return!pi(t,e)}))}var Ci=1,xi=1,vi=0,Ei=0,Bi=0,Fi="";function Oi(t,e,n,o,i,r,a,c){return{value:t,root:e,parent:n,type:o,props:i,children:r,line:Ci,column:xi,length:a,return:"",siblings:c}}function Si(t,e){return gi(Oi("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function Pi(t){for(;t.root;)t=Si(t.root,{children:[t]});wi(t,t.siblings)}function ji(){return Bi=Ei>0?yi(Fi,--Ei):0,xi--,10===Bi&&(xi=1,Ci--),Bi}function Ui(){return Bi=Ei<vi?yi(Fi,Ei++):0,xi++,10===Bi&&(xi=1,Ci++),Bi}function ki(){return yi(Fi,Ei)}function Mi(){return Ei}function Ti(t,e){return Li(Fi,t,e)}function zi(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Qi(t){return hi(Ti(Ei-1,Ri(91===t?t+2:40===t?t+1:t)))}function Ni(t){for(;(Bi=ki())&&Bi<33;)Ui();return zi(t)>2||zi(Bi)>3?"":" "}function Di(t,e){for(;--e&&Ui()&&!(Bi<48||Bi>102||Bi>57&&Bi<65||Bi>70&&Bi<97););return Ti(t,Mi()+(e<6&&32==ki()&&32==Ui()))}function Ri(t){for(;Ui();)switch(Bi){case t:return Ei;case 34:case 39:34!==t&&39!==t&&Ri(Bi);break;case 40:41===t&&Ri(t);break;case 92:Ui()}return Ei}function qi(t,e){for(;Ui()&&t+Bi!==57&&(t+Bi!==84||47!==ki()););return"/*"+Ti(e,Ei-1)+"*"+fi(47===t?t:Ui())}function Gi(t){for(;!zi(ki());)Ui();return Ti(t,Ei)}function Ki(t,e){for(var n="",o=0;o<t.length;o++)n+=e(t[o],o,t,e)||"";return n}function Vi(t,e,n,o){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case li:return t.return=t.return||t.value;case ci:return"";case di:return t.return=t.value+"{"+Ki(t.children,o)+"}";case si:if(!bi(t.value=t.props.join(",")))return""}return bi(n=Ki(t.children,o))?t.return=t.value+"{"+n+"}":""}function Hi(t,e,n){switch(function(t,e){return 45^yi(t,0)?(((e<<2^yi(t,0))<<2^yi(t,1))<<2^yi(t,2))<<2^yi(t,3):0}(t,e)){case 5103:return ai+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ai+t+t;case 4789:return ri+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return ai+t+ri+t+ii+t+t;case 5936:switch(yi(t,e+11)){case 114:return ai+t+ii+_i(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return ai+t+ii+_i(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return ai+t+ii+_i(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return ai+t+ii+t+t;case 6165:return ai+t+ii+"flex-"+t+t;case 5187:return ai+t+_i(t,/(\w+).+(:[^]+)/,ai+"box-$1$2"+ii+"flex-$1$2")+t;case 5443:return ai+t+ii+"flex-item-"+_i(t,/flex-|-self/g,"")+(pi(t,/flex-|baseline/)?"":ii+"grid-row-"+_i(t,/flex-|-self/g,""))+t;case 4675:return ai+t+ii+"flex-line-pack"+_i(t,/align-content|flex-|-self/g,"")+t;case 5548:return ai+t+ii+_i(t,"shrink","negative")+t;case 5292:return ai+t+ii+_i(t,"basis","preferred-size")+t;case 6060:return ai+"box-"+_i(t,"-grow","")+ai+t+ii+_i(t,"grow","positive")+t;case 4554:return ai+_i(t,/([^-])(transform)/g,"$1"+ai+"$2")+t;case 6187:return _i(_i(_i(t,/(zoom-|grab)/,ai+"$1"),/(image-set)/,ai+"$1"),t,"")+t;case 5495:case 3959:return _i(t,/(image-set\([^]*)/,ai+"$1$`$1");case 4968:return _i(_i(t,/(.+:)(flex-)?(.*)/,ai+"box-pack:$3"+ii+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ai+t+t;case 4200:if(!pi(t,/flex-|baseline/))return ii+"grid-column-align"+Li(t,e)+t;break;case 2592:case 3360:return ii+_i(t,"template-","")+t;case 4384:case 3616:return n&&n.some((function(t,n){return e=n,pi(t.props,/grid-\w+-end/)}))?~mi(t+(n=n[e].value),"span",0)?t:ii+_i(t,"-start","")+t+ii+"grid-row-span:"+(~mi(n,"span",0)?pi(n,/\d+/):+pi(n,/\d+/)-+pi(t,/\d+/))+";":ii+_i(t,"-start","")+t;case 4896:case 4128:return n&&n.some((function(t){return pi(t.props,/grid-\w+-start/)}))?t:ii+_i(_i(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return _i(t,/(.+)-inline(.+)/,ai+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(bi(t)-1-e>6)switch(yi(t,e+1)){case 109:if(45!==yi(t,e+4))break;case 102:return _i(t,/(.+:)(.+)-([^]+)/,"$1"+ai+"$2-$3$1"+ri+(108==yi(t,e+3)?"$3":"$2-$3"))+t;case 115:return~mi(t,"stretch",0)?Hi(_i(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return _i(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(e,n,o,i,r,a,c){return ii+n+":"+o+c+(i?ii+n+"-span:"+(r?a:+a-+o)+c:"")+t}));case 4949:if(121===yi(t,e+6))return _i(t,":",":"+ai)+t;break;case 6444:switch(yi(t,45===yi(t,14)?18:11)){case 120:return _i(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+ai+(45===yi(t,14)?"inline-":"")+"box$3$1"+ai+"$2$3$1"+ii+"$2box$3")+t;case 100:return _i(t,":",":"+ii)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return _i(t,"scroll-","scroll-snap-")+t}return t}function Yi(t,e,n,o){if(t.length>-1&&!t.return)switch(t.type){case li:return void(t.return=Hi(t.value,t.length,n));case di:return Ki([Si(t,{value:_i(t.value,"@","@"+ai)})],o);case si:if(t.length)return function(t,e){return t.map(e).join("")}(n=t.props,(function(e){switch(pi(e,o=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Pi(Si(t,{props:[_i(e,/:(read-\w+)/,":-moz-$1")]})),Pi(Si(t,{props:[e]})),gi(t,{props:Ii(n,o)});break;case"::placeholder":Pi(Si(t,{props:[_i(e,/:(plac\w+)/,":"+ai+"input-$1")]})),Pi(Si(t,{props:[_i(e,/:(plac\w+)/,":-moz-$1")]})),Pi(Si(t,{props:[_i(e,/:(plac\w+)/,ii+"input-$1")]})),Pi(Si(t,{props:[e]})),gi(t,{props:Ii(n,o)})}return""}))}}function Ji(t){return function(t){return Fi="",t}(Wi("",null,null,null,[""],t=function(t){return Ci=xi=1,vi=bi(Fi=t),Ei=0,[]}(t),0,[0],t))}function Wi(t,e,n,o,i,r,a,c,s){for(var l=0,d=0,u=a,f=0,g=0,h=0,p=1,_=1,m=1,y=0,L="",b=i,A=r,w=o,I=L;_;)switch(h=y,y=Ui()){case 40:if(108!=h&&58==yi(I,u-1)){-1!=mi(I+=_i(Qi(y),"&","&\f"),"&\f",ui(l?c[l-1]:0))&&(m=-1);break}case 34:case 39:case 91:I+=Qi(y);break;case 9:case 10:case 13:case 32:I+=Ni(h);break;case 92:I+=Di(Mi()-1,7);continue;case 47:switch(ki()){case 42:case 47:wi(Zi(qi(Ui(),Mi()),e,n,s),s);break;default:I+="/"}break;case 123*p:c[l++]=bi(I)*m;case 125*p:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+d:-1==m&&(I=_i(I,/\f/g,"")),g>0&&bi(I)-u&&wi(g>32?$i(I+";",o,n,u-1,s):$i(_i(I," ","")+";",o,n,u-2,s),s);break;case 59:I+=";";default:if(wi(w=Xi(I,e,n,l,d,i,c,L,b=[],A=[],u,r),r),123===y)if(0===d)Wi(I,e,w,w,b,r,u,c,A);else switch(99===f&&110===yi(I,3)?100:f){case 100:case 108:case 109:case 115:Wi(t,w,w,o&&wi(Xi(t,w,w,0,0,i,c,L,i,b=[],u,A),A),i,A,u,c,o?b:A);break;default:Wi(I,w,w,w,[""],A,0,c,A)}}l=d=g=0,p=m=1,L=I="",u=a;break;case 58:u=1+bi(I),g=h;default:if(p<1)if(123==y)--p;else if(125==y&&0==p++&&125==ji())continue;switch(I+=fi(y),y*p){case 38:m=d>0?1:(I+="\f",-1);break;case 44:c[l++]=(bi(I)-1)*m,m=1;break;case 64:45===ki()&&(I+=Qi(Ui())),f=ki(),d=u=bi(L=I+=Gi(Mi())),y++;break;case 45:45===h&&2==bi(I)&&(p=0)}}return r}function Xi(t,e,n,o,i,r,a,c,s,l,d,u){for(var f=i-1,g=0===i?r:[""],h=Ai(g),p=0,_=0,m=0;p<o;++p)for(var y=0,L=Li(t,f+1,f=ui(_=a[p])),b=t;y<h;++y)(b=hi(_>0?g[y]+" "+L:_i(L,/&\f/g,g[y])))&&(s[m++]=b);return Oi(t,e,n,0===i?si:c,s,l,d,u)}function Zi(t,e,n,o){return Oi(t,e,n,ci,fi(Bi),Li(t,2,-2),0,o)}function $i(t,e,n,o,i){return Oi(t,e,n,li,Li(t,0,o),Li(t,o+1,-1),o,i)}var tr={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},er="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",nr="active",or="data-styled-version",ir="6.1.19",rr="/*!sc*/\n",ar="undefined"!=typeof window&&"undefined"!=typeof document,cr=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY),sr=(new Set,Object.freeze([])),lr=Object.freeze({});var dr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),ur=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,fr=/(^-|-$)/g;function gr(t){return t.replace(ur,"-").replace(fr,"")}var hr=/(a)(d)/gi,pr=function(t){return String.fromCharCode(t+(t>25?39:97))};function _r(t){var e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=pr(e%52)+n;return(pr(e%52)+n).replace(hr,"$1-$2")}var mr,yr=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},Lr=function(t){return yr(5381,t)};function br(t){return _r(Lr(t)>>>0)}function Ar(t){return"string"==typeof t&&!0}var wr="function"==typeof Symbol&&Symbol.for,Ir=wr?Symbol.for("react.memo"):60115,Cr=wr?Symbol.for("react.forward_ref"):60112,xr={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},vr={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Er={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Br=((mr={})[Cr]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},mr[Ir]=Er,mr);function Fr(t){return("type"in(e=t)&&e.type.$$typeof)===Ir?Er:"$$typeof"in t?Br[t.$$typeof]:xr;var e}var Or=Object.defineProperty,Sr=Object.getOwnPropertyNames,Pr=Object.getOwnPropertySymbols,jr=Object.getOwnPropertyDescriptor,Ur=Object.getPrototypeOf,kr=Object.prototype;function Mr(t,e,n){if("string"!=typeof e){if(kr){var o=Ur(e);o&&o!==kr&&Mr(t,o,n)}var i=Sr(e);Pr&&(i=i.concat(Pr(e)));for(var r=Fr(t),a=Fr(e),c=0;c<i.length;++c){var s=i[c];if(!(s in vr||n&&n[s]||a&&s in a||r&&s in r)){var l=jr(e,s);try{Or(t,s,l)}catch(t){}}}}return t}function Tr(t){return"function"==typeof t}function zr(t){return"object"==typeof t&&"styledComponentId"in t}function Qr(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function Nr(t,e){if(0===t.length)return"";for(var n=t[0],o=1;o<t.length;o++)n+=e?e+t[o]:t[o];return n}function Dr(t){return null!==t&&"object"==typeof t&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function Rr(t,e,n){if(void 0===n&&(n=!1),!n&&!Dr(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var o=0;o<e.length;o++)t[o]=Rr(t[o],e[o]);else if(Dr(e))for(var o in e)t[o]=Rr(t[o],e[o]);return t}function qr(t,e){Object.defineProperty(t,"toString",{value:e})}function Gr(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var Kr=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return t.prototype.indexOfGroup=function(t){for(var e=0,n=0;n<t;n++)e+=this.groupSizes[n];return e},t.prototype.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,i=o;t>=i;)if((i<<=1)<0)throw Gr(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var r=o;r<i;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(t+1),c=(r=0,e.length);r<c;r++)this.tag.insertRule(a,e[r])&&(this.groupSizes[t]++,a++)},t.prototype.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],n=this.indexOfGroup(t),o=n+e;this.groupSizes[t]=0;for(var i=n;i<o;i++)this.tag.deleteRule(n)}},t.prototype.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var n=this.groupSizes[t],o=this.indexOfGroup(t),i=o+n,r=o;r<i;r++)e+="".concat(this.tag.getRule(r)).concat(rr);return e},t}(),Vr=new Map,Hr=new Map,Yr=1,Jr=function(t){if(Vr.has(t))return Vr.get(t);for(;Hr.has(Yr);)Yr++;var e=Yr++;return Vr.set(t,e),Hr.set(e,t),e},Wr=function(t,e){Yr=e+1,Vr.set(t,e),Hr.set(e,t)},Xr="style[".concat(er,"][").concat(or,'="').concat(ir,'"]'),Zr=new RegExp("^".concat(er,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),$r=function(t,e,n){for(var o,i=n.split(","),r=0,a=i.length;r<a;r++)(o=i[r])&&t.registerName(e,o)},ta=function(t,e){for(var n,o=(null!==(n=e.textContent)&&void 0!==n?n:"").split(rr),i=[],r=0,a=o.length;r<a;r++){var c=o[r].trim();if(c){var s=c.match(Zr);if(s){var l=0|parseInt(s[1],10),d=s[2];0!==l&&(Wr(d,l),$r(t,d,s[3]),t.getTag().insertRules(l,i)),i.length=0}else i.push(c)}}},ea=function(t){for(var e=document.querySelectorAll(Xr),n=0,o=e.length;n<o;n++){var i=e[n];i&&i.getAttribute(er)!==nr&&(ta(t,i),i.parentNode&&i.parentNode.removeChild(i))}};function na(){return i.nc}var oa=function(t){var e=document.head,n=t||e,o=document.createElement("style"),i=function(t){var e=Array.from(t.querySelectorAll("style[".concat(er,"]")));return e[e.length-1]}(n),r=void 0!==i?i.nextSibling:null;o.setAttribute(er,nr),o.setAttribute(or,ir);var a=na();return a&&o.setAttribute("nonce",a),n.insertBefore(o,r),o},ia=function(){function t(t){this.element=oa(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,n=0,o=e.length;n<o;n++){var i=e[n];if(i.ownerNode===t)return i}throw Gr(17)}(this.element),this.length=0}return t.prototype.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch(t){return!1}},t.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},t.prototype.getRule=function(t){var e=this.sheet.cssRules[t];return e&&e.cssText?e.cssText:""},t}(),ra=function(){function t(t){this.element=oa(t),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(t,e){if(t<=this.length&&t>=0){var n=document.createTextNode(e);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},t.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),aa=function(){function t(t){this.rules=[],this.length=0}return t.prototype.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},t.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},t.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),ca=ar,sa={isServer:!ar,useCSSOMInjection:!cr},la=function(){function t(t,e,n){void 0===t&&(t=lr),void 0===e&&(e={});var o=this;this.options=ti(ti({},sa),t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&ar&&ca&&(ca=!1,ea(this)),qr(this,(function(){return function(t){for(var e=t.getTag(),n=e.length,o="",i=function(n){var i=function(t){return Hr.get(t)}(n);if(void 0===i)return"continue";var r=t.names.get(i),a=e.getGroup(n);if(void 0===r||!r.size||0===a.length)return"continue";var c="".concat(er,".g").concat(n,'[id="').concat(i,'"]'),s="";void 0!==r&&r.forEach((function(t){t.length>0&&(s+="".concat(t,","))})),o+="".concat(a).concat(c,'{content:"').concat(s,'"}').concat(rr)},r=0;r<n;r++)i(r);return o}(o)}))}return t.registerId=function(t){return Jr(t)},t.prototype.rehydrate=function(){!this.server&&ar&&ea(this)},t.prototype.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(ti(ti({},this.options),e),this.gs,n&&this.names||void 0)},t.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(t=function(t){var e=t.useCSSOMInjection,n=t.target;return t.isServer?new aa(n):e?new ia(n):new ra(n)}(this.options),new Kr(t)));var t},t.prototype.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},t.prototype.registerName=function(t,e){if(Jr(t),this.names.has(t))this.names.get(t).add(e);else{var n=new Set;n.add(e),this.names.set(t,n)}},t.prototype.insertRules=function(t,e,n){this.registerName(t,e),this.getTag().insertRules(Jr(t),n)},t.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},t.prototype.clearRules=function(t){this.getTag().clearGroup(Jr(t)),this.clearNames(t)},t.prototype.clearTag=function(){this.tag=void 0},t}(),da=/&/g,ua=/^\s*\/\/.*$/gm;function fa(t,e){return t.map((function(t){return"rule"===t.type&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map((function(t){return"".concat(e," ").concat(t)}))),Array.isArray(t.children)&&"@keyframes"!==t.type&&(t.children=fa(t.children,e)),t}))}function ga(t){var e,n,o,i=void 0===t?lr:t,r=i.options,a=void 0===r?lr:r,c=i.plugins,s=void 0===c?sr:c,l=function(t,o,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(e):t},d=s.slice();d.push((function(t){t.type===si&&t.value.includes("&")&&(t.props[0]=t.props[0].replace(da,n).replace(o,l))})),a.prefix&&d.push(Yi),d.push(Vi);var u=function(t,i,r,c){void 0===i&&(i=""),void 0===r&&(r=""),void 0===c&&(c="&"),e=c,n=i,o=new RegExp("\\".concat(n,"\\b"),"g");var s=t.replace(ua,""),l=Ji(r||i?"".concat(r," ").concat(i," { ").concat(s," }"):s);a.namespace&&(l=fa(l,a.namespace));var u,f,g,h=[];return Ki(l,(u=d.concat((g=function(t){return h.push(t)},function(t){t.root||(t=t.return)&&g(t)})),f=Ai(u),function(t,e,n,o){for(var i="",r=0;r<f;r++)i+=u[r](t,e,n,o)||"";return i})),h};return u.hash=s.length?s.reduce((function(t,e){return e.name||Gr(15),yr(t,e.name)}),5381).toString():"",u}var ha=new la,pa=ga(),_a=$o().createContext({shouldForwardProp:void 0,styleSheet:ha,stylis:pa}),ma=(_a.Consumer,$o().createContext(void 0));function ya(){return(0,Zo.useContext)(_a)}function La(t){var e=(0,Zo.useState)(t.stylisPlugins),n=e[0],o=e[1],i=ya().styleSheet,r=(0,Zo.useMemo)((function(){var e=i;return t.sheet?e=t.sheet:t.target&&(e=e.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(e=e.reconstructWithOptions({useCSSOMInjection:!1})),e}),[t.disableCSSOMInjection,t.sheet,t.target,i]),a=(0,Zo.useMemo)((function(){return ga({options:{namespace:t.namespace,prefix:t.enableVendorPrefixes},plugins:n})}),[t.enableVendorPrefixes,t.namespace,n]);(0,Zo.useEffect)((function(){oi()(n,t.stylisPlugins)||o(t.stylisPlugins)}),[t.stylisPlugins]);var c=(0,Zo.useMemo)((function(){return{shouldForwardProp:t.shouldForwardProp,styleSheet:r,stylis:a}}),[t.shouldForwardProp,r,a]);return $o().createElement(_a.Provider,{value:c},$o().createElement(ma.Provider,{value:a},t.children))}var ba=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=pa);var o=n.name+e.hash;t.hasNameForId(n.id,o)||t.insertRules(n.id,o,e(n.rules,o,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=e,qr(this,(function(){throw Gr(12,String(n.name))}))}return t.prototype.getName=function(t){return void 0===t&&(t=pa),this.name+t.hash},t}(),Aa=function(t){return t>="A"&&t<="Z"};function wa(t){for(var e="",n=0;n<t.length;n++){var o=t[n];if(1===n&&"-"===o&&"-"===t[0])return t;Aa(o)?e+="-"+o.toLowerCase():e+=o}return e.startsWith("ms-")?"-"+e:e}var Ia=function(t){return null==t||!1===t||""===t},Ca=function(t){var e,n,o=[];for(var i in t){var r=t[i];t.hasOwnProperty(i)&&!Ia(r)&&(Array.isArray(r)&&r.isCss||Tr(r)?o.push("".concat(wa(i),":"),r,";"):Dr(r)?o.push.apply(o,ei(ei(["".concat(i," {")],Ca(r),!1),["}"],!1)):o.push("".concat(wa(i),": ").concat((e=i,null==(n=r)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||e in tr||e.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return o};function xa(t,e,n,o){return Ia(t)?[]:zr(t)?[".".concat(t.styledComponentId)]:Tr(t)?!Tr(i=t)||i.prototype&&i.prototype.isReactComponent||!e?[t]:xa(t(e),e,n,o):t instanceof ba?n?(t.inject(n,o),[t.getName(o)]):[t]:Dr(t)?Ca(t):Array.isArray(t)?Array.prototype.concat.apply(sr,t.map((function(t){return xa(t,e,n,o)}))):[t.toString()];var i}function va(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(Tr(n)&&!zr(n))return!1}return!0}var Ea=Lr(ir),Ba=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&va(t),this.componentId=e,this.baseHash=yr(Ea,e),this.baseStyle=n,la.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,e,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(this.componentId,this.staticRulesId))o=Qr(o,this.staticRulesId);else{var i=Nr(xa(this.rules,t,e,n)),r=_r(yr(this.baseHash,i)>>>0);if(!e.hasNameForId(this.componentId,r)){var a=n(i,".".concat(r),void 0,this.componentId);e.insertRules(this.componentId,r,a)}o=Qr(o,r),this.staticRulesId=r}else{for(var c=yr(this.baseHash,n.hash),s="",l=0;l<this.rules.length;l++){var d=this.rules[l];if("string"==typeof d)s+=d;else if(d){var u=Nr(xa(d,t,e,n));c=yr(c,u+l),s+=u}}if(s){var f=_r(c>>>0);e.hasNameForId(this.componentId,f)||e.insertRules(this.componentId,f,n(s,".".concat(f),void 0,this.componentId)),o=Qr(o,f)}}return o},t}(),Fa=$o().createContext(void 0);function Oa(t){var e=$o().useContext(Fa),n=(0,Zo.useMemo)((function(){return function(t,e){if(!t)throw Gr(14);if(Tr(t))return t(e);if(Array.isArray(t)||"object"!=typeof t)throw Gr(8);return e?ti(ti({},e),t):t}(t.theme,e)}),[t.theme,e]);return t.children?$o().createElement(Fa.Provider,{value:n},t.children):null}Fa.Consumer;var Sa={};function Pa(t,e,n){var o=zr(t),i=t,r=!Ar(t),a=e.attrs,c=void 0===a?sr:a,s=e.componentId,l=void 0===s?function(t,e){var n="string"!=typeof t?"sc":gr(t);Sa[n]=(Sa[n]||0)+1;var o="".concat(n,"-").concat(br(ir+n+Sa[n]));return e?"".concat(e,"-").concat(o):o}(e.displayName,e.parentComponentId):s,d=e.displayName,u=void 0===d?function(t){return Ar(t)?"styled.".concat(t):"Styled(".concat(function(t){return t.displayName||t.name||"Component"}(t),")")}(t):d,f=e.displayName&&e.componentId?"".concat(gr(e.displayName),"-").concat(e.componentId):e.componentId||l,g=o&&i.attrs?i.attrs.concat(c).filter(Boolean):c,h=e.shouldForwardProp;if(o&&i.shouldForwardProp){var p=i.shouldForwardProp;if(e.shouldForwardProp){var _=e.shouldForwardProp;h=function(t,e){return p(t,e)&&_(t,e)}}else h=p}var m=new Ba(n,f,o?i.componentStyle:void 0);function y(t,e){return function(t,e,n){var o=t.attrs,i=t.componentStyle,r=t.defaultProps,a=t.foldedComponentIds,c=t.styledComponentId,s=t.target,l=$o().useContext(Fa),d=ya(),u=t.shouldForwardProp||d.shouldForwardProp,f=function(t,e,n){return void 0===n&&(n=lr),t.theme!==n.theme&&t.theme||e||n.theme}(e,l,r)||lr,g=function(t,e,n){for(var o,i=ti(ti({},e),{className:void 0,theme:n}),r=0;r<t.length;r+=1){var a=Tr(o=t[r])?o(i):o;for(var c in a)i[c]="className"===c?Qr(i[c],a[c]):"style"===c?ti(ti({},i[c]),a[c]):a[c]}return e.className&&(i.className=Qr(i.className,e.className)),i}(o,e,f),h=g.as||s,p={};for(var _ in g)void 0===g[_]||"$"===_[0]||"as"===_||"theme"===_&&g.theme===f||("forwardedAs"===_?p.as=g.forwardedAs:u&&!u(_,h)||(p[_]=g[_]));var m=function(t,e){var n=ya();return t.generateAndInjectStyles(e,n.styleSheet,n.stylis)}(i,g),y=Qr(a,c);return m&&(y+=" "+m),g.className&&(y+=" "+g.className),p[Ar(h)&&!dr.has(h)?"class":"className"]=y,n&&(p.ref=n),(0,Zo.createElement)(h,p)}(L,t,e)}y.displayName=u;var L=$o().forwardRef(y);return L.attrs=g,L.componentStyle=m,L.displayName=u,L.shouldForwardProp=h,L.foldedComponentIds=o?Qr(i.foldedComponentIds,i.styledComponentId):"",L.styledComponentId=f,L.target=o?i.target:t,Object.defineProperty(L,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=o?function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var o=0,i=e;o<i.length;o++)Rr(t,i[o],!0);return t}({},i.defaultProps,t):t}}),qr(L,(function(){return".".concat(L.styledComponentId)})),r&&Mr(L,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),L}function ja(t,e){for(var n=[t[0]],o=0,i=e.length;o<i;o+=1)n.push(e[o],t[o+1]);return n}new Set;var Ua=function(t){return Object.assign(t,{isCss:!0})};function ka(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Tr(t)||Dr(t))return Ua(xa(ja(sr,ei([t],e,!0))));var o=t;return 0===e.length&&1===o.length&&"string"==typeof o[0]?xa(o):Ua(xa(ja(o,e)))}function Ma(t,e,n){if(void 0===n&&(n=lr),!e)throw Gr(1,e);var o=function(o){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];return t(e,n,ka.apply(void 0,ei([o],i,!1)))};return o.attrs=function(o){return Ma(t,e,ti(ti({},n),{attrs:Array.prototype.concat(n.attrs,o).filter(Boolean)}))},o.withConfig=function(o){return Ma(t,e,ti(ti({},n),o))},o}var Ta,za,Qa,Na=function(t){return Ma(Pa,t)},Da=Na;function Ra(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}dr.forEach((function(t){Da[t]=Na(t)})),function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=va(t),la.registerId(this.componentId+1)}t.prototype.createStyles=function(t,e,n,o){var i=o(Nr(xa(this.rules,e,n,o)),""),r=this.componentId+t;n.insertRules(r,r,i)},t.prototype.removeStyles=function(t,e){e.clearRules(this.componentId+t)},t.prototype.renderStyles=function(t,e,n,o){t>2&&la.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,o)}}(),function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString();if(!e)return"";var n=na(),o=Nr([n&&'nonce="'.concat(n,'"'),"".concat(er,'="true"'),"".concat(or,'="').concat(ir,'"')].filter(Boolean)," ");return"<style ".concat(o,">").concat(e,"</style>")},this.getStyleTags=function(){if(t.sealed)throw Gr(2);return t._emitSheetCSS()},this.getStyleElement=function(){var e;if(t.sealed)throw Gr(2);var n=t.instance.toString();if(!n)return[];var o=((e={})[er]="",e[or]=ir,e.dangerouslySetInnerHTML={__html:n},e),i=na();return i&&(o.nonce=i),[$o().createElement("style",ti({},o,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new la({isServer:!0}),this.sealed=!1}t.prototype.collectStyles=function(t){if(this.sealed)throw Gr(2);return $o().createElement(La,{sheet:this.instance},t)},t.prototype.interleaveWithNodeStream=function(t){throw Gr(3)}}(),"__sc-".concat(er,"__");const qa=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=Nr(ka.apply(void 0,ei([t],e,!1))),i=br(o);return new ba(i,o)}(Ta||(Ta=Ra(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))),Ga=Da.span(za||(za=Ra(["\n width: 16px;\n height: 16px;\n\n ","\n border-radius: 50%;\n display: inline-block;\n border-top: 2px solid #fff;\n border-right: 2px solid transparent;\n box-sizing: border-box;\n animation: "," 1s linear infinite;\n"])),(t=>"large"===t.size&&ka(Qa||(Qa=Ra(["\n width: 32px;\n height: 32px;\n "])))),qa);var Ka=i(74);const Va=t=>{let{className:e,size:n}=t;return(0,Ka.jsx)(Ga,{className:e,size:n})};var Ha,Ya,Ja,Wa,Xa,Za,$a;function tc(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const ec=Da.button(Ha||(Ha=tc(["\n font-family: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n font-size: 100%;\n font-weight: inherit;\n line-height: inherit;\n letter-spacing: inherit;\n color: inherit;\n margin: 0;\n padding: 6px 12px;\n position: relative;\n font-size: 14px;\n cursor: pointer;\n height: 40px;\n line-height: 16px;\n font-weight: 500;\n border-radius: 6px;\n border: 1px solid ",";\n color: ",";\n background-color: ",";\n\n ","\n\n ","\n\n ","\n\n\n ","\n"])),(t=>t.theme&&t.theme.primaryBorderColor),(t=>t.theme&&t.theme.primaryTextColor),(t=>t.theme.backgroundColor),(t=>"action"===t.appearance&&ka(Ya||(Ya=tc(["\n background-color: ",";\n border-color: ",";\n color: ",";\n "])),(t=>t.theme.buttonActionBackgroundColor),(t=>t.theme.buttonActionBorderColor),(t=>t.theme.buttonActionTextColor))),(t=>"small"===t.size&&ka(Ja||(Ja=tc(["\n height: 32px;\n font-size: 12px;\n padding: 4px 8px;\n line-height: 12px;\n "])))),(t=>t.disabled&&ka(Wa||(Wa=tc(["\n opacity: 0.5;\n cursor: not-allowed;\n color: ",";\n background-color: ",";\n "])),(t=>t.theme.additionalTextColor),(t=>t.theme.buttonDisabledBackgroundColor))),(t=>t.loading&&ka(Xa||(Xa=tc(["\n cursor: not-allowed;\n color: transparent !important;\n\n ","\n "])),!t.disabled&&ka(Za||(Za=tc(["\n &:hover {\n background-position: right top;\n }\n &:active {\n background-position: center center;\n transform: scale(1.01);\n }\n "])))))),nc=Da(Va)($a||($a=tc(["\n position: absolute;\n top: 50%;\n left: 50%;\n translate: -50% -50%;\n"]))),oc=t=>{let{children:e,onClick:n,className:o,size:i="default",disabled:r,appearance:a="default",loading:c}=t;return(0,Ka.jsxs)(ec,{size:i,onClick:r?void 0:n,className:o,disabled:r,loading:c,appearance:a,children:[c&&(0,Ka.jsx)(nc,{}),e]})};var ic;Da.svg(ic||(rc=["\n width: 16px;\n height: 16px;\n"],ac||(ac=rc.slice(0)),ic=Object.freeze(Object.defineProperties(rc,{raw:{value:Object.freeze(ac)}}))));var rc,ac,cc;Da.svg(cc||(cc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var sc;Da.svg(sc||(sc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var lc;Da.svg(lc||(lc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var dc;Da.svg(dc||(dc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var uc;const fc=Da.svg(uc||(uc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n color: ",";\n"])),(t=>t.theme.backgroundColor));var gc;const hc=Da.svg(gc||(gc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var pc;Da.svg(pc||(pc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var _c;Da.svg(_c||(_c=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 32px;\n height: 32px;\n"])));var mc;const yc=Da.svg(mc||(mc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n color: ",";\n"])),(t=>t.theme.primaryTextColor));var Lc;const bc=Da.svg(Lc||(Lc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"]))),Ac=t=>{let{className:e}=t;return(0,Ka.jsxs)(bc,{className:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ka.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Ka.jsx)("path",{d:"M12 16v-4"}),(0,Ka.jsx)("path",{d:"M12 8h.01"})]})};var wc;const Ic=Da.svg(wc||(wc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 24px;\n height: 24px;\n"]))),Cc=t=>{let{className:e}=t;return(0,Ka.jsx)(Ic,{className:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Ka.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})})};var xc;Da.svg(xc||(xc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var vc;Da.svg(vc||(vc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var Ec;Da.svg(Ec||(Ec=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 12px;\n height: 12px;\n"])));const Bc=t=>{let{className:e}=t;return(0,Ka.jsx)(fc,{className:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Ka.jsx)("path",{d:"M20 6 9 17l-5-5"})})},Fc=t=>{let{className:e}=t;return(0,Ka.jsxs)(hc,{className:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ka.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Ka.jsx)("polyline",{points:"12 6 12 12 16 14"})]})},Oc=t=>{let{className:e,onClick:n}=t;return(0,Ka.jsxs)(yc,{onClick:n,className:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ka.jsx)("path",{d:"m12 19-7-7 7-7"}),(0,Ka.jsx)("path",{d:"M19 12H5"})]})},Sc=t=>{let{className:e}=t;return(0,Ka.jsx)("svg",{className:e,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Ka.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.144225 0.144225C0.336519 -0.048075 0.648289 -0.048075 0.840589 0.144225L5.00002 4.30363L9.15945 0.144225C9.35175 -0.048075 9.66348 -0.048075 9.85577 0.144225C10.0481 0.336519 10.0481 0.648289 9.85577 0.840589L5.69641 5.00002L9.85577 9.15945C10.0481 9.35175 10.0481 9.66348 9.85577 9.85577C9.66348 10.0481 9.35175 10.0481 9.15945 9.85577L5.00002 5.69641L0.840589 9.85577C0.648289 10.0481 0.336519 10.0481 0.144225 9.85577C-0.048075 9.66348 -0.048075 9.35175 0.144225 9.15945L4.30363 5.00002L0.144225 0.840589C-0.048075 0.648289 -0.048075 0.336519 0.144225 0.144225Z",fill:"#686869"})})};var Pc;const jc=Da.h1(Pc||(Pc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n font-size: 16px;\n margin: 0;\n font-weight: 700;\n color: ",";\n"])),(t=>t.theme.primaryTextColor)),Uc=t=>{let{children:e,className:n}=t;return(0,Ka.jsx)(jc,{className:n,children:e})};var kc;const Mc=Da.h2(kc||(kc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n font-size: 14px;\n color: ",";\n margin: 0;\n font-weight: 500;\n"])),(t=>t.theme.secondaryTextColor));var Tc;const zc=Da.a(Tc||(Tc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n margin: 0;\n color: ",";\n font-size: 12px;\n line-height: 16px;\n text-decoration: none;\n"])),(t=>t.theme.primaryTextColor)),Qc=t=>{let{children:e,className:n,target:o,href:i}=t;return(0,Ka.jsx)(zc,{href:i,target:o,className:n,children:e})};var Nc;const Dc=Da.p(Nc||(Nc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n margin: 0;\n color: ",";\n font-size: 14px;\n line-height: 120%;\n"])),(t=>t.theme.secondaryTextColor)),Rc=t=>{let{children:e,className:n,onClick:o}=t;return(0,Ka.jsx)(Dc,{className:n,onClick:o,children:e})};var qc,Gc,Kc,Vc,Hc,Yc,Jc;function Wc(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Xc=Da.div(qc||(qc=Wc(["\n padding: 16px;\n border-radius: 8px;\n font-size: 14px;\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n display: flex;\n svg {\n stroke: ",";\n }\n\n ","\n\n ","\n\n ","\n"])),(t=>t.theme.messageBackgroundColor),(t=>t.theme.primaryBorderColor),(t=>t.theme.primaryTextColor),(t=>t.theme.primaryTextColor),(t=>"error"===t.status&&ka(Gc||(Gc=Wc(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n svg {\n stroke: ",";\n path {\n stroke: ",";\n }\n }\n "])),(t=>t.theme.errorStatusBackgroundColor),(t=>t.theme.errorStatusBorderColor),(t=>t.theme.errorStatusTextColor),(t=>t.theme.errorStatusTextColor),(t=>t.theme.errorStatusTextColor))),(t=>"info"===t.status&&ka(Kc||(Kc=Wc(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n "])),(t=>t.theme.infoStatusBackgroundColor),(t=>t.theme.infoStatusBorderColor),(t=>t.theme.infoStatusTextColor))),(t=>"warning"===t.status&&ka(Vc||(Vc=Wc(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n svg {\n stroke: ",";\n path {\n stroke: ",";\n }\n }\n "])),(t=>t.theme.warningStatusBackgroundColor),(t=>t.theme.warningStatusBorderColor),(t=>t.theme.warningStatusTextColor),(t=>t.theme.warningStatusTextColor),(t=>t.theme.warningStatusTextColor)))),Zc=Da.div(Hc||(Hc=Wc(["\n font-size: 12px;\n flex: 1;\n"]))),$c=Da.h4(Yc||(Yc=Wc(["\n font-size: 14px;\n margin: 0 0 4px;\n"]))),ts=Da(Ac)(Jc||(Jc=Wc(["\n margin-right: 6px;\n"]))),es=t=>{let{children:e,className:n,status:o="default",title:i}=t;const r="warning"===o||"error"===o?(0,Ka.jsx)(ts,{}):null;return(0,Ka.jsxs)(Xc,{className:n,status:o,children:[r,(0,Ka.jsxs)(Zc,{children:[i&&(0,Ka.jsx)($c,{children:i}),e]})]})};var ns,os,is,rs;function as(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const cs=Da.div(ns||(ns=as(["\n display: inline-block;\n padding: 2px 8px;\n border-radius: 999px;\n line-height: 16px;\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n font-size: 12px;\n font-weight: 500;\n\n ","\n\n ","\n\n ","\n"])),(t=>t.theme.defaultStatusBackgroundColor),(t=>t.theme.defaultStatusBorderColor),(t=>t.theme.primaryTextColor),(t=>"info"===t.status&&ka(os||(os=as(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n "])),(t=>t.theme.infoStatusBackgroundColor),(t=>t.theme.infoStatusBorderColor),(t=>t.theme.infoStatusTextColor))),(t=>"success"===t.status&&ka(is||(is=as(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n "])),(t=>t.theme.successStatusBackgroundColor),(t=>t.theme.successStatusBorderColor),(t=>t.theme.successStatusTextColor))),(t=>"error"===t.status&&ka(rs||(rs=as(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n "])),(t=>t.theme.errorStatusBackgroundColor),(t=>t.theme.errorStatusBorderColor),(t=>t.theme.errorStatusTextColor)))),ss=t=>{let{children:e,className:n,status:o="default"}=t;return(0,Ka.jsx)(cs,{className:n,status:o,children:e})};var ls,ds,us,fs,gs,hs,ps,_s,ms;function ys(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function Ls(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}Da.div(ls||(ls=ys(["\n height: 8px;\n border-radius: 999px;\n overflow: hidden;\n position: relative;\n background: ",";\n"])),(t=>t.theme.blankColor)),Da.div(ds||(ds=ys(["\n position: absolute;\n top: 0;\n background: ",";\n left: 0;\n border-radius: 2px;\n height: 100%;\n"])),(t=>t.theme.primaryTextColor)),Da.div(us||(us=ys([""]))),Da.div(fs||(fs=ys(["\n display: flex;\n justify-content: space-between;\n margin-bottom: 3px;\n"]))),Da.span(gs||(gs=ys(["\n color: ",";\n font-size: 12px;\n"])),(t=>t.theme.secondaryTextColor));const bs=Da.div(hs||(hs=Ls(["\n display: flex;\n align-items: center;\n text-align: left;\n cursor: pointer;\n"]))),As=Da.div(ps||(ps=Ls(["\n display: flex;\n align-items: center;\n min-width: 16px;\n justify-content: center;\n height: 16px;\n border-radius: 4px;\n background-color: ",";\n\n ","\n"])),(t=>t.theme.primaryBorderColor),(t=>t.checked&&ka(_s||(_s=Ls(["\n background-color: ",";\n "])),t.theme.buttonActionBackgroundColor))),ws=Da.h3(ms||(ms=Ls(["\n font-size: 12px;\n font-weight: 400;\n margin: 0 0 0 6px;\n"])));var Is,Cs,xs,vs,Es,Bs,Fs,Os,Ss,Ps,js,Us,ks,Ms;function Ts(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const zs=Da.div(Is||(Is=Ts(["\n padding: 12px;\n border-radius: 8px;\n\n background-color: ",";\n border: 1px solid ",";\n\n ","\n\n ","\n"])),(t=>t.theme.defaultStatusBackgroundColor),(t=>t.theme.defaultStatusBorderColor),(t=>"completed"===t.status&&ka(Cs||(Cs=Ts(["\n background-color: ",";\n border: 1px solid ",";\n "])),(t=>t.theme.successStatusBackgroundColor),(t=>t.theme.successStatusBorderColor))),(t=>("pending"===t.status||"scheduled"===t.status)&&ka(xs||(xs=Ts(["\n background-color: ",";\n border: 1px solid ",";\n "])),(t=>t.theme.pendingStatusBackgroundColor),(t=>t.theme.pendingStatusBorderColor)))),Qs=Da((t=>{let{title:e,checked:n,onClick:o,disabled:i,className:r}=t;return(0,Ka.jsxs)(bs,{className:r,children:[(0,Ka.jsx)(As,{checked:n,onClick:()=>{i||o&&o(!n)},children:n&&(0,Ka.jsx)(Bc,{})}),e&&(0,Ka.jsx)(ws,{children:e})]})}))(vs||(vs=Ts([""]))),Ns=Da.h3(Es||(Es=Ts(["\n font-size: 14px;\n font-weight: 500;\n color: ",";\n margin: 0;\n"])),(t=>t.theme.primaryTextColor)),Ds=Da.h4(Bs||(Bs=Ts(["\n font-size: 12px;\n font-weight: 400;\n color: ",";\n margin: 0;\n"])),(t=>t.theme.secondaryTextColor)),Rs=Da.img(Fs||(Fs=Ts(["\n width: 16px;\n height: 16px;\n display: block;\n object-fit: cover;\n object-position: center;\n"]))),qs=Da.div(Os||(Os=Ts(["\n width: 30px;\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n border: 1px solid ",";\n border-radius: 6px;\n"])),(t=>t.theme.backgroundColor),(t=>t.theme.primaryBorderColor)),Gs=Da.div(Ss||(Ss=Ts([""]))),Ks=Da.ul(Ps||(Ps=Ts(["\n margin: 4px 0 0;\n padding: 0 0 0 10px;\n"]))),Vs=Da.li(js||(js=Ts([""]))),Hs=Da.div(Us||(Us=Ts(["\n display: grid;\n grid-template-columns: 30px 1fr max-content;\n gap: 10px;\n align-items: center;\n\n ","\n"])),(t=>t.selectable&&ka(ks||(ks=Ts(["\n grid-template-columns: min-content 30px 1fr max-content;\n "]))))),Ys=Da.div(Ms||(Ms=Ts(["\n color: ",";\n padding-top: 10px;\n padding-left: 40px;\n"])),(t=>t.theme.secondaryTextColor)),Js=t=>{let{status:e,children:n,icon:o,title:i,description:r,selectable:a,selected:c,onSelect:s,groups:l,id:d}=t;const u=(t=>t&&1!==t.length?t.map((t=>{const e=t.checks;return e?"".concat(e[0].value,"+: ").concat(t.points," pts."):""})).filter((t=>t)):null)(l);return(0,Ka.jsxs)(zs,{status:e,children:[(0,Ka.jsxs)(Hs,{selectable:a,children:[a&&(0,Ka.jsx)(Qs,{checked:Boolean(c),onClick:s,id:d}),(0,Ka.jsx)(qs,{children:(0,Ka.jsx)(Rs,{src:o})}),(0,Ka.jsxs)(Gs,{children:[(0,Ka.jsx)(Ns,{children:i}),(0,Ka.jsx)(Ds,{children:r})]}),n]}),u&&(0,Ka.jsxs)(Ys,{children:["Tiers:",(0,Ka.jsx)(Ks,{children:u.reverse().map((t=>(0,Ka.jsx)(Vs,{children:t})))})]})]})};var Ws;const Xs=Da.div(Ws||(Ws=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n justify-self: end;\n display: flex;\n gap: 4px;\n align-items: center;\n"]))),Zs=async()=>{const t="0x0b2Ab187a6FD2d2F05fACc158611838c284E3a9c",e="84532",n="testnet";return console.log({REGISTRY:t,CHAIN_ID:e,EXTENSION_MODE:n}),{REGISTRY:t,CHAIN_ID:e,EXTENSION_MODE:n}},$s=async(t,e,n,o)=>{const i=await Zs(),r=Yo(i.CHAIN_ID),a=Ho({identity_commitment:e,semaphore_group_id:n,fetch_proofs:o});return Vo("".concat(t,"/v1/indexer/").concat(r,"/proofs?").concat(a),"GET",{Authorization:"Bearer ".concat(To)})},tl=async(t,e,n,o,i,r)=>{const a=await Zs(),c=Yo(a.CHAIN_ID);return Vo("".concat(t,"/v1/task-manager/").concat(c,"/verification/tasks"),"POST",{Authorization:"Bearer ".concat(To)},{registry:e,credential_group_id:n,id_hash:o,identity_commitment:i,verifier_signature:r})};var el=i(614),nl=i(368),ol=i(514);let il=function(t){t()};const rl=()=>il,al=Symbol.for("react-redux-context"),cl="undefined"!=typeof globalThis?globalThis:{};function sl(){var t;if(!Zo.createContext)return{};const e=null!=(t=cl[al])?t:cl[al]=new Map;let n=e.get(Zo.createContext);return n||(n=Zo.createContext(null),e.set(Zo.createContext,n)),n}const ll=sl();function dl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ll;return function(){return(0,Zo.useContext)(t)}}const ul=dl();let fl=()=>{throw new Error("uSES not initialized!")};const gl=(t,e)=>t===e;function hl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ll;const e=t===ll?ul:dl(t);return function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{equalityFn:o=gl,stabilityCheck:i,noopCheck:r}="function"==typeof n?{equalityFn:n}:n,{store:a,subscription:c,getServerState:s,stabilityCheck:l,noopCheck:d}=e(),u=((0,Zo.useRef)(!0),(0,Zo.useCallback)({[t.name]:e=>t(e)}[t.name],[t,l,i])),f=fl(c.addNestedSub,a.getState,s||a.getState,u,o);return(0,Zo.useDebugValue)(f),f}}const pl=hl();i(416),i(409);const _l={notify(){},get:()=>[]};const ml="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?Zo.useLayoutEffect:Zo.useEffect;let yl=null;const Ll=function(t){let{store:e,context:n,children:o,serverState:i,stabilityCheck:r="once",noopCheck:a="once"}=t;const c=Zo.useMemo((()=>{const t=function(t,e){let n,o=_l,i=0,r=!1;function a(){l.onStateChange&&l.onStateChange()}function c(){i++,n||(n=e?e.addNestedSub(a):t.subscribe(a),o=function(){const t=rl();let e=null,n=null;return{clear(){e=null,n=null},notify(){t((()=>{let t=e;for(;t;)t.callback(),t=t.next}))},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(t){let o=!0,i=n={callback:t,next:null,prev:n};return i.prev?i.prev.next=i:e=i,function(){o&&null!==e&&(o=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}())}function s(){i--,n&&0===i&&(n(),n=void 0,o.clear(),o=_l)}const l={addNestedSub:function(t){c();const e=o.subscribe(t);let n=!1;return()=>{n||(n=!0,e(),s())}},notifyNestedSubs:function(){o.notify()},handleChangeWrapper:a,isSubscribed:function(){return r},trySubscribe:function(){r||(r=!0,c())},tryUnsubscribe:function(){r&&(r=!1,s())},getListeners:()=>o};return l}(e);return{store:e,subscription:t,getServerState:i?()=>i:void 0,stabilityCheck:r,noopCheck:a}}),[e,i,r,a]),s=Zo.useMemo((()=>e.getState()),[e]);ml((()=>{const{subscription:t}=c;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),s!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[c,s]);const l=n||ll;return Zo.createElement(l.Provider,{value:c},o)};function bl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ll;const e=t===ll?ul:dl(t);return function(){const{store:t}=e();return t}}const Al=bl();function wl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ll;const e=t===ll?Al:bl(t);return function(){return e().dispatch}}const Il=wl();var Cl,xl;function vl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function El(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vl(Object(n),!0).forEach((function(e){Bl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Bl(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Cl=nl.useSyncExternalStoreWithSelector,fl=Cl,(t=>{yl=t})(el.useSyncExternalStore),xl=ol.unstable_batchedUpdates,il=xl;var Fl=function(t){return t["/verifications/addVerification"]="/verifications/addVerification",t["/verifications/addVerifications"]="/verifications/addVerifications",t["/verifications/setLoading"]="/verifications/setLoading",t}(Fl||{});const Ol={verifications:[],loading:!1},Sl=t=>({type:Fl["/verifications/addVerification"],payload:t}),Pl=t=>({type:Fl["/verifications/addVerifications"],payload:t}),jl=()=>pl((t=>t.verifications));var Ul=i(495),kl=i.n(Ul);function Ml(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Tl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ml(Object(n),!0).forEach((function(e){zl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ml(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function zl(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ql=function(t){return t["/modal/setIsOpen"]="/modal/setIsOpen",t["/modal/setLoading"]="/modal/setLoading",t}(Ql||{});const Nl={isOpen:!1,loading:!1},Dl=t=>({type:Ql["/modal/setLoading"],payload:t}),Rl=t=>{let{title:e,groups:n,icon:o,description:i,status:r,id:a,userKey:c}=t;const s=Il(),l=((t,e,n,o)=>{switch(t){case"default":const t=(t=>{if(0===t.length)return null;if(1===t.length)return"".concat(t[0].points," pts.");const e=t.reduce(((t,e)=>(t<e.points&&(t=e.points),t)),0);return"up to ".concat(e," pts.")})(e);return(0,Ka.jsxs)(Ka.Fragment,{children:[(0,Ka.jsxs)(ss,{status:"info",children:["+",t]}),(0,Ka.jsx)(oc,{appearance:"action",size:"small",onClick:async()=>{try{const t=await Zs(),e=No(!0).find((t=>t.id===n)),i=null==e?void 0:e.groups[0];if(i){const e=ko(o,null==i?void 0:i.credentialGroupId),n={registry:t.REGISTRY,credential_group_id:null==i?void 0:i.credentialGroupId,semaphore_identity_commitment:String(e.commitment),origin:window.location.origin},r=Ho({state:btoa(JSON.stringify(n))});if(Dl(!0),!window.open("".concat(Qo,"/auth/github/login?").concat(r),"oauth","width=400,height=600,popup=yes"))throw Dl(!1),new Error("Popup blocked");const a=async n=>{var o,r,c;if(console.log({event:n,AUTH_DOMAIN:Qo}),n.origin===Qo){if("AUTH_SUCCESS"===(null===(o=n.data)||void 0===o?void 0:o.type)){const{signature:o,verifier_hash:r,verifier_message:{id_hash:l}}=n.data.payload;window.removeEventListener("message",a);const{task:d,success:u}=await tl(zo,t.REGISTRY,null==i?void 0:i.credentialGroupId,l,String(e.commitment),o);u&&(Dl(!1),c={status:"scheduled",scheduledTime:d.scheduled_time,taskId:d.id,credentialGroupId:null==i?void 0:i.credentialGroupId,fetched:!1},s(Sl(c))),console.log({task:d})}if("AUTH_ERROR"===(null===(r=n.data)||void 0===r?void 0:r.type))throw Dl(!1),window.removeEventListener("message",a),new Error(n.data.error)}};window.addEventListener("message",a)}}catch(t){Dl(!1),alert(t.message)}},children:"Verify"})]});case"pending":case"scheduled":return(0,Ka.jsx)(Fc,{});default:return(0,Ka.jsx)(Bc,{})}})(r,n,a,c);return(0,Ka.jsx)(Js,{status:r,selectable:!1,title:e,description:i,icon:o,id:a,groups:n,children:(0,Ka.jsx)(Xs,{children:l})})};var ql,Gl,Kl,Vl,Hl,Yl,Jl,Wl,Xl;function Zl(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}Da.div(ql||(ql=Zl(["\n padding: 12px;\n border-radius: 8px;\n display: grid;\n grid-template-columns: 30px 1fr max-content;\n gap: 10px;\n align-items: center;\n background-color: ",";\n border: 1px solid ",";\n\n ","\n\n ","\n"])),(t=>t.theme.defaultStatusBackgroundColor),(t=>t.theme.defaultStatusBorderColor),(t=>"completed"===t.status&&ka(Gl||(Gl=Zl(["\n background-color: ",";\n border: 1px solid ",";\n "])),(t=>t.theme.successStatusBackgroundColor),(t=>t.theme.successStatusBorderColor))),(t=>("pending"===t.status||"scheduled"===t.status)&&ka(Kl||(Kl=Zl(["\n background-color: ",";\n border: 1px solid ",";\n "])),(t=>t.theme.pendingStatusBackgroundColor),(t=>t.theme.pendingStatusBorderColor)))),Da.div(Vl||(Vl=Zl(["\n width: 30px;\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n border: 1px solid ",";\n border-radius: 6px;\n"])),(t=>t.theme.backgroundColor),(t=>t.theme.primaryBorderColor)),Da.h3(Hl||(Hl=Zl(["\n font-size: 14px;\n font-weight: 500;\n color: ",";\n margin: 0;\n"])),(t=>t.theme.primaryTextColor)),Da.h4(Yl||(Yl=Zl(["\n font-size: 12px;\n font-weight: 400;\n color: ",";\n margin: 0;\n"])),(t=>t.theme.secondaryTextColor)),Da.div(Jl||(Jl=Zl([""])));const $l=Da.div(Wl||(Wl=Zl(["\n justify-self: end;\n display: flex;\n gap: 4px;\n align-items: center;\n"]))),td=(Da.img(Xl||(Xl=Zl(["\n width: 16px;\n height: 16px;\n display: block;\n object-fit: cover;\n object-position: center;\n"]))),t=>{let{title:e,taskId:n,points:o,icon:i,description:r,scheduledTime:a,status:c,selectable:s,selected:l,onSelect:d,credentialGroupId:u,fetched:f}=t;const[g,h]=(0,Zo.useState)(null);(0,Zo.useEffect)((()=>{const t=window.setInterval((async()=>{const t=+new Date,e=a-t;h(e<=0?0:e)}),1e3);return()=>{window.clearInterval(t)}}),[]);const p=((t,e,o,i)=>{switch(t){case"default":return(0,Ka.jsxs)(ss,{status:"default",children:[e," pts"]});case"pending":return(0,Ka.jsx)(Fc,{});case"scheduled":return(0,Ka.jsxs)(Ka.Fragment,{children:[(0,Ka.jsx)(Fc,{}),Wo(o||0)," left"]});case"completed":return i?null:(0,Ka.jsxs)(Ka.Fragment,{children:[(0,Ka.jsxs)(ss,{status:"info",children:["+",e]}),(0,Ka.jsx)(oc,{onClick:async()=>{if(!n)return alert("taskId not defined")},size:"small",children:"Check TX"})]});default:return(0,Ka.jsx)(Bc,{})}})(c,o,g,f);return(0,Ka.jsx)(Js,{status:c,selectable:s,title:e,description:r,icon:i,selected:l,onSelect:d,id:u,children:(0,Ka.jsx)($l,{children:p})})});var ed,nd,od;function id(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const rd=Da.div(ed||(ed=id(["\n padding: 16px;\n border: 1px solid ",";\n border-radius: 8px;\n background-color: ",";\n width: 100%;\n font-size: 14px;\n\n ","\n\n ","\n"])),(t=>t.theme.primaryBorderColor),(t=>t.theme.messageBackgroundColor),(t=>"error"===t.status&&ka(nd||(nd=id(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n "])),(t=>t.theme.errorStatusBackgroundColor),(t=>t.theme.errorStatusBorderColor),(t=>t.theme.errorStatusTextColor))),(t=>"warning"===t.status&&ka(od||(od=id(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n "])),(t=>t.theme.warningStatusBackgroundColor),(t=>t.theme.warningStatusBorderColor),(t=>t.theme.warningStatusTextColor))));var ad,cd,sd;function ld(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const dd=Da.div(ad||(ad=ld(["\n width: 58px;\n min-height: 58px;\n border: 1px solid ",";\n border-radius: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n\n ","\n"])),(t=>t.theme.secondaryBorderColor),(t=>"error"===t.status&&ka(cd||(cd=ld(["\n border: 1px solid ",";\n background-color: ",";\n "])),(t=>t.theme.errorStatusBorderColor),(t=>t.theme.errorStatusBackgroundColor)))),ud=Da.img(sd||(sd=ld(["\n min-width: 25px;\n max-width: 25px;\n height: 25px;\n display: block;\n object-fit: cover;\n object-position: center;\n"]))),fd=t=>t?"string"==typeof t?(0,Ka.jsx)(ud,{src:t}):t:null;var gd,hd,pd,_d,md,yd,Ld,bd,Ad;function wd(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function Id(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}Da.ul(gd||(gd=wd(["\n margin: 0;\n padding-left: 20px;\n"]))),Da.li(hd||(hd=wd(["\n margin: 0 0 8px;\n"]))),Da.div(pd||(pd=Id([""]))),Da.h4(_d||(_d=Id(["\n color: ",";\n font-size: 12px;\n margin: 0;\n font-weight: 400;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 4px;\n"])),(t=>t.theme.secondaryTextColor)),Da.div(md||(md=Id(["\n padding: 12px 0 0;\n display: none;\n\n ","\n"])),(t=>t.expanded&&ka(yd||(yd=Id(["\n display: block;\n "]))))),Da.span(Ld||(Ld=Id(["\n transition: rotate 0.3s;\n ","\n"])),(t=>t.expanded&&ka(bd||(bd=Id(["\n rotate: 90deg;\n "])))));const Cd=Da.div(Ad||(Ad=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n border-radius: 8px;\n width: 32px;\n height: 32px;\n background-color: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"])),(t=>t.theme.secondaryBackgroundColor));var xd,vd,Ed,Bd,Fd;function Od(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Sd=Da.div(xd||(xd=Od(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.3);\n width: 100%;\n height: 100%;\n z-index: 100;\n display: flex;\n align-items: center;\n justify-content: center;\n backdrop-filter: blur(2px);\n box-sizing: border-box;\n"]))),Pd=Da.div(vd||(vd=Od(["\n max-width: 680px;\n position: relative;\n width: 100%;\n background: ",";\n border-radius: 20px;\n border: 1px solid ",";\n padding: 16px;\n\n @media (max-width: ",") {\n padding: 40px 25px;\n }\n"])),(t=>t.theme&&t.theme.widgetBackgroundColor),(t=>t.theme&&t.theme.primaryBorderColor),(t=>t.theme.mobileBreakpoint)),jd=Da.h3(Ed||(Ed=Od(["\n margin: 0 0 20px;\n font-size: 32px;\n font-weight: 700;\n text-align: center;\n color: ",";\n"])),(t=>t.theme.primaryTextColor)),Ud=Da.div(Bd||(Bd=Od(["\n margin: 0 auto 20px;\n display: flex;\n justify-content: center;\n"]))),kd=Da((t=>{let{className:e,onClick:n}=t;return(0,Ka.jsx)(Cd,{className:e,onClick:n,children:(0,Ka.jsx)(Sc,{})})}))(Fd||(Fd=Od(["\n position: absolute;\n right: 20px;\n top: 20px;\n"]))),Md=t=>{let{title:e,onClose:n,children:o,className:i,dialogClassName:r,icon:a}=t;return(0,Ka.jsx)(Sd,{onClick:t=>{t.target===t.currentTarget&&n&&n()},className:i,children:(0,Ka.jsxs)(Pd,{className:r,children:[(0,Ka.jsx)(kd,{onClick:n}),a&&(0,Ka.jsx)(Ud,{children:a}),e&&(0,Ka.jsx)(jd,{children:e}),o]})})};var Td,zd,Qd;function Nd(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Dd=Da(Md)(Td||(Td=Nd(["\n ","\n"])),(t=>!t.visible&&ka(zd||(zd=Nd(["\n opacity: 0;\n pointer-events: none;\n "]))))),Rd=Da.iframe(Qd||(Qd=Nd(["\n width: 100%;\n height: 500px;\n border: none;\n overflow: auto;\n"]))),qd={primaryTextColor:"rgb(3, 7, 18)",primaryBackgroundColor:"rgb(253, 254, 255)",secondaryBackgroundColor:"rgb(250, 250, 250)",mobileBreakpoint:"600px",primaryBorderColor:"rgb(229, 231, 235)",secondaryBorderColor:"#2C2C2F",widgetBackgroundColor:"#FFF",backgroundColor:"rgb(255, 255, 255)",secondaryTextColor:"rgb(115, 115, 115)",blankColor:"rgb(245, 245, 245)",overlayBackgroundColor:"rgba(255, 255, 255, .9)",messageBackgroundColor:"rgba(244, 244, 245, 0.3)",additionalTextColor:"rgb(156, 163, 175)",buttonActionTextColor:"#FFF",successStatusBorderColor:"rgb(187, 247, 208)",successStatusBackgroundColor:"rgb(240, 253, 244)",successStatusTextColor:"rgb(22, 163, 74)",errorStatusBackgroundColor:"rgb(254, 242, 242)",errorStatusBorderColor:"rgb(254, 202, 202)",errorStatusTextColor:"rgb(153, 27, 27)",buttonDisabledBackgroundColor:"rgb(229, 231, 235)",warningStatusBackgroundColor:"rgb(254, 252, 232)",warningStatusBorderColor:"rgb(254, 240, 138)",warningStatusTextColor:"rgb(180, 83, 9)",infoStatusBorderColor:"rgb(191, 219, 254)",infoStatusBackgroundColor:"rgb(239, 246, 255)",infoStatusTextColor:"rgb(29, 78, 216)",defaultStatusBackgroundColor:"rgb(255, 255, 255)",defaultStatusBorderColor:"rgb(229, 231, 235)",pendingStatusBackgroundColor:"rgb(254, 252, 232)",pendingStatusBorderColor:"rgb(254, 240, 138)",buttonActionBackgroundColor:"#000",buttonActionBackgroundHoverColor:"#000",buttonActionBackgroundActiveColor:"#000",buttonActionBorderHoverColor:"transparent",buttonActionBorderActiveColor:"transparent",buttonActionBorderColor:"transparent"},Gd=t=>{let{visible:e,setVisible:n,iframeOnLoad:o,onLogin:i,onLogout:r,connectUrl:a="https://connect.bringid.org"}=t;const c=(0,Zo.useRef)(null);!function(t,e,n,o){(0,Zo.useEffect)((()=>{function i(i){const r=i.origin,a=i.data;if(console.log("useMessageProxy: ",{data:a,fromOrigin:r}),r!==window.location.origin){if(r===e)return console.log("fromOrigin === connectUrl: ",{data:a}),"LOGIN"===a.type?void(n&&n()):"LOGOUT"===a.type?void(o&&o()):void window.postMessage(a,window.location.origin)}else{var c;if(!t.current)return;null===(c=t.current.contentWindow)||void 0===c||c.postMessage(a,e)}}return window.addEventListener("message",i),()=>window.removeEventListener("message",i)}),[])}(c,a,i,r);const s="undefined"==typeof window?"":"".concat(a,"?url=").concat(encodeURIComponent(window.location.href));return(0,Ka.jsx)(Oa,{theme:qd,children:(0,Ka.jsx)(Dd,{visible:e,onClose:()=>n(!1),children:(0,Ka.jsx)(Rd,{ref:c,src:s,onLoad:o})})})},Kd=class{constructor(){this.isExtensionInstalled=()=>new Promise(((t,e)=>{setTimeout((()=>{console.log("SDK::",{window});const e=window.bringID;t(Boolean(e))}),1500)})),this.requestProofs=async t=>{let{drop:e,address:n,pointsRequired:o}=t;try{return window.postMessage({type:"PING"}),window.postMessage({type:"REQUEST_PROOFS",host:window.location.host,dropAddress:e,pointsRequired:o,address:n},"*"),new Promise(((t,e)=>{const n=e=>{switch(e.data.type){case"RECEIVE_PROOFS":t({proofs:e.data.data.proofs,points:e.data.data.points}),window.removeEventListener("message",n);break;case"PROOFS_REJECTED":t({proofs:null,points:0})}};window.addEventListener("message",n)}))}catch(t){return console.log({error:t}),{proofs:null,points:0}}}}};function Vd(t){return Vd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vd(t)}function Hd(t,e,n){return(e=function(t){var e=function(t){if("object"!=Vd(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vd(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Jd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Yd(Object(n),!0).forEach((function(e){Hd(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yd(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Wd(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Xd="function"==typeof Symbol&&Symbol.observable||"@@observable",Zd=function(){return Math.random().toString(36).substring(7).split("").join(".")},$d={INIT:"@@redux/INIT"+Zd(),REPLACE:"@@redux/REPLACE"+Zd(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Zd()}};function tu(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function eu(t){return function(e){var n=e.dispatch,o=e.getState;return function(e){return function(i){return"function"==typeof i?i(n,o,t):e(i)}}}}var nu=eu();nu.withExtraArgument=eu;const ou=nu;function iu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function ru(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?iu(Object(n),!0).forEach((function(e){au(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):iu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function au(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}i(966);var cu=function(t){return t["/user/setKey"]="/user/setKey",t["/user/setId"]="/user/setId",t["/user/setUser"]="/user/setUser",t["/user/setLoading"]="/user/setLoading",t["/user/setAddress"]="/user/setAddress",t["/user/setApiKey"]="/user/setApiKey",t["/user/destroy"]="/user/destroy",t}(cu||{});const su={key:null,id:null,address:null,loading:!1,apiKey:null},lu=()=>pl((t=>t.user),kl());function du(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function uu(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?du(Object(n),!0).forEach((function(e){fu(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):du(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function fu(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var gu=function(t){return t["/requestProofs/registerRequest"]="/requestProofs/registerRequest",t["/requestProofs/showRequest"]="/requestProofs/showRequest",t["/requestProofs/resetRequest"]="/requestProofs/resetRequest",t}(gu||{});const hu={pointsRequired:null,dropAddress:null,isOpen:!1},pu=t=>({type:gu["/requestProofs/showRequest"],payload:t}),_u=function(t){for(var e=Object.keys(t),n={},o=0;o<e.length;o++){var i=e[o];"function"==typeof t[i]&&(n[i]=t[i])}var r,a=Object.keys(n);try{!function(t){Object.keys(t).forEach((function(e){var n=t[e];if(void 0===n(void 0,{type:$d.INIT}))throw new Error(Wd(12));if(void 0===n(void 0,{type:$d.PROBE_UNKNOWN_ACTION()}))throw new Error(Wd(13))}))}(n)}catch(t){r=t}return function(t,e){if(void 0===t&&(t={}),r)throw r;for(var o=!1,i={},c=0;c<a.length;c++){var s=a[c],l=n[s],d=t[s],u=l(d,e);if(void 0===u)throw e&&e.type,new Error(Wd(14));i[s]=u,o=o||u!==d}return(o=o||a.length!==Object.keys(t).length)?i:t}}({user:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:su,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case cu["/user/setKey"]:return console.log("KEY UPDATING"),ru(ru({},t),{},{key:e.payload});case cu["/user/setUser"]:return e.payload;case cu["/user/destroy"]:return t;case cu["/user/setId"]:return ru(ru({},t),{},{id:e.payload});case cu["/user/setLoading"]:return ru(ru({},t),{},{loading:e.payload});case cu["/user/setApiKey"]:return ru(ru({},t),{},{apiKey:e.payload});case cu["/user/setAddress"]:return ru(ru({},t),{},{address:e.payload});default:return t}},verifications:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ol,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Fl["/verifications/addVerification"]:if(t.verifications.find((t=>t.credentialGroupId))){const n=t.verifications.map((t=>t.credentialGroupId===e.payload.credentialGroupId?e.payload:t));return El(El({},t),{},{verifications:n})}return El(El({},t),{},{verifications:[e.payload,...t.verifications]});case Fl["/verifications/addVerifications"]:return El(El({},t),{},{verifications:e.payload});case Fl["/verifications/setLoading"]:return El(El({},t),{},{loading:e.payload});default:return t}},modal:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Nl,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ql["/modal/setIsOpen"]:return Tl(Tl({},t),{},{isOpen:e.payload});case Ql["/modal/setLoading"]:return Tl(Tl({},t),{},{loading:e.payload});default:return t}},requestProofs:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hu,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case gu["/requestProofs/registerRequest"]:return uu(uu({},t),{},{pointsRequired:e.payload.pointsRequired,dropAddress:e.payload.dropAddress});case gu["/requestProofs/showRequest"]:return uu(uu({},t),{},{isOpen:e.payload});case gu["/requestProofs/resetRequest"]:return uu({},t);default:return t}}}),mu=function t(e,n,o){var i;if("function"==typeof n&&"function"==typeof o||"function"==typeof o&&"function"==typeof arguments[3])throw new Error(Wd(0));if("function"==typeof n&&void 0===o&&(o=n,n=void 0),void 0!==o){if("function"!=typeof o)throw new Error(Wd(1));return o(t)(e,n)}if("function"!=typeof e)throw new Error(Wd(2));var r=e,a=n,c=[],s=c,l=!1;function d(){s===c&&(s=c.slice())}function u(){if(l)throw new Error(Wd(3));return a}function f(t){if("function"!=typeof t)throw new Error(Wd(4));if(l)throw new Error(Wd(5));var e=!0;return d(),s.push(t),function(){if(e){if(l)throw new Error(Wd(6));e=!1,d();var n=s.indexOf(t);s.splice(n,1),c=null}}}function g(t){if(!function(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t))throw new Error(Wd(7));if(void 0===t.type)throw new Error(Wd(8));if(l)throw new Error(Wd(9));try{l=!0,a=r(a,t)}finally{l=!1}for(var e=c=s,n=0;n<e.length;n++)(0,e[n])();return t}return g({type:$d.INIT}),(i={dispatch:g,subscribe:f,getState:u,replaceReducer:function(t){if("function"!=typeof t)throw new Error(Wd(10));r=t,g({type:$d.REPLACE})}})[Xd]=function(){var t,e=f;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(Wd(11));function n(){t.next&&t.next(u())}return n(),{unsubscribe:e(n)}}})[Xd]=function(){return this},t},i}(_u,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),o=function(){throw new Error(Wd(15))},i={getState:n.getState,dispatch:function(){return o.apply(void 0,arguments)}},r=e.map((function(t){return t(i)}));return o=tu.apply(void 0,r)(n.dispatch),Jd(Jd({},n),{},{dispatch:o})}}}(ou)),yu=mu;var Lu,bu,Au,wu=i(72),Iu=i.n(wu),Cu=i(825),xu=i.n(Cu),vu=i(659),Eu=i.n(vu),Bu=i(56),Fu=i.n(Bu),Ou=i(540),Su=i.n(Ou),Pu=i(113),ju=i.n(Pu),Uu=i(35),ku={};function Mu(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}ku.styleTagTransform=ju(),ku.setAttributes=Fu(),ku.insert=Eu().bind(null,"head"),ku.domAPI=xu(),ku.insertStyleElement=Su(),Iu()(Uu.A,ku),Uu.A&&Uu.A.locals&&Uu.A.locals;const Tu="DialogWindowClassName",zu=Da(Md)(Lu||(Lu=Mu(["\n\n ","\n"])),(t=>!t.visible&&ka(bu||(bu=Mu(["\n opacity: 0;\n pointer-events: none;\n "]))))),Qu=Da.div(Au||(Au=Mu(["\n ."," {\n position: relative;\n width: 400px;\n padding: 8px;\n border-radius: 8px;\n height: 600px;\n }\n"])),Tu);var Nu,Du,Ru,qu,Gu,Ku,Vu,Hu,Yu;function Ju(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Wu=Da(Uc)(Nu||(Nu=Ju([""]))),Xu=Da.header(Du||(Du=Ju(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 0 16px;\n border-bottom: 1px solid ",";\n margin-bottom: 16px;\n"])),(t=>t.theme.primaryBorderColor)),Zu=(Da.span(Ru||(Ru=Ju(["\n color: ",";\n text-transform: capitalize;\n"])),(t=>t.theme.successStatusTextColor)),Da(oc)(qu||(qu=Ju(["\n margin-left: auto;\n"])))),$u=Da.div(Gu||(Gu=Ju(["\n display: flex;\n align-items: center;\n width: 100%;\n"]))),tf=Da.div(Ku||(Ku=Ju([""]))),ef=Da.div(Vu||(Vu=Ju(["\n font-size: 14px;\n display: flex;\n align-items: center;\n gap: 8px;\n color: ",";\n"])),(t=>t.theme.secondaryTextColor)),nf=Da.span(Hu||(Hu=Ju(["\n color: ",";\n font-weight: 700;\n"])),(t=>t.theme.primaryTextColor)),of=Da(Rc)(Yu||(Yu=Ju(["\n font-size: 12px;\n"]))),rf=(t,e,n)=>{const o=Il();return t&&n?(0,Ka.jsxs)($u,{children:[(0,Ka.jsxs)(tf,{children:[(0,Ka.jsxs)(ef,{children:[(0,Ka.jsx)(Cc,{})," ",(0,Ka.jsx)(nf,{children:Mo(t)})]}),(0,Ka.jsxs)(of,{children:["Total Bring Score: ",e]})]}),(0,Ka.jsx)(Zu,{onClick:async()=>{o(Pl([])),o({type:cu["/user/destroy"]})},children:"Logout"})]}):(0,Ka.jsx)(Wu,{children:"BringID"})},af=t=>{let{points:e,address:n,userKey:o}=t;return(0,Ka.jsx)(Xu,{children:rf(n,e,o)})};var cf,sf;function lf(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const df=Da.div(cf||(cf=lf(["\n padding: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n"]))),uf=Da.h3(sf||(sf=lf(["\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n margin: 0;\n color: ",";\n text-align: center;\n"])),(t=>t.theme.secondaryTextColor)),ff=t=>{let{className:e,title:n}=t;return(0,Ka.jsx)(df,{className:e,children:(0,Ka.jsx)(uf,{children:n})})};var gf;const hf=Da.div(gf||(gf=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"]))),pf=t=>{let{tasks:e,className:n,verifications:o}=t;const i=lu();return(0,Ka.jsx)(hf,{className:n,children:e.map(((t,e)=>{const n=((t,e)=>{if(null==t||!t.groups||!Array.isArray(e))return null;for(const n of t.groups){const t=e.find((t=>t.credentialGroupId===n.credentialGroupId));if(t)return t}return null})(t,o);return(0,Ka.jsx)(Rl,{status:(null==n?void 0:n.status)||"default",title:t.title,description:t.description,groups:t.groups,id:t.id,userKey:i.key},t.id)}))})};var _f,mf,yf,Lf;function bf(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Af=Da(oc)(_f||(_f=bf(["\n width: max-content;\n margin: 10px auto;\n"]))),wf=Da.div(mf||(mf=bf(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"]))),If=Da(es)(yf||(yf=bf(["\n margin-bottom: 10px;\n"]))),Cf=Da(Qc)(Lf||(Lf=bf(["\n text-decoration: underline;\n"])));var xf;const vf=Da.div(xf||(xf=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"])));var Ef,Bf,Ff,Of,Sf,Pf,jf,Uf,kf,Mf,Tf,zf,Qf,Nf,Df,Rf;function qf(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Gf=Da.div(Ef||(Ef=qf(["\n padding: 12px;\n height: 100%;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n z-index: 10;\n left: 0;\n background-color: ",";\n"])),(t=>t.theme.backgroundColor)),Kf=Da(Uc)(Bf||(Bf=qf(["\n text-align: center;\n font-size: 24px;\n margin-bottom: 8px;\n"]))),Vf=(Da.header(Ff||(Ff=qf(["\n display: flex;\n align-items: center;\n flex-direction: column;\n margin-bottom: 24px;\n"]))),Da.div(Of||(Of=qf(["\n padding: 24px;\n border-radius: 8px;\n border: 1px solid ",";\n display: flex;\n flex-direction: column;\n align-items: center;\n height: 100%;\n"])),(t=>t.theme.secondaryBorderColor))),Hf=(Da.div(Sf||(Sf=qf(["\n height: 100%;\n"]))),Da((t=>{let{className:e,icon:n,status:o="default"}=t;return(0,Ka.jsx)(dd,{status:o,className:e,children:fd(n)})}))(Pf||(Pf=qf(["\n margin-bottom: 12px;\n border-radius: 58px;\n"])))),Yf=Da(Rc)(jf||(jf=qf(["\n text-align: center;\n font-size: 14px;\n margin-bottom: 40px;\n"]))),Jf=Da((t=>{let{children:e,className:n,status:o="default"}=t;return(0,Ka.jsx)(rd,{className:n,status:o,children:e})}))(Uf||(Uf=qf(["\n margin-bottom: 18px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n"]))),Wf=Da.div(kf||(kf=qf(["\n display: flex;\n justify-content: space-between;\n gap: 12px;\n width: 100%;\n"]))),Xf=Da(oc)(Mf||(Mf=qf(["\n flex: 1;\n"]))),Zf=Da.img(Tf||(Tf=qf(["\n width: 58px;\n height: 58px;\n object-fit: cover;\n object-position: center;\n"]))),$f=Da(es)(zf||(zf=qf(["\n margin-bottom: 18px;\n"]))),tg=Da.span(Qf||(Qf=qf(["\n text-decoration: underline;\n cursor: pointer;\n"]))),eg=(Da.span(Nf||(Nf=qf(["\n color: ",";\n text-transform: capitalize;\n"])),(t=>t.theme.errorStatusTextColor)),Da.span(Df||(Df=qf(["\n color: ",";\n text-transform: capitalize;\n"])),(t=>t.theme.successStatusTextColor)),Da((t=>{let{tasks:e,verifications:n,onSelect:o,selected:i,className:r,devMode:a}=t;return(0,Ka.jsx)(vf,{className:r,children:n.map((t=>{if("completed"!==t.status)return;const e=Do(t.credentialGroupId,a);if(e){const{credentialGroupId:n,points:r}=e.group,a=i.includes(n);return(0,Ka.jsx)(td,{title:e.title,description:e.description,taskId:t.taskId,points:r,scheduledTime:t.scheduledTime,status:"default",fetched:t.fetched,selectable:!0,selected:a,credentialGroupId:t.credentialGroupId,onSelect:t=>{o(n,t)}},n)}}))})}))(Rf||(Rf=qf(["\n margin-bottom: 16px;\n width: 100%;\n"])))),ng=i.p+"6d49141a78bd0420b0384a3801745c44.gif";function og(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var ig=0;function rg(t){return"__private_"+ig+++"_"+t}var ag=rg("apiUrl");const cg=new class{constructor(){Object.defineProperty(this,ag,{writable:!0,value:void 0}),this.getProof=async(t,e,n)=>{const o=await $s(og(this,ag)[ag],t,e,n),{success:i,proof:r}=o;if(i)return r},this.createIdentity=(t,e)=>ko(t,e),og(this,ag)[ag]=function(){try{return zo||""}catch(t){return""}}()}};function sg(t){return[t.pi_a[0],t.pi_a[1],t.pi_b[0][1],t.pi_b[0][0],t.pi_b[1][1],t.pi_b[1][0],t.pi_c[0],t.pi_c[1]]}var lg;!function(t){t.POSEIDON="poseidon",t.SEMAPHORE="semaphore",t.SEMAPHORE_IDENTITY="semaphore-identity"}(lg||(lg={}));const dg=Object.values(lg).sort(),ug=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];function fg(t,e){return e&&10!=e?16==e?"0x"==t.slice(0,2)?BigInt(t):BigInt("0x"+t):void 0:BigInt(t)}const gg=fg;function hg(t){const e=t.toString(16);return 4*(e.length-1)+ug[parseInt(e[0],16)]}function pg(t){return BigInt(t)<BigInt(0)}function _g(t){return!t}function mg(t,e){return BigInt(t)<<BigInt(e)}function yg(t,e){return BigInt(t)>>BigInt(e)}const Lg=mg,bg=yg;function Ag(t){return(BigInt(t)&BigInt(1))==BigInt(1)}function wg(t){let e=BigInt(t);const n=[];for(;e;)e&BigInt(1)?n.push(1):n.push(0),e>>=BigInt(1);return n}function Ig(t){if(t>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("Number too big");return Number(t)}function Cg(t,e){return BigInt(t)+BigInt(e)}function xg(t,e){return BigInt(t)-BigInt(e)}function vg(t){return-BigInt(t)}function Eg(t,e){return BigInt(t)*BigInt(e)}function Bg(t,e){return BigInt(t)**BigInt(e)}function Fg(t,e){return BigInt(t)/BigInt(e)}function Og(t,e){return BigInt(t)%BigInt(e)}function Sg(t,e){return BigInt(t)==BigInt(e)}function Pg(t,e){return BigInt(t)>BigInt(e)}function jg(t,e){return BigInt(t)>=BigInt(e)}function Ug(t,e){return BigInt(t)&BigInt(e)}function kg(t,e,n,o){const i="0000000"+n.toString(16),r=new Uint32Array(t.buffer,t.byteOffset+e,o/4),a=1+(4*(i.length-7)-1>>5);for(let t=0;t<a;t++)r[t]=parseInt(i.substring(i.length-8*t-8,i.length-8*t),16);for(let t=a;t<r.length;t++)r[t]=0;for(let e=4*r.length;e<o;e++)t[e]=Ig(Ug(yg(n,8*e),255))}function Mg(t,e,n,o){const i="0000000"+n.toString(16),r=new DataView(t.buffer,t.byteOffset+e,o),a=1+(4*(i.length-7)-1>>5);for(let t=0;t<a;t++)r.setUint32(o-4*t-4,parseInt(i.substring(i.length-8*t-8,i.length-8*t),16),!1);for(let t=0;t<o/4-a;t++)r[t]=0}function Tg(t,e,n){n=n||t.byteLength,e=e||0;const o=new Uint32Array(t.buffer,t.byteOffset+e,n/4),i=new Array(n/4);return o.forEach(((t,e)=>i[i.length-e-1]=t.toString(16).padStart(8,"0"))),fg(i.join(""),16)}function zg(t,e,n){n=n||t.byteLength,e=e||0;const o=new DataView(t.buffer,t.byteOffset+e,n),i=new Array(n/4);for(let t=0;t<n/4;t++)i[t]=o.getUint32(4*t,!1).toString(16).padStart(8,"0");return fg(i.join(""),16)}function Qg(t,e){return t.toString(e)}function Ng(t){const e=new Uint8Array(Math.floor((hg(t)-1)/8)+1);return kg(e,0,t,e.byteLength),e}const Dg=gg(0),Rg=gg(1);var qg=Object.freeze({__proto__:null,abs:function(t){return BigInt(t)>=0?BigInt(t):-BigInt(t)},add:Cg,band:Ug,bitLength:hg,bits:wg,bor:function(t,e){return BigInt(t)|BigInt(e)},bxor:function(t,e){return BigInt(t)^BigInt(e)},div:Fg,e:gg,eq:Sg,exp:function(t,e){return BigInt(t)**BigInt(e)},fromArray:function(t,e){let n=BigInt(0);e=BigInt(e);for(let o=0;o<t.length;o++)n=n*e+BigInt(t[o]);return n},fromRprBE:zg,fromRprLE:Tg,fromString:fg,geq:jg,gt:Pg,isNegative:pg,isOdd:Ag,isZero:_g,land:function(t,e){return BigInt(t)&&BigInt(e)},leq:function(t,e){return BigInt(t)<=BigInt(e)},lnot:function(t){return!BigInt(t)},lor:function(t,e){return BigInt(t)||BigInt(e)},lt:function(t,e){return BigInt(t)<BigInt(e)},mod:Og,mul:Eg,naf:function(t){let e=BigInt(t);const n=[];for(;e;){if(e&BigInt(1)){const t=2-Number(e%BigInt(4));n.push(t),e-=BigInt(t)}else n.push(0);e>>=BigInt(1)}return n},neg:vg,neq:function(t,e){return BigInt(t)!=BigInt(e)},one:Rg,pow:Bg,shiftLeft:mg,shiftRight:yg,shl:Lg,shr:bg,square:function(t){return BigInt(t)*BigInt(t)},sub:xg,toArray:function(t,e){const n=[];let o=BigInt(t);for(e=BigInt(e);o;)n.unshift(Number(o%e)),o/=e;return n},toLEBuff:Ng,toNumber:Ig,toRprBE:Mg,toRprLE:kg,toString:Qg,zero:Dg});const Gg=[];for(let t=0;t<256;t++)Gg[t]=Kg(t,8);function Kg(t,e){let n=0,o=t;for(let t=0;t<e;t++)n<<=1,n|=1&o,o>>=1;return n}function Vg(t,e,n){if(_g(n))return t.one;const o=wg(n);if(0==o.length)return t.one;let i=e;for(let n=o.length-2;n>=0;n--)i=t.square(i),o[n]&&(i=t.mul(i,e));return i}function Hg(t,e,n,o,i){t[e]=t[e]+t[n]>>>0,t[i]=(t[i]^t[e])>>>0,t[i]=(t[i]<<16|t[i]>>>16&65535)>>>0,t[o]=t[o]+t[i]>>>0,t[n]=(t[n]^t[o])>>>0,t[n]=(t[n]<<12|t[n]>>>20&4095)>>>0,t[e]=t[e]+t[n]>>>0,t[i]=(t[i]^t[e])>>>0,t[i]=(t[i]<<8|t[i]>>>24&255)>>>0,t[o]=t[o]+t[i]>>>0,t[n]=(t[n]^t[o])>>>0,t[n]=(t[n]<<7|t[n]>>>25&127)>>>0}class Yg{constructor(t){t=t||[0,0,0,0,0,0,0,0],this.state=[1634760805,857760878,2036477234,1797285236,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],0,0,0,0],this.idx=16,this.buff=new Array(16)}nextU32(){return 16==this.idx&&this.update(),this.buff[this.idx++]}nextU64(){return Cg(Eg(this.nextU32(),4294967296),this.nextU32())}nextBool(){return!(1&~this.nextU32())}update(){for(let t=0;t<16;t++)this.buff[t]=this.state[t];for(let e=0;e<10;e++)Hg(t=this.buff,0,4,8,12),Hg(t,1,5,9,13),Hg(t,2,6,10,14),Hg(t,3,7,11,15),Hg(t,0,5,10,15),Hg(t,1,6,11,12),Hg(t,2,7,8,13),Hg(t,3,4,9,14);var t;for(let t=0;t<16;t++)this.buff[t]=this.buff[t]+this.state[t]>>>0;this.idx=0,this.state[12]=this.state[12]+1>>>0,0==this.state[12]&&(this.state[13]=this.state[13]+1>>>0,0==this.state[13]&&(this.state[14]=this.state[14]+1>>>0,0==this.state[14]&&(this.state[15]=this.state[15]+1>>>0)))}}function Jg(t){let e=new Uint8Array(t);if(void 0!==globalThis.crypto)globalThis.crypto.getRandomValues(e);else for(let n=0;n<t;n++)e[n]=4294967296*Math.random()>>>0;return e}let Wg=null;function Xg(){return Wg||(Wg=new Yg(function(){const t=Jg(32),e=new Uint32Array(t.buffer),n=[];for(let t=0;t<8;t++)n.push(e[t]);return n}()),Wg)}class Zg{constructor(t,e,n){this.F=e,this.G=t,this.opMulGF=n;let o=e.sqrt_t||e.t,i=e.sqrt_s||e.s,r=e.one;for(;e.eq(e.pow(r,e.half),e.one);)r=e.add(r,e.one);this.w=new Array(i+1),this.wi=new Array(i+1),this.w[i]=this.F.pow(r,o),this.wi[i]=this.F.inv(this.w[i]);let a=i-1;for(;a>=0;)this.w[a]=this.F.square(this.w[a+1]),this.wi[a]=this.F.square(this.wi[a+1]),a--;this.roots=[],this._setRoots(Math.min(i,15))}_setRoots(t){for(let e=t;e>=0&&!this.roots[e];e--){let t=this.F.one;const n=1<<e,o=new Array(n);for(let i=0;i<n;i++)o[i]=t,t=this.F.mul(t,this.w[e]);this.roots[e]=o}}fft(t){if(t.length<=1)return t;const e=$g(t.length-1)+1;this._setRoots(e);const n=1<<e;if(t.length!=n)throw new Error("Size must be multiple of 2");return th(this,t,e,0,1)}ifft(t){if(t.length<=1)return t;const e=$g(t.length-1)+1;this._setRoots(e);const n=1<<e;if(t.length!=n)throw new Error("Size must be multiple of 2");const o=th(this,t,e,0,1),i=this.F.inv(this.F.mulScalar(this.F.one,n)),r=new Array(n);for(let t=0;t<n;t++)r[t]=this.opMulGF(o[(n-t)%n],i);return r}}function $g(t){return(4294901760&t?(t&=4294901760,16):0)|(4278255360&t?(t&=4278255360,8):0)|(4042322160&t?(t&=4042322160,4):0)|(3435973836&t?(t&=3435973836,2):0)|!!(2863311530&t)}function th(t,e,n,o,i){const r=1<<n;if(1==r)return[e[o]];if(2==r)return[t.G.add(e[o],e[o+i]),t.G.sub(e[o],e[o+i])];const a=r>>1,c=th(t,e,n-1,o,2*i),s=th(t,e,n-1,o+i,2*i),l=new Array(r);for(let e=0;e<a;e++)l[e]=t.G.add(c[e],t.opMulGF(s[e],t.roots[n][e])),l[e+a]=t.G.sub(c[e],t.opMulGF(s[e],t.roots[n][e]));return l}class eh{constructor(t){this.type="F1",this.one=BigInt(1),this.zero=BigInt(0),this.p=BigInt(t),this.m=1,this.negone=this.p-this.one,this.two=BigInt(2),this.half=this.p>>this.one,this.bitLength=hg(this.p),this.mask=(this.one<<BigInt(this.bitLength))-this.one,this.n64=Math.floor((this.bitLength-1)/64)+1,this.n32=2*this.n64,this.n8=8*this.n64,this.R=this.e(this.one<<BigInt(64*this.n64)),this.Ri=this.inv(this.R);const e=this.negone>>this.one;this.nqr=this.two;let n=this.pow(this.nqr,e);for(;!this.eq(n,this.negone);)this.nqr=this.nqr+this.one,n=this.pow(this.nqr,e);for(this.s=0,this.t=this.negone;(this.t&this.one)==this.zero;)this.s=this.s+1,this.t=this.t>>this.one;this.nqr_to_t=this.pow(this.nqr,this.t),function(t){if(t.m%2==1)if(Sg(Og(t.p,4),1))if(Sg(Og(t.p,8),1))if(Sg(Og(t.p,16),1))!function(t){for(t.sqrt_q=Bg(t.p,t.m),t.sqrt_s=0,t.sqrt_t=xg(t.sqrt_q,1);!Ag(t.sqrt_t);)t.sqrt_s=t.sqrt_s+1,t.sqrt_t=Fg(t.sqrt_t,2);let e=t.one;for(;t.eq(e,t.one);){const n=t.random();t.sqrt_z=t.pow(n,t.sqrt_t),e=t.pow(t.sqrt_z,2**(t.sqrt_s-1))}t.sqrt_tm1d2=Fg(xg(t.sqrt_t,1),2),t.sqrt=function(t){const e=this;if(e.isZero(t))return e.zero;let n=e.pow(t,e.sqrt_tm1d2);const o=e.pow(e.mul(e.square(n),t),2**(e.sqrt_s-1));if(e.eq(o,e.negone))return null;let i=e.sqrt_s,r=e.mul(t,n),a=e.mul(r,n),c=e.sqrt_z;for(;!e.eq(a,e.one);){let t=e.square(a),o=1;for(;!e.eq(t,e.one);)t=e.square(t),o++;n=c;for(let t=0;t<i-o-1;t++)n=e.square(n);c=e.square(n),a=e.mul(a,c),r=e.mul(r,n),i=o}return e.geq(r,e.zero)?r:e.neg(r)}}(t);else{if(!Sg(Og(t.p,16),9))throw new Error("Field withot sqrt");!function(t){t.sqrt=function(){throw new Error("Sqrt alg 4 not implemented")}}(t)}else{if(!Sg(Og(t.p,8),5))throw new Error("Field withot sqrt");!function(t){t.sqrt=function(){throw new Error("Sqrt alg 3 not implemented")}}(t)}else Sg(Og(t.p,4),3)&&function(t){t.sqrt_q=Bg(t.p,t.m),t.sqrt_e1=Fg(xg(t.sqrt_q,3),4),t.sqrt=function(e){if(this.isZero(e))return this.zero;const n=this.pow(e,this.sqrt_e1),o=this.mul(this.square(n),e);if(this.eq(o,this.negone))return null;const i=this.mul(n,e);return t.geq(i,t.zero)?i:t.neg(i)}}(t);else{const e=Og(Bg(t.p,t.m/2),4);1==e?function(t){t.sqrt=function(){throw new Error("Sqrt alg 10 not implemented")}}(t):3==e?function(t){t.sqrt_q=Bg(t.p,t.m/2),t.sqrt_e34=Fg(xg(t.sqrt_q,3),4),t.sqrt_e12=Fg(xg(t.sqrt_q,1),2),t.frobenius=function(e,n){return e%2==1?t.conjugate(n):n},t.sqrt=function(t){const e=this,n=e.pow(t,e.sqrt_e34),o=e.mul(e.square(n),t),i=e.mul(e.frobenius(1,o),o);if(e.eq(i,e.negone))return null;const r=e.mul(n,t);let a;if(e.eq(o,e.negone))a=e.mul(r,[e.F.zero,e.F.one]);else{const t=e.pow(e.add(e.one,o),e.sqrt_e12);a=e.mul(t,r)}return e.geq(a,e.zero)?a:e.neg(a)}}(t):function(t){t.sqrt=function(){throw new Error("Sqrt alg 8 not implemented")}}(t)}}(this),this.FFT=new Zg(this,this,this.mul.bind(this)),this.fft=this.FFT.fft.bind(this.FFT),this.ifft=this.FFT.ifft.bind(this.FFT),this.w=this.FFT.w,this.wi=this.FFT.wi,this.shift=this.square(this.nqr),this.k=this.exp(this.nqr,2**this.s)}e(t,e){let n;if(e?16==e&&(n=BigInt("0x"+t)):n=BigInt(t),n<0){let t=-n;return t>=this.p&&(t%=this.p),this.p-t}return n>=this.p?n%this.p:n}add(t,e){const n=t+e;return n>=this.p?n-this.p:n}sub(t,e){return t>=e?t-e:this.p-e+t}neg(t){return t?this.p-t:t}mul(t,e){return t*e%this.p}mulScalar(t,e){return t*this.e(e)%this.p}square(t){return t*t%this.p}eq(t,e){return t==e}neq(t,e){return t!=e}lt(t,e){return(t>this.half?t-this.p:t)<(e>this.half?e-this.p:e)}gt(t,e){return(t>this.half?t-this.p:t)>(e>this.half?e-this.p:e)}leq(t,e){return(t>this.half?t-this.p:t)<=(e>this.half?e-this.p:e)}geq(t,e){return(t>this.half?t-this.p:t)>=(e>this.half?e-this.p:e)}div(t,e){return this.mul(t,this.inv(e))}idiv(t,e){if(!e)throw new Error("Division by zero");return t/e}inv(t){if(!t)throw new Error("Division by zero");let e=this.zero,n=this.p,o=this.one,i=t%this.p;for(;i;){let t=n/i;[e,o]=[o,e-t*o],[n,i]=[i,n-t*i]}return e<this.zero&&(e+=this.p),e}mod(t,e){return t%e}pow(t,e){return Vg(this,t,e)}exp(t,e){return Vg(this,t,e)}band(t,e){const n=t&e&this.mask;return n>=this.p?n-this.p:n}bor(t,e){const n=(t|e)&this.mask;return n>=this.p?n-this.p:n}bxor(t,e){const n=(t^e)&this.mask;return n>=this.p?n-this.p:n}bnot(t){const e=t^this.mask;return e>=this.p?e-this.p:e}shl(t,e){if(Number(e)<this.bitLength){const n=t<<e&this.mask;return n>=this.p?n-this.p:n}{const n=this.p-e;return Number(n)<this.bitLength?t>>n:this.zero}}shr(t,e){if(Number(e)<this.bitLength)return t>>e;{const n=this.p-e;if(Number(n)<this.bitLength){const e=t<<n&this.mask;return e>=this.p?e-this.p:e}return 0}}land(t,e){return t&&e?this.one:this.zero}lor(t,e){return t||e?this.one:this.zero}lnot(t){return t?this.zero:this.one}sqrt_old(t){if(t==this.zero)return this.zero;if(this.pow(t,this.negone>>this.one)!=this.one)return null;let e=this.s,n=this.nqr_to_t,o=this.pow(t,this.t),i=this.pow(t,this.add(this.t,this.one)>>this.one);for(;o!=this.one;){let t=this.square(o),r=1;for(;t!=this.one;)r++,t=this.square(t);let a=n;for(let t=0;t<e-r-1;t++)a=this.square(a);e=r,n=this.square(a),o=this.mul(o,n),i=this.mul(i,a)}return i>this.p>>this.one&&(i=this.neg(i)),i}normalize(t,e){if((t=BigInt(t,e))<0){let e=-t;return e>=this.p&&(e%=this.p),this.p-e}return t>=this.p?t%this.p:t}random(){const t=2*this.bitLength/8;let e=this.zero;for(let n=0;n<t;n++)e=(e<<BigInt(8))+BigInt(Jg(1)[0]);return e%this.p}toString(t,e){let n;return e=e||10,n=t>this.half&&10==e?"-"+(this.p-t).toString(e):t.toString(e),n}isZero(t){return t==this.zero}fromRng(t){let e;do{e=this.zero;for(let n=0;n<this.n64;n++)e+=t.nextU64()<<BigInt(64*n);e&=this.mask}while(e>=this.p);return e=e*this.Ri%this.p,e}fft(t){return this.FFT.fft(t)}ifft(t){return this.FFT.ifft(t)}toRprLE(t,e,n){kg(t,e,n,8*this.n64)}toRprBE(t,e,n){Mg(t,e,n,8*this.n64)}toRprBEM(t,e,n){return this.toRprBE(t,e,this.mul(this.R,n))}toRprLEM(t,e,n){return this.toRprLE(t,e,this.mul(this.R,n))}fromRprLE(t,e){return Tg(t,e,this.n8)}fromRprBE(t,e){return zg(t,e,this.n8)}fromRprLEM(t,e){return this.mul(this.fromRprLE(t,e),this.Ri)}fromRprBEM(t,e){return this.mul(this.fromRprBE(t,e),this.Ri)}toObject(t){return t}}var nh={bigInt2BytesLE:function(t,e){const n=Array(e);let o=BigInt(t);for(let t=0;t<e;t++)n[t]=Number(0xFFn&o),o>>=8n;return n},bigInt2U32LE:function(t,e){const n=Array(e);let o=BigInt(t);for(let t=0;t<e;t++)n[t]=Number(0xFFFFFFFFn&o),o>>=32n;return n},isOcamNum:function(t){return!!Array.isArray(t)&&3==t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&!!Array.isArray(t[2])}},oh=function(t,e,n,o,i,r,a){const c=t.addFunction(e);c.addParam("base","i32"),c.addParam("scalar","i32"),c.addParam("scalarLength","i32"),c.addParam("r","i32"),c.addLocal("i","i32"),c.addLocal("b","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(n));c.addCode(s.if(s.i32_eqz(s.getLocal("scalarLength")),[...s.call(a,s.getLocal("r")),...s.ret([])])),c.addCode(s.call(r,s.getLocal("base"),l)),c.addCode(s.call(a,s.getLocal("r"))),c.addCode(s.setLocal("i",s.getLocal("scalarLength"))),c.addCode(s.block(s.loop(s.setLocal("i",s.i32_sub(s.getLocal("i"),s.i32_const(1))),s.setLocal("b",s.i32_load8_u(s.i32_add(s.getLocal("scalar"),s.getLocal("i")))),...function(){const t=[];for(let e=0;e<8;e++)t.push(...s.call(i,s.getLocal("r"),s.getLocal("r")),...s.if(s.i32_ge_u(s.getLocal("b"),s.i32_const(128>>e)),[...s.setLocal("b",s.i32_sub(s.getLocal("b"),s.i32_const(128>>e))),...s.call(o,s.getLocal("r"),l,s.getLocal("r"))]));return t}(),s.br_if(1,s.i32_eqz(s.getLocal("i"))),s.br(0))))},ih=function(t,e){const n=8*t.modules[e].n64,o=t.addFunction(e+"_batchInverse");o.addParam("pIn","i32"),o.addParam("inStep","i32"),o.addParam("n","i32"),o.addParam("pOut","i32"),o.addParam("outStep","i32"),o.addLocal("itAux","i32"),o.addLocal("itIn","i32"),o.addLocal("itOut","i32"),o.addLocal("i","i32");const i=o.getCodeBuilder(),r=i.i32_const(t.alloc(n));o.addCode(i.setLocal("itAux",i.i32_load(i.i32_const(0))),i.i32_store(i.i32_const(0),i.i32_add(i.getLocal("itAux"),i.i32_mul(i.i32_add(i.getLocal("n"),i.i32_const(1)),i.i32_const(n))))),o.addCode(i.call(e+"_one",i.getLocal("itAux")),i.setLocal("itIn",i.getLocal("pIn")),i.setLocal("itAux",i.i32_add(i.getLocal("itAux"),i.i32_const(n))),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.if(i.call(e+"_isZero",i.getLocal("itIn")),i.call(e+"_copy",i.i32_sub(i.getLocal("itAux"),i.i32_const(n)),i.getLocal("itAux")),i.call(e+"_mul",i.getLocal("itIn"),i.i32_sub(i.getLocal("itAux"),i.i32_const(n)),i.getLocal("itAux"))),i.setLocal("itIn",i.i32_add(i.getLocal("itIn"),i.getLocal("inStep"))),i.setLocal("itAux",i.i32_add(i.getLocal("itAux"),i.i32_const(n))),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))),i.setLocal("itIn",i.i32_sub(i.getLocal("itIn"),i.getLocal("inStep"))),i.setLocal("itAux",i.i32_sub(i.getLocal("itAux"),i.i32_const(n))),i.setLocal("itOut",i.i32_add(i.getLocal("pOut"),i.i32_mul(i.i32_sub(i.getLocal("n"),i.i32_const(1)),i.getLocal("outStep")))),i.call(e+"_inverse",i.getLocal("itAux"),i.getLocal("itAux")),i.block(i.loop(i.br_if(1,i.i32_eqz(i.getLocal("i"))),i.if(i.call(e+"_isZero",i.getLocal("itIn")),[...i.call(e+"_copy",i.getLocal("itAux"),i.i32_sub(i.getLocal("itAux"),i.i32_const(n))),...i.call(e+"_zero",i.getLocal("itOut"))],[...i.call(e+"_copy",i.i32_sub(i.getLocal("itAux"),i.i32_const(n)),r),...i.call(e+"_mul",i.getLocal("itAux"),i.getLocal("itIn"),i.i32_sub(i.getLocal("itAux"),i.i32_const(n))),...i.call(e+"_mul",i.getLocal("itAux"),r,i.getLocal("itOut"))]),i.setLocal("itIn",i.i32_sub(i.getLocal("itIn"),i.getLocal("inStep"))),i.setLocal("itOut",i.i32_sub(i.getLocal("itOut"),i.getLocal("outStep"))),i.setLocal("itAux",i.i32_sub(i.getLocal("itAux"),i.i32_const(n))),i.setLocal("i",i.i32_sub(i.getLocal("i"),i.i32_const(1))),i.br(0)))),o.addCode(i.i32_store(i.i32_const(0),i.getLocal("itAux")))},rh=function(t,e,n,o,i,r){void 0===r&&(r=o<i);const a=t.addFunction(e);a.addParam("pIn","i32"),a.addParam("n","i32"),a.addParam("pOut","i32"),a.addLocal("i","i32"),a.addLocal("itIn","i32"),a.addLocal("itOut","i32");const c=a.getCodeBuilder();r?a.addCode(c.setLocal("itIn",c.i32_add(c.getLocal("pIn"),c.i32_mul(c.i32_sub(c.getLocal("n"),c.i32_const(1)),c.i32_const(o)))),c.setLocal("itOut",c.i32_add(c.getLocal("pOut"),c.i32_mul(c.i32_sub(c.getLocal("n"),c.i32_const(1)),c.i32_const(i)))),c.setLocal("i",c.i32_const(0)),c.block(c.loop(c.br_if(1,c.i32_eq(c.getLocal("i"),c.getLocal("n"))),c.call(n,c.getLocal("itIn"),c.getLocal("itOut")),c.setLocal("itIn",c.i32_sub(c.getLocal("itIn"),c.i32_const(o))),c.setLocal("itOut",c.i32_sub(c.getLocal("itOut"),c.i32_const(i))),c.setLocal("i",c.i32_add(c.getLocal("i"),c.i32_const(1))),c.br(0)))):a.addCode(c.setLocal("itIn",c.getLocal("pIn")),c.setLocal("itOut",c.getLocal("pOut")),c.setLocal("i",c.i32_const(0)),c.block(c.loop(c.br_if(1,c.i32_eq(c.getLocal("i"),c.getLocal("n"))),c.call(n,c.getLocal("itIn"),c.getLocal("itOut")),c.setLocal("itIn",c.i32_add(c.getLocal("itIn"),c.i32_const(o))),c.setLocal("itOut",c.i32_add(c.getLocal("itOut"),c.i32_const(i))),c.setLocal("i",c.i32_add(c.getLocal("i"),c.i32_const(1))),c.br(0))))},ah={};function ch(t,e){return t===e?0:t>e?1:-1}function sh(t){return t*t}function lh(t){return t%2n!==0n}function dh(t){return t%2n===0n}function uh(t){return t<0n}function fh(t){return t>0n}function gh(t){return uh(t)?t.toString(2).length-1:t.toString(2).length}function hh(t){return t<0n?-t:t}function ph(t){return 1n===hh(t)}function _h(t,e){for(var n,o,i,r=0n,a=1n,c=e,s=hh(t);0n!==s;)n=c/s,o=r,i=c,r=a,c=s,a=o-n*a,s=i-n*s;if(!ph(c))throw new Error(t.toString()+" and "+e.toString()+" are not co-prime");return-1===ch(r,0n)&&(r+=e),uh(t)?-r:r}function mh(t,e,n){if(0n===n)throw new Error("Cannot take modPow with modulus 0");var o=1n,i=t%n;for(uh(e)&&(e*=-1n,i=_h(i,n));fh(e);){if(0n===i)return 0n;lh(e)&&(o=o*i%n),e/=2n,i=sh(i)%n}return o}function yh(t,e){return 0n!==e&&(!!ph(e)||(0===function(t,e){return(t=t>=0n?t:-t)===(e=e>=0n?e:-e)?0:t>e?1:-1}(e,2n)?dh(t):t%e===0n))}function Lh(t,e){for(var n,o,i,r=function(t){return t-1n}(t),a=r,c=0;dh(a);)a/=2n,c++;t:for(o=0;o<e.length;o++)if(!(t<e[o]||ph(i=mh(BigInt(e[o]),a,t))||i===r)){for(n=c-1;0!=n;n--){if(ph(i=sh(i)%t))return!1;if(i===r)continue t}return!1}return!0}ah.bitLength=gh,ah.isOdd=lh,ah.isNegative=uh,ah.abs=hh,ah.isUnit=ph,ah.compare=ch,ah.modInv=_h,ah.modPow=mh,ah.isPrime=function(t){var e=function(t){var e=hh(t);return!ph(e)&&(2n===e||3n===e||5n===e||!(dh(e)||yh(e,3n)||yh(e,5n))&&(e<49n||void 0))}(t);if(void 0!==e)return e;var n=hh(t),o=gh(n);if(o<=64)return Lh(n,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var i=Math.log(2)*Number(o),r=Math.ceil(i),a=[],c=0;c<r;c++)a.push(BigInt(c+2));return Lh(n,a)},ah.square=sh;const bh=nh,Ah=oh,wh=ih,Ih=rh,Ch=function(t,e,n,o,i,r){void 0===r&&(r=o<i);const a=t.addFunction(e);a.addParam("pIn1","i32"),a.addParam("pIn2","i32"),a.addParam("n","i32"),a.addParam("pOut","i32"),a.addLocal("i","i32"),a.addLocal("itIn1","i32"),a.addLocal("itIn2","i32"),a.addLocal("itOut","i32");const c=a.getCodeBuilder();r?a.addCode(c.setLocal("itIn1",c.i32_add(c.getLocal("pIn1"),c.i32_mul(c.i32_sub(c.getLocal("n"),c.i32_const(1)),c.i32_const(o)))),c.setLocal("itIn2",c.i32_add(c.getLocal("pIn2"),c.i32_mul(c.i32_sub(c.getLocal("n"),c.i32_const(1)),c.i32_const(o)))),c.setLocal("itOut",c.i32_add(c.getLocal("pOut"),c.i32_mul(c.i32_sub(c.getLocal("n"),c.i32_const(1)),c.i32_const(i)))),c.setLocal("i",c.i32_const(0)),c.block(c.loop(c.br_if(1,c.i32_eq(c.getLocal("i"),c.getLocal("n"))),c.call(n,c.getLocal("itIn1"),c.getLocal("itIn2"),c.getLocal("itOut")),c.setLocal("itIn1",c.i32_sub(c.getLocal("itIn1"),c.i32_const(o))),c.setLocal("itIn2",c.i32_sub(c.getLocal("itIn2"),c.i32_const(o))),c.setLocal("itOut",c.i32_sub(c.getLocal("itOut"),c.i32_const(i))),c.setLocal("i",c.i32_add(c.getLocal("i"),c.i32_const(1))),c.br(0)))):a.addCode(c.setLocal("itIn1",c.getLocal("pIn1")),c.setLocal("itIn2",c.getLocal("pIn2")),c.setLocal("itOut",c.getLocal("pOut")),c.setLocal("i",c.i32_const(0)),c.block(c.loop(c.br_if(1,c.i32_eq(c.getLocal("i"),c.getLocal("n"))),c.call(n,c.getLocal("itIn1"),c.getLocal("itIn2"),c.getLocal("itOut")),c.setLocal("itIn1",c.i32_add(c.getLocal("itIn1"),c.i32_const(o))),c.setLocal("itIn2",c.i32_add(c.getLocal("itIn2"),c.i32_const(o))),c.setLocal("itOut",c.i32_add(c.getLocal("itOut"),c.i32_const(i))),c.setLocal("i",c.i32_add(c.getLocal("i"),c.i32_const(1))),c.br(0))))},{bitLength:xh,modInv:vh,modPow:Eh,isPrime:Bh,isOdd:Fh,square:Oh}=ah;var Sh=function(t,e,n,o){const i=BigInt(e),r=Math.floor((xh(i-1n)-1)/64)+1,a=2*r,c=8*r,s=n||"f1m";if(t.modules[s])return s;const l=function(t,e,n){const o=n||"int";if(t.modules[o])return o;t.modules[o]={};const i=2*e,r=8*e;return function(){const n=t.addFunction(o+"_copy");n.addParam("px","i32"),n.addParam("pr","i32");const i=n.getCodeBuilder();for(let t=0;t<e;t++)n.addCode(i.i64_store(i.getLocal("pr"),8*t,i.i64_load(i.getLocal("px"),8*t)))}(),function(){const n=t.addFunction(o+"_zero");n.addParam("pr","i32");const i=n.getCodeBuilder();for(let t=0;t<e;t++)n.addCode(i.i64_store(i.getLocal("pr"),8*t,i.i64_const(0)))}(),function(){const n=t.addFunction(o+"_isZero");n.addParam("px","i32"),n.setReturnType("i32");const i=n.getCodeBuilder();n.addCode(function t(e){return 0==e?i.ret(i.i64_eqz(i.i64_load(i.getLocal("px")))):i.if(i.i64_eqz(i.i64_load(i.getLocal("px"),8*e)),t(e-1),i.ret(i.i32_const(0)))}(e-1)),n.addCode(i.ret(i.i32_const(0)))}(),function(){const n=t.addFunction(o+"_one");n.addParam("pr","i32");const i=n.getCodeBuilder();n.addCode(i.i64_store(i.getLocal("pr"),0,i.i64_const(1)));for(let t=1;t<e;t++)n.addCode(i.i64_store(i.getLocal("pr"),8*t,i.i64_const(0)))}(),function(){const n=t.addFunction(o+"_eq");n.addParam("px","i32"),n.addParam("py","i32"),n.setReturnType("i32");const i=n.getCodeBuilder();n.addCode(function t(e){return 0==e?i.ret(i.i64_eq(i.i64_load(i.getLocal("px")),i.i64_load(i.getLocal("py")))):i.if(i.i64_eq(i.i64_load(i.getLocal("px"),8*e),i.i64_load(i.getLocal("py"),8*e)),t(e-1),i.ret(i.i32_const(0)))}(e-1)),n.addCode(i.ret(i.i32_const(0)))}(),function(){const n=t.addFunction(o+"_gte");n.addParam("px","i32"),n.addParam("py","i32"),n.setReturnType("i32");const i=n.getCodeBuilder();n.addCode(function t(e){return 0==e?i.ret(i.i64_ge_u(i.i64_load(i.getLocal("px")),i.i64_load(i.getLocal("py")))):i.if(i.i64_lt_u(i.i64_load(i.getLocal("px"),8*e),i.i64_load(i.getLocal("py"),8*e)),i.ret(i.i32_const(0)),i.if(i.i64_gt_u(i.i64_load(i.getLocal("px"),8*e),i.i64_load(i.getLocal("py"),8*e)),i.ret(i.i32_const(1)),t(e-1)))}(e-1)),n.addCode(i.ret(i.i32_const(0)))}(),function(){const e=t.addFunction(o+"_add");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32"),e.setReturnType("i32"),e.addLocal("c","i64");const n=e.getCodeBuilder();e.addCode(n.setLocal("c",n.i64_add(n.i64_load32_u(n.getLocal("x")),n.i64_load32_u(n.getLocal("y"))))),e.addCode(n.i64_store32(n.getLocal("r"),n.getLocal("c")));for(let t=1;t<i;t++)e.addCode(n.setLocal("c",n.i64_add(n.i64_add(n.i64_load32_u(n.getLocal("x"),4*t),n.i64_load32_u(n.getLocal("y"),4*t)),n.i64_shr_u(n.getLocal("c"),n.i64_const(32))))),e.addCode(n.i64_store32(n.getLocal("r"),4*t,n.getLocal("c")));e.addCode(n.i32_wrap_i64(n.i64_shr_u(n.getLocal("c"),n.i64_const(32))))}(),function(){const e=t.addFunction(o+"_sub");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32"),e.setReturnType("i32"),e.addLocal("c","i64");const n=e.getCodeBuilder();e.addCode(n.setLocal("c",n.i64_sub(n.i64_load32_u(n.getLocal("x")),n.i64_load32_u(n.getLocal("y"))))),e.addCode(n.i64_store32(n.getLocal("r"),n.i64_and(n.getLocal("c"),n.i64_const("0xFFFFFFFF"))));for(let t=1;t<i;t++)e.addCode(n.setLocal("c",n.i64_add(n.i64_sub(n.i64_load32_u(n.getLocal("x"),4*t),n.i64_load32_u(n.getLocal("y"),4*t)),n.i64_shr_s(n.getLocal("c"),n.i64_const(32))))),e.addCode(n.i64_store32(n.getLocal("r"),4*t,n.i64_and(n.getLocal("c"),n.i64_const("0xFFFFFFFF"))));e.addCode(n.i32_wrap_i64(n.i64_shr_s(n.getLocal("c"),n.i64_const(32))))}(),function(){const e=t.addFunction(o+"_mul");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32"),e.addLocal("c0","i64"),e.addLocal("c1","i64");for(let t=0;t<i;t++)e.addLocal("x"+t,"i64"),e.addLocal("y"+t,"i64");const n=e.getCodeBuilder(),r=[],a=[];function c(t,e){let o,i;return r[t]?o=n.getLocal("x"+t):(o=n.teeLocal("x"+t,n.i64_load32_u(n.getLocal("x"),4*t)),r[t]=!0),a[e]?i=n.getLocal("y"+e):(i=n.teeLocal("y"+e,n.i64_load32_u(n.getLocal("y"),4*e)),a[e]=!0),n.i64_mul(o,i)}let s="c0",l="c1";for(let t=0;t<2*i-1;t++){for(let o=Math.max(0,t-i+1);o<=t&&o<i;o++){const i=t-o;e.addCode(n.setLocal(s,n.i64_add(n.i64_and(n.getLocal(s),n.i64_const(4294967295)),c(o,i)))),e.addCode(n.setLocal(l,n.i64_add(n.getLocal(l),n.i64_shr_u(n.getLocal(s),n.i64_const(32)))))}e.addCode(n.i64_store32(n.getLocal("r"),4*t,n.getLocal(s))),[s,l]=[l,s],e.addCode(n.setLocal(l,n.i64_shr_u(n.getLocal(s),n.i64_const(32))))}e.addCode(n.i64_store32(n.getLocal("r"),4*i*2-4,n.getLocal(s)))}(),function(){const e=t.addFunction(o+"_square");e.addParam("x","i32"),e.addParam("r","i32"),e.addLocal("c0","i64"),e.addLocal("c1","i64"),e.addLocal("c0_old","i64"),e.addLocal("c1_old","i64");for(let t=0;t<i;t++)e.addLocal("x"+t,"i64");const n=e.getCodeBuilder(),r=[];function a(t,e){let o,i;return r[t]?o=n.getLocal("x"+t):(o=n.teeLocal("x"+t,n.i64_load32_u(n.getLocal("x"),4*t)),r[t]=!0),r[e]?i=n.getLocal("x"+e):(i=n.teeLocal("x"+e,n.i64_load32_u(n.getLocal("x"),4*e)),r[e]=!0),n.i64_mul(o,i)}let c="c0",s="c1",l="c0_old",d="c1_old";for(let t=0;t<2*i-1;t++){e.addCode(n.setLocal(c,n.i64_const(0)),n.setLocal(s,n.i64_const(0)));for(let o=Math.max(0,t-i+1);o<t+1>>1&&o<i;o++){const i=t-o;e.addCode(n.setLocal(c,n.i64_add(n.i64_and(n.getLocal(c),n.i64_const(4294967295)),a(o,i)))),e.addCode(n.setLocal(s,n.i64_add(n.getLocal(s),n.i64_shr_u(n.getLocal(c),n.i64_const(32)))))}e.addCode(n.setLocal(c,n.i64_shl(n.i64_and(n.getLocal(c),n.i64_const(4294967295)),n.i64_const(1)))),e.addCode(n.setLocal(s,n.i64_add(n.i64_shl(n.getLocal(s),n.i64_const(1)),n.i64_shr_u(n.getLocal(c),n.i64_const(32))))),t%2==0&&(e.addCode(n.setLocal(c,n.i64_add(n.i64_and(n.getLocal(c),n.i64_const(4294967295)),a(t>>1,t>>1)))),e.addCode(n.setLocal(s,n.i64_add(n.getLocal(s),n.i64_shr_u(n.getLocal(c),n.i64_const(32)))))),t>0&&(e.addCode(n.setLocal(c,n.i64_add(n.i64_and(n.getLocal(c),n.i64_const(4294967295)),n.i64_and(n.getLocal(l),n.i64_const(4294967295))))),e.addCode(n.setLocal(s,n.i64_add(n.i64_add(n.getLocal(s),n.i64_shr_u(n.getLocal(c),n.i64_const(32))),n.getLocal(d))))),e.addCode(n.i64_store32(n.getLocal("r"),4*t,n.getLocal(c))),e.addCode(n.setLocal(l,n.getLocal(s)),n.setLocal(d,n.i64_shr_u(n.getLocal(l),n.i64_const(32))))}e.addCode(n.i64_store32(n.getLocal("r"),4*i*2-4,n.getLocal(l)))}(),function(){const e=t.addFunction(o+"_squareOld");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(o+"_mul",n.getLocal("x"),n.getLocal("x"),n.getLocal("r")))}(),function(){!function(){const e=t.addFunction(o+"__mul1");e.addParam("px","i32"),e.addParam("y","i64"),e.addParam("pr","i32"),e.addLocal("c","i64");const n=e.getCodeBuilder();e.addCode(n.setLocal("c",n.i64_mul(n.i64_load32_u(n.getLocal("px"),0,0),n.getLocal("y")))),e.addCode(n.i64_store32(n.getLocal("pr"),0,0,n.getLocal("c")));for(let t=1;t<i;t++)e.addCode(n.setLocal("c",n.i64_add(n.i64_mul(n.i64_load32_u(n.getLocal("px"),4*t,0),n.getLocal("y")),n.i64_shr_u(n.getLocal("c"),n.i64_const(32))))),e.addCode(n.i64_store32(n.getLocal("pr"),4*t,0,n.getLocal("c")))}(),function(){const e=t.addFunction(o+"__add1");e.addParam("x","i32"),e.addParam("y","i64"),e.addLocal("c","i64"),e.addLocal("px","i32");const n=e.getCodeBuilder();e.addCode(n.setLocal("px",n.getLocal("x"))),e.addCode(n.setLocal("c",n.i64_add(n.i64_load32_u(n.getLocal("px"),0,0),n.getLocal("y")))),e.addCode(n.i64_store32(n.getLocal("px"),0,0,n.getLocal("c"))),e.addCode(n.setLocal("c",n.i64_shr_u(n.getLocal("c"),n.i64_const(32)))),e.addCode(n.block(n.loop(n.br_if(1,n.i64_eqz(n.getLocal("c"))),n.setLocal("px",n.i32_add(n.getLocal("px"),n.i32_const(4))),n.setLocal("c",n.i64_add(n.i64_load32_u(n.getLocal("px"),0,0),n.getLocal("c"))),n.i64_store32(n.getLocal("px"),0,0,n.getLocal("c")),n.setLocal("c",n.i64_shr_u(n.getLocal("c"),n.i64_const(32))),n.br(0))))}();const e=t.addFunction(o+"_div");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("c","i32"),e.addParam("r","i32"),e.addLocal("rr","i32"),e.addLocal("cc","i32"),e.addLocal("eX","i32"),e.addLocal("eY","i32"),e.addLocal("sy","i64"),e.addLocal("sx","i64"),e.addLocal("ec","i32");const n=e.getCodeBuilder(),a=n.i32_const(t.alloc(r)),c=n.i32_const(t.alloc(r)),s=n.i32_const(t.alloc(r)),l=n.getLocal("cc"),d=n.getLocal("rr"),u=t.alloc(2*r),f=n.i32_const(u),g=n.i32_const(u+r);e.addCode(n.if(n.getLocal("c"),n.setLocal("cc",n.getLocal("c")),n.setLocal("cc",c))),e.addCode(n.if(n.getLocal("r"),n.setLocal("rr",n.getLocal("r")),n.setLocal("rr",s))),e.addCode(n.call(o+"_copy",n.getLocal("x"),d)),e.addCode(n.call(o+"_copy",n.getLocal("y"),a)),e.addCode(n.call(o+"_zero",l)),e.addCode(n.call(o+"_zero",f)),e.addCode(n.setLocal("eX",n.i32_const(r-1))),e.addCode(n.setLocal("eY",n.i32_const(r-1))),e.addCode(n.block(n.loop(n.br_if(1,n.i32_or(n.i32_load8_u(n.i32_add(a,n.getLocal("eY")),0,0),n.i32_eq(n.getLocal("eY"),n.i32_const(3)))),n.setLocal("eY",n.i32_sub(n.getLocal("eY"),n.i32_const(1))),n.br(0)))),e.addCode(n.setLocal("sy",n.i64_add(n.i64_load32_u(n.i32_sub(n.i32_add(a,n.getLocal("eY")),n.i32_const(3)),0,0),n.i64_const(1)))),e.addCode(n.if(n.i64_eq(n.getLocal("sy"),n.i64_const(1)),n.drop(n.i64_div_u(n.i64_const(0),n.i64_const(0))))),e.addCode(n.block(n.loop(n.block(n.loop(n.br_if(1,n.i32_or(n.i32_load8_u(n.i32_add(d,n.getLocal("eX")),0,0),n.i32_eq(n.getLocal("eX"),n.i32_const(7)))),n.setLocal("eX",n.i32_sub(n.getLocal("eX"),n.i32_const(1))),n.br(0))),n.setLocal("sx",n.i64_load(n.i32_sub(n.i32_add(d,n.getLocal("eX")),n.i32_const(7)),0,0)),n.setLocal("sx",n.i64_div_u(n.getLocal("sx"),n.getLocal("sy"))),n.setLocal("ec",n.i32_sub(n.i32_sub(n.getLocal("eX"),n.getLocal("eY")),n.i32_const(4))),n.block(n.loop(n.br_if(1,n.i32_and(n.i64_eqz(n.i64_and(n.getLocal("sx"),n.i64_const("0xFFFFFFFF00000000"))),n.i32_ge_s(n.getLocal("ec"),n.i32_const(0)))),n.setLocal("sx",n.i64_shr_u(n.getLocal("sx"),n.i64_const(8))),n.setLocal("ec",n.i32_add(n.getLocal("ec"),n.i32_const(1))),n.br(0))),n.if(n.i64_eqz(n.getLocal("sx")),[...n.br_if(2,n.i32_eqz(n.call(o+"_gte",d,a))),...n.setLocal("sx",n.i64_const(1)),...n.setLocal("ec",n.i32_const(0))]),n.call(o+"__mul1",a,n.getLocal("sx"),g),n.drop(n.call(o+"_sub",d,n.i32_sub(g,n.getLocal("ec")),d)),n.call(o+"__add1",n.i32_add(l,n.getLocal("ec")),n.getLocal("sx")),n.br(0))))}(),function(){const e=t.addFunction(o+"_inverseMod");e.addParam("px","i32"),e.addParam("pm","i32"),e.addParam("pr","i32"),e.addLocal("t","i32"),e.addLocal("newt","i32"),e.addLocal("r","i32"),e.addLocal("qq","i32"),e.addLocal("qr","i32"),e.addLocal("newr","i32"),e.addLocal("swp","i32"),e.addLocal("x","i32"),e.addLocal("signt","i32"),e.addLocal("signnewt","i32"),e.addLocal("signx","i32");const n=e.getCodeBuilder(),i=n.i32_const(t.alloc(r)),a=n.i32_const(t.alloc(r)),c=n.i32_const(t.alloc(r)),s=n.i32_const(t.alloc(r)),l=n.i32_const(t.alloc(r)),d=n.i32_const(t.alloc(r)),u=n.i32_const(t.alloc(2*r)),f=n.i32_const(t.alloc(r));e.addCode(n.setLocal("t",i),n.call(o+"_zero",i),n.setLocal("signt",n.i32_const(0))),e.addCode(n.setLocal("r",a),n.call(o+"_copy",n.getLocal("pm"),a)),e.addCode(n.setLocal("newt",c),n.call(o+"_one",c),n.setLocal("signnewt",n.i32_const(0))),e.addCode(n.setLocal("newr",s),n.call(o+"_copy",n.getLocal("px"),s)),e.addCode(n.setLocal("qq",l)),e.addCode(n.setLocal("qr",d)),e.addCode(n.setLocal("x",f)),e.addCode(n.block(n.loop(n.br_if(1,n.call(o+"_isZero",n.getLocal("newr"))),n.call(o+"_div",n.getLocal("r"),n.getLocal("newr"),n.getLocal("qq"),n.getLocal("qr")),n.call(o+"_mul",n.getLocal("qq"),n.getLocal("newt"),u),n.if(n.getLocal("signt"),n.if(n.getLocal("signnewt"),n.if(n.call(o+"_gte",u,n.getLocal("t")),[...n.drop(n.call(o+"_sub",u,n.getLocal("t"),n.getLocal("x"))),...n.setLocal("signx",n.i32_const(0))],[...n.drop(n.call(o+"_sub",n.getLocal("t"),u,n.getLocal("x"))),...n.setLocal("signx",n.i32_const(1))]),[...n.drop(n.call(o+"_add",u,n.getLocal("t"),n.getLocal("x"))),...n.setLocal("signx",n.i32_const(1))]),n.if(n.getLocal("signnewt"),[...n.drop(n.call(o+"_add",u,n.getLocal("t"),n.getLocal("x"))),...n.setLocal("signx",n.i32_const(0))],n.if(n.call(o+"_gte",n.getLocal("t"),u),[...n.drop(n.call(o+"_sub",n.getLocal("t"),u,n.getLocal("x"))),...n.setLocal("signx",n.i32_const(0))],[...n.drop(n.call(o+"_sub",u,n.getLocal("t"),n.getLocal("x"))),...n.setLocal("signx",n.i32_const(1))]))),n.setLocal("swp",n.getLocal("t")),n.setLocal("t",n.getLocal("newt")),n.setLocal("newt",n.getLocal("x")),n.setLocal("x",n.getLocal("swp")),n.setLocal("signt",n.getLocal("signnewt")),n.setLocal("signnewt",n.getLocal("signx")),n.setLocal("swp",n.getLocal("r")),n.setLocal("r",n.getLocal("newr")),n.setLocal("newr",n.getLocal("qr")),n.setLocal("qr",n.getLocal("swp")),n.br(0)))),e.addCode(n.if(n.getLocal("signt"),n.drop(n.call(o+"_sub",n.getLocal("pm"),n.getLocal("t"),n.getLocal("pr"))),n.call(o+"_copy",n.getLocal("t"),n.getLocal("pr"))))}(),t.exportFunction(o+"_copy"),t.exportFunction(o+"_zero"),t.exportFunction(o+"_one"),t.exportFunction(o+"_isZero"),t.exportFunction(o+"_eq"),t.exportFunction(o+"_gte"),t.exportFunction(o+"_add"),t.exportFunction(o+"_sub"),t.exportFunction(o+"_mul"),t.exportFunction(o+"_square"),t.exportFunction(o+"_squareOld"),t.exportFunction(o+"_div"),t.exportFunction(o+"_inverseMod"),o}(t,r,o),d=t.alloc(c,bh.bigInt2BytesLE(i,c)),u=t.alloc(bh.bigInt2BytesLE(Oh(1n<<BigInt(64*r))%i,c)),f=t.alloc(bh.bigInt2BytesLE((1n<<BigInt(64*r))%i,c)),g=t.alloc(bh.bigInt2BytesLE(0n,c)),h=i-1n,p=h>>1n,_=t.alloc(c,bh.bigInt2BytesLE(p,c)),m=p+1n,y=t.alloc(c,bh.bigInt2BytesLE(m,c));t.modules[s]={pq:d,pR2:u,n64:r,q:i,pOne:f,pZero:g,pePlusOne:y};let L=2n;if(Bh(i))for(;Eh(L,p,i)!==h;)L+=1n;let b=0,A=h;for(;!Fh(A)&&0n!==A;)b++,A>>=1n;const w=t.alloc(c,bh.bigInt2BytesLE(A,c)),I=Eh(L,A,i),C=t.alloc(bh.bigInt2BytesLE((I<<BigInt(64*r))%i,c)),x=A+1n>>1n,v=t.alloc(c,bh.bigInt2BytesLE(x,c));return t.exportFunction(l+"_copy",s+"_copy"),t.exportFunction(l+"_zero",s+"_zero"),t.exportFunction(l+"_isZero",s+"_isZero"),t.exportFunction(l+"_eq",s+"_eq"),function(){const e=t.addFunction(s+"_isOne");e.addParam("x","i32"),e.setReturnType("i32");const n=e.getCodeBuilder();e.addCode(n.ret(n.call(l+"_eq",n.getLocal("x"),n.i32_const(f))))}(),function(){const e=t.addFunction(s+"_add");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.if(n.call(l+"_add",n.getLocal("x"),n.getLocal("y"),n.getLocal("r")),n.drop(n.call(l+"_sub",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))),n.if(n.call(l+"_gte",n.getLocal("r"),n.i32_const(d)),n.drop(n.call(l+"_sub",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))))))}(),function(){const e=t.addFunction(s+"_sub");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.if(n.call(l+"_sub",n.getLocal("x"),n.getLocal("y"),n.getLocal("r")),n.drop(n.call(l+"_add",n.getLocal("r"),n.i32_const(d),n.getLocal("r")))))}(),function(){const e=t.addFunction(s+"_neg");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(s+"_sub",n.i32_const(g),n.getLocal("x"),n.getLocal("r")))}(),function(){const e=t.alloc(a*a*8),n=t.addFunction(s+"_mReduct");n.addParam("t","i32"),n.addParam("r","i32"),n.addLocal("np32","i64"),n.addLocal("c","i64"),n.addLocal("m","i64");const o=n.getCodeBuilder(),r=Number(0x100000000n-vh(i,0x100000000n));n.addCode(o.setLocal("np32",o.i64_const(r)));for(let t=0;t<a;t++){n.addCode(o.setLocal("c",o.i64_const(0))),n.addCode(o.setLocal("m",o.i64_and(o.i64_mul(o.i64_load32_u(o.getLocal("t"),4*t),o.getLocal("np32")),o.i64_const("0xFFFFFFFF"))));for(let e=0;e<a;e++)n.addCode(o.setLocal("c",o.i64_add(o.i64_add(o.i64_load32_u(o.getLocal("t"),4*(t+e)),o.i64_shr_u(o.getLocal("c"),o.i64_const(32))),o.i64_mul(o.i64_load32_u(o.i32_const(d),4*e),o.getLocal("m"))))),n.addCode(o.i64_store32(o.getLocal("t"),4*(t+e),o.getLocal("c")));n.addCode(o.i64_store32(o.i32_const(e),4*t,o.i64_shr_u(o.getLocal("c"),o.i64_const(32))))}n.addCode(o.call(s+"_add",o.i32_const(e),o.i32_add(o.getLocal("t"),o.i32_const(4*a)),o.getLocal("r")))}(),function(){const e=t.addFunction(s+"_mul");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32"),e.addLocal("c0","i64"),e.addLocal("c1","i64"),e.addLocal("np32","i64");for(let t=0;t<a;t++)e.addLocal("x"+t,"i64"),e.addLocal("y"+t,"i64"),e.addLocal("m"+t,"i64"),e.addLocal("q"+t,"i64");const n=e.getCodeBuilder(),o=Number(0x100000000n-vh(i,0x100000000n));e.addCode(n.setLocal("np32",n.i64_const(o)));const r=[],c=[],u=[];function f(t,e){let o,i;return r[t]?o=n.getLocal("x"+t):(o=n.teeLocal("x"+t,n.i64_load32_u(n.getLocal("x"),4*t)),r[t]=!0),c[e]?i=n.getLocal("y"+e):(i=n.teeLocal("y"+e,n.i64_load32_u(n.getLocal("y"),4*e)),c[e]=!0),n.i64_mul(o,i)}function g(t,e){let o,i;return u[t]?o=n.getLocal("q"+t):(o=n.teeLocal("q"+t,n.i64_load32_u(n.i32_const(0),d+4*t)),u[t]=!0),i=n.getLocal("m"+e),n.i64_mul(o,i)}let h="c0",p="c1";for(let t=0;t<2*a-1;t++){for(let o=Math.max(0,t-a+1);o<=t&&o<a;o++){const i=t-o;e.addCode(n.setLocal(h,n.i64_add(n.i64_and(n.getLocal(h),n.i64_const(4294967295)),f(o,i)))),e.addCode(n.setLocal(p,n.i64_add(n.getLocal(p),n.i64_shr_u(n.getLocal(h),n.i64_const(32)))))}for(let o=Math.max(1,t-a+1);o<=t&&o<a;o++){const i=t-o;e.addCode(n.setLocal(h,n.i64_add(n.i64_and(n.getLocal(h),n.i64_const(4294967295)),g(o,i)))),e.addCode(n.setLocal(p,n.i64_add(n.getLocal(p),n.i64_shr_u(n.getLocal(h),n.i64_const(32)))))}t<a&&(e.addCode(n.setLocal("m"+t,n.i64_and(n.i64_mul(n.i64_and(n.getLocal(h),n.i64_const(4294967295)),n.getLocal("np32")),n.i64_const("0xFFFFFFFF")))),e.addCode(n.setLocal(h,n.i64_add(n.i64_and(n.getLocal(h),n.i64_const(4294967295)),g(0,t)))),e.addCode(n.setLocal(p,n.i64_add(n.getLocal(p),n.i64_shr_u(n.getLocal(h),n.i64_const(32)))))),t>=a&&e.addCode(n.i64_store32(n.getLocal("r"),4*(t-a),n.getLocal(h))),[h,p]=[p,h],e.addCode(n.setLocal(p,n.i64_shr_u(n.getLocal(h),n.i64_const(32))))}e.addCode(n.i64_store32(n.getLocal("r"),4*a-4,n.getLocal(h))),e.addCode(n.if(n.i32_wrap_i64(n.getLocal(p)),n.drop(n.call(l+"_sub",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))),n.if(n.call(l+"_gte",n.getLocal("r"),n.i32_const(d)),n.drop(n.call(l+"_sub",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))))))}(),function(){const e=t.addFunction(s+"_square");e.addParam("x","i32"),e.addParam("r","i32"),e.addLocal("c0","i64"),e.addLocal("c1","i64"),e.addLocal("c0_old","i64"),e.addLocal("c1_old","i64"),e.addLocal("np32","i64");for(let t=0;t<a;t++)e.addLocal("x"+t,"i64"),e.addLocal("m"+t,"i64"),e.addLocal("q"+t,"i64");const n=e.getCodeBuilder(),o=Number(0x100000000n-vh(i,0x100000000n));e.addCode(n.setLocal("np32",n.i64_const(o)));const r=[],c=[];function u(t,e){let o,i;return r[t]?o=n.getLocal("x"+t):(o=n.teeLocal("x"+t,n.i64_load32_u(n.getLocal("x"),4*t)),r[t]=!0),r[e]?i=n.getLocal("x"+e):(i=n.teeLocal("x"+e,n.i64_load32_u(n.getLocal("x"),4*e)),r[e]=!0),n.i64_mul(o,i)}function f(t,e){let o,i;return c[t]?o=n.getLocal("q"+t):(o=n.teeLocal("q"+t,n.i64_load32_u(n.i32_const(0),d+4*t)),c[t]=!0),i=n.getLocal("m"+e),n.i64_mul(o,i)}let g="c0",h="c1",p="c0_old",_="c1_old";for(let t=0;t<2*a-1;t++){e.addCode(n.setLocal(g,n.i64_const(0)),n.setLocal(h,n.i64_const(0)));for(let o=Math.max(0,t-a+1);o<t+1>>1&&o<a;o++){const i=t-o;e.addCode(n.setLocal(g,n.i64_add(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),u(o,i)))),e.addCode(n.setLocal(h,n.i64_add(n.getLocal(h),n.i64_shr_u(n.getLocal(g),n.i64_const(32)))))}e.addCode(n.setLocal(g,n.i64_shl(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),n.i64_const(1)))),e.addCode(n.setLocal(h,n.i64_add(n.i64_shl(n.getLocal(h),n.i64_const(1)),n.i64_shr_u(n.getLocal(g),n.i64_const(32))))),t%2==0&&(e.addCode(n.setLocal(g,n.i64_add(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),u(t>>1,t>>1)))),e.addCode(n.setLocal(h,n.i64_add(n.getLocal(h),n.i64_shr_u(n.getLocal(g),n.i64_const(32)))))),t>0&&(e.addCode(n.setLocal(g,n.i64_add(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),n.i64_and(n.getLocal(p),n.i64_const(4294967295))))),e.addCode(n.setLocal(h,n.i64_add(n.i64_add(n.getLocal(h),n.i64_shr_u(n.getLocal(g),n.i64_const(32))),n.getLocal(_)))));for(let o=Math.max(1,t-a+1);o<=t&&o<a;o++){const i=t-o;e.addCode(n.setLocal(g,n.i64_add(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),f(o,i)))),e.addCode(n.setLocal(h,n.i64_add(n.getLocal(h),n.i64_shr_u(n.getLocal(g),n.i64_const(32)))))}t<a&&(e.addCode(n.setLocal("m"+t,n.i64_and(n.i64_mul(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),n.getLocal("np32")),n.i64_const("0xFFFFFFFF")))),e.addCode(n.setLocal(g,n.i64_add(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),f(0,t)))),e.addCode(n.setLocal(h,n.i64_add(n.getLocal(h),n.i64_shr_u(n.getLocal(g),n.i64_const(32)))))),t>=a&&e.addCode(n.i64_store32(n.getLocal("r"),4*(t-a),n.getLocal(g))),e.addCode(n.setLocal(p,n.getLocal(h)),n.setLocal(_,n.i64_shr_u(n.getLocal(p),n.i64_const(32))))}e.addCode(n.i64_store32(n.getLocal("r"),4*a-4,n.getLocal(p))),e.addCode(n.if(n.i32_wrap_i64(n.getLocal(_)),n.drop(n.call(l+"_sub",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))),n.if(n.call(l+"_gte",n.getLocal("r"),n.i32_const(d)),n.drop(n.call(l+"_sub",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))))))}(),function(){const e=t.addFunction(s+"_squareOld");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(s+"_mul",n.getLocal("x"),n.getLocal("x"),n.getLocal("r")))}(),function(){const e=t.addFunction(s+"_toMontgomery");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(s+"_mul",n.getLocal("x"),n.i32_const(u),n.getLocal("r")))}(),function(){const e=t.alloc(2*c),n=t.addFunction(s+"_fromMontgomery");n.addParam("x","i32"),n.addParam("r","i32");const o=n.getCodeBuilder();n.addCode(o.call(l+"_copy",o.getLocal("x"),o.i32_const(e))),n.addCode(o.call(l+"_zero",o.i32_const(e+c))),n.addCode(o.call(s+"_mReduct",o.i32_const(e),o.getLocal("r")))}(),function(){const e=t.addFunction(s+"_isNegative");e.addParam("x","i32"),e.setReturnType("i32");const n=e.getCodeBuilder(),o=n.i32_const(t.alloc(c));e.addCode(n.call(s+"_fromMontgomery",n.getLocal("x"),o),n.call(l+"_gte",o,n.i32_const(y)))}(),function(){const e=t.addFunction(s+"_sign");e.addParam("x","i32"),e.setReturnType("i32");const n=e.getCodeBuilder(),o=n.i32_const(t.alloc(c));e.addCode(n.if(n.call(l+"_isZero",n.getLocal("x")),n.ret(n.i32_const(0))),n.call(s+"_fromMontgomery",n.getLocal("x"),o),n.if(n.call(l+"_gte",o,n.i32_const(y)),n.ret(n.i32_const(-1))),n.ret(n.i32_const(1)))}(),function(){const e=t.addFunction(s+"_inverse");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(s+"_fromMontgomery",n.getLocal("x"),n.getLocal("r"))),e.addCode(n.call(l+"_inverseMod",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))),e.addCode(n.call(s+"_toMontgomery",n.getLocal("r"),n.getLocal("r")))}(),function(){const e=t.addFunction(s+"_one");e.addParam("pr","i32");const n=e.getCodeBuilder();e.addCode(n.call(l+"_copy",n.i32_const(f),n.getLocal("pr")))}(),function(){const e=t.addFunction(s+"_load");e.addParam("scalar","i32"),e.addParam("scalarLen","i32"),e.addParam("r","i32"),e.addLocal("p","i32"),e.addLocal("l","i32"),e.addLocal("i","i32"),e.addLocal("j","i32");const n=e.getCodeBuilder(),o=n.i32_const(t.alloc(c)),i=t.alloc(c),r=n.i32_const(i);e.addCode(n.call(l+"_zero",n.getLocal("r")),n.setLocal("i",n.i32_const(c)),n.setLocal("p",n.getLocal("scalar")),n.block(n.loop(n.br_if(1,n.i32_gt_u(n.getLocal("i"),n.getLocal("scalarLen"))),n.if(n.i32_eq(n.getLocal("i"),n.i32_const(c)),n.call(s+"_one",o),n.call(s+"_mul",o,n.i32_const(u),o)),n.call(s+"_mul",n.getLocal("p"),o,r),n.call(s+"_add",n.getLocal("r"),r,n.getLocal("r")),n.setLocal("p",n.i32_add(n.getLocal("p"),n.i32_const(c))),n.setLocal("i",n.i32_add(n.getLocal("i"),n.i32_const(c))),n.br(0))),n.setLocal("l",n.i32_rem_u(n.getLocal("scalarLen"),n.i32_const(c))),n.if(n.i32_eqz(n.getLocal("l")),n.ret([])),n.call(l+"_zero",r),n.setLocal("j",n.i32_const(0)),n.block(n.loop(n.br_if(1,n.i32_eq(n.getLocal("j"),n.getLocal("l"))),n.i32_store8(n.getLocal("j"),i,n.i32_load8_u(n.getLocal("p"))),n.setLocal("p",n.i32_add(n.getLocal("p"),n.i32_const(1))),n.setLocal("j",n.i32_add(n.getLocal("j"),n.i32_const(1))),n.br(0))),n.if(n.i32_eq(n.getLocal("i"),n.i32_const(c)),n.call(s+"_one",o),n.call(s+"_mul",o,n.i32_const(u),o)),n.call(s+"_mul",r,o,r),n.call(s+"_add",n.getLocal("r"),r,n.getLocal("r")))}(),function(){const e=t.addFunction(s+"_timesScalar");e.addParam("x","i32"),e.addParam("scalar","i32"),e.addParam("scalarLen","i32"),e.addParam("r","i32");const n=e.getCodeBuilder(),o=n.i32_const(t.alloc(c));e.addCode(n.call(s+"_load",n.getLocal("scalar"),n.getLocal("scalarLen"),o),n.call(s+"_toMontgomery",o,o),n.call(s+"_mul",n.getLocal("x"),o,n.getLocal("r")))}(),wh(t,s),Ih(t,s+"_batchToMontgomery",s+"_toMontgomery",c,c),Ih(t,s+"_batchFromMontgomery",s+"_fromMontgomery",c,c),Ih(t,s+"_batchNeg",s+"_neg",c,c),Ch(t,s+"_batchAdd",s+"_add",c,c),Ch(t,s+"_batchSub",s+"_sub",c,c),Ch(t,s+"_batchMul",s+"_mul",c,c),t.exportFunction(s+"_add"),t.exportFunction(s+"_sub"),t.exportFunction(s+"_neg"),t.exportFunction(s+"_isNegative"),t.exportFunction(s+"_isOne"),t.exportFunction(s+"_sign"),t.exportFunction(s+"_mReduct"),t.exportFunction(s+"_mul"),t.exportFunction(s+"_square"),t.exportFunction(s+"_squareOld"),t.exportFunction(s+"_fromMontgomery"),t.exportFunction(s+"_toMontgomery"),t.exportFunction(s+"_inverse"),t.exportFunction(s+"_one"),t.exportFunction(s+"_load"),t.exportFunction(s+"_timesScalar"),Ah(t,s+"_exp",c,s+"_mul",s+"_square",l+"_copy",s+"_one"),t.exportFunction(s+"_exp"),t.exportFunction(s+"_batchInverse"),Bh(i)&&(function(){const e=t.addFunction(s+"_sqrt");e.addParam("n","i32"),e.addParam("r","i32"),e.addLocal("m","i32"),e.addLocal("i","i32"),e.addLocal("j","i32");const n=e.getCodeBuilder(),o=n.i32_const(f),i=n.i32_const(t.alloc(c)),r=n.i32_const(t.alloc(c)),a=n.i32_const(t.alloc(c)),l=n.i32_const(t.alloc(c)),d=n.i32_const(t.alloc(c));e.addCode(n.if(n.call(s+"_isZero",n.getLocal("n")),n.ret(n.call(s+"_zero",n.getLocal("r")))),n.setLocal("m",n.i32_const(b)),n.call(s+"_copy",n.i32_const(C),i),n.call(s+"_exp",n.getLocal("n"),n.i32_const(w),n.i32_const(c),r),n.call(s+"_exp",n.getLocal("n"),n.i32_const(v),n.i32_const(c),a),n.block(n.loop(n.br_if(1,n.call(s+"_eq",r,o)),n.call(s+"_square",r,l),n.setLocal("i",n.i32_const(1)),n.block(n.loop(n.br_if(1,n.call(s+"_eq",l,o)),n.call(s+"_square",l,l),n.setLocal("i",n.i32_add(n.getLocal("i"),n.i32_const(1))),n.br(0))),n.call(s+"_copy",i,d),n.setLocal("j",n.i32_sub(n.i32_sub(n.getLocal("m"),n.getLocal("i")),n.i32_const(1))),n.block(n.loop(n.br_if(1,n.i32_eqz(n.getLocal("j"))),n.call(s+"_square",d,d),n.setLocal("j",n.i32_sub(n.getLocal("j"),n.i32_const(1))),n.br(0))),n.setLocal("m",n.getLocal("i")),n.call(s+"_square",d,i),n.call(s+"_mul",r,i,r),n.call(s+"_mul",a,d,a),n.br(0))),n.if(n.call(s+"_isNegative",a),n.call(s+"_neg",a,n.getLocal("r")),n.call(s+"_copy",a,n.getLocal("r"))))}(),function(){const e=t.addFunction(s+"_isSquare");e.addParam("n","i32"),e.setReturnType("i32");const n=e.getCodeBuilder(),o=n.i32_const(f),i=n.i32_const(t.alloc(c));e.addCode(n.if(n.call(s+"_isZero",n.getLocal("n")),n.ret(n.i32_const(1))),n.call(s+"_exp",n.getLocal("n"),n.i32_const(_),n.i32_const(c),i),n.call(s+"_eq",i,o))}(),t.exportFunction(s+"_sqrt"),t.exportFunction(s+"_isSquare")),t.exportFunction(s+"_batchToMontgomery"),t.exportFunction(s+"_batchFromMontgomery"),s};const Ph=Sh,{bitLength:jh}=ah;var Uh=function(t,e,n,o,i){const r=BigInt(e),a=Math.floor((jh(r-1n)-1)/64)+1,c=8*a,s=n||"f1";if(t.modules[s])return s;t.modules[s]={n64:a};const l=i||"int",d=Ph(t,r,o,l),u=t.modules[d].pR2,f=t.modules[d].pq,g=t.modules[d].pePlusOne;return function(){const e=t.alloc(c),n=t.addFunction(s+"_mul");n.addParam("x","i32"),n.addParam("y","i32"),n.addParam("r","i32");const o=n.getCodeBuilder();n.addCode(o.call(d+"_mul",o.getLocal("x"),o.getLocal("y"),o.i32_const(e))),n.addCode(o.call(d+"_mul",o.i32_const(e),o.i32_const(u),o.getLocal("r")))}(),function(){const e=t.addFunction(s+"_square");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(s+"_mul",n.getLocal("x"),n.getLocal("x"),n.getLocal("r")))}(),function(){const e=t.addFunction(s+"_inverse");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(l+"_inverseMod",n.getLocal("x"),n.i32_const(f),n.getLocal("r")))}(),function(){const e=t.addFunction(s+"_isNegative");e.addParam("x","i32"),e.setReturnType("i32");const n=e.getCodeBuilder();e.addCode(n.call(l+"_gte",n.getLocal("x"),n.i32_const(g)))}(),t.exportFunction(d+"_add",s+"_add"),t.exportFunction(d+"_sub",s+"_sub"),t.exportFunction(d+"_neg",s+"_neg"),t.exportFunction(s+"_mul"),t.exportFunction(s+"_square"),t.exportFunction(s+"_inverse"),t.exportFunction(s+"_isNegative"),t.exportFunction(d+"_copy",s+"_copy"),t.exportFunction(d+"_zero",s+"_zero"),t.exportFunction(d+"_one",s+"_one"),t.exportFunction(d+"_isZero",s+"_isZero"),t.exportFunction(d+"_eq",s+"_eq"),s};const kh=oh,Mh=ih,Th=nh;var zh=function(t,e,n,o){if(t.modules[n])return n;const i=8*t.modules[o].n64,r=t.modules[o].q;return t.modules[n]={n64:2*t.modules[o].n64},function(){const e=t.addFunction(n+"_isZero");e.addParam("x","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i));e.addCode(r.i32_and(r.call(o+"_isZero",a),r.call(o+"_isZero",c)))}(),function(){const e=t.addFunction(n+"_isOne");e.addParam("x","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i));e.addCode(r.ret(r.i32_and(r.call(o+"_isOne",a),r.call(o+"_isZero",c))))}(),function(){const e=t.addFunction(n+"_zero");e.addParam("x","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i));e.addCode(r.call(o+"_zero",a),r.call(o+"_zero",c))}(),function(){const e=t.addFunction(n+"_one");e.addParam("x","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i));e.addCode(r.call(o+"_one",a),r.call(o+"_zero",c))}(),function(){const e=t.addFunction(n+"_copy");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_copy",a,s),r.call(o+"_copy",c,l))}(),function(){const r=t.addFunction(n+"_mul");r.addParam("x","i32"),r.addParam("y","i32"),r.addParam("r","i32");const a=r.getCodeBuilder(),c=a.getLocal("x"),s=a.i32_add(a.getLocal("x"),a.i32_const(i)),l=a.getLocal("y"),d=a.i32_add(a.getLocal("y"),a.i32_const(i)),u=a.getLocal("r"),f=a.i32_add(a.getLocal("r"),a.i32_const(i)),g=a.i32_const(t.alloc(i)),h=a.i32_const(t.alloc(i)),p=a.i32_const(t.alloc(i)),_=a.i32_const(t.alloc(i));r.addCode(a.call(o+"_mul",c,l,g),a.call(o+"_mul",s,d,h),a.call(o+"_add",c,s,p),a.call(o+"_add",l,d,_),a.call(o+"_mul",p,_,p),a.call(e,h,u),a.call(o+"_add",g,u,u),a.call(o+"_add",g,h,f),a.call(o+"_sub",p,f,f))}(),function(){const e=t.addFunction(n+"_mul1");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("y"),l=r.getLocal("r"),d=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_mul",a,s,l),r.call(o+"_mul",c,s,d))}(),function(){const r=t.addFunction(n+"_square");r.addParam("x","i32"),r.addParam("r","i32");const a=r.getCodeBuilder(),c=a.getLocal("x"),s=a.i32_add(a.getLocal("x"),a.i32_const(i)),l=a.getLocal("r"),d=a.i32_add(a.getLocal("r"),a.i32_const(i)),u=a.i32_const(t.alloc(i)),f=a.i32_const(t.alloc(i)),g=a.i32_const(t.alloc(i)),h=a.i32_const(t.alloc(i));r.addCode(a.call(o+"_mul",c,s,u),a.call(o+"_add",c,s,f),a.call(e,s,g),a.call(o+"_add",c,g,g),a.call(e,u,h),a.call(o+"_add",h,u,h),a.call(o+"_mul",f,g,l),a.call(o+"_sub",l,h,l),a.call(o+"_add",u,u,d))}(),function(){const e=t.addFunction(n+"_add");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("y"),l=r.i32_add(r.getLocal("y"),r.i32_const(i)),d=r.getLocal("r"),u=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_add",a,s,d),r.call(o+"_add",c,l,u))}(),function(){const e=t.addFunction(n+"_sub");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("y"),l=r.i32_add(r.getLocal("y"),r.i32_const(i)),d=r.getLocal("r"),u=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_sub",a,s,d),r.call(o+"_sub",c,l,u))}(),function(){const e=t.addFunction(n+"_neg");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_neg",a,s),r.call(o+"_neg",c,l))}(),function(){const e=t.addFunction(n+"_conjugate");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_copy",a,s),r.call(o+"_neg",c,l))}(),function(){const e=t.addFunction(n+"_toMontgomery");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_toMontgomery",a,s),r.call(o+"_toMontgomery",c,l))}(),function(){const e=t.addFunction(n+"_fromMontgomery");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_fromMontgomery",a,s),r.call(o+"_fromMontgomery",c,l))}(),function(){const e=t.addFunction(n+"_eq");e.addParam("x","i32"),e.addParam("y","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("y"),l=r.i32_add(r.getLocal("y"),r.i32_const(i));e.addCode(r.i32_and(r.call(o+"_eq",a,s),r.call(o+"_eq",c,l)))}(),function(){const r=t.addFunction(n+"_inverse");r.addParam("x","i32"),r.addParam("r","i32");const a=r.getCodeBuilder(),c=a.getLocal("x"),s=a.i32_add(a.getLocal("x"),a.i32_const(i)),l=a.getLocal("r"),d=a.i32_add(a.getLocal("r"),a.i32_const(i)),u=a.i32_const(t.alloc(i)),f=a.i32_const(t.alloc(i)),g=a.i32_const(t.alloc(i)),h=a.i32_const(t.alloc(i));r.addCode(a.call(o+"_square",c,u),a.call(o+"_square",s,f),a.call(e,f,g),a.call(o+"_sub",u,g,g),a.call(o+"_inverse",g,h),a.call(o+"_mul",c,h,l),a.call(o+"_mul",s,h,d),a.call(o+"_neg",d,d))}(),function(){const e=t.addFunction(n+"_timesScalar");e.addParam("x","i32"),e.addParam("scalar","i32"),e.addParam("scalarLen","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_timesScalar",a,r.getLocal("scalar"),r.getLocal("scalarLen"),s),r.call(o+"_timesScalar",c,r.getLocal("scalar"),r.getLocal("scalarLen"),l))}(),function(){const e=t.addFunction(n+"_sign");e.addParam("x","i32"),e.addLocal("s","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i));e.addCode(r.setLocal("s",r.call(o+"_sign",c)),r.if(r.getLocal("s"),r.ret(r.getLocal("s"))),r.ret(r.call(o+"_sign",a)))}(),function(){const e=t.addFunction(n+"_isNegative");e.addParam("x","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i));e.addCode(r.if(r.call(o+"_isZero",c),r.ret(r.call(o+"_isNegative",a))),r.ret(r.call(o+"_isNegative",c)))}(),t.exportFunction(n+"_isZero"),t.exportFunction(n+"_isOne"),t.exportFunction(n+"_zero"),t.exportFunction(n+"_one"),t.exportFunction(n+"_copy"),t.exportFunction(n+"_mul"),t.exportFunction(n+"_mul1"),t.exportFunction(n+"_square"),t.exportFunction(n+"_add"),t.exportFunction(n+"_sub"),t.exportFunction(n+"_neg"),t.exportFunction(n+"_sign"),t.exportFunction(n+"_conjugate"),t.exportFunction(n+"_fromMontgomery"),t.exportFunction(n+"_toMontgomery"),t.exportFunction(n+"_eq"),t.exportFunction(n+"_inverse"),Mh(t,n),kh(t,n+"_exp",2*i,n+"_mul",n+"_square",n+"_copy",n+"_one"),function(){const e=t.addFunction(n+"_sqrt");e.addParam("a","i32"),e.addParam("pr","i32");const a=e.getCodeBuilder(),c=a.i32_const(t.alloc(Th.bigInt2BytesLE((BigInt(r||0)-3n)/4n,i))),s=a.i32_const(t.alloc(Th.bigInt2BytesLE((BigInt(r||0)-1n)/2n,i))),l=a.getLocal("a"),d=a.i32_const(t.alloc(2*i)),u=a.i32_const(t.alloc(2*i)),f=a.i32_const(t.alloc(2*i)),g=t.alloc(2*i),h=a.i32_const(g),p=a.i32_const(g),_=a.i32_const(g+i),m=a.i32_const(t.alloc(2*i)),y=a.i32_const(t.alloc(2*i));e.addCode(a.call(n+"_one",h),a.call(n+"_neg",h,h),a.call(n+"_exp",l,c,a.i32_const(i),d),a.call(n+"_square",d,u),a.call(n+"_mul",l,u,u),a.call(n+"_conjugate",u,f),a.call(n+"_mul",f,u,f),a.if(a.call(n+"_eq",f,h),a.unreachable()),a.call(n+"_mul",d,l,m),a.if(a.call(n+"_eq",u,h),[...a.call(o+"_zero",p),...a.call(o+"_one",_),...a.call(n+"_mul",h,m,a.getLocal("pr"))],[...a.call(n+"_one",y),...a.call(n+"_add",y,u,y),...a.call(n+"_exp",y,s,a.i32_const(i),y),...a.call(n+"_mul",y,m,a.getLocal("pr"))]))}(),function(){const e=t.addFunction(n+"_isSquare");e.addParam("a","i32"),e.setReturnType("i32");const o=e.getCodeBuilder(),a=o.i32_const(t.alloc(Th.bigInt2BytesLE((BigInt(r||0)-3n)/4n,i))),c=o.getLocal("a"),s=o.i32_const(t.alloc(2*i)),l=o.i32_const(t.alloc(2*i)),d=o.i32_const(t.alloc(2*i)),u=t.alloc(2*i),f=o.i32_const(u);e.addCode(o.call(n+"_one",f),o.call(n+"_neg",f,f),o.call(n+"_exp",c,a,o.i32_const(i),s),o.call(n+"_square",s,l),o.call(n+"_mul",c,l,l),o.call(n+"_conjugate",l,d),o.call(n+"_mul",d,l,d),o.if(o.call(n+"_eq",d,f),o.ret(o.i32_const(0))),o.ret(o.i32_const(1)))}(),t.exportFunction(n+"_exp"),t.exportFunction(n+"_timesScalar"),t.exportFunction(n+"_batchInverse"),t.exportFunction(n+"_sqrt"),t.exportFunction(n+"_isSquare"),t.exportFunction(n+"_isNegative"),n};const Qh=oh,Nh=ih;var Dh=function(t,e,n,o){if(t.modules[n])return n;const i=8*t.modules[o].n64;return t.modules[n]={n64:3*t.modules[o].n64},function(){const e=t.addFunction(n+"_isZero");e.addParam("x","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i));e.addCode(r.i32_and(r.i32_and(r.call(o+"_isZero",a),r.call(o+"_isZero",c)),r.call(o+"_isZero",s)))}(),function(){const e=t.addFunction(n+"_isOne");e.addParam("x","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i));e.addCode(r.ret(r.i32_and(r.i32_and(r.call(o+"_isOne",a),r.call(o+"_isZero",c)),r.call(o+"_isZero",s))))}(),function(){const e=t.addFunction(n+"_zero");e.addParam("x","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i));e.addCode(r.call(o+"_zero",a),r.call(o+"_zero",c),r.call(o+"_zero",s))}(),function(){const e=t.addFunction(n+"_one");e.addParam("x","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i));e.addCode(r.call(o+"_one",a),r.call(o+"_zero",c),r.call(o+"_zero",s))}(),function(){const e=t.addFunction(n+"_copy");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("r"),d=r.i32_add(r.getLocal("r"),r.i32_const(i)),u=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_copy",a,l),r.call(o+"_copy",c,d),r.call(o+"_copy",s,u))}(),function(){const r=t.addFunction(n+"_mul");r.addParam("x","i32"),r.addParam("y","i32"),r.addParam("r","i32");const a=r.getCodeBuilder(),c=a.getLocal("x"),s=a.i32_add(a.getLocal("x"),a.i32_const(i)),l=a.i32_add(a.getLocal("x"),a.i32_const(2*i)),d=a.getLocal("y"),u=a.i32_add(a.getLocal("y"),a.i32_const(i)),f=a.i32_add(a.getLocal("y"),a.i32_const(2*i)),g=a.getLocal("r"),h=a.i32_add(a.getLocal("r"),a.i32_const(i)),p=a.i32_add(a.getLocal("r"),a.i32_const(2*i)),_=a.i32_const(t.alloc(i)),m=a.i32_const(t.alloc(i)),y=a.i32_const(t.alloc(i)),L=a.i32_const(t.alloc(i)),b=a.i32_const(t.alloc(i)),A=a.i32_const(t.alloc(i)),w=a.i32_const(t.alloc(i)),I=a.i32_const(t.alloc(i)),C=a.i32_const(t.alloc(i)),x=a.i32_const(t.alloc(i)),v=a.i32_const(t.alloc(i)),E=a.i32_const(t.alloc(i)),B=a.i32_const(t.alloc(i));r.addCode(a.call(o+"_mul",c,d,_),a.call(o+"_mul",s,u,m),a.call(o+"_mul",l,f,y),a.call(o+"_add",c,s,L),a.call(o+"_add",d,u,b),a.call(o+"_add",c,l,A),a.call(o+"_add",d,f,w),a.call(o+"_add",s,l,I),a.call(o+"_add",u,f,C),a.call(o+"_add",_,m,x),a.call(o+"_add",_,y,v),a.call(o+"_add",m,y,E),a.call(o+"_mul",I,C,g),a.call(o+"_sub",g,E,g),a.call(e,g,g),a.call(o+"_add",_,g,g),a.call(o+"_mul",L,b,h),a.call(o+"_sub",h,x,h),a.call(e,y,B),a.call(o+"_add",h,B,h),a.call(o+"_mul",A,w,p),a.call(o+"_sub",p,v,p),a.call(o+"_add",p,m,p))}(),function(){const r=t.addFunction(n+"_square");r.addParam("x","i32"),r.addParam("r","i32");const a=r.getCodeBuilder(),c=a.getLocal("x"),s=a.i32_add(a.getLocal("x"),a.i32_const(i)),l=a.i32_add(a.getLocal("x"),a.i32_const(2*i)),d=a.getLocal("r"),u=a.i32_add(a.getLocal("r"),a.i32_const(i)),f=a.i32_add(a.getLocal("r"),a.i32_const(2*i)),g=a.i32_const(t.alloc(i)),h=a.i32_const(t.alloc(i)),p=a.i32_const(t.alloc(i)),_=a.i32_const(t.alloc(i)),m=a.i32_const(t.alloc(i)),y=a.i32_const(t.alloc(i)),L=a.i32_const(t.alloc(i));r.addCode(a.call(o+"_square",c,g),a.call(o+"_mul",c,s,h),a.call(o+"_add",h,h,p),a.call(o+"_sub",c,s,_),a.call(o+"_add",_,l,_),a.call(o+"_square",_,_),a.call(o+"_mul",s,l,m),a.call(o+"_add",m,m,y),a.call(o+"_square",l,L),a.call(e,y,d),a.call(o+"_add",g,d,d),a.call(e,L,u),a.call(o+"_add",p,u,u),a.call(o+"_add",g,L,f),a.call(o+"_sub",y,f,f),a.call(o+"_add",_,f,f),a.call(o+"_add",p,f,f))}(),function(){const e=t.addFunction(n+"_add");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("y"),d=r.i32_add(r.getLocal("y"),r.i32_const(i)),u=r.i32_add(r.getLocal("y"),r.i32_const(2*i)),f=r.getLocal("r"),g=r.i32_add(r.getLocal("r"),r.i32_const(i)),h=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_add",a,l,f),r.call(o+"_add",c,d,g),r.call(o+"_add",s,u,h))}(),function(){const e=t.addFunction(n+"_sub");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("y"),d=r.i32_add(r.getLocal("y"),r.i32_const(i)),u=r.i32_add(r.getLocal("y"),r.i32_const(2*i)),f=r.getLocal("r"),g=r.i32_add(r.getLocal("r"),r.i32_const(i)),h=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_sub",a,l,f),r.call(o+"_sub",c,d,g),r.call(o+"_sub",s,u,h))}(),function(){const e=t.addFunction(n+"_neg");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("r"),d=r.i32_add(r.getLocal("r"),r.i32_const(i)),u=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_neg",a,l),r.call(o+"_neg",c,d),r.call(o+"_neg",s,u))}(),function(){const e=t.addFunction(n+"_sign");e.addParam("x","i32"),e.addLocal("s","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i));e.addCode(r.setLocal("s",r.call(o+"_sign",s)),r.if(r.getLocal("s"),r.ret(r.getLocal("s"))),r.setLocal("s",r.call(o+"_sign",c)),r.if(r.getLocal("s"),r.ret(r.getLocal("s"))),r.ret(r.call(o+"_sign",a)))}(),function(){const e=t.addFunction(n+"_toMontgomery");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("r"),d=r.i32_add(r.getLocal("r"),r.i32_const(i)),u=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_toMontgomery",a,l),r.call(o+"_toMontgomery",c,d),r.call(o+"_toMontgomery",s,u))}(),function(){const e=t.addFunction(n+"_fromMontgomery");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("r"),d=r.i32_add(r.getLocal("r"),r.i32_const(i)),u=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_fromMontgomery",a,l),r.call(o+"_fromMontgomery",c,d),r.call(o+"_fromMontgomery",s,u))}(),function(){const e=t.addFunction(n+"_eq");e.addParam("x","i32"),e.addParam("y","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("y"),d=r.i32_add(r.getLocal("y"),r.i32_const(i)),u=r.i32_add(r.getLocal("y"),r.i32_const(2*i));e.addCode(r.i32_and(r.i32_and(r.call(o+"_eq",a,l),r.call(o+"_eq",c,d)),r.call(o+"_eq",s,u)))}(),function(){const r=t.addFunction(n+"_inverse");r.addParam("x","i32"),r.addParam("r","i32");const a=r.getCodeBuilder(),c=a.getLocal("x"),s=a.i32_add(a.getLocal("x"),a.i32_const(i)),l=a.i32_add(a.getLocal("x"),a.i32_const(2*i)),d=a.getLocal("r"),u=a.i32_add(a.getLocal("r"),a.i32_const(i)),f=a.i32_add(a.getLocal("r"),a.i32_const(2*i)),g=a.i32_const(t.alloc(i)),h=a.i32_const(t.alloc(i)),p=a.i32_const(t.alloc(i)),_=a.i32_const(t.alloc(i)),m=a.i32_const(t.alloc(i)),y=a.i32_const(t.alloc(i)),L=a.i32_const(t.alloc(i)),b=a.i32_const(t.alloc(i)),A=a.i32_const(t.alloc(i)),w=a.i32_const(t.alloc(i)),I=a.i32_const(t.alloc(i));r.addCode(a.call(o+"_square",c,g),a.call(o+"_square",s,h),a.call(o+"_square",l,p),a.call(o+"_mul",c,s,_),a.call(o+"_mul",c,l,m),a.call(o+"_mul",s,l,y),a.call(e,y,L),a.call(o+"_sub",g,L,L),a.call(e,p,b),a.call(o+"_sub",b,_,b),a.call(o+"_sub",h,m,A),a.call(o+"_mul",l,b,w),a.call(o+"_mul",s,A,I),a.call(o+"_add",w,I,w),a.call(e,w,w),a.call(o+"_mul",c,L,I),a.call(o+"_add",I,w,w),a.call(o+"_inverse",w,w),a.call(o+"_mul",w,L,d),a.call(o+"_mul",w,b,u),a.call(o+"_mul",w,A,f))}(),function(){const e=t.addFunction(n+"_timesScalar");e.addParam("x","i32"),e.addParam("scalar","i32"),e.addParam("scalarLen","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("r"),d=r.i32_add(r.getLocal("r"),r.i32_const(i)),u=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_timesScalar",a,r.getLocal("scalar"),r.getLocal("scalarLen"),l),r.call(o+"_timesScalar",c,r.getLocal("scalar"),r.getLocal("scalarLen"),d),r.call(o+"_timesScalar",s,r.getLocal("scalar"),r.getLocal("scalarLen"),u))}(),function(){const e=t.addFunction(n+"_isNegative");e.addParam("x","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i));e.addCode(r.if(r.call(o+"_isZero",s),r.if(r.call(o+"_isZero",c),r.ret(r.call(o+"_isNegative",a)),r.ret(r.call(o+"_isNegative",c)))),r.ret(r.call(o+"_isNegative",s)))}(),t.exportFunction(n+"_isZero"),t.exportFunction(n+"_isOne"),t.exportFunction(n+"_zero"),t.exportFunction(n+"_one"),t.exportFunction(n+"_copy"),t.exportFunction(n+"_mul"),t.exportFunction(n+"_square"),t.exportFunction(n+"_add"),t.exportFunction(n+"_sub"),t.exportFunction(n+"_neg"),t.exportFunction(n+"_sign"),t.exportFunction(n+"_fromMontgomery"),t.exportFunction(n+"_toMontgomery"),t.exportFunction(n+"_eq"),t.exportFunction(n+"_inverse"),Nh(t,n),Qh(t,n+"_exp",3*i,n+"_mul",n+"_square",n+"_copy",n+"_one"),t.exportFunction(n+"_exp"),t.exportFunction(n+"_timesScalar"),t.exportFunction(n+"_batchInverse"),t.exportFunction(n+"_isNegative"),n};const Rh=function(t,e,n,o,i,r,a,c){const s=t.addFunction(e);s.addParam("base","i32"),s.addParam("scalar","i32"),s.addParam("scalarLength","i32"),s.addParam("r","i32"),s.addLocal("old0","i32"),s.addLocal("nbits","i32"),s.addLocal("i","i32"),s.addLocal("last","i32"),s.addLocal("cur","i32"),s.addLocal("carry","i32"),s.addLocal("p","i32");const l=s.getCodeBuilder(),d=l.i32_const(t.alloc(n));function u(t){return l.i32_and(l.i32_shr_u(l.i32_load(l.i32_add(l.getLocal("scalar"),l.i32_and(l.i32_shr_u(t,l.i32_const(3)),l.i32_const(4294967292)))),l.i32_and(t,l.i32_const(31))),l.i32_const(1))}function f(t){return[...l.i32_store8(l.getLocal("p"),l.i32_const(t)),...l.setLocal("p",l.i32_add(l.getLocal("p"),l.i32_const(1)))]}s.addCode(l.if(l.i32_eqz(l.getLocal("scalarLength")),[...l.call(c,l.getLocal("r")),...l.ret([])]),l.setLocal("nbits",l.i32_shl(l.getLocal("scalarLength"),l.i32_const(3))),l.setLocal("old0",l.i32_load(l.i32_const(0))),l.setLocal("p",l.getLocal("old0")),l.i32_store(l.i32_const(0),l.i32_and(l.i32_add(l.i32_add(l.getLocal("old0"),l.i32_const(32)),l.getLocal("nbits")),l.i32_const(4294967288))),l.setLocal("i",l.i32_const(1)),l.setLocal("last",u(l.i32_const(0))),l.setLocal("carry",l.i32_const(0)),l.block(l.loop(l.br_if(1,l.i32_eq(l.getLocal("i"),l.getLocal("nbits"))),l.setLocal("cur",u(l.getLocal("i"))),l.if(l.getLocal("last"),l.if(l.getLocal("cur"),l.if(l.getLocal("carry"),[...l.setLocal("last",l.i32_const(0)),...l.setLocal("carry",l.i32_const(1)),...f(1)],[...l.setLocal("last",l.i32_const(0)),...l.setLocal("carry",l.i32_const(1)),...f(255)]),l.if(l.getLocal("carry"),[...l.setLocal("last",l.i32_const(0)),...l.setLocal("carry",l.i32_const(1)),...f(255)],[...l.setLocal("last",l.i32_const(0)),...l.setLocal("carry",l.i32_const(0)),...f(1)])),l.if(l.getLocal("cur"),l.if(l.getLocal("carry"),[...l.setLocal("last",l.i32_const(0)),...l.setLocal("carry",l.i32_const(1)),...f(0)],[...l.setLocal("last",l.i32_const(1)),...l.setLocal("carry",l.i32_const(0)),...f(0)]),l.if(l.getLocal("carry"),[...l.setLocal("last",l.i32_const(1)),...l.setLocal("carry",l.i32_const(0)),...f(0)],[...l.setLocal("last",l.i32_const(0)),...l.setLocal("carry",l.i32_const(0)),...f(0)]))),l.setLocal("i",l.i32_add(l.getLocal("i"),l.i32_const(1))),l.br(0))),l.if(l.getLocal("last"),l.if(l.getLocal("carry"),[...f(255),...f(0),...f(1)],[...f(1)]),l.if(l.getLocal("carry"),[...f(0),...f(1)])),l.setLocal("p",l.i32_sub(l.getLocal("p"),l.i32_const(1))),l.call(a,l.getLocal("base"),d),l.call(c,l.getLocal("r")),l.block(l.loop(l.call(i,l.getLocal("r"),l.getLocal("r")),l.setLocal("cur",l.i32_load8_u(l.getLocal("p"))),l.if(l.getLocal("cur"),l.if(l.i32_eq(l.getLocal("cur"),l.i32_const(1)),l.call(o,l.getLocal("r"),d,l.getLocal("r")),l.call(r,l.getLocal("r"),d,l.getLocal("r")))),l.br_if(1,l.i32_eq(l.getLocal("old0"),l.getLocal("p"))),l.setLocal("p",l.i32_sub(l.getLocal("p"),l.i32_const(1))),l.br(0))),l.i32_store(l.i32_const(0),l.getLocal("old0")))},qh=rh,Gh=function(t,e,n,o,i){const r=8*t.modules[e].n64;!function(){const e=t.addFunction(n+"_getChunk");e.addParam("pScalar","i32"),e.addParam("scalarSize","i32"),e.addParam("startBit","i32"),e.addParam("chunkSize","i32"),e.addLocal("bitsToEnd","i32"),e.addLocal("mask","i32"),e.setReturnType("i32");const o=e.getCodeBuilder();e.addCode(o.setLocal("bitsToEnd",o.i32_sub(o.i32_mul(o.getLocal("scalarSize"),o.i32_const(8)),o.getLocal("startBit"))),o.if(o.i32_gt_s(o.getLocal("chunkSize"),o.getLocal("bitsToEnd")),o.setLocal("mask",o.i32_sub(o.i32_shl(o.i32_const(1),o.getLocal("bitsToEnd")),o.i32_const(1))),o.setLocal("mask",o.i32_sub(o.i32_shl(o.i32_const(1),o.getLocal("chunkSize")),o.i32_const(1)))),o.i32_and(o.i32_shr_u(o.i32_load(o.i32_add(o.getLocal("pScalar"),o.i32_shr_u(o.getLocal("startBit"),o.i32_const(3))),0,0),o.i32_and(o.getLocal("startBit"),o.i32_const(7))),o.getLocal("mask")))}(),function(){const o=t.addFunction(n+"_reduceTable");o.addParam("pTable","i32"),o.addParam("p","i32"),o.addLocal("half","i32"),o.addLocal("it1","i32"),o.addLocal("it2","i32"),o.addLocal("pAcc","i32");const i=o.getCodeBuilder();o.addCode(i.if(i.i32_eq(i.getLocal("p"),i.i32_const(1)),i.ret([])),i.setLocal("half",i.i32_shl(i.i32_const(1),i.i32_sub(i.getLocal("p"),i.i32_const(1)))),i.setLocal("it1",i.getLocal("pTable")),i.setLocal("it2",i.i32_add(i.getLocal("pTable"),i.i32_mul(i.getLocal("half"),i.i32_const(r)))),i.setLocal("pAcc",i.i32_sub(i.getLocal("it2"),i.i32_const(r))),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("it1"),i.getLocal("pAcc"))),i.call(e+"_add",i.getLocal("it1"),i.getLocal("it2"),i.getLocal("it1")),i.call(e+"_add",i.getLocal("pAcc"),i.getLocal("it2"),i.getLocal("pAcc")),i.setLocal("it1",i.i32_add(i.getLocal("it1"),i.i32_const(r))),i.setLocal("it2",i.i32_add(i.getLocal("it2"),i.i32_const(r))),i.br(0))),i.call(n+"_reduceTable",i.getLocal("pTable"),i.i32_sub(i.getLocal("p"),i.i32_const(1))),i.setLocal("p",i.i32_sub(i.getLocal("p"),i.i32_const(1))),i.block(i.loop(i.br_if(1,i.i32_eqz(i.getLocal("p"))),i.call(e+"_double",i.getLocal("pAcc"),i.getLocal("pAcc")),i.setLocal("p",i.i32_sub(i.getLocal("p"),i.i32_const(1))),i.br(0))),i.call(e+"_add",i.getLocal("pTable"),i.getLocal("pAcc"),i.getLocal("pTable")))}(),function(){const a=t.addFunction(n+"_chunk");a.addParam("pBases","i32"),a.addParam("pScalars","i32"),a.addParam("scalarSize","i32"),a.addParam("n","i32"),a.addParam("startBit","i32"),a.addParam("chunkSize","i32"),a.addParam("pr","i32"),a.addLocal("nChunks","i32"),a.addLocal("itScalar","i32"),a.addLocal("endScalar","i32"),a.addLocal("itBase","i32"),a.addLocal("i","i32"),a.addLocal("j","i32"),a.addLocal("nTable","i32"),a.addLocal("pTable","i32"),a.addLocal("idx","i32"),a.addLocal("pIdxTable","i32");const c=a.getCodeBuilder();a.addCode(c.if(c.i32_eqz(c.getLocal("n")),[...c.call(e+"_zero",c.getLocal("pr")),...c.ret([])]),c.setLocal("nTable",c.i32_shl(c.i32_const(1),c.getLocal("chunkSize"))),c.setLocal("pTable",c.i32_load(c.i32_const(0))),c.i32_store(c.i32_const(0),c.i32_add(c.getLocal("pTable"),c.i32_mul(c.getLocal("nTable"),c.i32_const(r)))),c.setLocal("j",c.i32_const(0)),c.block(c.loop(c.br_if(1,c.i32_eq(c.getLocal("j"),c.getLocal("nTable"))),c.call(e+"_zero",c.i32_add(c.getLocal("pTable"),c.i32_mul(c.getLocal("j"),c.i32_const(r)))),c.setLocal("j",c.i32_add(c.getLocal("j"),c.i32_const(1))),c.br(0))),c.setLocal("itBase",c.getLocal("pBases")),c.setLocal("itScalar",c.getLocal("pScalars")),c.setLocal("endScalar",c.i32_add(c.getLocal("pScalars"),c.i32_mul(c.getLocal("n"),c.getLocal("scalarSize")))),c.block(c.loop(c.br_if(1,c.i32_eq(c.getLocal("itScalar"),c.getLocal("endScalar"))),c.setLocal("idx",c.call(n+"_getChunk",c.getLocal("itScalar"),c.getLocal("scalarSize"),c.getLocal("startBit"),c.getLocal("chunkSize"))),c.if(c.getLocal("idx"),[...c.setLocal("pIdxTable",c.i32_add(c.getLocal("pTable"),c.i32_mul(c.i32_sub(c.getLocal("idx"),c.i32_const(1)),c.i32_const(r)))),...c.call(o,c.getLocal("pIdxTable"),c.getLocal("itBase"),c.getLocal("pIdxTable"))]),c.setLocal("itScalar",c.i32_add(c.getLocal("itScalar"),c.getLocal("scalarSize"))),c.setLocal("itBase",c.i32_add(c.getLocal("itBase"),c.i32_const(i))),c.br(0))),c.call(n+"_reduceTable",c.getLocal("pTable"),c.getLocal("chunkSize")),c.call(e+"_copy",c.getLocal("pTable"),c.getLocal("pr")),c.i32_store(c.i32_const(0),c.getLocal("pTable")))}(),function(){const o=t.addFunction(n);o.addParam("pBases","i32"),o.addParam("pScalars","i32"),o.addParam("scalarSize","i32"),o.addParam("n","i32"),o.addParam("pr","i32"),o.addLocal("chunkSize","i32"),o.addLocal("nChunks","i32"),o.addLocal("itScalar","i32"),o.addLocal("endScalar","i32"),o.addLocal("itBase","i32"),o.addLocal("itBit","i32"),o.addLocal("i","i32"),o.addLocal("j","i32"),o.addLocal("nTable","i32"),o.addLocal("pTable","i32"),o.addLocal("idx","i32"),o.addLocal("pIdxTable","i32");const i=o.getCodeBuilder(),a=i.i32_const(t.alloc(r)),c=t.alloc([17,17,17,17,17,17,17,17,17,17,16,16,15,14,13,13,12,11,10,9,8,7,7,6,5,4,3,2,1,1,1,1]);o.addCode(i.call(e+"_zero",i.getLocal("pr")),i.if(i.i32_eqz(i.getLocal("n")),i.ret([])),i.setLocal("chunkSize",i.i32_load8_u(i.i32_clz(i.getLocal("n")),c)),i.setLocal("nChunks",i.i32_add(i.i32_div_u(i.i32_sub(i.i32_shl(i.getLocal("scalarSize"),i.i32_const(3)),i.i32_const(1)),i.getLocal("chunkSize")),i.i32_const(1))),i.setLocal("itBit",i.i32_mul(i.i32_sub(i.getLocal("nChunks"),i.i32_const(1)),i.getLocal("chunkSize"))),i.block(i.loop(i.br_if(1,i.i32_lt_s(i.getLocal("itBit"),i.i32_const(0))),i.if(i.i32_eqz(i.call(e+"_isZero",i.getLocal("pr"))),[...i.setLocal("j",i.i32_const(0)),...i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("j"),i.getLocal("chunkSize"))),i.call(e+"_double",i.getLocal("pr"),i.getLocal("pr")),i.setLocal("j",i.i32_add(i.getLocal("j"),i.i32_const(1))),i.br(0)))]),i.call(n+"_chunk",i.getLocal("pBases"),i.getLocal("pScalars"),i.getLocal("scalarSize"),i.getLocal("n"),i.getLocal("itBit"),i.getLocal("chunkSize"),a),i.call(e+"_add",i.getLocal("pr"),a,i.getLocal("pr")),i.setLocal("itBit",i.i32_sub(i.getLocal("itBit"),i.getLocal("chunkSize"))),i.br(0))))}(),t.exportFunction(n),t.exportFunction(n+"_chunk")};var Kh=function(t,e,n,o){const i=t.modules[n].n64,r=8*i;return t.modules[e]||(t.modules[e]={n64:3*i},function(){const o=t.addFunction(e+"_isZeroAffine");o.addParam("p1","i32"),o.setReturnType("i32");const i=o.getCodeBuilder();o.addCode(i.i32_and(i.call(n+"_isZero",i.getLocal("p1")),i.call(n+"_isZero",i.i32_add(i.getLocal("p1"),i.i32_const(r)))))}(),function(){const o=t.addFunction(e+"_isZero");o.addParam("p1","i32"),o.setReturnType("i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_isZero",i.i32_add(i.getLocal("p1"),i.i32_const(2*r))))}(),function(){const o=t.addFunction(e+"_zeroAffine");o.addParam("pr","i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_zero",i.getLocal("pr"))),o.addCode(i.call(n+"_zero",i.i32_add(i.getLocal("pr"),i.i32_const(r))))}(),function(){const o=t.addFunction(e+"_zero");o.addParam("pr","i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_zero",i.getLocal("pr"))),o.addCode(i.call(n+"_one",i.i32_add(i.getLocal("pr"),i.i32_const(r)))),o.addCode(i.call(n+"_zero",i.i32_add(i.getLocal("pr"),i.i32_const(2*r))))}(),function(){const n=t.addFunction(e+"_copyAffine");n.addParam("ps","i32"),n.addParam("pd","i32");const o=n.getCodeBuilder();for(let t=0;t<2*i;t++)n.addCode(o.i64_store(o.getLocal("pd"),8*t,o.i64_load(o.getLocal("ps"),8*t)))}(),function(){const n=t.addFunction(e+"_copy");n.addParam("ps","i32"),n.addParam("pd","i32");const o=n.getCodeBuilder();for(let t=0;t<3*i;t++)n.addCode(o.i64_store(o.getLocal("pd"),8*t,o.i64_load(o.getLocal("ps"),8*t)))}(),function(){const o=t.addFunction(e+"_toJacobian");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.getLocal("pr"),l=i.i32_add(i.getLocal("pr"),i.i32_const(r)),d=i.i32_add(i.getLocal("pr"),i.i32_const(2*r));o.addCode(i.if(i.call(e+"_isZeroAffine",i.getLocal("p1")),i.call(e+"_zero",i.getLocal("pr")),[...i.call(n+"_one",d),...i.call(n+"_copy",c,l),...i.call(n+"_copy",a,s)]))}(),function(){const o=t.addFunction(e+"_eqAffine");o.addParam("p1","i32"),o.addParam("p2","i32"),o.setReturnType("i32"),o.addLocal("z1","i32");const i=o.getCodeBuilder();o.addCode(i.ret(i.i32_and(i.call(n+"_eq",i.getLocal("p1"),i.getLocal("p2")),i.call(n+"_eq",i.i32_add(i.getLocal("p1"),i.i32_const(r)),i.i32_add(i.getLocal("p2"),i.i32_const(r))))))}(),function(){const o=t.addFunction(e+"_eqMixed");o.addParam("p1","i32"),o.addParam("p2","i32"),o.setReturnType("i32"),o.addLocal("z1","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r));o.addCode(i.setLocal("z1",i.i32_add(i.getLocal("p1"),i.i32_const(2*r))));const s=i.getLocal("z1"),l=i.getLocal("p2"),d=i.i32_add(i.getLocal("p2"),i.i32_const(r)),u=i.i32_const(t.alloc(r)),f=i.i32_const(t.alloc(r)),g=i.i32_const(t.alloc(r)),h=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),i.ret(i.call(e+"_isZeroAffine",i.getLocal("p2")))),i.if(i.call(e+"_isZeroAffine",i.getLocal("p2")),i.ret(i.i32_const(0))),i.if(i.call(n+"_isOne",s),i.ret(i.call(e+"_eqAffine",i.getLocal("p1"),i.getLocal("p2")))),i.call(n+"_square",s,u),i.call(n+"_mul",l,u,f),i.call(n+"_mul",s,u,g),i.call(n+"_mul",d,g,h),i.if(i.call(n+"_eq",a,f),i.if(i.call(n+"_eq",c,h),i.ret(i.i32_const(1)))),i.ret(i.i32_const(0)))}(),function(){const o=t.addFunction(e+"_eq");o.addParam("p1","i32"),o.addParam("p2","i32"),o.setReturnType("i32"),o.addLocal("z1","i32"),o.addLocal("z2","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r));o.addCode(i.setLocal("z1",i.i32_add(i.getLocal("p1"),i.i32_const(2*r))));const s=i.getLocal("z1"),l=i.getLocal("p2"),d=i.i32_add(i.getLocal("p2"),i.i32_const(r));o.addCode(i.setLocal("z2",i.i32_add(i.getLocal("p2"),i.i32_const(2*r))));const u=i.getLocal("z2"),f=i.i32_const(t.alloc(r)),g=i.i32_const(t.alloc(r)),h=i.i32_const(t.alloc(r)),p=i.i32_const(t.alloc(r)),_=i.i32_const(t.alloc(r)),m=i.i32_const(t.alloc(r)),y=i.i32_const(t.alloc(r)),L=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),i.ret(i.call(e+"_isZero",i.getLocal("p2")))),i.if(i.call(e+"_isZero",i.getLocal("p2")),i.ret(i.i32_const(0))),i.if(i.call(n+"_isOne",s),i.ret(i.call(e+"_eqMixed",i.getLocal("p2"),i.getLocal("p1")))),i.if(i.call(n+"_isOne",u),i.ret(i.call(e+"_eqMixed",i.getLocal("p1"),i.getLocal("p2")))),i.call(n+"_square",s,f),i.call(n+"_square",u,g),i.call(n+"_mul",a,g,h),i.call(n+"_mul",l,f,p),i.call(n+"_mul",s,f,_),i.call(n+"_mul",u,g,m),i.call(n+"_mul",c,m,y),i.call(n+"_mul",d,_,L),i.if(i.call(n+"_eq",h,p),i.if(i.call(n+"_eq",y,L),i.ret(i.i32_const(1)))),i.ret(i.i32_const(0)))}(),function(){const o=t.addFunction(e+"_doubleAffine");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.getLocal("pr"),l=i.i32_add(i.getLocal("pr"),i.i32_const(r)),d=i.i32_add(i.getLocal("pr"),i.i32_const(2*r)),u=i.i32_const(t.alloc(r)),f=i.i32_const(t.alloc(r)),g=i.i32_const(t.alloc(r)),h=i.i32_const(t.alloc(r)),p=i.i32_const(t.alloc(r)),_=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZeroAffine",i.getLocal("p1")),[...i.call(e+"_toJacobian",i.getLocal("p1"),i.getLocal("pr")),...i.ret([])]),i.call(n+"_square",a,u),i.call(n+"_square",c,f),i.call(n+"_square",f,g),i.call(n+"_add",a,f,h),i.call(n+"_square",h,h),i.call(n+"_sub",h,u,h),i.call(n+"_sub",h,g,h),i.call(n+"_add",h,h,h),i.call(n+"_add",u,u,p),i.call(n+"_add",p,u,p),i.call(n+"_add",c,c,d),i.call(n+"_square",p,s),i.call(n+"_sub",s,h,s),i.call(n+"_sub",s,h,s),i.call(n+"_add",g,g,_),i.call(n+"_add",_,_,_),i.call(n+"_add",_,_,_),i.call(n+"_sub",h,s,l),i.call(n+"_mul",l,p,l),i.call(n+"_sub",l,_,l))}(),function(){const o=t.addFunction(e+"_double");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.i32_add(i.getLocal("p1"),i.i32_const(2*r)),l=i.getLocal("pr"),d=i.i32_add(i.getLocal("pr"),i.i32_const(r)),u=i.i32_add(i.getLocal("pr"),i.i32_const(2*r)),f=i.i32_const(t.alloc(r)),g=i.i32_const(t.alloc(r)),h=i.i32_const(t.alloc(r)),p=i.i32_const(t.alloc(r)),_=i.i32_const(t.alloc(r)),m=i.i32_const(t.alloc(r)),y=i.i32_const(t.alloc(r)),L=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),[...i.call(e+"_copy",i.getLocal("p1"),i.getLocal("pr")),...i.ret([])]),i.if(i.call(n+"_isOne",s),[...i.ret(i.call(e+"_doubleAffine",i.getLocal("p1"),i.getLocal("pr"))),...i.ret([])]),i.call(n+"_square",a,f),i.call(n+"_square",c,g),i.call(n+"_square",g,h),i.call(n+"_add",a,g,p),i.call(n+"_square",p,p),i.call(n+"_sub",p,f,p),i.call(n+"_sub",p,h,p),i.call(n+"_add",p,p,p),i.call(n+"_add",f,f,_),i.call(n+"_add",_,f,_),i.call(n+"_square",_,m),i.call(n+"_mul",c,s,y),i.call(n+"_add",p,p,l),i.call(n+"_sub",m,l,l),i.call(n+"_add",h,h,L),i.call(n+"_add",L,L,L),i.call(n+"_add",L,L,L),i.call(n+"_sub",p,l,d),i.call(n+"_mul",d,_,d),i.call(n+"_sub",d,L,d),i.call(n+"_add",y,y,u))}(),function(){const o=t.addFunction(e+"_addAffine");o.addParam("p1","i32"),o.addParam("p2","i32"),o.addParam("pr","i32"),o.addLocal("z1","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r));o.addCode(i.setLocal("z1",i.i32_add(i.getLocal("p1"),i.i32_const(2*r))));const s=i.getLocal("p2"),l=i.i32_add(i.getLocal("p2"),i.i32_const(r)),d=i.getLocal("pr"),u=i.i32_add(i.getLocal("pr"),i.i32_const(r)),f=i.i32_add(i.getLocal("pr"),i.i32_const(2*r)),g=i.i32_const(t.alloc(r)),h=i.i32_const(t.alloc(r)),p=i.i32_const(t.alloc(r)),_=i.i32_const(t.alloc(r)),m=i.i32_const(t.alloc(r)),y=i.i32_const(t.alloc(r)),L=i.i32_const(t.alloc(r)),b=i.i32_const(t.alloc(r)),A=i.i32_const(t.alloc(r)),w=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZeroAffine",i.getLocal("p1")),[...i.call(e+"_copyAffine",i.getLocal("p2"),i.getLocal("pr")),...i.call(n+"_one",i.i32_add(i.getLocal("pr"),i.i32_const(2*r))),...i.ret([])]),i.if(i.call(e+"_isZeroAffine",i.getLocal("p2")),[...i.call(e+"_copyAffine",i.getLocal("p1"),i.getLocal("pr")),...i.call(n+"_one",i.i32_add(i.getLocal("pr"),i.i32_const(2*r))),...i.ret([])]),i.if(i.call(n+"_eq",a,s),i.if(i.call(n+"_eq",c,l),[...i.call(e+"_doubleAffine",i.getLocal("p2"),i.getLocal("pr")),...i.ret([])])),i.call(n+"_sub",s,a,g),i.call(n+"_sub",l,c,p),i.call(n+"_square",g,h),i.call(n+"_add",h,h,_),i.call(n+"_add",_,_,_),i.call(n+"_mul",g,_,m),i.call(n+"_add",p,p,y),i.call(n+"_mul",a,_,b),i.call(n+"_square",y,L),i.call(n+"_add",b,b,A),i.call(n+"_sub",L,m,d),i.call(n+"_sub",d,A,d),i.call(n+"_mul",c,m,w),i.call(n+"_add",w,w,w),i.call(n+"_sub",b,d,u),i.call(n+"_mul",u,y,u),i.call(n+"_sub",u,w,u),i.call(n+"_add",g,g,f))}(),function(){const o=t.addFunction(e+"_addMixed");o.addParam("p1","i32"),o.addParam("p2","i32"),o.addParam("pr","i32"),o.addLocal("z1","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r));o.addCode(i.setLocal("z1",i.i32_add(i.getLocal("p1"),i.i32_const(2*r))));const s=i.getLocal("z1"),l=i.getLocal("p2"),d=i.i32_add(i.getLocal("p2"),i.i32_const(r)),u=i.getLocal("pr"),f=i.i32_add(i.getLocal("pr"),i.i32_const(r)),g=i.i32_add(i.getLocal("pr"),i.i32_const(2*r)),h=i.i32_const(t.alloc(r)),p=i.i32_const(t.alloc(r)),_=i.i32_const(t.alloc(r)),m=i.i32_const(t.alloc(r)),y=i.i32_const(t.alloc(r)),L=i.i32_const(t.alloc(r)),b=i.i32_const(t.alloc(r)),A=i.i32_const(t.alloc(r)),w=i.i32_const(t.alloc(r)),I=i.i32_const(t.alloc(r)),C=i.i32_const(t.alloc(r)),x=i.i32_const(t.alloc(r)),v=i.i32_const(t.alloc(r)),E=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),[...i.call(e+"_copyAffine",i.getLocal("p2"),i.getLocal("pr")),...i.call(n+"_one",i.i32_add(i.getLocal("pr"),i.i32_const(2*r))),...i.ret([])]),i.if(i.call(e+"_isZeroAffine",i.getLocal("p2")),[...i.call(e+"_copy",i.getLocal("p1"),i.getLocal("pr")),...i.ret([])]),i.if(i.call(n+"_isOne",s),[...i.call(e+"_addAffine",a,l,u),...i.ret([])]),i.call(n+"_square",s,h),i.call(n+"_mul",l,h,p),i.call(n+"_mul",s,h,_),i.call(n+"_mul",d,_,m),i.if(i.call(n+"_eq",a,p),i.if(i.call(n+"_eq",c,m),[...i.call(e+"_doubleAffine",i.getLocal("p2"),i.getLocal("pr")),...i.ret([])])),i.call(n+"_sub",p,a,y),i.call(n+"_sub",m,c,b),i.call(n+"_square",y,L),i.call(n+"_add",L,L,A),i.call(n+"_add",A,A,A),i.call(n+"_mul",y,A,w),i.call(n+"_add",b,b,I),i.call(n+"_mul",a,A,x),i.call(n+"_square",I,C),i.call(n+"_add",x,x,v),i.call(n+"_sub",C,w,u),i.call(n+"_sub",u,v,u),i.call(n+"_mul",c,w,E),i.call(n+"_add",E,E,E),i.call(n+"_sub",x,u,f),i.call(n+"_mul",f,I,f),i.call(n+"_sub",f,E,f),i.call(n+"_add",s,y,g),i.call(n+"_square",g,g),i.call(n+"_sub",g,h,g),i.call(n+"_sub",g,L,g))}(),function(){const o=t.addFunction(e+"_add");o.addParam("p1","i32"),o.addParam("p2","i32"),o.addParam("pr","i32"),o.addLocal("z1","i32"),o.addLocal("z2","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r));o.addCode(i.setLocal("z1",i.i32_add(i.getLocal("p1"),i.i32_const(2*r))));const s=i.getLocal("z1"),l=i.getLocal("p2"),d=i.i32_add(i.getLocal("p2"),i.i32_const(r));o.addCode(i.setLocal("z2",i.i32_add(i.getLocal("p2"),i.i32_const(2*r))));const u=i.getLocal("z2"),f=i.getLocal("pr"),g=i.i32_add(i.getLocal("pr"),i.i32_const(r)),h=i.i32_add(i.getLocal("pr"),i.i32_const(2*r)),p=i.i32_const(t.alloc(r)),_=i.i32_const(t.alloc(r)),m=i.i32_const(t.alloc(r)),y=i.i32_const(t.alloc(r)),L=i.i32_const(t.alloc(r)),b=i.i32_const(t.alloc(r)),A=i.i32_const(t.alloc(r)),w=i.i32_const(t.alloc(r)),I=i.i32_const(t.alloc(r)),C=i.i32_const(t.alloc(r)),x=i.i32_const(t.alloc(r)),v=i.i32_const(t.alloc(r)),E=i.i32_const(t.alloc(r)),B=i.i32_const(t.alloc(r)),F=i.i32_const(t.alloc(r)),O=i.i32_const(t.alloc(r)),S=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),[...i.call(e+"_copy",i.getLocal("p2"),i.getLocal("pr")),...i.ret([])]),i.if(i.call(e+"_isZero",i.getLocal("p2")),[...i.call(e+"_copy",i.getLocal("p1"),i.getLocal("pr")),...i.ret([])]),i.if(i.call(n+"_isOne",s),[...i.call(e+"_addMixed",l,a,f),...i.ret([])]),i.if(i.call(n+"_isOne",u),[...i.call(e+"_addMixed",a,l,f),...i.ret([])]),i.call(n+"_square",s,p),i.call(n+"_square",u,_),i.call(n+"_mul",a,_,m),i.call(n+"_mul",l,p,y),i.call(n+"_mul",s,p,L),i.call(n+"_mul",u,_,b),i.call(n+"_mul",c,b,A),i.call(n+"_mul",d,L,w),i.if(i.call(n+"_eq",m,y),i.if(i.call(n+"_eq",A,w),[...i.call(e+"_double",i.getLocal("p1"),i.getLocal("pr")),...i.ret([])])),i.call(n+"_sub",y,m,I),i.call(n+"_sub",w,A,C),i.call(n+"_add",I,I,x),i.call(n+"_square",x,x),i.call(n+"_mul",I,x,v),i.call(n+"_add",C,C,E),i.call(n+"_mul",m,x,F),i.call(n+"_square",E,B),i.call(n+"_add",F,F,O),i.call(n+"_sub",B,v,f),i.call(n+"_sub",f,O,f),i.call(n+"_mul",A,v,S),i.call(n+"_add",S,S,S),i.call(n+"_sub",F,f,g),i.call(n+"_mul",g,E,g),i.call(n+"_sub",g,S,g),i.call(n+"_add",s,u,h),i.call(n+"_square",h,h),i.call(n+"_sub",h,p,h),i.call(n+"_sub",h,_,h),i.call(n+"_mul",h,I,h))}(),function(){const o=t.addFunction(e+"_negAffine");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.getLocal("pr"),l=i.i32_add(i.getLocal("pr"),i.i32_const(r));o.addCode(i.call(n+"_copy",a,s),i.call(n+"_neg",c,l))}(),function(){const o=t.addFunction(e+"_neg");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.i32_add(i.getLocal("p1"),i.i32_const(2*r)),l=i.getLocal("pr"),d=i.i32_add(i.getLocal("pr"),i.i32_const(r)),u=i.i32_add(i.getLocal("pr"),i.i32_const(2*r));o.addCode(i.call(n+"_copy",a,l),i.call(n+"_neg",c,d),i.call(n+"_copy",s,u))}(),function(){const n=t.addFunction(e+"_subAffine");n.addParam("p1","i32"),n.addParam("p2","i32"),n.addParam("pr","i32");const o=n.getCodeBuilder(),i=o.i32_const(t.alloc(3*r));n.addCode(o.call(e+"_negAffine",o.getLocal("p2"),i),o.call(e+"_addAffine",o.getLocal("p1"),i,o.getLocal("pr")))}(),function(){const n=t.addFunction(e+"_subMixed");n.addParam("p1","i32"),n.addParam("p2","i32"),n.addParam("pr","i32");const o=n.getCodeBuilder(),i=o.i32_const(t.alloc(3*r));n.addCode(o.call(e+"_negAffine",o.getLocal("p2"),i),o.call(e+"_addMixed",o.getLocal("p1"),i,o.getLocal("pr")))}(),function(){const n=t.addFunction(e+"_sub");n.addParam("p1","i32"),n.addParam("p2","i32"),n.addParam("pr","i32");const o=n.getCodeBuilder(),i=o.i32_const(t.alloc(3*r));n.addCode(o.call(e+"_neg",o.getLocal("p2"),i),o.call(e+"_add",o.getLocal("p1"),i,o.getLocal("pr")))}(),function(){const o=t.addFunction(e+"_fromMontgomeryAffine");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_fromMontgomery",i.getLocal("p1"),i.getLocal("pr")));for(let t=1;t<2;t++)o.addCode(i.call(n+"_fromMontgomery",i.i32_add(i.getLocal("p1"),i.i32_const(t*r)),i.i32_add(i.getLocal("pr"),i.i32_const(t*r))))}(),function(){const o=t.addFunction(e+"_fromMontgomery");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_fromMontgomery",i.getLocal("p1"),i.getLocal("pr")));for(let t=1;t<3;t++)o.addCode(i.call(n+"_fromMontgomery",i.i32_add(i.getLocal("p1"),i.i32_const(t*r)),i.i32_add(i.getLocal("pr"),i.i32_const(t*r))))}(),function(){const o=t.addFunction(e+"_toMontgomeryAffine");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_toMontgomery",i.getLocal("p1"),i.getLocal("pr")));for(let t=1;t<2;t++)o.addCode(i.call(n+"_toMontgomery",i.i32_add(i.getLocal("p1"),i.i32_const(t*r)),i.i32_add(i.getLocal("pr"),i.i32_const(t*r))))}(),function(){const o=t.addFunction(e+"_toMontgomery");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_toMontgomery",i.getLocal("p1"),i.getLocal("pr")));for(let t=1;t<3;t++)o.addCode(i.call(n+"_toMontgomery",i.i32_add(i.getLocal("p1"),i.i32_const(t*r)),i.i32_add(i.getLocal("pr"),i.i32_const(t*r))))}(),function(){const o=t.addFunction(e+"_toAffine");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.i32_add(i.getLocal("p1"),i.i32_const(2*r)),l=i.getLocal("pr"),d=i.i32_add(i.getLocal("pr"),i.i32_const(r)),u=i.i32_const(t.alloc(r)),f=i.i32_const(t.alloc(r)),g=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),[...i.call(n+"_zero",l),...i.call(n+"_zero",d)],[...i.call(n+"_inverse",s,u),...i.call(n+"_square",u,f),...i.call(n+"_mul",u,f,g),...i.call(n+"_mul",a,f,l),...i.call(n+"_mul",c,g,d)]))}(),function(){const i=t.addFunction(e+"_inCurveAffine");i.addParam("pIn","i32"),i.setReturnType("i32");const a=i.getCodeBuilder(),c=a.getLocal("pIn"),s=a.i32_add(a.getLocal("pIn"),a.i32_const(r)),l=a.i32_const(t.alloc(r)),d=a.i32_const(t.alloc(r));i.addCode(a.call(n+"_square",s,l),a.call(n+"_square",c,d),a.call(n+"_mul",c,d,d),a.call(n+"_add",d,a.i32_const(o),d),a.ret(a.call(n+"_eq",l,d)))}(),function(){const n=t.addFunction(e+"_inCurve");n.addParam("pIn","i32"),n.setReturnType("i32");const o=n.getCodeBuilder(),i=o.i32_const(t.alloc(2*r));n.addCode(o.call(e+"_toAffine",o.getLocal("pIn"),i),o.ret(o.call(e+"_inCurveAffine",i)))}(),function(){const o=t.addFunction(e+"_batchToAffine");o.addParam("pIn","i32"),o.addParam("n","i32"),o.addParam("pOut","i32"),o.addLocal("pAux","i32"),o.addLocal("itIn","i32"),o.addLocal("itAux","i32"),o.addLocal("itOut","i32"),o.addLocal("i","i32");const i=o.getCodeBuilder(),a=i.i32_const(t.alloc(r));o.addCode(i.setLocal("pAux",i.i32_load(i.i32_const(0))),i.i32_store(i.i32_const(0),i.i32_add(i.getLocal("pAux"),i.i32_mul(i.getLocal("n"),i.i32_const(r)))),i.call(n+"_batchInverse",i.i32_add(i.getLocal("pIn"),i.i32_const(2*r)),i.i32_const(3*r),i.getLocal("n"),i.getLocal("pAux"),i.i32_const(r)),i.setLocal("itIn",i.getLocal("pIn")),i.setLocal("itAux",i.getLocal("pAux")),i.setLocal("itOut",i.getLocal("pOut")),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.if(i.call(n+"_isZero",i.getLocal("itAux")),[...i.call(n+"_zero",i.getLocal("itOut")),...i.call(n+"_zero",i.i32_add(i.getLocal("itOut"),i.i32_const(r)))],[...i.call(n+"_mul",i.getLocal("itAux"),i.i32_add(i.getLocal("itIn"),i.i32_const(r)),a),...i.call(n+"_square",i.getLocal("itAux"),i.getLocal("itAux")),...i.call(n+"_mul",i.getLocal("itAux"),i.getLocal("itIn"),i.getLocal("itOut")),...i.call(n+"_mul",i.getLocal("itAux"),a,i.i32_add(i.getLocal("itOut"),i.i32_const(r)))]),i.setLocal("itIn",i.i32_add(i.getLocal("itIn"),i.i32_const(3*r))),i.setLocal("itOut",i.i32_add(i.getLocal("itOut"),i.i32_const(2*r))),i.setLocal("itAux",i.i32_add(i.getLocal("itAux"),i.i32_const(r))),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))),i.i32_store(i.i32_const(0),i.getLocal("pAux")))}(),function(){const o=t.addFunction(e+"_normalize");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.i32_add(i.getLocal("p1"),i.i32_const(2*r)),l=i.getLocal("pr"),d=i.i32_add(i.getLocal("pr"),i.i32_const(r)),u=i.i32_add(i.getLocal("pr"),i.i32_const(2*r)),f=i.i32_const(t.alloc(r)),g=i.i32_const(t.alloc(r)),h=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),i.call(e+"_zero",i.getLocal("pr")),[...i.call(n+"_inverse",s,f),...i.call(n+"_square",f,g),...i.call(n+"_mul",f,g,h),...i.call(n+"_mul",a,g,l),...i.call(n+"_mul",c,h,d),...i.call(n+"_one",u)]))}(),function(){const n=t.addFunction(e+"__reverseBytes");n.addParam("pIn","i32"),n.addParam("n","i32"),n.addParam("pOut","i32"),n.addLocal("itOut","i32"),n.addLocal("itIn","i32");const o=n.getCodeBuilder();n.addCode(o.setLocal("itOut",o.i32_sub(o.i32_add(o.getLocal("pOut"),o.getLocal("n")),o.i32_const(1))),o.setLocal("itIn",o.getLocal("pIn")),o.block(o.loop(o.br_if(1,o.i32_lt_s(o.getLocal("itOut"),o.getLocal("pOut"))),o.i32_store8(o.getLocal("itOut"),o.i32_load8_u(o.getLocal("itIn"))),o.setLocal("itOut",o.i32_sub(o.getLocal("itOut"),o.i32_const(1))),o.setLocal("itIn",o.i32_add(o.getLocal("itIn"),o.i32_const(1))),o.br(0))))}(),function(){const n=t.addFunction(e+"_LEMtoU");n.addParam("pIn","i32"),n.addParam("pOut","i32");const o=n.getCodeBuilder(),i=t.alloc(2*r),a=o.i32_const(i),c=o.i32_const(i),s=o.i32_const(i+r);n.addCode(o.if(o.call(e+"_isZeroAffine",o.getLocal("pIn")),[...o.call(e+"_zeroAffine",o.getLocal("pOut")),...o.ret([])]),o.call(e+"_fromMontgomeryAffine",o.getLocal("pIn"),a),o.call(e+"__reverseBytes",c,o.i32_const(r),o.getLocal("pOut")),o.call(e+"__reverseBytes",s,o.i32_const(r),o.i32_add(o.getLocal("pOut"),o.i32_const(r))))}(),function(){const o=t.addFunction(e+"_LEMtoC");o.addParam("pIn","i32"),o.addParam("pOut","i32");const i=o.getCodeBuilder(),a=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZeroAffine",i.getLocal("pIn")),[...i.call(n+"_zero",i.getLocal("pOut")),...i.i32_store8(i.getLocal("pOut"),i.i32_const(64)),...i.ret([])]),i.call(n+"_fromMontgomery",i.getLocal("pIn"),a),i.call(e+"__reverseBytes",a,i.i32_const(r),i.getLocal("pOut")),i.if(i.i32_eq(i.call(n+"_sign",i.i32_add(i.getLocal("pIn"),i.i32_const(r))),i.i32_const(-1)),i.i32_store8(i.getLocal("pOut"),i.i32_or(i.i32_load8_u(i.getLocal("pOut")),i.i32_const(128)))))}(),function(){const n=t.addFunction(e+"_UtoLEM");n.addParam("pIn","i32"),n.addParam("pOut","i32");const o=n.getCodeBuilder(),i=t.alloc(2*r),a=o.i32_const(i),c=o.i32_const(i),s=o.i32_const(i+r);n.addCode(o.if(o.i32_and(o.i32_load8_u(o.getLocal("pIn")),o.i32_const(64)),[...o.call(e+"_zeroAffine",o.getLocal("pOut")),...o.ret([])]),o.call(e+"__reverseBytes",o.getLocal("pIn"),o.i32_const(r),c),o.call(e+"__reverseBytes",o.i32_add(o.getLocal("pIn"),o.i32_const(r)),o.i32_const(r),s),o.call(e+"_toMontgomeryAffine",a,o.getLocal("pOut")))}(),function(){const i=t.addFunction(e+"_CtoLEM");i.addParam("pIn","i32"),i.addParam("pOut","i32"),i.addLocal("firstByte","i32"),i.addLocal("greatest","i32");const a=i.getCodeBuilder(),c=t.alloc(2*r),s=a.i32_const(c),l=a.i32_const(c+r);i.addCode(a.setLocal("firstByte",a.i32_load8_u(a.getLocal("pIn"))),a.if(a.i32_and(a.getLocal("firstByte"),a.i32_const(64)),[...a.call(e+"_zeroAffine",a.getLocal("pOut")),...a.ret([])]),a.setLocal("greatest",a.i32_and(a.getLocal("firstByte"),a.i32_const(128))),a.call(n+"_copy",a.getLocal("pIn"),l),a.i32_store8(l,a.i32_and(a.getLocal("firstByte"),a.i32_const(63))),a.call(e+"__reverseBytes",l,a.i32_const(r),s),a.call(n+"_toMontgomery",s,a.getLocal("pOut")),a.call(n+"_square",a.getLocal("pOut"),l),a.call(n+"_mul",a.getLocal("pOut"),l,l),a.call(n+"_add",l,a.i32_const(o),l),a.call(n+"_sqrt",l,l),a.call(n+"_neg",l,s),a.if(a.i32_eq(a.call(n+"_sign",l),a.i32_const(-1)),a.if(a.getLocal("greatest"),a.call(n+"_copy",l,a.i32_add(a.getLocal("pOut"),a.i32_const(r))),a.call(n+"_neg",l,a.i32_add(a.getLocal("pOut"),a.i32_const(r)))),a.if(a.getLocal("greatest"),a.call(n+"_neg",l,a.i32_add(a.getLocal("pOut"),a.i32_const(r))),a.call(n+"_copy",l,a.i32_add(a.getLocal("pOut"),a.i32_const(r))))))}(),qh(t,e+"_batchLEMtoU",e+"_LEMtoU",2*r,2*r),qh(t,e+"_batchLEMtoC",e+"_LEMtoC",2*r,r),qh(t,e+"_batchUtoLEM",e+"_UtoLEM",2*r,2*r),qh(t,e+"_batchCtoLEM",e+"_CtoLEM",r,2*r,!0),qh(t,e+"_batchToJacobian",e+"_toJacobian",2*r,3*r,!0),Gh(t,e,e+"_multiexp",e+"_add",3*r),Gh(t,e,e+"_multiexpAffine",e+"_addMixed",2*r),Rh(t,e+"_timesScalar",3*r,e+"_add",e+"_double",e+"_sub",e+"_copy",e+"_zero"),Rh(t,e+"_timesScalarAffine",2*r,e+"_addMixed",e+"_double",e+"_subMixed",e+"_copyAffine",e+"_zero"),t.exportFunction(e+"_isZero"),t.exportFunction(e+"_isZeroAffine"),t.exportFunction(e+"_eq"),t.exportFunction(e+"_eqMixed"),t.exportFunction(e+"_eqAffine"),t.exportFunction(e+"_copy"),t.exportFunction(e+"_copyAffine"),t.exportFunction(e+"_zero"),t.exportFunction(e+"_zeroAffine"),t.exportFunction(e+"_double"),t.exportFunction(e+"_doubleAffine"),t.exportFunction(e+"_add"),t.exportFunction(e+"_addMixed"),t.exportFunction(e+"_addAffine"),t.exportFunction(e+"_neg"),t.exportFunction(e+"_negAffine"),t.exportFunction(e+"_sub"),t.exportFunction(e+"_subMixed"),t.exportFunction(e+"_subAffine"),t.exportFunction(e+"_fromMontgomery"),t.exportFunction(e+"_fromMontgomeryAffine"),t.exportFunction(e+"_toMontgomery"),t.exportFunction(e+"_toMontgomeryAffine"),t.exportFunction(e+"_timesScalar"),t.exportFunction(e+"_timesScalarAffine"),t.exportFunction(e+"_normalize"),t.exportFunction(e+"_LEMtoU"),t.exportFunction(e+"_LEMtoC"),t.exportFunction(e+"_UtoLEM"),t.exportFunction(e+"_CtoLEM"),t.exportFunction(e+"_batchLEMtoU"),t.exportFunction(e+"_batchLEMtoC"),t.exportFunction(e+"_batchUtoLEM"),t.exportFunction(e+"_batchCtoLEM"),t.exportFunction(e+"_toAffine"),t.exportFunction(e+"_toJacobian"),t.exportFunction(e+"_batchToAffine"),t.exportFunction(e+"_batchToJacobian"),t.exportFunction(e+"_inCurve"),t.exportFunction(e+"_inCurveAffine")),e};const{isOdd:Vh,modInv:Hh,modPow:Yh}=ah,Jh=nh;var Wh=function(t,e,n,o,i){const r=8*t.modules[o].n64,a=8*t.modules[n].n64,c=t.modules[o].q;let s=c-1n,l=0;for(;!Vh(s);)l++,s>>=1n;let d=2n;for(;1n===Yh(d,c>>1n,c);)d+=1n;const u=new Array(l+1);u[l]=Yh(d,s,c);let f=l-1;for(;f>=0;)u[f]=Yh(u[f+1],2n,c),f--;const g=[],h=(1n<<BigInt(8*r))%c;for(let t=0;t<u.length;t++){const e=u[t]*h%c;g.push(...Jh.bigInt2BytesLE(e,r))}const p=t.alloc(g),_=new Array(l+1);_[0]=1n;for(let t=1;t<=l;t++)_[t]=2n*_[t-1];const m=[];for(let t=0;t<=l;t++){const e=Hh(_[t],c)*h%c;m.push(...Jh.bigInt2BytesLE(e,r))}const y=t.alloc(m),L=Yh(d,2n,c),b=[],A=[];for(let t=0;t<=l;t++){const e=Yh(L,2n**BigInt(t),c),n=Hh(c+1n-e,c);b.push(...Jh.bigInt2BytesLE(e*h%c,r)),A.push(...Jh.bigInt2BytesLE(n*h%c,r))}const w=t.alloc(b),I=t.alloc(A);function C(t){let e=0;for(let n=0;n<8;n++)t&1<<n&&(e|=128>>n);return e}const x=Array(256);for(let t=0;t<256;t++)x[t]=C(t);const v=t.alloc(x);!function(){const n=t.addFunction(e+"__rev");n.addParam("x","i32"),n.addParam("bits","i32"),n.setReturnType("i32");const o=n.getCodeBuilder();n.addCode(o.i32_rotl(o.i32_add(o.i32_add(o.i32_shl(o.i32_load8_u(o.i32_and(o.getLocal("x"),o.i32_const(255)),v,0),o.i32_const(24)),o.i32_shl(o.i32_load8_u(o.i32_and(o.i32_shr_u(o.getLocal("x"),o.i32_const(8)),o.i32_const(255)),v,0),o.i32_const(16))),o.i32_add(o.i32_shl(o.i32_load8_u(o.i32_and(o.i32_shr_u(o.getLocal("x"),o.i32_const(16)),o.i32_const(255)),v,0),o.i32_const(8)),o.i32_load8_u(o.i32_and(o.i32_shr_u(o.getLocal("x"),o.i32_const(24)),o.i32_const(255)),v,0))),o.getLocal("bits")))}(),function(){const o=t.addFunction(e+"__reversePermutation");o.addParam("px","i32"),o.addParam("bits","i32"),o.addLocal("n","i32"),o.addLocal("i","i32"),o.addLocal("ri","i32"),o.addLocal("idx1","i32"),o.addLocal("idx2","i32");const i=o.getCodeBuilder(),r=i.i32_const(t.alloc(a));o.addCode(i.setLocal("n",i.i32_shl(i.i32_const(1),i.getLocal("bits"))),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("px"),i.i32_mul(i.getLocal("i"),i.i32_const(a)))),i.setLocal("ri",i.call(e+"__rev",i.getLocal("i"),i.getLocal("bits"))),i.setLocal("idx2",i.i32_add(i.getLocal("px"),i.i32_mul(i.getLocal("ri"),i.i32_const(a)))),i.if(i.i32_lt_u(i.getLocal("i"),i.getLocal("ri")),[...i.call(n+"_copy",i.getLocal("idx1"),r),...i.call(n+"_copy",i.getLocal("idx2"),i.getLocal("idx1")),...i.call(n+"_copy",r,i.getLocal("idx2"))]),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const r=t.addFunction(e+"__fftFinal");r.addParam("px","i32"),r.addParam("bits","i32"),r.addParam("reverse","i32"),r.addParam("mulFactor","i32"),r.addLocal("n","i32"),r.addLocal("ndiv2","i32"),r.addLocal("pInv2","i32"),r.addLocal("i","i32"),r.addLocal("mask","i32"),r.addLocal("idx1","i32"),r.addLocal("idx2","i32");const c=r.getCodeBuilder(),s=c.i32_const(t.alloc(a));r.addCode(c.if(c.i32_and(c.i32_eqz(c.getLocal("reverse")),c.call(o+"_isOne",c.getLocal("mulFactor"))),c.ret([])),c.setLocal("n",c.i32_shl(c.i32_const(1),c.getLocal("bits"))),c.setLocal("mask",c.i32_sub(c.getLocal("n"),c.i32_const(1))),c.setLocal("i",c.i32_const(1)),c.setLocal("ndiv2",c.i32_shr_u(c.getLocal("n"),c.i32_const(1))),c.block(c.loop(c.br_if(1,c.i32_ge_u(c.getLocal("i"),c.getLocal("ndiv2"))),c.setLocal("idx1",c.i32_add(c.getLocal("px"),c.i32_mul(c.getLocal("i"),c.i32_const(a)))),c.setLocal("idx2",c.i32_add(c.getLocal("px"),c.i32_mul(c.i32_sub(c.getLocal("n"),c.getLocal("i")),c.i32_const(a)))),c.if(c.getLocal("reverse"),c.if(c.call(o+"_isOne",c.getLocal("mulFactor")),[...c.call(n+"_copy",c.getLocal("idx1"),s),...c.call(n+"_copy",c.getLocal("idx2"),c.getLocal("idx1")),...c.call(n+"_copy",s,c.getLocal("idx2"))],[...c.call(n+"_copy",c.getLocal("idx1"),s),...c.call(i,c.getLocal("idx2"),c.getLocal("mulFactor"),c.getLocal("idx1")),...c.call(i,s,c.getLocal("mulFactor"),c.getLocal("idx2"))]),c.if(c.call(o+"_isOne",c.getLocal("mulFactor")),[],[...c.call(i,c.getLocal("idx1"),c.getLocal("mulFactor"),c.getLocal("idx1")),...c.call(i,c.getLocal("idx2"),c.getLocal("mulFactor"),c.getLocal("idx2"))])),c.setLocal("i",c.i32_add(c.getLocal("i"),c.i32_const(1))),c.br(0))),c.if(c.call(o+"_isOne",c.getLocal("mulFactor")),[],[...c.call(i,c.getLocal("px"),c.getLocal("mulFactor"),c.getLocal("px")),...c.setLocal("idx2",c.i32_add(c.getLocal("px"),c.i32_mul(c.getLocal("ndiv2"),c.i32_const(a)))),...c.call(i,c.getLocal("idx2"),c.getLocal("mulFactor"),c.getLocal("idx2"))]))}(),function(){const c=t.addFunction(e+"_rawfft");c.addParam("px","i32"),c.addParam("bits","i32"),c.addParam("reverse","i32"),c.addParam("mulFactor","i32"),c.addLocal("s","i32"),c.addLocal("k","i32"),c.addLocal("j","i32"),c.addLocal("m","i32"),c.addLocal("mdiv2","i32"),c.addLocal("n","i32"),c.addLocal("pwm","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(r)),d=s.i32_const(t.alloc(a)),u=s.i32_const(t.alloc(a));c.addCode(s.call(e+"__reversePermutation",s.getLocal("px"),s.getLocal("bits")),s.setLocal("n",s.i32_shl(s.i32_const(1),s.getLocal("bits"))),s.setLocal("s",s.i32_const(1)),s.block(s.loop(s.br_if(1,s.i32_gt_u(s.getLocal("s"),s.getLocal("bits"))),s.setLocal("m",s.i32_shl(s.i32_const(1),s.getLocal("s"))),s.setLocal("pwm",s.i32_add(s.i32_const(p),s.i32_mul(s.getLocal("s"),s.i32_const(r)))),s.setLocal("k",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_ge_u(s.getLocal("k"),s.getLocal("n"))),s.call(o+"_one",l),s.setLocal("mdiv2",s.i32_shr_u(s.getLocal("m"),s.i32_const(1))),s.setLocal("j",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_ge_u(s.getLocal("j"),s.getLocal("mdiv2"))),s.setLocal("idx1",s.i32_add(s.getLocal("px"),s.i32_mul(s.i32_add(s.getLocal("k"),s.getLocal("j")),s.i32_const(a)))),s.setLocal("idx2",s.i32_add(s.getLocal("idx1"),s.i32_mul(s.getLocal("mdiv2"),s.i32_const(a)))),s.call(i,s.getLocal("idx2"),l,d),s.call(n+"_copy",s.getLocal("idx1"),u),s.call(n+"_add",u,d,s.getLocal("idx1")),s.call(n+"_sub",u,d,s.getLocal("idx2")),s.call(o+"_mul",l,s.getLocal("pwm"),l),s.setLocal("j",s.i32_add(s.getLocal("j"),s.i32_const(1))),s.br(0))),s.setLocal("k",s.i32_add(s.getLocal("k"),s.getLocal("m"))),s.br(0))),s.setLocal("s",s.i32_add(s.getLocal("s"),s.i32_const(1))),s.br(0))),s.call(e+"__fftFinal",s.getLocal("px"),s.getLocal("bits"),s.getLocal("reverse"),s.getLocal("mulFactor")))}(),function(){const n=t.addFunction(e+"__log2");n.addParam("n","i32"),n.setReturnType("i32"),n.addLocal("bits","i32"),n.addLocal("aux","i32");const o=n.getCodeBuilder();n.addCode(o.setLocal("aux",o.i32_shr_u(o.getLocal("n"),o.i32_const(1)))),n.addCode(o.setLocal("bits",o.i32_const(0))),n.addCode(o.block(o.loop(o.br_if(1,o.i32_eqz(o.getLocal("aux"))),o.setLocal("aux",o.i32_shr_u(o.getLocal("aux"),o.i32_const(1))),o.setLocal("bits",o.i32_add(o.getLocal("bits"),o.i32_const(1))),o.br(0)))),n.addCode(o.if(o.i32_ne(o.getLocal("n"),o.i32_shl(o.i32_const(1),o.getLocal("bits"))),o.unreachable())),n.addCode(o.if(o.i32_gt_u(o.getLocal("bits"),o.i32_const(l)),o.unreachable())),n.addCode(o.getLocal("bits"))}(),function(){const n=t.addFunction(e+"_fft");n.addParam("px","i32"),n.addParam("n","i32"),n.addLocal("bits","i32");const i=n.getCodeBuilder(),a=i.i32_const(t.alloc(r));n.addCode(i.setLocal("bits",i.call(e+"__log2",i.getLocal("n"))),i.call(o+"_one",a),i.call(e+"_rawfft",i.getLocal("px"),i.getLocal("bits"),i.i32_const(0),a))}(),function(){const n=t.addFunction(e+"_ifft");n.addParam("px","i32"),n.addParam("n","i32"),n.addLocal("bits","i32"),n.addLocal("pInv2","i32");const o=n.getCodeBuilder();n.addCode(o.setLocal("bits",o.call(e+"__log2",o.getLocal("n"))),o.setLocal("pInv2",o.i32_add(o.i32_const(y),o.i32_mul(o.getLocal("bits"),o.i32_const(r)))),o.call(e+"_rawfft",o.getLocal("px"),o.getLocal("bits"),o.i32_const(1),o.getLocal("pInv2")))}(),function(){const c=t.addFunction(e+"_fftJoin");c.addParam("pBuff1","i32"),c.addParam("pBuff2","i32"),c.addParam("n","i32"),c.addParam("first","i32"),c.addParam("inc","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(r)),d=s.i32_const(t.alloc(a)),u=s.i32_const(t.alloc(a));c.addCode(s.call(o+"_copy",s.getLocal("first"),l),s.setLocal("i",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_eq(s.getLocal("i"),s.getLocal("n"))),s.setLocal("idx1",s.i32_add(s.getLocal("pBuff1"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.setLocal("idx2",s.i32_add(s.getLocal("pBuff2"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.call(i,s.getLocal("idx2"),l,d),s.call(n+"_copy",s.getLocal("idx1"),u),s.call(n+"_add",u,d,s.getLocal("idx1")),s.call(n+"_sub",u,d,s.getLocal("idx2")),s.call(o+"_mul",l,s.getLocal("inc"),l),s.setLocal("i",s.i32_add(s.getLocal("i"),s.i32_const(1))),s.br(0))))}(),function(){const c=t.addFunction(e+"_fftJoinExt");c.addParam("pBuff1","i32"),c.addParam("pBuff2","i32"),c.addParam("n","i32"),c.addParam("first","i32"),c.addParam("inc","i32"),c.addParam("totalBits","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32"),c.addLocal("pShiftToM","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(r)),d=s.i32_const(t.alloc(a));c.addCode(s.setLocal("pShiftToM",s.i32_add(s.i32_const(w),s.i32_mul(s.getLocal("totalBits"),s.i32_const(r)))),s.call(o+"_copy",s.getLocal("first"),l),s.setLocal("i",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_eq(s.getLocal("i"),s.getLocal("n"))),s.setLocal("idx1",s.i32_add(s.getLocal("pBuff1"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.setLocal("idx2",s.i32_add(s.getLocal("pBuff2"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.call(n+"_add",s.getLocal("idx1"),s.getLocal("idx2"),d),s.call(i,s.getLocal("idx2"),s.getLocal("pShiftToM"),s.getLocal("idx2")),s.call(n+"_add",s.getLocal("idx1"),s.getLocal("idx2"),s.getLocal("idx2")),s.call(i,s.getLocal("idx2"),l,s.getLocal("idx2")),s.call(n+"_copy",d,s.getLocal("idx1")),s.call(o+"_mul",l,s.getLocal("inc"),l),s.setLocal("i",s.i32_add(s.getLocal("i"),s.i32_const(1))),s.br(0))))}(),function(){const c=t.addFunction(e+"_fftJoinExtInv");c.addParam("pBuff1","i32"),c.addParam("pBuff2","i32"),c.addParam("n","i32"),c.addParam("first","i32"),c.addParam("inc","i32"),c.addParam("totalBits","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32"),c.addLocal("pShiftToM","i32"),c.addLocal("pSConst","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(r)),d=s.i32_const(t.alloc(a));c.addCode(s.setLocal("pShiftToM",s.i32_add(s.i32_const(w),s.i32_mul(s.getLocal("totalBits"),s.i32_const(r)))),s.setLocal("pSConst",s.i32_add(s.i32_const(I),s.i32_mul(s.getLocal("totalBits"),s.i32_const(r)))),s.call(o+"_copy",s.getLocal("first"),l),s.setLocal("i",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_eq(s.getLocal("i"),s.getLocal("n"))),s.setLocal("idx1",s.i32_add(s.getLocal("pBuff1"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.setLocal("idx2",s.i32_add(s.getLocal("pBuff2"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.call(i,s.getLocal("idx2"),l,d),s.call(n+"_sub",s.getLocal("idx1"),d,s.getLocal("idx2")),s.call(i,s.getLocal("idx2"),s.getLocal("pSConst"),s.getLocal("idx2")),s.call(i,s.getLocal("idx1"),s.getLocal("pShiftToM"),s.getLocal("idx1")),s.call(n+"_sub",d,s.getLocal("idx1"),s.getLocal("idx1")),s.call(i,s.getLocal("idx1"),s.getLocal("pSConst"),s.getLocal("idx1")),s.call(o+"_mul",l,s.getLocal("inc"),l),s.setLocal("i",s.i32_add(s.getLocal("i"),s.i32_const(1))),s.br(0))))}(),function(){const c=t.addFunction(e+"_fftMix");c.addParam("pBuff","i32"),c.addParam("n","i32"),c.addParam("exp","i32"),c.addLocal("nGroups","i32"),c.addLocal("nPerGroup","i32"),c.addLocal("nPerGroupDiv2","i32"),c.addLocal("pairOffset","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32"),c.addLocal("j","i32"),c.addLocal("pwm","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(r)),d=s.i32_const(t.alloc(a)),u=s.i32_const(t.alloc(a));c.addCode(s.setLocal("nPerGroup",s.i32_shl(s.i32_const(1),s.getLocal("exp"))),s.setLocal("nPerGroupDiv2",s.i32_shr_u(s.getLocal("nPerGroup"),s.i32_const(1))),s.setLocal("nGroups",s.i32_shr_u(s.getLocal("n"),s.getLocal("exp"))),s.setLocal("pairOffset",s.i32_mul(s.getLocal("nPerGroupDiv2"),s.i32_const(a))),s.setLocal("pwm",s.i32_add(s.i32_const(p),s.i32_mul(s.getLocal("exp"),s.i32_const(r)))),s.setLocal("i",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_eq(s.getLocal("i"),s.getLocal("nGroups"))),s.call(o+"_one",l),s.setLocal("j",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_eq(s.getLocal("j"),s.getLocal("nPerGroupDiv2"))),s.setLocal("idx1",s.i32_add(s.getLocal("pBuff"),s.i32_mul(s.i32_add(s.i32_mul(s.getLocal("i"),s.getLocal("nPerGroup")),s.getLocal("j")),s.i32_const(a)))),s.setLocal("idx2",s.i32_add(s.getLocal("idx1"),s.getLocal("pairOffset"))),s.call(i,s.getLocal("idx2"),l,d),s.call(n+"_copy",s.getLocal("idx1"),u),s.call(n+"_add",u,d,s.getLocal("idx1")),s.call(n+"_sub",u,d,s.getLocal("idx2")),s.call(o+"_mul",l,s.getLocal("pwm"),l),s.setLocal("j",s.i32_add(s.getLocal("j"),s.i32_const(1))),s.br(0))),s.setLocal("i",s.i32_add(s.getLocal("i"),s.i32_const(1))),s.br(0))))}(),function(){const o=t.addFunction(e+"_fftFinal");o.addParam("pBuff","i32"),o.addParam("n","i32"),o.addParam("factor","i32"),o.addLocal("idx1","i32"),o.addLocal("idx2","i32"),o.addLocal("i","i32"),o.addLocal("ndiv2","i32");const r=o.getCodeBuilder(),c=r.i32_const(t.alloc(a));o.addCode(r.setLocal("ndiv2",r.i32_shr_u(r.getLocal("n"),r.i32_const(1))),r.if(r.i32_and(r.getLocal("n"),r.i32_const(1)),r.call(i,r.i32_add(r.getLocal("pBuff"),r.i32_mul(r.getLocal("ndiv2"),r.i32_const(a))),r.getLocal("factor"),r.i32_add(r.getLocal("pBuff"),r.i32_mul(r.getLocal("ndiv2"),r.i32_const(a))))),r.setLocal("i",r.i32_const(0)),r.block(r.loop(r.br_if(1,r.i32_ge_u(r.getLocal("i"),r.getLocal("ndiv2"))),r.setLocal("idx1",r.i32_add(r.getLocal("pBuff"),r.i32_mul(r.getLocal("i"),r.i32_const(a)))),r.setLocal("idx2",r.i32_add(r.getLocal("pBuff"),r.i32_mul(r.i32_sub(r.i32_sub(r.getLocal("n"),r.i32_const(1)),r.getLocal("i")),r.i32_const(a)))),r.call(i,r.getLocal("idx2"),r.getLocal("factor"),c),r.call(i,r.getLocal("idx1"),r.getLocal("factor"),r.getLocal("idx2")),r.call(n+"_copy",c,r.getLocal("idx1")),r.setLocal("i",r.i32_add(r.getLocal("i"),r.i32_const(1))),r.br(0))))}(),function(){const c=t.addFunction(e+"_prepareLagrangeEvaluation");c.addParam("pBuff1","i32"),c.addParam("pBuff2","i32"),c.addParam("n","i32"),c.addParam("first","i32"),c.addParam("inc","i32"),c.addParam("totalBits","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32"),c.addLocal("pShiftToM","i32"),c.addLocal("pSConst","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(r)),d=s.i32_const(t.alloc(a));c.addCode(s.setLocal("pShiftToM",s.i32_add(s.i32_const(w),s.i32_mul(s.getLocal("totalBits"),s.i32_const(r)))),s.setLocal("pSConst",s.i32_add(s.i32_const(I),s.i32_mul(s.getLocal("totalBits"),s.i32_const(r)))),s.call(o+"_copy",s.getLocal("first"),l),s.setLocal("i",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_eq(s.getLocal("i"),s.getLocal("n"))),s.setLocal("idx1",s.i32_add(s.getLocal("pBuff1"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.setLocal("idx2",s.i32_add(s.getLocal("pBuff2"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.call(i,s.getLocal("idx1"),s.getLocal("pShiftToM"),d),s.call(n+"_sub",s.getLocal("idx2"),d,d),s.call(n+"_sub",s.getLocal("idx1"),s.getLocal("idx2"),s.getLocal("idx2")),s.call(i,d,s.getLocal("pSConst"),s.getLocal("idx1")),s.call(i,s.getLocal("idx2"),l,s.getLocal("idx2")),s.call(o+"_mul",l,s.getLocal("inc"),l),s.setLocal("i",s.i32_add(s.getLocal("i"),s.i32_const(1))),s.br(0))))}(),t.exportFunction(e+"_fft"),t.exportFunction(e+"_ifft"),t.exportFunction(e+"_rawfft"),t.exportFunction(e+"_fftJoin"),t.exportFunction(e+"_fftJoinExt"),t.exportFunction(e+"_fftJoinExtInv"),t.exportFunction(e+"_fftMix"),t.exportFunction(e+"_fftFinal"),t.exportFunction(e+"_prepareLagrangeEvaluation")},Xh=function(t,e,n){const o=8*t.modules[n].n64;return function(){const i=t.addFunction(e+"_zero");i.addParam("px","i32"),i.addParam("n","i32"),i.addLocal("lastp","i32"),i.addLocal("p","i32");const r=i.getCodeBuilder();i.addCode(r.setLocal("p",r.getLocal("px")),r.setLocal("lastp",r.i32_add(r.getLocal("px"),r.i32_mul(r.getLocal("n"),r.i32_const(o)))),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("p"),r.getLocal("lastp"))),r.call(n+"_zero",r.getLocal("p")),r.setLocal("p",r.i32_add(r.getLocal("p"),r.i32_const(o))),r.br(0))))}(),function(){const i=t.addFunction(e+"_constructLC");i.addParam("ppolynomials","i32"),i.addParam("psignals","i32"),i.addParam("nSignals","i32"),i.addParam("pres","i32"),i.addLocal("i","i32"),i.addLocal("j","i32"),i.addLocal("pp","i32"),i.addLocal("ps","i32"),i.addLocal("pd","i32"),i.addLocal("ncoefs","i32");const r=i.getCodeBuilder(),a=r.i32_const(t.alloc(o));i.addCode(r.setLocal("i",r.i32_const(0)),r.setLocal("pp",r.getLocal("ppolynomials")),r.setLocal("ps",r.getLocal("psignals")),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("i"),r.getLocal("nSignals"))),r.setLocal("ncoefs",r.i32_load(r.getLocal("pp"))),r.setLocal("pp",r.i32_add(r.getLocal("pp"),r.i32_const(4))),r.setLocal("j",r.i32_const(0)),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("j"),r.getLocal("ncoefs"))),r.setLocal("pd",r.i32_add(r.getLocal("pres"),r.i32_mul(r.i32_load(r.getLocal("pp")),r.i32_const(o)))),r.setLocal("pp",r.i32_add(r.getLocal("pp"),r.i32_const(4))),r.call(n+"_mul",r.getLocal("ps"),r.getLocal("pp"),a),r.call(n+"_add",a,r.getLocal("pd"),r.getLocal("pd")),r.setLocal("pp",r.i32_add(r.getLocal("pp"),r.i32_const(o))),r.setLocal("j",r.i32_add(r.getLocal("j"),r.i32_const(1))),r.br(0))),r.setLocal("ps",r.i32_add(r.getLocal("ps"),r.i32_const(o))),r.setLocal("i",r.i32_add(r.getLocal("i"),r.i32_const(1))),r.br(0))))}(),t.exportFunction(e+"_zero"),t.exportFunction(e+"_constructLC"),e},Zh=function(t,e,n){const o=8*t.modules[n].n64;return function(){const i=t.addFunction(e+"_buildABC");i.addParam("pCoefs","i32"),i.addParam("nCoefs","i32"),i.addParam("pWitness","i32"),i.addParam("pA","i32"),i.addParam("pB","i32"),i.addParam("pC","i32"),i.addParam("offsetOut","i32"),i.addParam("nOut","i32"),i.addParam("offsetWitness","i32"),i.addParam("nWitness","i32"),i.addLocal("it","i32"),i.addLocal("ita","i32"),i.addLocal("itb","i32"),i.addLocal("last","i32"),i.addLocal("m","i32"),i.addLocal("c","i32"),i.addLocal("s","i32"),i.addLocal("pOut","i32");const r=i.getCodeBuilder(),a=r.i32_const(t.alloc(o));i.addCode(r.setLocal("ita",r.getLocal("pA")),r.setLocal("itb",r.getLocal("pB")),r.setLocal("last",r.i32_add(r.getLocal("pA"),r.i32_mul(r.getLocal("nOut"),r.i32_const(o)))),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("ita"),r.getLocal("last"))),r.call(n+"_zero",r.getLocal("ita")),r.call(n+"_zero",r.getLocal("itb")),r.setLocal("ita",r.i32_add(r.getLocal("ita"),r.i32_const(o))),r.setLocal("itb",r.i32_add(r.getLocal("itb"),r.i32_const(o))),r.br(0))),r.setLocal("it",r.getLocal("pCoefs")),r.setLocal("last",r.i32_add(r.getLocal("pCoefs"),r.i32_mul(r.getLocal("nCoefs"),r.i32_const(o+12)))),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("it"),r.getLocal("last"))),r.setLocal("s",r.i32_load(r.getLocal("it"),8)),r.if(r.i32_or(r.i32_lt_u(r.getLocal("s"),r.getLocal("offsetWitness")),r.i32_ge_u(r.getLocal("s"),r.i32_add(r.getLocal("offsetWitness"),r.getLocal("nWitness")))),[...r.setLocal("it",r.i32_add(r.getLocal("it"),r.i32_const(o+12))),...r.br(1)]),r.setLocal("m",r.i32_load(r.getLocal("it"))),r.if(r.i32_eq(r.getLocal("m"),r.i32_const(0)),r.setLocal("pOut",r.getLocal("pA")),r.if(r.i32_eq(r.getLocal("m"),r.i32_const(1)),r.setLocal("pOut",r.getLocal("pB")),[...r.setLocal("it",r.i32_add(r.getLocal("it"),r.i32_const(o+12))),...r.br(1)])),r.setLocal("c",r.i32_load(r.getLocal("it"),4)),r.if(r.i32_or(r.i32_lt_u(r.getLocal("c"),r.getLocal("offsetOut")),r.i32_ge_u(r.getLocal("c"),r.i32_add(r.getLocal("offsetOut"),r.getLocal("nOut")))),[...r.setLocal("it",r.i32_add(r.getLocal("it"),r.i32_const(o+12))),...r.br(1)]),r.setLocal("pOut",r.i32_add(r.getLocal("pOut"),r.i32_mul(r.i32_sub(r.getLocal("c"),r.getLocal("offsetOut")),r.i32_const(o)))),r.call(n+"_mul",r.i32_add(r.getLocal("pWitness"),r.i32_mul(r.i32_sub(r.getLocal("s"),r.getLocal("offsetWitness")),r.i32_const(o))),r.i32_add(r.getLocal("it"),r.i32_const(12)),a),r.call(n+"_add",r.getLocal("pOut"),a,r.getLocal("pOut")),r.setLocal("it",r.i32_add(r.getLocal("it"),r.i32_const(o+12))),r.br(0))),r.setLocal("ita",r.getLocal("pA")),r.setLocal("itb",r.getLocal("pB")),r.setLocal("it",r.getLocal("pC")),r.setLocal("last",r.i32_add(r.getLocal("pA"),r.i32_mul(r.getLocal("nOut"),r.i32_const(o)))),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("ita"),r.getLocal("last"))),r.call(n+"_mul",r.getLocal("ita"),r.getLocal("itb"),r.getLocal("it")),r.setLocal("ita",r.i32_add(r.getLocal("ita"),r.i32_const(o))),r.setLocal("itb",r.i32_add(r.getLocal("itb"),r.i32_const(o))),r.setLocal("it",r.i32_add(r.getLocal("it"),r.i32_const(o))),r.br(0))))}(),function(){const i=t.addFunction(e+"_joinABC");i.addParam("pA","i32"),i.addParam("pB","i32"),i.addParam("pC","i32"),i.addParam("n","i32"),i.addParam("pP","i32"),i.addLocal("ita","i32"),i.addLocal("itb","i32"),i.addLocal("itc","i32"),i.addLocal("itp","i32"),i.addLocal("last","i32");const r=i.getCodeBuilder(),a=r.i32_const(t.alloc(o));i.addCode(r.setLocal("ita",r.getLocal("pA")),r.setLocal("itb",r.getLocal("pB")),r.setLocal("itc",r.getLocal("pC")),r.setLocal("itp",r.getLocal("pP")),r.setLocal("last",r.i32_add(r.getLocal("pA"),r.i32_mul(r.getLocal("n"),r.i32_const(o)))),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("ita"),r.getLocal("last"))),r.call(n+"_mul",r.getLocal("ita"),r.getLocal("itb"),a),r.call(n+"_sub",a,r.getLocal("itc"),r.getLocal("itp")),r.setLocal("ita",r.i32_add(r.getLocal("ita"),r.i32_const(o))),r.setLocal("itb",r.i32_add(r.getLocal("itb"),r.i32_const(o))),r.setLocal("itc",r.i32_add(r.getLocal("itc"),r.i32_const(o))),r.setLocal("itp",r.i32_add(r.getLocal("itp"),r.i32_const(o))),r.br(0))))}(),function(){const i=t.addFunction(e+"_batchAdd");i.addParam("pa","i32"),i.addParam("pb","i32"),i.addParam("n","i32"),i.addParam("pr","i32"),i.addLocal("ita","i32"),i.addLocal("itb","i32"),i.addLocal("itr","i32"),i.addLocal("last","i32");const r=i.getCodeBuilder();i.addCode(r.setLocal("ita",r.getLocal("pa")),r.setLocal("itb",r.getLocal("pb")),r.setLocal("itr",r.getLocal("pr")),r.setLocal("last",r.i32_add(r.getLocal("pa"),r.i32_mul(r.getLocal("n"),r.i32_const(o)))),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("ita"),r.getLocal("last"))),r.call(n+"_add",r.getLocal("ita"),r.getLocal("itb"),r.getLocal("itr")),r.setLocal("ita",r.i32_add(r.getLocal("ita"),r.i32_const(o))),r.setLocal("itb",r.i32_add(r.getLocal("itb"),r.i32_const(o))),r.setLocal("itr",r.i32_add(r.getLocal("itr"),r.i32_const(o))),r.br(0))))}(),t.exportFunction(e+"_buildABC"),t.exportFunction(e+"_joinABC"),t.exportFunction(e+"_batchAdd"),e},$h=function(t,e,n,o,i,r,a,c){const s=t.addFunction(e);s.addParam("pIn","i32"),s.addParam("n","i32"),s.addParam("pFirst","i32"),s.addParam("pInc","i32"),s.addParam("pOut","i32"),s.addLocal("pOldFree","i32"),s.addLocal("i","i32"),s.addLocal("pFrom","i32"),s.addLocal("pTo","i32");const l=s.getCodeBuilder(),d=l.i32_const(t.alloc(a));s.addCode(l.setLocal("pFrom",l.getLocal("pIn")),l.setLocal("pTo",l.getLocal("pOut"))),s.addCode(l.call(o+"_copy",l.getLocal("pFirst"),d)),s.addCode(l.setLocal("i",l.i32_const(0)),l.block(l.loop(l.br_if(1,l.i32_eq(l.getLocal("i"),l.getLocal("n"))),l.call(c,l.getLocal("pFrom"),d,l.getLocal("pTo")),l.setLocal("pFrom",l.i32_add(l.getLocal("pFrom"),l.i32_const(i))),l.setLocal("pTo",l.i32_add(l.getLocal("pTo"),l.i32_const(r))),l.call(o+"_mul",d,l.getLocal("pInc"),d),l.setLocal("i",l.i32_add(l.getLocal("i"),l.i32_const(1))),l.br(0)))),t.exportFunction(e)};const tp=nh,ep=Sh,np=Uh,op=zh,ip=Dh,rp=Kh,ap=Wh,cp=Xh,sp=Zh,lp=$h,{bitLength:dp,modInv:up,isOdd:fp,isNegative:gp}=ah,hp=nh,pp=Sh,_p=Uh,mp=zh,yp=Dh,Lp=Kh,bp=Wh,Ap=Xh,wp=Zh,Ip=$h,{bitLength:Cp,isOdd:xp,isNegative:vp}=ah;var Ep=function(t,e){const n=e||"bn128";if(t.modules[n])return n;const o=21888242871839275222246405745257275088696311157297823662689037894645226208583n,i=21888242871839275222246405745257275088548364400416034343698204186575808495617n,r=Math.floor((dp(o-1n)-1)/64)+1,a=8*r,c=a,s=a,l=2*s,d=12*s,u=t.alloc(tp.bigInt2BytesLE(i,c)),f=ep(t,o,"f1m");np(t,i,"fr","frm");const g=t.alloc(tp.bigInt2BytesLE(L(3n),s)),h=rp(t,"g1m","f1m",g);ap(t,"frm","frm","frm","frm_mul"),cp(t,"pol","frm"),sp(t,"qap","frm");const p=op(t,"f1m_neg","f2m","f1m"),_=t.alloc([...tp.bigInt2BytesLE(L(19485874751759354771024239261021720505790618469301721065564631296452457478373n),s),...tp.bigInt2BytesLE(L(266929791119991161246907387137283842545076965332900288569378510910307636690n),s)]),m=rp(t,"g2m","f2m",_);function y(e,n){const o=t.addFunction(e);o.addParam("pG","i32"),o.addParam("pFr","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),r=i.i32_const(t.alloc(a));o.addCode(i.call("frm_fromMontgomery",i.getLocal("pFr"),r),i.call(n,i.getLocal("pG"),r,i.i32_const(a),i.getLocal("pr"))),t.exportFunction(e)}function L(t){return BigInt(t)*(1n<<BigInt(8*s))%o}y("g1m_timesFr","g1m_timesScalar"),ap(t,"g1m","g1m","frm","g1m_timesFr"),y("g2m_timesFr","g2m_timesScalar"),ap(t,"g2m","g2m","frm","g2m_timesFr"),y("g1m_timesFrAffine","g1m_timesScalarAffine"),y("g2m_timesFrAffine","g2m_timesScalarAffine"),lp(t,"frm_batchApplyKey","fmr","frm",a,a,a,"frm_mul"),lp(t,"g1m_batchApplyKey","g1m","frm",3*a,3*a,a,"g1m_timesFr"),lp(t,"g1m_batchApplyKeyMixed","g1m","frm",2*a,3*a,a,"g1m_timesFrAffine"),lp(t,"g2m_batchApplyKey","g2m","frm",2*a*3,3*a*2,a,"g2m_timesFr"),lp(t,"g2m_batchApplyKeyMixed","g2m","frm",2*a*2,3*a*2,a,"g2m_timesFrAffine");const b=[1n,2n,1n],A=t.alloc([...tp.bigInt2BytesLE(L(b[0]),s),...tp.bigInt2BytesLE(L(b[1]),s),...tp.bigInt2BytesLE(L(b[2]),s)]),w=[0n,1n,0n],I=t.alloc([...tp.bigInt2BytesLE(L(w[0]),s),...tp.bigInt2BytesLE(L(w[1]),s),...tp.bigInt2BytesLE(L(w[2]),s)]),C=[[10857046999023057135944570762232829481370756359578518086990519993285655852781n,11559732032986387107991004021392285783925812861821192530917403151452391805634n],[8495653923123431417604973247489272438418190587263600148770280649306958101930n,4082367875863433681332203403145435568316851327593401208105741076214120093531n],[1n,0n]],x=t.alloc([...tp.bigInt2BytesLE(L(C[0][0]),s),...tp.bigInt2BytesLE(L(C[0][1]),s),...tp.bigInt2BytesLE(L(C[1][0]),s),...tp.bigInt2BytesLE(L(C[1][1]),s),...tp.bigInt2BytesLE(L(C[2][0]),s),...tp.bigInt2BytesLE(L(C[2][1]),s)]),v=[[0n,0n],[1n,0n],[0n,0n]],E=t.alloc([...tp.bigInt2BytesLE(L(v[0][0]),s),...tp.bigInt2BytesLE(L(v[0][1]),s),...tp.bigInt2BytesLE(L(v[1][0]),s),...tp.bigInt2BytesLE(L(v[1][1]),s),...tp.bigInt2BytesLE(L(v[2][0]),s),...tp.bigInt2BytesLE(L(v[2][1]),s)]),B=t.alloc([...tp.bigInt2BytesLE(L(1),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s)]),F=t.alloc([...tp.bigInt2BytesLE(L(9),s),...tp.bigInt2BytesLE(L(1),s)]),O=t.alloc([...tp.bigInt2BytesLE(L(up(2n,o)),s),...tp.bigInt2BytesLE(0n,s)]),S=F,P=t.alloc([...tp.bigInt2BytesLE(L(19485874751759354771024239261021720505790618469301721065564631296452457478373n),s),...tp.bigInt2BytesLE(L(266929791119991161246907387137283842545076965332900288569378510910307636690n),s)]);!function(){const e=t.addFunction(n+"_mulNR6");e.addParam("x","i32"),e.addParam("pr","i32");const o=e.getCodeBuilder();e.addCode(o.call(p+"_mul",o.i32_const(F),o.getLocal("x"),o.getLocal("pr")))}();const j=ip(t,n+"_mulNR6","f6m","f2m");!function(){const e=t.addFunction(n+"_mulNR12");e.addParam("x","i32"),e.addParam("pr","i32");const o=e.getCodeBuilder();e.addCode(o.call(p+"_mul",o.i32_const(F),o.i32_add(o.getLocal("x"),o.i32_const(4*a)),o.getLocal("pr")),o.call(p+"_copy",o.getLocal("x"),o.i32_add(o.getLocal("pr"),o.i32_const(2*a))),o.call(p+"_copy",o.i32_add(o.getLocal("x"),o.i32_const(2*a)),o.i32_add(o.getLocal("pr"),o.i32_const(4*a))))}();const U=op(t,n+"_mulNR12","ftm",j),k=function(){let t=29793968203157093288n;const e=[];for(;t>0n;)fp(t)?e.push(1):e.push(0),t>>=1n;return e}(),M=t.alloc(k),T=3*l,z=k.length-1,Q=k.reduce(((t,e)=>t+(0!=e?1:0)),0),N=6*a,D=3*a*2+(Q+z+1)*T;function R(e){const i=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[8376118865763821496583973867626364092589906065868298776909617916018768340080n,16469823323077808223889137241176536799009286646108169935659301613961712198316n],[21888242871839275220042445260109153167277707414472061641714758635765020556617n,0n],[11697423496358154304825782922584725312912383441159505038794027105778954184319n,303847389135065887422783454877609941456349188919719272345083954437860409601n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3321304630594332808241809054958361220322477375291206261884409189760185844239n,5722266937896532885780051958958348231143373700109372999374820235121374419868n],[21888242871839275222246405745257275088696311157297823662689037894645226208582n,0n],[13512124006075453725662431877630910996106405091429524885779419978626457868503n,5418419548761466998357268504080738289687024511189653727029736280683514010267n],[2203960485148121921418603742825762020974279258880205651966n,0n],[10190819375481120917420622822672549775783927716138318623895010788866272024264n,21584395482704209334823622290379665147239961968378104390343953940207365798982n],[2203960485148121921418603742825762020974279258880205651967n,0n],[18566938241244942414004596690298913868373833782006617400804628704885040364344n,16165975933942742336466353786298926857552937457188450663314217659523851788715n]]],r=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[21575463638280843010398324269430826099269044274347216827212613867836435027261n,10307601595873709700152284273816112264069230130616436755625194854815875713954n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3772000881919853776433695186713858239009073593817195771773381919316419345261n,2236595495967245188281701248203181795121068902605861227855261137820944008926n],[2203960485148121921418603742825762020974279258880205651966n,0n],[18429021223477853657660792034369865839114504446431234726392080002137598044644n,9344045779998320333812420223237981029506012124075525679208581902008406485703n]],[[1n,0n],[2581911344467009335267311115468803099551665605076196740867805258568234346338n,19937756971775647987995932169929341994314640652964949448313374472400716661030n],[2203960485148121921418603742825762020974279258880205651966n,0n],[5324479202449903542726783395506214481928257762400643279780343368557297135718n,16208900380737693084919495127334387981393726419856888799917914180988844123039n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[13981852324922362344252311234282257507216387789820983642040889267519694726527n,7629828391165209371577384193250820201684255241773809077146787135900891633097n]]],a=t.addFunction(n+"__frobeniusMap"+e);a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder();for(let n=0;n<6;n++){const o=0==n?c.getLocal("x"):c.i32_add(c.getLocal("x"),c.i32_const(n*l)),u=o,g=c.i32_add(c.getLocal("x"),c.i32_const(n*l+s)),h=0==n?c.getLocal("r"):c.i32_add(c.getLocal("r"),c.i32_const(n*l)),_=h,m=c.i32_add(c.getLocal("r"),c.i32_const(n*l+s)),y=d(i[Math.floor(n/3)][e%12],r[n%3][e%6]),b=t.alloc([...tp.bigInt2BytesLE(L(y[0]),32),...tp.bigInt2BytesLE(L(y[1]),32)]);e%2==1?a.addCode(c.call(f+"_copy",u,_),c.call(f+"_neg",g,m),c.call(p+"_mul",h,c.i32_const(b),h)):a.addCode(c.call(p+"_mul",o,c.i32_const(b),h))}function d(t,e){const n=BigInt(t[0]),i=BigInt(t[1]),r=BigInt(e[0]),a=BigInt(e[1]),c=[(n*r-i*a)%o,(n*a+i*r)%o];return gp(c[0])&&(c[0]=c[0]+o),c}}function q(){!function(){const e=t.addFunction(n+"__cyclotomicSquare");e.addParam("x","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("x"),r=o.i32_add(o.getLocal("x"),o.i32_const(l)),a=o.i32_add(o.getLocal("x"),o.i32_const(2*l)),c=o.i32_add(o.getLocal("x"),o.i32_const(3*l)),s=o.i32_add(o.getLocal("x"),o.i32_const(4*l)),d=o.i32_add(o.getLocal("x"),o.i32_const(5*l)),u=o.getLocal("r"),f=o.i32_add(o.getLocal("r"),o.i32_const(l)),g=o.i32_add(o.getLocal("r"),o.i32_const(2*l)),h=o.i32_add(o.getLocal("r"),o.i32_const(3*l)),_=o.i32_add(o.getLocal("r"),o.i32_const(4*l)),m=o.i32_add(o.getLocal("r"),o.i32_const(5*l)),y=o.i32_const(t.alloc(l)),L=o.i32_const(t.alloc(l)),b=o.i32_const(t.alloc(l)),A=o.i32_const(t.alloc(l)),w=o.i32_const(t.alloc(l)),I=o.i32_const(t.alloc(l)),C=o.i32_const(t.alloc(l)),x=o.i32_const(t.alloc(l));e.addCode(o.call(p+"_mul",i,s,C),o.call(p+"_mul",s,o.i32_const(F),y),o.call(p+"_add",i,y,y),o.call(p+"_add",i,s,x),o.call(p+"_mul",x,y,y),o.call(p+"_mul",o.i32_const(F),C,x),o.call(p+"_add",C,x,x),o.call(p+"_sub",y,x,y),o.call(p+"_add",C,C,L),o.call(p+"_mul",c,a,C),o.call(p+"_mul",a,o.i32_const(F),b),o.call(p+"_add",c,b,b),o.call(p+"_add",c,a,x),o.call(p+"_mul",x,b,b),o.call(p+"_mul",o.i32_const(F),C,x),o.call(p+"_add",C,x,x),o.call(p+"_sub",b,x,b),o.call(p+"_add",C,C,A),o.call(p+"_mul",r,d,C),o.call(p+"_mul",d,o.i32_const(F),w),o.call(p+"_add",r,w,w),o.call(p+"_add",r,d,x),o.call(p+"_mul",x,w,w),o.call(p+"_mul",o.i32_const(F),C,x),o.call(p+"_add",C,x,x),o.call(p+"_sub",w,x,w),o.call(p+"_add",C,C,I),o.call(p+"_sub",y,i,u),o.call(p+"_add",u,u,u),o.call(p+"_add",y,u,u),o.call(p+"_add",L,s,_),o.call(p+"_add",_,_,_),o.call(p+"_add",L,_,_),o.call(p+"_mul",I,o.i32_const(S),x),o.call(p+"_add",x,c,h),o.call(p+"_add",h,h,h),o.call(p+"_add",x,h,h),o.call(p+"_sub",w,a,g),o.call(p+"_add",g,g,g),o.call(p+"_add",w,g,g),o.call(p+"_sub",b,r,f),o.call(p+"_add",f,f,f),o.call(p+"_add",b,f,f),o.call(p+"_add",A,d,m),o.call(p+"_add",m,m,m),o.call(p+"_add",A,m,m))}(),function(e,o){const i=function(t){let e=t;const n=[];for(;e>0n;){if(fp(e)){const t=2-Number(e%4n);n.push(t),e-=BigInt(t)}else n.push(0);e>>=1n}return n}(e).map((t=>-1==t?255:t)),r=t.alloc(i),a=t.addFunction(n+"__cyclotomicExp_"+o);a.addParam("x","i32"),a.addParam("r","i32"),a.addLocal("bit","i32"),a.addLocal("i","i32");const c=a.getCodeBuilder(),s=c.getLocal("x"),l=c.getLocal("r"),u=c.i32_const(t.alloc(d));a.addCode(c.call(U+"_conjugate",s,u),c.call(U+"_one",l),c.if(c.teeLocal("bit",c.i32_load8_s(c.i32_const(i.length-1),r)),c.if(c.i32_eq(c.getLocal("bit"),c.i32_const(1)),c.call(U+"_mul",l,s,l),c.call(U+"_mul",l,u,l))),c.setLocal("i",c.i32_const(i.length-2)),c.block(c.loop(c.call(n+"__cyclotomicSquare",l,l),c.if(c.teeLocal("bit",c.i32_load8_s(c.getLocal("i"),r)),c.if(c.i32_eq(c.getLocal("bit"),c.i32_const(1)),c.call(U+"_mul",l,s,l),c.call(U+"_mul",l,u,l))),c.br_if(1,c.i32_eqz(c.getLocal("i"))),c.setLocal("i",c.i32_sub(c.getLocal("i"),c.i32_const(1))),c.br(0))))}(4965661367192848881n,"w0");const e=t.addFunction(n+"__finalExponentiationLastChunk");e.addParam("x","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("x"),r=o.getLocal("r"),a=o.i32_const(t.alloc(d)),c=o.i32_const(t.alloc(d)),s=o.i32_const(t.alloc(d)),u=o.i32_const(t.alloc(d)),f=o.i32_const(t.alloc(d)),g=o.i32_const(t.alloc(d)),h=o.i32_const(t.alloc(d)),_=o.i32_const(t.alloc(d)),m=o.i32_const(t.alloc(d)),y=o.i32_const(t.alloc(d)),L=o.i32_const(t.alloc(d)),b=o.i32_const(t.alloc(d)),A=o.i32_const(t.alloc(d)),w=o.i32_const(t.alloc(d)),I=o.i32_const(t.alloc(d)),C=o.i32_const(t.alloc(d)),x=o.i32_const(t.alloc(d)),v=o.i32_const(t.alloc(d)),E=o.i32_const(t.alloc(d)),B=o.i32_const(t.alloc(d)),O=o.i32_const(t.alloc(d));e.addCode(o.call(n+"__cyclotomicExp_w0",i,a),o.call(U+"_conjugate",a,a),o.call(n+"__cyclotomicSquare",a,c),o.call(n+"__cyclotomicSquare",c,s),o.call(U+"_mul",s,c,u),o.call(n+"__cyclotomicExp_w0",u,f),o.call(U+"_conjugate",f,f),o.call(n+"__cyclotomicSquare",f,g),o.call(n+"__cyclotomicExp_w0",g,h),o.call(U+"_conjugate",h,h),o.call(U+"_conjugate",u,_),o.call(U+"_conjugate",h,m),o.call(U+"_mul",m,f,y),o.call(U+"_mul",y,_,L),o.call(U+"_mul",L,c,b),o.call(U+"_mul",L,f,A),o.call(U+"_mul",A,i,w),o.call(n+"__frobeniusMap1",b,I),o.call(U+"_mul",I,w,C),o.call(n+"__frobeniusMap2",L,x),o.call(U+"_mul",x,C,v),o.call(U+"_conjugate",i,E),o.call(U+"_mul",E,b,B),o.call(n+"__frobeniusMap3",B,O),o.call(U+"_mul",O,v,r))}t.modules[n]={n64:r,pG1gen:A,pG1zero:I,pG1b:g,pG2gen:x,pG2zero:E,pG2b:_,pq:t.modules.f1m.pq,pr:u,pOneT:B,prePSize:N,preQSize:D,r:i.toString(),q:o.toString()};const G=t.alloc(N),K=t.alloc(D);function V(e){const o=t.addFunction(n+"_pairingEq"+e);for(let t=0;t<e;t++)o.addParam("p_"+t,"i32"),o.addParam("q_"+t,"i32");o.addParam("c","i32"),o.setReturnType("i32");const i=o.getCodeBuilder(),r=i.i32_const(t.alloc(d)),a=i.i32_const(t.alloc(d));o.addCode(i.call(U+"_one",r));for(let t=0;t<e;t++)o.addCode(i.call(n+"_prepareG1",i.getLocal("p_"+t),i.i32_const(G))),o.addCode(i.call(n+"_prepareG2",i.getLocal("q_"+t),i.i32_const(K))),o.addCode(i.call(n+"_millerLoop",i.i32_const(G),i.i32_const(K),a)),o.addCode(i.call(U+"_mul",r,a,r));o.addCode(i.call(n+"_finalExponentiation",r,r)),o.addCode(i.call(U+"_eq",r,i.getLocal("c")))}!function(){const e=t.addFunction(n+"_prepAddStep");e.addParam("pQ","i32"),e.addParam("pR","i32"),e.addParam("pCoef","i32");const o=e.getCodeBuilder(),i=o.getLocal("pQ"),r=o.i32_add(o.getLocal("pQ"),o.i32_const(l)),a=o.getLocal("pR"),c=o.i32_add(o.getLocal("pR"),o.i32_const(l)),s=o.i32_add(o.getLocal("pR"),o.i32_const(2*l)),d=o.getLocal("pCoef"),u=o.i32_add(o.getLocal("pCoef"),o.i32_const(l)),f=o.i32_add(o.getLocal("pCoef"),o.i32_const(2*l)),g=u,h=o.i32_const(t.alloc(l)),_=o.i32_const(t.alloc(l)),m=o.i32_const(t.alloc(l)),y=o.i32_const(t.alloc(l)),L=o.i32_const(t.alloc(l)),b=o.i32_const(t.alloc(l)),A=o.i32_const(t.alloc(l));e.addCode(o.call(p+"_mul",i,s,g),o.call(p+"_sub",a,g,g),o.call(p+"_mul",r,s,h),o.call(p+"_sub",c,h,h),o.call(p+"_square",g,_),o.call(p+"_square",h,m),o.call(p+"_mul",g,_,y),o.call(p+"_mul",a,_,L),o.call(p+"_add",L,L,A),o.call(p+"_mul",s,m,b),o.call(p+"_add",y,b,b),o.call(p+"_sub",b,A,b),o.call(p+"_mul",g,b,a),o.call(p+"_mul",y,c,c),o.call(p+"_sub",L,b,A),o.call(p+"_mul",h,A,A),o.call(p+"_sub",A,c,c),o.call(p+"_mul",s,y,s),o.call(p+"_mul",g,r,A),o.call(p+"_mul",h,i,d),o.call(p+"_sub",d,A,d),o.call(p+"_mul",d,o.i32_const(S),d),o.call(p+"_neg",h,f))}(),function(){const e=t.addFunction(n+"_prepDblStep");e.addParam("pR","i32"),e.addParam("pCoef","i32");const o=e.getCodeBuilder(),i=o.getLocal("pR"),r=o.i32_add(o.getLocal("pR"),o.i32_const(l)),a=o.i32_add(o.getLocal("pR"),o.i32_const(2*l)),c=o.getLocal("pCoef"),s=o.i32_add(o.getLocal("pCoef"),o.i32_const(l)),d=o.i32_add(o.getLocal("pCoef"),o.i32_const(2*l)),u=o.i32_const(t.alloc(l)),f=o.i32_const(t.alloc(l)),g=o.i32_const(t.alloc(l)),h=o.i32_const(t.alloc(l)),_=o.i32_const(t.alloc(l)),m=o.i32_const(t.alloc(l)),y=o.i32_const(t.alloc(l)),L=o.i32_const(t.alloc(l)),b=o.i32_const(t.alloc(l)),A=o.i32_const(t.alloc(l)),w=o.i32_const(t.alloc(l)),I=o.i32_const(t.alloc(l));e.addCode(o.call(p+"_mul",r,o.i32_const(O),u),o.call(p+"_mul",i,u,u),o.call(p+"_square",r,f),o.call(p+"_square",a,g),o.call(p+"_add",g,g,h),o.call(p+"_add",h,g,h),o.call(p+"_mul",o.i32_const(P),h,_),o.call(p+"_add",_,_,m),o.call(p+"_add",_,m,m),o.call(p+"_add",f,m,y),o.call(p+"_mul",y,o.i32_const(O),y),o.call(p+"_add",f,g,I),o.call(p+"_add",r,a,L),o.call(p+"_square",L,L),o.call(p+"_sub",L,I,L),o.call(p+"_sub",_,f,b),o.call(p+"_square",i,A),o.call(p+"_square",_,w),o.call(p+"_sub",f,m,I),o.call(p+"_mul",u,I,i),o.call(p+"_add",w,w,I),o.call(p+"_add",w,I,I),o.call(p+"_square",y,r),o.call(p+"_sub",r,I,r),o.call(p+"_mul",f,L,a),o.call(p+"_mul",o.i32_const(S),b,c),o.call(p+"_neg",L,s),o.call(p+"_add",A,A,d),o.call(p+"_add",A,d,d))}(),function(){const e=t.addFunction(n+"_prepareG1");e.addParam("pP","i32"),e.addParam("ppreP","i32");const o=e.getCodeBuilder();e.addCode(o.call(h+"_normalize",o.getLocal("pP"),o.getLocal("ppreP")))}(),function(){!function(){const e=t.addFunction(n+"_mulByQ");e.addParam("p1","i32"),e.addParam("pr","i32");const o=e.getCodeBuilder(),i=o.getLocal("p1"),r=o.i32_add(o.getLocal("p1"),o.i32_const(l)),a=o.i32_add(o.getLocal("p1"),o.i32_const(2*l)),c=o.getLocal("pr"),d=o.i32_add(o.getLocal("pr"),o.i32_const(l)),u=o.i32_add(o.getLocal("pr"),o.i32_const(2*l)),f=o.i32_const(t.alloc([...tp.bigInt2BytesLE(L("21575463638280843010398324269430826099269044274347216827212613867836435027261"),s),...tp.bigInt2BytesLE(L("10307601595873709700152284273816112264069230130616436755625194854815875713954"),s)])),g=o.i32_const(t.alloc([...tp.bigInt2BytesLE(L("2821565182194536844548159561693502659359617185244120367078079554186484126554"),s),...tp.bigInt2BytesLE(L("3505843767911556378687030309984248845540243509899259641013678093033130930403"),s)]));e.addCode(o.call(p+"_conjugate",i,c),o.call(p+"_mul",f,c,c),o.call(p+"_conjugate",r,d),o.call(p+"_mul",g,d,d),o.call(p+"_conjugate",a,u))}();const e=t.addFunction(n+"_prepareG2");e.addParam("pQ","i32"),e.addParam("ppreQ","i32"),e.addLocal("pCoef","i32"),e.addLocal("i","i32");const o=e.getCodeBuilder(),i=o.getLocal("pQ"),r=t.alloc(3*l),a=o.i32_const(r),c=o.i32_const(r),d=o.i32_const(r+l),u=o.i32_const(r+2*l),f=o.i32_add(o.getLocal("ppreQ"),o.i32_const(0)),g=o.i32_add(o.getLocal("ppreQ"),o.i32_const(l)),h=t.alloc(3*l),_=o.i32_const(h),y=t.alloc(3*l),b=o.i32_const(y),A=o.i32_const(y+l);e.addCode(o.call(m+"_normalize",i,f),o.call(p+"_copy",f,c),o.call(p+"_copy",g,d),o.call(p+"_one",u)),e.addCode(o.setLocal("pCoef",o.i32_add(o.getLocal("ppreQ"),o.i32_const(3*l))),o.setLocal("i",o.i32_const(k.length-2)),o.block(o.loop(o.call(n+"_prepDblStep",a,o.getLocal("pCoef")),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T))),o.if(o.i32_load8_s(o.getLocal("i"),M),[...o.call(n+"_prepAddStep",f,a,o.getLocal("pCoef")),...o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T)))]),o.br_if(1,o.i32_eqz(o.getLocal("i"))),o.setLocal("i",o.i32_sub(o.getLocal("i"),o.i32_const(1))),o.br(0)))),e.addCode(o.call(n+"_mulByQ",f,_),o.call(n+"_mulByQ",_,b)),e.addCode(o.call(p+"_neg",A,A),o.call(n+"_prepAddStep",_,a,o.getLocal("pCoef")),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T))),o.call(n+"_prepAddStep",b,a,o.getLocal("pCoef")),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T))))}(),function(){const e=t.addFunction(n+"__mulBy024");e.addParam("pEll0","i32"),e.addParam("pEllVW","i32"),e.addParam("pEllVV","i32"),e.addParam("pR","i32");const o=e.getCodeBuilder(),i=o.getLocal("pEll0"),r=o.getLocal("pEllVV"),c=o.getLocal("pEllVW"),s=o.getLocal("pR"),d=o.i32_add(o.getLocal("pR"),o.i32_const(2*a)),u=o.i32_add(o.getLocal("pR"),o.i32_const(4*a)),f=o.i32_add(o.getLocal("pR"),o.i32_const(6*a)),g=o.i32_add(o.getLocal("pR"),o.i32_const(8*a)),h=o.i32_add(o.getLocal("pR"),o.i32_const(10*a)),_=o.i32_const(t.alloc(l)),m=o.i32_const(t.alloc(l)),y=o.i32_const(t.alloc(l)),L=o.i32_const(t.alloc(l)),b=o.i32_const(t.alloc(l)),A=o.i32_const(t.alloc(l)),w=o.i32_const(t.alloc(l)),I=o.i32_const(t.alloc(l)),C=o.i32_const(t.alloc(l)),x=o.i32_const(t.alloc(l)),v=o.i32_const(t.alloc(l));e.addCode(o.call(p+"_mul",s,i,w),o.call(p+"_mul",u,r,I),o.call(p+"_mul",g,c,C),o.call(p+"_add",s,g,y),o.call(p+"_add",s,u,m),o.call(p+"_add",d,f,L),o.call(p+"_add",L,h,L),o.call(p+"_mul",d,r,x),o.call(p+"_add",x,C,b),o.call(p+"_mul",o.i32_const(F),b,A),o.call(p+"_add",A,w,s),o.call(p+"_mul",h,c,b),o.call(p+"_add",x,b,x),o.call(p+"_add",b,I,b),o.call(p+"_mul",o.i32_const(F),b,A),o.call(p+"_mul",d,i,b),o.call(p+"_add",x,b,x),o.call(p+"_add",A,b,d),o.call(p+"_add",i,r,_),o.call(p+"_mul",m,_,b),o.call(p+"_add",w,I,v),o.call(p+"_sub",b,v,b),o.call(p+"_mul",f,c,A),o.call(p+"_add",x,A,x),o.call(p+"_add",u,g,_),o.call(p+"_add",b,A,u),o.call(p+"_add",r,c,m),o.call(p+"_mul",m,_,b),o.call(p+"_add",I,C,v),o.call(p+"_sub",b,v,b),o.call(p+"_mul",o.i32_const(F),b,A),o.call(p+"_mul",f,i,b),o.call(p+"_add",x,b,x),o.call(p+"_add",A,b,f),o.call(p+"_mul",h,r,b),o.call(p+"_add",x,b,x),o.call(p+"_mul",o.i32_const(F),b,A),o.call(p+"_add",i,c,_),o.call(p+"_mul",y,_,b),o.call(p+"_add",w,C,v),o.call(p+"_sub",b,v,b),o.call(p+"_add",A,b,g),o.call(p+"_add",i,r,_),o.call(p+"_add",_,c,_),o.call(p+"_mul",L,_,b),o.call(p+"_sub",b,x,h))}(),function(){const e=t.addFunction(n+"__mulBy024Old");e.addParam("pEll0","i32"),e.addParam("pEllVW","i32"),e.addParam("pEllVV","i32"),e.addParam("pR","i32");const o=e.getCodeBuilder(),i=o.getLocal("pEll0"),r=o.getLocal("pEllVV"),a=o.getLocal("pEllVW"),c=o.getLocal("pR"),s=t.alloc(d),u=o.i32_const(s),f=o.i32_const(s),g=o.i32_const(s+l),h=o.i32_const(s+2*l),_=o.i32_const(s+3*l),m=o.i32_const(s+4*l),y=o.i32_const(s+5*l);e.addCode(o.call(p+"_copy",i,f),o.call(p+"_zero",g),o.call(p+"_copy",r,h),o.call(p+"_zero",_),o.call(p+"_copy",a,m),o.call(p+"_zero",y),o.call(U+"_mul",u,c,c))}(),function(){const e=t.addFunction(n+"_millerLoop");e.addParam("ppreP","i32"),e.addParam("ppreQ","i32"),e.addParam("r","i32"),e.addLocal("pCoef","i32"),e.addLocal("i","i32");const o=e.getCodeBuilder(),i=o.getLocal("ppreP"),r=o.i32_add(o.getLocal("ppreP"),o.i32_const(s)),a=o.getLocal("pCoef"),c=o.i32_add(o.getLocal("pCoef"),o.i32_const(l)),d=o.i32_add(o.getLocal("pCoef"),o.i32_const(2*l)),u=t.alloc(l),f=o.i32_const(u),g=t.alloc(l),h=o.i32_const(g),_=o.getLocal("r");e.addCode(o.call(U+"_one",_),o.setLocal("pCoef",o.i32_add(o.getLocal("ppreQ"),o.i32_const(3*l))),o.setLocal("i",o.i32_const(k.length-2)),o.block(o.loop(o.call(U+"_square",_,_),o.call(p+"_mul1",c,r,f),o.call(p+"_mul1",d,i,h),o.call(n+"__mulBy024",a,f,h,_),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T))),o.if(o.i32_load8_s(o.getLocal("i"),M),[...o.call(p+"_mul1",c,r,f),...o.call(p+"_mul1",d,i,h),...o.call(n+"__mulBy024",a,f,h,_),...o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T)))]),o.br_if(1,o.i32_eqz(o.getLocal("i"))),o.setLocal("i",o.i32_sub(o.getLocal("i"),o.i32_const(1))),o.br(0)))),e.addCode(o.call(p+"_mul1",c,r,f),o.call(p+"_mul1",d,i,h),o.call(n+"__mulBy024",a,f,h,_),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T))),o.call(p+"_mul1",c,r,f),o.call(p+"_mul1",d,i,h),o.call(n+"__mulBy024",a,f,h,_),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T))))}();for(let e=0;e<10;e++)R(e),t.exportFunction(n+"__frobeniusMap"+e);!function(){const e=t.addFunction(n+"_finalExponentiationOld");e.addParam("x","i32"),e.addParam("r","i32");const o=t.alloc(tp.bigInt2BytesLE(552484233613224096312617126783173147097382103762957654188882734314196910839907541213974502761540629817009608548654680343627701153829446747810907373256841551006201639677726139946029199968412598804882391702273019083653272047566316584365559776493027495458238373902875937659943504873220554161550525926302303331747463515644711876653177129578303191095900909191624817826566688241804408081892785725967931714097716709526092261278071952560171111444072049229123565057483750161460024353346284167282452756217662335528813519139808291170539072125381230815729071544861602750936964829313608137325426383735122175229541155376346436093930287402089517426973178917569713384748081827255472576937471496195752727188261435633271238710131736096299798168852925540549342330775279877006784354801422249722573783561685179618816480037695005515426162362431072245638324744480n,352)),i=e.getCodeBuilder();e.addCode(i.call(U+"_exp",i.getLocal("x"),i.i32_const(o),i.i32_const(352),i.getLocal("r")))}(),function(){!function(){const e=t.addFunction(n+"__finalExponentiationFirstChunk");e.addParam("x","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("x"),r=i,c=o.i32_add(i,o.i32_const(6*a)),s=o.getLocal("r"),l=t.alloc(d),u=o.i32_const(l),f=u,g=o.i32_const(l+6*a),h=o.i32_const(t.alloc(d)),p=o.i32_const(t.alloc(d)),_=o.i32_const(t.alloc(d));e.addCode(o.call(j+"_copy",r,f),o.call(j+"_neg",c,g),o.call(U+"_inverse",i,h),o.call(U+"_mul",u,h,p),o.call(n+"__frobeniusMap2",p,_),o.call(U+"_mul",p,_,s))}(),q();const e=t.addFunction(n+"_finalExponentiation");e.addParam("x","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("x"),r=o.getLocal("r"),c=o.i32_const(t.alloc(d));e.addCode(o.call(n+"__finalExponentiationFirstChunk",i,c),o.call(n+"__finalExponentiationLastChunk",c,r))}();for(let e=1;e<=5;e++)V(e),t.exportFunction(n+"_pairingEq"+e);!function(){const e=t.addFunction(n+"_pairing");e.addParam("p","i32"),e.addParam("q","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.i32_const(t.alloc(d));e.addCode(o.call(n+"_prepareG1",o.getLocal("p"),o.i32_const(G))),e.addCode(o.call(n+"_prepareG2",o.getLocal("q"),o.i32_const(K))),e.addCode(o.call(n+"_millerLoop",o.i32_const(G),o.i32_const(K),i)),e.addCode(o.call(n+"_finalExponentiation",i,o.getLocal("r")))}(),t.exportFunction(n+"_pairing"),t.exportFunction(n+"_prepareG1"),t.exportFunction(n+"_prepareG2"),t.exportFunction(n+"_millerLoop"),t.exportFunction(n+"_finalExponentiation"),t.exportFunction(n+"_finalExponentiationOld"),t.exportFunction(n+"__mulBy024"),t.exportFunction(n+"__mulBy024Old"),t.exportFunction(n+"__cyclotomicSquare"),t.exportFunction(n+"__cyclotomicExp_w0")},Bp=function(t,e){const n=e||"bls12381";if(t.modules[n])return n;const o=0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn,i=0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001n,r=Math.floor((Cp(o-1n)-1)/64)+1,a=8*r,c=a,s=2*c,l=12*c,d=Math.floor((Cp(i-1n)-1)/64)+1,u=8*d,f=u,g=t.alloc(hp.bigInt2BytesLE(i,f)),h=pp(t,o,"f1m","intq");_p(t,i,"fr","frm","intr");const p=t.alloc(hp.bigInt2BytesLE(A(4n),c)),_=Lp(t,"g1m","f1m",p);bp(t,"frm","frm","frm","frm_mul"),Ap(t,"pol","frm"),wp(t,"qap","frm");const m=mp(t,"f1m_neg","f2m","f1m"),y=t.alloc([...hp.bigInt2BytesLE(A(4n),c),...hp.bigInt2BytesLE(A(4n),c)]),L=Lp(t,"g2m","f2m",y);function b(e,n){const o=t.addFunction(e);o.addParam("pG","i32"),o.addParam("pFr","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),r=i.i32_const(t.alloc(u));o.addCode(i.call("frm_fromMontgomery",i.getLocal("pFr"),r),i.call(n,i.getLocal("pG"),r,i.i32_const(u),i.getLocal("pr"))),t.exportFunction(e)}function A(t){return BigInt(t)*(1n<<BigInt(8*c))%o}b("g1m_timesFr","g1m_timesScalar"),bp(t,"g1m","g1m","frm","g1m_timesFr"),b("g2m_timesFr","g2m_timesScalar"),bp(t,"g2m","g2m","frm","g2m_timesFr"),b("g1m_timesFrAffine","g1m_timesScalarAffine"),b("g2m_timesFrAffine","g2m_timesScalarAffine"),Ip(t,"frm_batchApplyKey","fmr","frm",u,u,u,"frm_mul"),Ip(t,"g1m_batchApplyKey","g1m","frm",3*a,3*a,u,"g1m_timesFr"),Ip(t,"g1m_batchApplyKeyMixed","g1m","frm",2*a,3*a,u,"g1m_timesFrAffine"),Ip(t,"g2m_batchApplyKey","g2m","frm",2*a*3,3*a*2,u,"g2m_timesFr"),Ip(t,"g2m_batchApplyKeyMixed","g2m","frm",2*a*2,3*a*2,u,"g2m_timesFrAffine");const w=[3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507n,1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569n,1n],I=t.alloc([...hp.bigInt2BytesLE(A(w[0]),c),...hp.bigInt2BytesLE(A(w[1]),c),...hp.bigInt2BytesLE(A(w[2]),c)]),C=[0n,1n,0n],x=t.alloc([...hp.bigInt2BytesLE(A(C[0]),c),...hp.bigInt2BytesLE(A(C[1]),c),...hp.bigInt2BytesLE(A(C[2]),c)]),v=[[352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160n,3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758n],[1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905n,927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582n],[1n,0n]],E=t.alloc([...hp.bigInt2BytesLE(A(v[0][0]),c),...hp.bigInt2BytesLE(A(v[0][1]),c),...hp.bigInt2BytesLE(A(v[1][0]),c),...hp.bigInt2BytesLE(A(v[1][1]),c),...hp.bigInt2BytesLE(A(v[2][0]),c),...hp.bigInt2BytesLE(A(v[2][1]),c)]),B=[[0n,0n],[1n,0n],[0n,0n]],F=t.alloc([...hp.bigInt2BytesLE(A(B[0][0]),c),...hp.bigInt2BytesLE(A(B[0][1]),c),...hp.bigInt2BytesLE(A(B[1][0]),c),...hp.bigInt2BytesLE(A(B[1][1]),c),...hp.bigInt2BytesLE(A(B[2][0]),c),...hp.bigInt2BytesLE(A(B[2][1]),c)]),O=t.alloc([...hp.bigInt2BytesLE(A(1n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c)]),S=t.alloc([...hp.bigInt2BytesLE(A(1n),c),...hp.bigInt2BytesLE(A(1n),c)]);!function(){const e=t.addFunction(m+"_mulNR");e.addParam("x","i32"),e.addParam("pr","i32");const n=e.getCodeBuilder(),o=n.i32_const(t.alloc(c)),i=n.getLocal("x"),r=n.i32_add(n.getLocal("x"),n.i32_const(c)),a=n.getLocal("pr"),s=n.i32_add(n.getLocal("pr"),n.i32_const(c));e.addCode(n.call(h+"_copy",i,o),n.call(h+"_sub",i,r,a),n.call(h+"_add",o,r,s))}();const P=yp(t,m+"_mulNR","f6m","f2m");!function(){const e=t.addFunction(P+"_mulNR");e.addParam("x","i32"),e.addParam("pr","i32");const n=e.getCodeBuilder(),o=n.i32_const(t.alloc(2*c));e.addCode(n.call(m+"_copy",n.getLocal("x"),o),n.call(m+"_mulNR",n.i32_add(n.getLocal("x"),n.i32_const(4*a)),n.getLocal("pr")),n.call(m+"_copy",n.i32_add(n.getLocal("x"),n.i32_const(2*a)),n.i32_add(n.getLocal("pr"),n.i32_const(4*a))),n.call(m+"_copy",o,n.i32_add(n.getLocal("pr"),n.i32_const(2*a))))}();const j=mp(t,P+"_mulNR","ftm",P),U=function(){let t=0xd201000000010000n;const e=[];for(;t>0n;)xp(t)?e.push(1):e.push(0),t>>=1n;return e}(),k=t.alloc(U),M=3*s,T=U.length-1,z=U.reduce(((t,e)=>t+(0!=e?1:0)),0),Q=6*a,N=3*a*2+(z+T+1)*M,D=15132376222941642752n;function R(e){const n=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n,151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n],[2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n,1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n,877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n,3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n,2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n,3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n]]],i=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[0n,4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[0n,1n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[0n,793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n]],[[1n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n]]],r=t.addFunction(j+"_frobeniusMap"+e);r.addParam("x","i32"),r.addParam("r","i32");const l=r.getCodeBuilder();for(let o=0;o<6;o++){const u=0==o?l.getLocal("x"):l.i32_add(l.getLocal("x"),l.i32_const(o*s)),f=u,g=l.i32_add(l.getLocal("x"),l.i32_const(o*s+c)),p=0==o?l.getLocal("r"):l.i32_add(l.getLocal("r"),l.i32_const(o*s)),_=p,y=l.i32_add(l.getLocal("r"),l.i32_const(o*s+c)),L=d(n[Math.floor(o/3)][e%12],i[o%3][e%6]),b=t.alloc([...hp.bigInt2BytesLE(A(L[0]),a),...hp.bigInt2BytesLE(A(L[1]),a)]);e%2==1?r.addCode(l.call(h+"_copy",f,_),l.call(h+"_neg",g,y),l.call(m+"_mul",p,l.i32_const(b),p)):r.addCode(l.call(m+"_mul",u,l.i32_const(b),p))}function d(t,e){const n=t[0],i=t[1],r=e[0],a=e[1],c=[(n*r-i*a)%o,(n*a+i*r)%o];return vp(c[0])&&(c[0]=c[0]+o),c}}t.modules[n]={n64q:r,n64r:d,n8q:a,n8r:u,pG1gen:I,pG1zero:x,pG1b:p,pG2gen:E,pG2zero:F,pG2b:y,pq:t.modules.f1m.pq,pr:g,pOneT:O,r:i,q:o,prePSize:Q,preQSize:N},function(){const e=t.addFunction(P+"_mul1");e.addParam("pA","i32"),e.addParam("pC1","i32"),e.addParam("pR","i32");const n=e.getCodeBuilder(),o=n.getLocal("pA"),i=n.i32_add(n.getLocal("pA"),n.i32_const(2*c)),r=n.i32_add(n.getLocal("pA"),n.i32_const(4*c)),a=n.getLocal("pC1"),s=n.getLocal("pR"),l=n.i32_add(n.getLocal("pR"),n.i32_const(2*c)),d=n.i32_add(n.getLocal("pR"),n.i32_const(4*c)),u=n.i32_const(t.alloc(2*c)),f=n.i32_const(t.alloc(2*c));e.addCode(n.call(m+"_add",o,i,u),n.call(m+"_add",i,r,f),n.call(m+"_mul",i,a,d),n.call(m+"_mul",f,a,s),n.call(m+"_sub",s,d,s),n.call(m+"_mulNR",s,s),n.call(m+"_mul",u,a,l),n.call(m+"_sub",l,d,l))}(),function(){const e=t.addFunction(P+"_mul01");e.addParam("pA","i32"),e.addParam("pC0","i32"),e.addParam("pC1","i32"),e.addParam("pR","i32");const n=e.getCodeBuilder(),o=n.getLocal("pA"),i=n.i32_add(n.getLocal("pA"),n.i32_const(2*c)),r=n.i32_add(n.getLocal("pA"),n.i32_const(4*c)),a=n.getLocal("pC0"),s=n.getLocal("pC1"),l=n.getLocal("pR"),d=n.i32_add(n.getLocal("pR"),n.i32_const(2*c)),u=n.i32_add(n.getLocal("pR"),n.i32_const(4*c)),f=n.i32_const(t.alloc(2*c)),g=n.i32_const(t.alloc(2*c)),h=n.i32_const(t.alloc(2*c)),p=n.i32_const(t.alloc(2*c));e.addCode(n.call(m+"_mul",o,a,f),n.call(m+"_mul",i,s,g),n.call(m+"_add",o,i,h),n.call(m+"_add",o,r,p),n.call(m+"_add",i,r,l),n.call(m+"_mul",l,s,l),n.call(m+"_sub",l,g,l),n.call(m+"_mulNR",l,l),n.call(m+"_add",l,f,l),n.call(m+"_add",a,s,d),n.call(m+"_mul",d,h,d),n.call(m+"_sub",d,f,d),n.call(m+"_sub",d,g,d),n.call(m+"_mul",p,a,u),n.call(m+"_sub",u,f,u),n.call(m+"_add",u,g,u))}(),function(){const e=t.addFunction(j+"_mul014");e.addParam("pA","i32"),e.addParam("pC0","i32"),e.addParam("pC1","i32"),e.addParam("pC4","i32"),e.addParam("pR","i32");const n=e.getCodeBuilder(),o=n.getLocal("pA"),i=n.i32_add(n.getLocal("pA"),n.i32_const(6*c)),r=n.getLocal("pC0"),a=n.getLocal("pC1"),s=n.getLocal("pC4"),l=n.i32_const(t.alloc(6*c)),d=n.i32_const(t.alloc(6*c)),u=n.i32_const(t.alloc(2*c)),f=n.getLocal("pR"),g=n.i32_add(n.getLocal("pR"),n.i32_const(6*c));e.addCode(n.call(P+"_mul01",o,r,a,l),n.call(P+"_mul1",i,s,d),n.call(m+"_add",a,s,u),n.call(P+"_add",i,o,g),n.call(P+"_mul01",g,r,u,g),n.call(P+"_sub",g,l,g),n.call(P+"_sub",g,d,g),n.call(P+"_copy",d,f),n.call(P+"_mulNR",f,f),n.call(P+"_add",f,l,f))}(),function(){const e=t.addFunction(n+"_ell");e.addParam("pP","i32"),e.addParam("pCoefs","i32"),e.addParam("pF","i32");const o=e.getCodeBuilder(),i=o.getLocal("pP"),r=o.i32_add(o.getLocal("pP"),o.i32_const(a)),s=o.getLocal("pF"),l=o.getLocal("pCoefs"),d=o.i32_add(o.getLocal("pCoefs"),o.i32_const(c)),u=o.i32_add(o.getLocal("pCoefs"),o.i32_const(2*c)),f=o.i32_add(o.getLocal("pCoefs"),o.i32_const(3*c)),g=o.i32_add(o.getLocal("pCoefs"),o.i32_const(4*c)),p=t.alloc(2*c),_=o.i32_const(p),m=o.i32_const(p),y=o.i32_const(p+c),L=t.alloc(2*c),b=o.i32_const(L),A=o.i32_const(L),w=o.i32_const(L+c);e.addCode(o.call(h+"_mul",l,r,m),o.call(h+"_mul",d,r,y),o.call(h+"_mul",u,i,A),o.call(h+"_mul",f,i,w),o.call(j+"_mul014",s,g,b,_,s))}();const q=t.alloc(Q),G=t.alloc(N);function K(e){const o=t.addFunction(n+"_pairingEq"+e);for(let t=0;t<e;t++)o.addParam("p_"+t,"i32"),o.addParam("q_"+t,"i32");o.addParam("c","i32"),o.setReturnType("i32");const i=o.getCodeBuilder(),r=i.i32_const(t.alloc(l)),a=i.i32_const(t.alloc(l));o.addCode(i.call(j+"_one",r));for(let t=0;t<e;t++)o.addCode(i.call(n+"_prepareG1",i.getLocal("p_"+t),i.i32_const(q))),o.addCode(i.call(n+"_prepareG2",i.getLocal("q_"+t),i.i32_const(G))),o.addCode(i.if(i.i32_eqz(i.call(_+"_inGroupAffine",i.i32_const(q))),i.ret(i.i32_const(0))),i.if(i.i32_eqz(i.call(L+"_inGroupAffine",i.i32_const(G))),i.ret(i.i32_const(0)))),o.addCode(i.call(n+"_millerLoop",i.i32_const(q),i.i32_const(G),a)),o.addCode(i.call(j+"_mul",r,a,r));o.addCode(i.call(n+"_finalExponentiation",r,r)),o.addCode(i.call(j+"_eq",r,i.getLocal("c")))}for(let e=0;e<10;e++)R(e),t.exportFunction(j+"_frobeniusMap"+e);!function(){const e=t.addFunction(_+"_inGroupAffine");e.addParam("p","i32"),e.setReturnType("i32");const n=e.getCodeBuilder(),o=(D*D-1n)/3n,i=n.i32_const(t.alloc(hp.bigInt2BytesLE(A(4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n),a))),r=n.i32_const(t.alloc(hp.bigInt2BytesLE(A(793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n),a))),s=n.i32_const(t.alloc(hp.bigInt2BytesLE(o,16))),l=n.getLocal("p"),d=n.i32_add(n.getLocal("p"),n.i32_const(c)),u=t.alloc(3*c),f=n.i32_const(u),g=n.i32_const(u),p=n.i32_const(u+c),m=t.alloc(2*c),y=n.i32_const(m),L=n.i32_const(m),b=n.i32_const(m+c);e.addCode(n.if(n.call(_+"_isZeroAffine",n.getLocal("p")),n.ret(n.i32_const(1))),n.if(n.i32_eqz(n.call(_+"_inCurveAffine",n.getLocal("p"))),n.ret(n.i32_const(0))),n.call(h+"_mul",l,i,g),n.call(h+"_copy",d,p),n.call(h+"_mul",l,r,L),n.call(h+"_copy",d,b),n.call(_+"_doubleAffine",f,f),n.call(_+"_subMixed",f,n.getLocal("p"),f),n.call(_+"_subMixed",f,y,f),n.call(_+"_timesScalar",f,s,n.i32_const(16),f),n.ret(n.call(_+"_eqMixed",f,y)));const w=t.addFunction(_+"_inGroup");w.addParam("pIn","i32"),w.setReturnType("i32");const I=w.getCodeBuilder(),C=I.i32_const(t.alloc(2*c));w.addCode(I.call(_+"_toAffine",I.getLocal("pIn"),C),I.ret(I.call(_+"_inGroupAffine",C)))}(),function(){const e=t.addFunction(L+"_inGroupAffine");e.addParam("p","i32"),e.setReturnType("i32");const n=e.getCodeBuilder(),o=[2001204777610833696708894912867952078278441409969503942666029068062015825245418932221343814564507832018947136279894n,2001204777610833696708894912867952078278441409969503942666029068062015825245418932221343814564507832018947136279893n],i=[2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n,2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n],r=n.i32_const(t.alloc([...hp.bigInt2BytesLE(A(o[0]),a),...hp.bigInt2BytesLE(A(o[1]),a)])),l=n.i32_const(t.alloc(hp.bigInt2BytesLE(A(4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n),a))),d=n.i32_const(t.alloc([...hp.bigInt2BytesLE(A(i[0]),a),...hp.bigInt2BytesLE(A(i[1]),a)])),u=n.i32_const(t.alloc(hp.bigInt2BytesLE(D,8))),f=n.getLocal("p"),g=n.i32_add(n.getLocal("p"),n.i32_const(s)),p=n.i32_const(t.alloc(c)),_=n.i32_const(t.alloc(s)),y=n.i32_const(t.alloc(s)),b=t.alloc(2*s),w=n.i32_const(b),I=n.i32_const(b),C=n.i32_const(b),x=n.i32_const(b+c),v=n.i32_const(b+s),E=n.i32_const(b+s),B=n.i32_const(b+s+c),F=t.alloc(3*s),O=n.i32_const(F),S=n.i32_const(F),P=n.i32_const(F),j=n.i32_const(F+c),U=n.i32_const(F+s),k=n.i32_const(F+s),M=n.i32_const(F+s+c),T=n.i32_const(F+2*s);e.addCode(n.if(n.call(L+"_isZeroAffine",n.getLocal("p")),n.ret(n.i32_const(1))),n.if(n.i32_eqz(n.call(L+"_inCurveAffine",n.getLocal("p"))),n.ret(n.i32_const(0))),n.call(m+"_mul",f,r,_),n.call(m+"_mul",g,r,y),n.call(m+"_mul1",_,l,I),n.call(m+"_neg",y,v),n.call(m+"_neg",_,S),n.call(m+"_mul",y,d,U),n.call(h+"_sub",C,x,p),n.call(h+"_add",C,x,x),n.call(h+"_copy",p,C),n.call(h+"_sub",E,B,p),n.call(h+"_add",E,B,B),n.call(h+"_copy",p,E),n.call(h+"_add",P,j,p),n.call(h+"_sub",P,j,j),n.call(h+"_copy",p,P),n.call(h+"_sub",M,k,p),n.call(h+"_add",k,M,M),n.call(h+"_copy",p,k),n.call(m+"_one",T),n.call(L+"_timesScalar",O,u,n.i32_const(8),O),n.call(L+"_addMixed",O,w,O),n.ret(n.call(L+"_eqMixed",O,n.getLocal("p"))));const z=t.addFunction(L+"_inGroup");z.addParam("pIn","i32"),z.setReturnType("i32");const Q=z.getCodeBuilder(),N=Q.i32_const(t.alloc(2*s));z.addCode(Q.call(L+"_toAffine",Q.getLocal("pIn"),N),Q.ret(Q.call(L+"_inGroupAffine",N)))}(),function(){const e=t.addFunction(n+"_prepAddStep");e.addParam("R","i32"),e.addParam("Q","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("R"),r=o.i32_add(o.getLocal("R"),o.i32_const(2*a)),c=o.i32_add(o.getLocal("R"),o.i32_const(4*a)),l=o.getLocal("Q"),d=o.i32_add(o.getLocal("Q"),o.i32_const(2*a)),u=o.getLocal("r"),f=o.i32_add(o.getLocal("r"),o.i32_const(2*a)),g=o.i32_add(o.getLocal("r"),o.i32_const(4*a)),h=o.i32_const(t.alloc(s)),p=o.i32_const(t.alloc(s)),_=o.i32_const(t.alloc(s)),y=o.i32_const(t.alloc(s)),L=o.i32_const(t.alloc(s)),b=o.i32_const(t.alloc(s)),A=o.i32_const(t.alloc(s)),w=o.i32_const(t.alloc(s)),I=o.i32_const(t.alloc(s)),C=o.i32_const(t.alloc(s)),x=o.i32_const(t.alloc(s));e.addCode(o.call(m+"_square",c,h),o.call(m+"_square",d,p),o.call(m+"_mul",h,l,y),o.call(m+"_add",d,c,f),o.call(m+"_square",f,f),o.call(m+"_sub",f,p,f),o.call(m+"_sub",f,h,f),o.call(m+"_mul",f,h,f),o.call(m+"_sub",y,i,L),o.call(m+"_square",L,b),o.call(m+"_add",b,b,A),o.call(m+"_add",A,A,A),o.call(m+"_mul",A,L,w),o.call(m+"_sub",f,r,I),o.call(m+"_sub",I,r,I),o.call(m+"_mul",I,l,g),o.call(m+"_mul",A,i,C),o.call(m+"_square",I,i),o.call(m+"_sub",i,w,i),o.call(m+"_sub",i,C,i),o.call(m+"_sub",i,C,i),o.call(m+"_add",c,L,c),o.call(m+"_square",c,c),o.call(m+"_sub",c,h,c),o.call(m+"_sub",c,b,c),o.call(m+"_add",d,c,u),o.call(m+"_sub",C,i,x),o.call(m+"_mul",x,I,x),o.call(m+"_mul",r,w,y),o.call(m+"_add",y,y,y),o.call(m+"_sub",x,y,r),o.call(m+"_square",u,u),o.call(m+"_sub",u,p,u),o.call(m+"_square",c,_),o.call(m+"_sub",u,_,u),o.call(m+"_add",g,g,g),o.call(m+"_sub",g,u,g),o.call(m+"_add",c,c,u),o.call(m+"_neg",I,I),o.call(m+"_add",I,I,f))}(),function(){const e=t.addFunction(n+"_prepDblStep");e.addParam("R","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("R"),r=o.i32_add(o.getLocal("R"),o.i32_const(2*a)),c=o.i32_add(o.getLocal("R"),o.i32_const(4*a)),l=o.getLocal("r"),d=o.i32_add(o.getLocal("r"),o.i32_const(2*a)),u=o.i32_add(o.getLocal("r"),o.i32_const(4*a)),f=o.i32_const(t.alloc(s)),g=o.i32_const(t.alloc(s)),h=o.i32_const(t.alloc(s)),p=o.i32_const(t.alloc(s)),_=o.i32_const(t.alloc(s));e.addCode(o.call(m+"_square",i,l),o.call(m+"_square",r,g),o.call(m+"_square",g,h),o.call(m+"_add",g,i,d),o.call(m+"_square",d,d),o.call(m+"_sub",d,l,d),o.call(m+"_sub",d,h,d),o.call(m+"_add",d,d,d),o.call(m+"_add",l,l,p),o.call(m+"_add",p,l,p),o.call(m+"_add",i,p,u),o.call(m+"_square",p,_),o.call(m+"_square",c,f),o.call(m+"_sub",_,d,i),o.call(m+"_sub",i,d,i),o.call(m+"_add",c,r,c),o.call(m+"_square",c,c),o.call(m+"_sub",c,g,c),o.call(m+"_sub",c,f,c),o.call(m+"_sub",d,i,r),o.call(m+"_mul",r,p,r),o.call(m+"_add",h,h,h),o.call(m+"_add",h,h,h),o.call(m+"_add",h,h,h),o.call(m+"_sub",r,h,r),o.call(m+"_mul",p,f,d),o.call(m+"_add",d,d,d),o.call(m+"_neg",d,d),o.call(m+"_square",u,u),o.call(m+"_sub",u,l,u),o.call(m+"_sub",u,_,u),o.call(m+"_add",g,g,g),o.call(m+"_add",g,g,g),o.call(m+"_sub",u,g,u),o.call(m+"_mul",c,f,l),o.call(m+"_add",l,l,l))}(),function(){const e=t.addFunction(n+"_prepareG1");e.addParam("pP","i32"),e.addParam("ppreP","i32");const o=e.getCodeBuilder();e.addCode(o.call(_+"_normalize",o.getLocal("pP"),o.getLocal("ppreP")))}(),function(){const e=t.addFunction(n+"_prepareG2");e.addParam("pQ","i32"),e.addParam("ppreQ","i32"),e.addLocal("pCoef","i32"),e.addLocal("i","i32");const o=e.getCodeBuilder(),i=o.getLocal("pQ"),r=t.alloc(3*s),a=o.i32_const(r),c=o.getLocal("ppreQ");e.addCode(o.call(L+"_normalize",i,c),o.if(o.call(L+"_isZero",c),o.ret([])),o.call(L+"_copy",c,a),o.setLocal("pCoef",o.i32_add(o.getLocal("ppreQ"),o.i32_const(3*s)))),e.addCode(o.setLocal("i",o.i32_const(U.length-2)),o.block(o.loop(o.call(n+"_prepDblStep",a,o.getLocal("pCoef")),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(M))),o.if(o.i32_load8_s(o.getLocal("i"),k),[...o.call(n+"_prepAddStep",a,c,o.getLocal("pCoef")),...o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(M)))]),o.br_if(1,o.i32_eqz(o.getLocal("i"))),o.setLocal("i",o.i32_sub(o.getLocal("i"),o.i32_const(1))),o.br(0))))}(),function(){const e=t.addFunction(n+"_millerLoop");e.addParam("ppreP","i32"),e.addParam("ppreQ","i32"),e.addParam("r","i32"),e.addLocal("pCoef","i32"),e.addLocal("i","i32");const o=e.getCodeBuilder(),i=o.getLocal("ppreP"),r=o.getLocal("pCoef"),a=o.getLocal("r");e.addCode(o.call(j+"_one",a),o.if(o.call(_+"_isZero",i),o.ret([])),o.if(o.call(_+"_isZero",o.getLocal("ppreQ")),o.ret([])),o.setLocal("pCoef",o.i32_add(o.getLocal("ppreQ"),o.i32_const(3*s))),o.setLocal("i",o.i32_const(U.length-2)),o.block(o.loop(o.call(n+"_ell",i,r,a),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(M))),o.if(o.i32_load8_s(o.getLocal("i"),k),[...o.call(n+"_ell",i,r,a),...o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(M)))]),o.call(j+"_square",a,a),o.br_if(1,o.i32_eq(o.getLocal("i"),o.i32_const(1))),o.setLocal("i",o.i32_sub(o.getLocal("i"),o.i32_const(1))),o.br(0))),o.call(n+"_ell",i,r,a)),e.addCode(o.call(j+"_conjugate",a,a))}(),function(){const e=t.addFunction(n+"_finalExponentiationOld");e.addParam("x","i32"),e.addParam("r","i32");const o=t.alloc(hp.bigInt2BytesLE(322277361516934140462891564586510139908379969514828494218366688025288661041104682794998680497580008899973249814104447692778988208376779573819485263026159588510513834876303014016798809919343532899164848730280942609956670917565618115867287399623286813270357901731510188149934363360381614501334086825442271920079363289954510565375378443704372994881406797882676971082200626541916413184642520269678897559532260949334760604962086348898118982248842634379637598665468817769075878555493752214492790122785850202957575200176084204422751485957336465472324810982833638490904279282696134323072515220044451592646885410572234451732790590013479358343841220074174848221722017083597872017638514103174122784843925578370430843522959600095676285723737049438346544753168912974976791528535276317256904336520179281145394686565050419250614107803233314658825463117900250701199181529205942363159325765991819433914303908860460720581408201373164047773794825411011922305820065611121544561808414055302212057471395719432072209245600258134364584636810093520285711072578721435517884103526483832733289802426157301542744476740008494780363354305116978805620671467071400711358839553375340724899735460480144599782014906586543813292157922220645089192130209334926661588737007768565838519456601560804957985667880395221049249803753582637708560n,544)),i=e.getCodeBuilder();e.addCode(i.call(j+"_exp",i.getLocal("x"),i.i32_const(o),i.i32_const(544),i.getLocal("r")))}(),function(){!function(){const e=t.addFunction(n+"__cyclotomicSquare");e.addParam("x","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("x"),r=o.i32_add(o.getLocal("x"),o.i32_const(s)),a=o.i32_add(o.getLocal("x"),o.i32_const(2*s)),c=o.i32_add(o.getLocal("x"),o.i32_const(3*s)),l=o.i32_add(o.getLocal("x"),o.i32_const(4*s)),d=o.i32_add(o.getLocal("x"),o.i32_const(5*s)),u=o.getLocal("r"),f=o.i32_add(o.getLocal("r"),o.i32_const(s)),g=o.i32_add(o.getLocal("r"),o.i32_const(2*s)),h=o.i32_add(o.getLocal("r"),o.i32_const(3*s)),p=o.i32_add(o.getLocal("r"),o.i32_const(4*s)),_=o.i32_add(o.getLocal("r"),o.i32_const(5*s)),y=o.i32_const(t.alloc(s)),L=o.i32_const(t.alloc(s)),b=o.i32_const(t.alloc(s)),A=o.i32_const(t.alloc(s)),w=o.i32_const(t.alloc(s)),I=o.i32_const(t.alloc(s)),C=o.i32_const(t.alloc(s)),x=o.i32_const(t.alloc(s));e.addCode(o.call(m+"_mul",i,l,C),o.call(m+"_mulNR",l,y),o.call(m+"_add",i,y,y),o.call(m+"_add",i,l,x),o.call(m+"_mul",x,y,y),o.call(m+"_mulNR",C,x),o.call(m+"_add",C,x,x),o.call(m+"_sub",y,x,y),o.call(m+"_add",C,C,L),o.call(m+"_mul",c,a,C),o.call(m+"_mulNR",a,b),o.call(m+"_add",c,b,b),o.call(m+"_add",c,a,x),o.call(m+"_mul",x,b,b),o.call(m+"_mulNR",C,x),o.call(m+"_add",C,x,x),o.call(m+"_sub",b,x,b),o.call(m+"_add",C,C,A),o.call(m+"_mul",r,d,C),o.call(m+"_mulNR",d,w),o.call(m+"_add",r,w,w),o.call(m+"_add",r,d,x),o.call(m+"_mul",x,w,w),o.call(m+"_mulNR",C,x),o.call(m+"_add",C,x,x),o.call(m+"_sub",w,x,w),o.call(m+"_add",C,C,I),o.call(m+"_sub",y,i,u),o.call(m+"_add",u,u,u),o.call(m+"_add",y,u,u),o.call(m+"_add",L,l,p),o.call(m+"_add",p,p,p),o.call(m+"_add",L,p,p),o.call(m+"_mul",I,o.i32_const(S),x),o.call(m+"_add",x,c,h),o.call(m+"_add",h,h,h),o.call(m+"_add",x,h,h),o.call(m+"_sub",w,a,g),o.call(m+"_add",g,g,g),o.call(m+"_add",w,g,g),o.call(m+"_sub",b,r,f),o.call(m+"_add",f,f,f),o.call(m+"_add",b,f,f),o.call(m+"_add",A,d,_),o.call(m+"_add",_,_,_),o.call(m+"_add",A,_,_))}(),function(e,o,i){const r=function(t){let e=t;const n=[];for(;e>0n;){if(xp(e)){const t=2-Number(e%4n);n.push(t),e-=BigInt(t)}else n.push(0);e>>=1n}return n}(e).map((t=>-1==t?255:t)),a=t.alloc(r),c=t.addFunction(n+"__cyclotomicExp_"+i);c.addParam("x","i32"),c.addParam("r","i32"),c.addLocal("bit","i32"),c.addLocal("i","i32");const s=c.getCodeBuilder(),d=s.getLocal("x"),u=s.getLocal("r"),f=s.i32_const(t.alloc(l));c.addCode(s.call(j+"_conjugate",d,f),s.call(j+"_one",u),s.if(s.teeLocal("bit",s.i32_load8_s(s.i32_const(r.length-1),a)),s.if(s.i32_eq(s.getLocal("bit"),s.i32_const(1)),s.call(j+"_mul",u,d,u),s.call(j+"_mul",u,f,u))),s.setLocal("i",s.i32_const(r.length-2)),s.block(s.loop(s.call(n+"__cyclotomicSquare",u,u),s.if(s.teeLocal("bit",s.i32_load8_s(s.getLocal("i"),a)),s.if(s.i32_eq(s.getLocal("bit"),s.i32_const(1)),s.call(j+"_mul",u,d,u),s.call(j+"_mul",u,f,u))),s.br_if(1,s.i32_eqz(s.getLocal("i"))),s.setLocal("i",s.i32_sub(s.getLocal("i"),s.i32_const(1))),s.br(0)))),o&&c.addCode(s.call(j+"_conjugate",u,u))}(D,!0,"w0");const e=t.addFunction(n+"_finalExponentiation");e.addParam("x","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("x"),r=o.getLocal("r"),a=o.i32_const(t.alloc(l)),c=o.i32_const(t.alloc(l)),d=o.i32_const(t.alloc(l)),u=o.i32_const(t.alloc(l)),f=o.i32_const(t.alloc(l)),g=o.i32_const(t.alloc(l)),h=o.i32_const(t.alloc(l));e.addCode(o.call(j+"_frobeniusMap6",i,a),o.call(j+"_inverse",i,c),o.call(j+"_mul",a,c,d),o.call(j+"_copy",d,c),o.call(j+"_frobeniusMap2",d,d),o.call(j+"_mul",d,c,d),o.call(n+"__cyclotomicSquare",d,c),o.call(j+"_conjugate",c,c),o.call(n+"__cyclotomicExp_w0",d,u),o.call(n+"__cyclotomicSquare",u,f),o.call(j+"_mul",c,u,g),o.call(n+"__cyclotomicExp_w0",g,c),o.call(n+"__cyclotomicExp_w0",c,a),o.call(n+"__cyclotomicExp_w0",a,h),o.call(j+"_mul",h,f,h),o.call(n+"__cyclotomicExp_w0",h,f),o.call(j+"_conjugate",g,g),o.call(j+"_mul",f,g,f),o.call(j+"_mul",f,d,f),o.call(j+"_conjugate",d,g),o.call(j+"_mul",c,d,c),o.call(j+"_frobeniusMap3",c,c),o.call(j+"_mul",h,g,h),o.call(j+"_frobeniusMap1",h,h),o.call(j+"_mul",u,a,u),o.call(j+"_frobeniusMap2",u,u),o.call(j+"_mul",u,c,u),o.call(j+"_mul",u,h,u),o.call(j+"_mul",u,f,r))}();for(let e=1;e<=5;e++)K(e),t.exportFunction(n+"_pairingEq"+e);!function(){const e=t.addFunction(n+"_pairing");e.addParam("p","i32"),e.addParam("q","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.i32_const(t.alloc(l));e.addCode(o.call(n+"_prepareG1",o.getLocal("p"),o.i32_const(q))),e.addCode(o.call(n+"_prepareG2",o.getLocal("q"),o.i32_const(G))),e.addCode(o.call(n+"_millerLoop",o.i32_const(q),o.i32_const(G),i)),e.addCode(o.call(n+"_finalExponentiation",i,o.getLocal("r")))}(),t.exportFunction(n+"_pairing"),t.exportFunction(n+"_prepareG1"),t.exportFunction(n+"_prepareG2"),t.exportFunction(n+"_millerLoop"),t.exportFunction(n+"_finalExponentiation"),t.exportFunction(n+"_finalExponentiationOld"),t.exportFunction(n+"__cyclotomicSquare"),t.exportFunction(n+"__cyclotomicExp_w0"),t.exportFunction(P+"_mul1"),t.exportFunction(P+"_mul01"),t.exportFunction(j+"_mul014"),t.exportFunction(_+"_inGroupAffine"),t.exportFunction(_+"_inGroup"),t.exportFunction(L+"_inGroupAffine"),t.exportFunction(L+"_inGroup")};function Fp(t,e){let n=t;void 0===e&&0==(e=Math.floor((hg(t)-1)/8)+1)&&(e=1);const o=new Uint8Array(e),i=new DataView(o.buffer);let r=0;for(;r<e;)r+4<=e?(i.setUint32(r,Number(n&BigInt(4294967295)),!0),r+=4,n>>=BigInt(32)):r+2<=e?(i.setUint16(r,Number(n&BigInt(65535)),!0),r+=2,n>>=BigInt(16)):(i.setUint8(r,Number(n&BigInt(255)),!0),r+=1,n>>=BigInt(8));if(n)throw new Error("Number does not fit in this length");return o}const Op=[];for(let t=0;t<256;t++)Op[t]=Sp(t,8);function Sp(t,e){let n=0,o=t;for(let t=0;t<e;t++)n<<=1,n|=1&o,o>>=1;return n}function Pp(t,e){return(Op[t>>>24]|Op[t>>>16&255]<<8|Op[t>>>8&255]<<16|Op[255&t]<<24)>>>32-e}function jp(t){return(4294901760&t?(t&=4294901760,16):0)|(4278255360&t?(t&=4278255360,8):0)|(4042322160&t?(t&=4042322160,4):0)|(3435973836&t?(t&=3435973836,2):0)|!!(2863311530&t)}function Up(t,e){const n=t.byteLength/e,o=jp(n);if(n!=1<<o)throw new Error("Invalid number of pointers");for(let i=0;i<n;i++){const n=Pp(i,o);if(i>n){const o=t.slice(i*e,(i+1)*e);t.set(t.slice(n*e,(n+1)*e),i*e),t.set(o,n*e)}}}function kp(t,e){const n=new Uint8Array(e*t.length);for(let o=0;o<t.length;o++)n.set(t[o],o*e);return n}function Mp(t,e){const n=t.byteLength/e,o=new Array(n);for(let i=0;i<n;i++)o[i]=t.slice(i*e,i*e+e);return o}var Tp=Object.freeze({__proto__:null,array2buffer:kp,beBuff2int:function(t){let e=BigInt(0),n=t.length,o=0;const i=new DataView(t.buffer,t.byteOffset,t.byteLength);for(;n>0;)n>=4?(n-=4,e+=BigInt(i.getUint32(n))<<BigInt(8*o),o+=4):n>=2?(n-=2,e+=BigInt(i.getUint16(n))<<BigInt(8*o),o+=2):(n-=1,e+=BigInt(i.getUint8(n))<<BigInt(8*o),o+=1);return e},beInt2Buff:function(t,e){let n=t;const o=new Uint8Array(e),i=new DataView(o.buffer);let r=e;for(;r>0;)r-4>=0?(r-=4,i.setUint32(r,Number(n&BigInt(4294967295))),n>>=BigInt(32)):r-2>=0?(r-=2,i.setUint16(r,Number(n&BigInt(65535))),n>>=BigInt(16)):(r-=1,i.setUint8(r,Number(n&BigInt(255))),n>>=BigInt(8));if(n)throw new Error("Number does not fit in this length");return o},bitReverse:Pp,buffReverseBits:Up,buffer2array:Mp,leBuff2int:function(t){let e=BigInt(0),n=0;const o=new DataView(t.buffer,t.byteOffset,t.byteLength);for(;n<t.length;)n+4<=t.length?(e+=BigInt(o.getUint32(n,!0))<<BigInt(8*n),n+=4):n+2<=t.length?(e+=BigInt(o.getUint16(n,!0))<<BigInt(8*n),n+=2):(e+=BigInt(o.getUint8(n,!0))<<BigInt(8*n),n+=1);return e},leInt2Buff:Fp,log2:jp,stringifyBigInts:function t(e){if("bigint"==typeof e||void 0!==e.eq)return e.toString(10);if(e instanceof Uint8Array)return Tg(e,0);if(Array.isArray(e))return e.map(t);if("object"==typeof e){const n={};return Object.keys(e).forEach((o=>{n[o]=t(e[o])})),n}return e},stringifyFElements:function t(e,n){if("bigint"==typeof n||void 0!==n.eq)return n.toString(10);if(n instanceof Uint8Array)return e.toString(e.e(n));if(Array.isArray(n))return n.map(t.bind(this,e));if("object"==typeof n){const o={};return Object.keys(n).forEach((i=>{o[i]=t(e,n[i])})),o}return n},unstringifyBigInts:function t(e){if("string"==typeof e&&/^[0-9]+$/.test(e))return BigInt(e);if("string"==typeof e&&/^0x[0-9a-fA-F]+$/.test(e))return BigInt(e);if(Array.isArray(e))return e.map(t);if("object"==typeof e){if(null===e)return null;const n={};return Object.keys(e).forEach((o=>{n[o]=t(e[o])})),n}return e},unstringifyFElements:function t(e,n){if("string"==typeof n&&/^[0-9]+$/.test(n))return e.e(n);if("string"==typeof n&&/^0x[0-9a-fA-F]+$/.test(n))return e.e(n);if(Array.isArray(n))return n.map(t.bind(this,e));if("object"==typeof n){if(null===n)return null;const o={};return Object.keys(n).forEach((i=>{o[i]=t(e,n[i])})),o}return n}});const zp=1<<30;class Qp{constructor(t){this.buffers=[],this.byteLength=t;for(let e=0;e<t;e+=zp){const n=Math.min(t-e,zp);this.buffers.push(new Uint8Array(n))}}slice(t,e){void 0===e&&(e=this.byteLength),void 0===t&&(t=0);const n=e-t,o=Math.floor(t/zp);if(o==Math.floor((t+n-1)/zp)||0==n)return this.buffers[o].slice(t%zp,t%zp+n);let i,r=o,a=t%zp,c=n;for(;c>0;){const t=a+c>zp?zp-a:c,e=new Uint8Array(this.buffers[r].buffer,this.buffers[r].byteOffset+a,t);if(t==n)return e.slice();i||(i=n<=zp?new Uint8Array(n):new Qp(n)),i.set(e,n-c),c-=t,r++,a=0}return i}set(t,e){void 0===e&&(e=0);const n=t.byteLength;if(0==n)return;const o=Math.floor(e/zp);if(o==Math.floor((e+n-1)/zp))return t instanceof Qp&&1==t.buffers.length?this.buffers[o].set(t.buffers[0],e%zp):this.buffers[o].set(t,e%zp);let i=o,r=e%zp,a=n;for(;a>0;){const e=r+a>zp?zp-r:a,o=t.slice(n-a,n-a+e);new Uint8Array(this.buffers[i].buffer,this.buffers[i].byteOffset+r,e).set(o),a-=e,i++,r=0}}}function Np(t,e,n,o){return async function(i){const r=Math.floor(i.byteLength/n);if(r*n!==i.byteLength)throw new Error("Invalid buffer size");const a=Math.floor(r/t.concurrency),c=[];for(let s=0;s<t.concurrency;s++){let l;if(l=s<t.concurrency-1?a:r-s*a,0==l)continue;const d=[{cmd:"ALLOCSET",var:0,buff:i.slice(s*a*n,s*a*n+l*n)},{cmd:"ALLOC",var:1,len:o*l},{cmd:"CALL",fnName:e,params:[{var:0},{val:l},{var:1}]},{cmd:"GET",out:0,var:1,len:o*l}];c.push(t.queueAction(d))}const s=await Promise.all(c);let l;l=i instanceof Qp?new Qp(r*o):new Uint8Array(r*o);let d=0;for(let t=0;t<s.length;t++)l.set(s[t][0],d),d+=s[t][0].byteLength;return l}}class Dp{constructor(t,e,n,o){if(this.tm=t,this.prefix=e,this.p=o,this.n8=n,this.type="F1",this.m=1,this.half=yg(o,Rg),this.bitLength=hg(o),this.mask=xg(mg(Rg,this.bitLength),Rg),this.pOp1=t.alloc(n),this.pOp2=t.alloc(n),this.pOp3=t.alloc(n),this.tm.instance.exports[e+"_zero"](this.pOp1),this.zero=this.tm.getBuff(this.pOp1,this.n8),this.tm.instance.exports[e+"_one"](this.pOp1),this.one=this.tm.getBuff(this.pOp1,this.n8),this.negone=this.neg(this.one),this.two=this.add(this.one,this.one),this.n64=Math.floor(n/8),this.n32=Math.floor(n/4),8*this.n64!=this.n8)throw new Error("n8 must be a multiple of 8");this.half=yg(this.p,Rg),this.nqr=this.two;let i=this.exp(this.nqr,this.half);for(;!this.eq(i,this.negone);)this.nqr=this.add(this.nqr,this.one),i=this.exp(this.nqr,this.half);this.shift=this.mul(this.nqr,this.nqr),this.shiftInv=this.inv(this.shift),this.s=0;let r=xg(this.p,Rg);for(;!Ag(r);)this.s=this.s+1,r=yg(r,Rg);this.w=[],this.w[this.s]=this.exp(this.nqr,r);for(let t=this.s-1;t>=0;t--)this.w[t]=this.square(this.w[t+1]);if(!this.eq(this.w[0],this.one))throw new Error("Error calculating roots of unity");this.batchToMontgomery=Np(t,e+"_batchToMontgomery",this.n8,this.n8),this.batchFromMontgomery=Np(t,e+"_batchFromMontgomery",this.n8,this.n8)}op2(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op2Bool(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2)}op1(t,e){return this.tm.setBuff(this.pOp1,e),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op1Bool(t,e){return this.tm.setBuff(this.pOp1,e),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3)}add(t,e){return this.op2("_add",t,e)}eq(t,e){return this.op2Bool("_eq",t,e)}isZero(t){return this.op1Bool("_isZero",t)}sub(t,e){return this.op2("_sub",t,e)}neg(t){return this.op1("_neg",t)}inv(t){return this.op1("_inverse",t)}toMontgomery(t){return this.op1("_toMontgomery",t)}fromMontgomery(t){return this.op1("_fromMontgomery",t)}mul(t,e){return this.op2("_mul",t,e)}div(t,e){return this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[this.prefix+"_inverse"](this.pOp2,this.pOp2),this.tm.instance.exports[this.prefix+"_mul"](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}square(t){return this.op1("_square",t)}isSquare(t){return this.op1Bool("_isSquare",t)}sqrt(t){return this.op1("_sqrt",t)}exp(t,e){return e instanceof Uint8Array||(e=Ng(gg(e))),this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[this.prefix+"_exp"](this.pOp1,this.pOp2,e.byteLength,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}isNegative(t){return this.op1Bool("_isNegative",t)}e(t,e){if(t instanceof Uint8Array)return t;let n=gg(t,e);pg(n)?(n=vg(n),Pg(n,this.p)&&(n=Og(n,this.p)),n=xg(this.p,n)):Pg(n,this.p)&&(n=Og(n,this.p));const o=Fp(n,this.n8);return this.toMontgomery(o)}toString(t,e){return Qg(Tg(this.fromMontgomery(t),0),e)}fromRng(t){let e;const n=new Uint8Array(this.n8);do{e=Dg;for(let n=0;n<this.n64;n++)e=Cg(e,mg(t.nextU64(),64*n));e=Ug(e,this.mask)}while(jg(e,this.p));return kg(n,0,e,this.n8),n}random(){return this.fromRng(Xg())}toObject(t){return Tg(this.fromMontgomery(t),0)}fromObject(t){const e=new Uint8Array(this.n8);return kg(e,0,t,this.n8),this.toMontgomery(e)}toRprLE(t,e,n){t.set(this.fromMontgomery(n),e)}toRprBE(t,e,n){const o=this.fromMontgomery(n);for(let t=0;t<this.n8/2;t++){const e=o[t];o[t]=o[this.n8-1-t],o[this.n8-1-t]=e}t.set(o,e)}fromRprLE(t,e){e=e||0;const n=t.slice(e,e+this.n8);return this.toMontgomery(n)}async batchInverse(t){let e=!1;const n=this.n8,o=this.n8;Array.isArray(t)?(t=kp(t,n),e=!0):t=t.slice(0,t.byteLength);const i=Math.floor(t.byteLength/n);if(i*n!==t.byteLength)throw new Error("Invalid buffer size");const r=Math.floor(i/this.tm.concurrency),a=[];for(let e=0;e<this.tm.concurrency;e++){let c;if(c=e<this.tm.concurrency-1?r:i-e*r,0==c)continue;const s=[{cmd:"ALLOCSET",var:0,buff:t.slice(e*r*n,e*r*n+c*n)},{cmd:"ALLOC",var:1,len:o*c},{cmd:"CALL",fnName:this.prefix+"_batchInverse",params:[{var:0},{val:n},{val:c},{var:1},{val:o}]},{cmd:"GET",out:0,var:1,len:o*c}];a.push(this.tm.queueAction(s))}const c=await Promise.all(a);let s;s=t instanceof Qp?new Qp(i*o):new Uint8Array(i*o);let l=0;for(let t=0;t<c.length;t++)s.set(c[t][0],l),l+=c[t][0].byteLength;return e?Mp(s,o):s}}class Rp{constructor(t,e,n){this.tm=t,this.prefix=e,this.F=n,this.type="F2",this.m=2*n.m,this.n8=2*this.F.n8,this.n32=2*this.F.n32,this.n64=2*this.F.n64,this.pOp1=t.alloc(2*n.n8),this.pOp2=t.alloc(2*n.n8),this.pOp3=t.alloc(2*n.n8),this.tm.instance.exports[e+"_zero"](this.pOp1),this.zero=t.getBuff(this.pOp1,this.n8),this.tm.instance.exports[e+"_one"](this.pOp1),this.one=t.getBuff(this.pOp1,this.n8),this.negone=this.neg(this.one),this.two=this.add(this.one,this.one)}op2(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op2Bool(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2)}op1(t,e){return this.tm.setBuff(this.pOp1,e),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op1Bool(t,e){return this.tm.setBuff(this.pOp1,e),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3)}add(t,e){return this.op2("_add",t,e)}eq(t,e){return this.op2Bool("_eq",t,e)}isZero(t){return this.op1Bool("_isZero",t)}sub(t,e){return this.op2("_sub",t,e)}neg(t){return this.op1("_neg",t)}inv(t){return this.op1("_inverse",t)}isNegative(t){return this.op1Bool("_isNegative",t)}toMontgomery(t){return this.op1("_toMontgomery",t)}fromMontgomery(t){return this.op1("_fromMontgomery",t)}mul(t,e){return this.op2("_mul",t,e)}mul1(t,e){return this.op2("_mul1",t,e)}div(t,e){return this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[this.prefix+"_inverse"](this.pOp2,this.pOp2),this.tm.instance.exports[this.prefix+"_mul"](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}square(t){return this.op1("_square",t)}isSquare(t){return this.op1Bool("_isSquare",t)}sqrt(t){return this.op1("_sqrt",t)}exp(t,e){return e instanceof Uint8Array||(e=Ng(gg(e))),this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[this.prefix+"_exp"](this.pOp1,this.pOp2,e.byteLength,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}e(t,e){if(t instanceof Uint8Array)return t;if(Array.isArray(t)&&2==t.length){const n=this.F.e(t[0],e),o=this.F.e(t[1],e),i=new Uint8Array(2*this.F.n8);return i.set(n),i.set(o,2*this.F.n8),i}throw new Error("invalid F2")}toString(t,e){const n=this.F.toString(t.slice(0,this.F.n8),e),o=this.F.toString(t.slice(this.F.n8),e);return"[".concat(n,", ").concat(o,"]")}fromRng(t){const e=this.F.fromRng(t),n=this.F.fromRng(t),o=new Uint8Array(2*this.F.n8);return o.set(e),o.set(n,this.F.n8),o}random(){return this.fromRng(Xg())}toObject(t){return[this.F.toObject(t.slice(0,this.F.n8)),this.F.toObject(t.slice(this.F.n8,2*this.F.n8))]}fromObject(t){const e=new Uint8Array(2*this.F.n8),n=this.F.fromObject(t[0]),o=this.F.fromObject(t[1]);return e.set(n),e.set(o,this.F.n8),e}c1(t){return t.slice(0,this.F.n8)}c2(t){return t.slice(this.F.n8)}}class qp{constructor(t,e,n){this.tm=t,this.prefix=e,this.F=n,this.type="F3",this.m=3*n.m,this.n8=3*this.F.n8,this.n32=3*this.F.n32,this.n64=3*this.F.n64,this.pOp1=t.alloc(3*n.n8),this.pOp2=t.alloc(3*n.n8),this.pOp3=t.alloc(3*n.n8),this.tm.instance.exports[e+"_zero"](this.pOp1),this.zero=t.getBuff(this.pOp1,this.n8),this.tm.instance.exports[e+"_one"](this.pOp1),this.one=t.getBuff(this.pOp1,this.n8),this.negone=this.neg(this.one),this.two=this.add(this.one,this.one)}op2(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op2Bool(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2)}op1(t,e){return this.tm.setBuff(this.pOp1,e),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op1Bool(t,e){return this.tm.setBuff(this.pOp1,e),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3)}eq(t,e){return this.op2Bool("_eq",t,e)}isZero(t){return this.op1Bool("_isZero",t)}add(t,e){return this.op2("_add",t,e)}sub(t,e){return this.op2("_sub",t,e)}neg(t){return this.op1("_neg",t)}inv(t){return this.op1("_inverse",t)}isNegative(t){return this.op1Bool("_isNegative",t)}toMontgomery(t){return this.op1("_toMontgomery",t)}fromMontgomery(t){return this.op1("_fromMontgomery",t)}mul(t,e){return this.op2("_mul",t,e)}div(t,e){return this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[this.prefix+"_inverse"](this.pOp2,this.pOp2),this.tm.instance.exports[this.prefix+"_mul"](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}square(t){return this.op1("_square",t)}isSquare(t){return this.op1Bool("_isSquare",t)}sqrt(t){return this.op1("_sqrt",t)}exp(t,e){return e instanceof Uint8Array||(e=Ng(gg(e))),this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[this.prefix+"_exp"](this.pOp1,this.pOp2,e.byteLength,this.pOp3),this.getBuff(this.pOp3,this.n8)}e(t,e){if(t instanceof Uint8Array)return t;if(Array.isArray(t)&&3==t.length){const n=this.F.e(t[0],e),o=this.F.e(t[1],e),i=this.F.e(t[2],e),r=new Uint8Array(3*this.F.n8);return r.set(n),r.set(o,this.F.n8),r.set(i,2*this.F.n8),r}throw new Error("invalid F3")}toString(t,e){const n=this.F.toString(t.slice(0,this.F.n8),e),o=this.F.toString(t.slice(this.F.n8,2*this.F.n8),e),i=this.F.toString(t.slice(2*this.F.n8),e);return"[".concat(n,", ").concat(o,", ").concat(i,"]")}fromRng(t){const e=this.F.fromRng(t),n=this.F.fromRng(t),o=this.F.fromRng(t),i=new Uint8Array(3*this.F.n8);return i.set(e),i.set(n,this.F.n8),i.set(o,2*this.F.n8),i}random(){return this.fromRng(Xg())}toObject(t){return[this.F.toObject(t.slice(0,this.F.n8)),this.F.toObject(t.slice(this.F.n8,2*this.F.n8)),this.F.toObject(t.slice(2*this.F.n8,3*this.F.n8))]}fromObject(t){const e=new Uint8Array(3*this.F.n8),n=this.F.fromObject(t[0]),o=this.F.fromObject(t[1]),i=this.F.fromObject(t[2]);return e.set(n),e.set(o,this.F.n8),e.set(i,2*this.F.n8),e}c1(t){return t.slice(0,this.F.n8)}c2(t){return t.slice(this.F.n8,2*this.F.n8)}c3(t){return t.slice(2*this.F.n8)}}class Gp{constructor(t,e,n,o,i,r){this.tm=t,this.prefix=e,this.F=n,this.pOp1=t.alloc(3*n.n8),this.pOp2=t.alloc(3*n.n8),this.pOp3=t.alloc(3*n.n8),this.tm.instance.exports[e+"_zero"](this.pOp1),this.zero=this.tm.getBuff(this.pOp1,3*n.n8),this.tm.instance.exports[e+"_zeroAffine"](this.pOp1),this.zeroAffine=this.tm.getBuff(this.pOp1,2*n.n8),this.one=this.tm.getBuff(o,3*n.n8),this.g=this.one,this.oneAffine=this.tm.getBuff(o,2*n.n8),this.gAffine=this.oneAffine,this.b=this.tm.getBuff(i,n.n8),r&&(this.cofactor=Ng(r)),this.negone=this.neg(this.one),this.two=this.add(this.one,this.one),this.batchLEMtoC=Np(t,e+"_batchLEMtoC",2*n.n8,n.n8),this.batchLEMtoU=Np(t,e+"_batchLEMtoU",2*n.n8,2*n.n8),this.batchCtoLEM=Np(t,e+"_batchCtoLEM",n.n8,2*n.n8),this.batchUtoLEM=Np(t,e+"_batchUtoLEM",2*n.n8,2*n.n8),this.batchToJacobian=Np(t,e+"_batchToJacobian",2*n.n8,3*n.n8),this.batchToAffine=Np(t,e+"_batchToAffine",3*n.n8,2*n.n8)}op2(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,3*this.F.n8)}op2bool(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2,this.pOp3)}op1(t,e){return this.tm.setBuff(this.pOp1,e),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,3*this.F.n8)}op1Affine(t,e){return this.tm.setBuff(this.pOp1,e),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,2*this.F.n8)}op1Bool(t,e){return this.tm.setBuff(this.pOp1,e),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3)}add(t,e){if(t.byteLength==3*this.F.n8){if(e.byteLength==3*this.F.n8)return this.op2("_add",t,e);if(e.byteLength==2*this.F.n8)return this.op2("_addMixed",t,e);throw new Error("invalid point size")}if(t.byteLength==2*this.F.n8){if(e.byteLength==3*this.F.n8)return this.op2("_addMixed",e,t);if(e.byteLength==2*this.F.n8)return this.op2("_addAffine",t,e);throw new Error("invalid point size")}throw new Error("invalid point size")}sub(t,e){if(t.byteLength==3*this.F.n8){if(e.byteLength==3*this.F.n8)return this.op2("_sub",t,e);if(e.byteLength==2*this.F.n8)return this.op2("_subMixed",t,e);throw new Error("invalid point size")}if(t.byteLength==2*this.F.n8){if(e.byteLength==3*this.F.n8)return this.op2("_subMixed",e,t);if(e.byteLength==2*this.F.n8)return this.op2("_subAffine",t,e);throw new Error("invalid point size")}throw new Error("invalid point size")}neg(t){if(t.byteLength==3*this.F.n8)return this.op1("_neg",t);if(t.byteLength==2*this.F.n8)return this.op1Affine("_negAffine",t);throw new Error("invalid point size")}double(t){if(t.byteLength==3*this.F.n8)return this.op1("_double",t);if(t.byteLength==2*this.F.n8)return this.op1("_doubleAffine",t);throw new Error("invalid point size")}isZero(t){if(t.byteLength==3*this.F.n8)return this.op1Bool("_isZero",t);if(t.byteLength==2*this.F.n8)return this.op1Bool("_isZeroAffine",t);throw new Error("invalid point size")}timesScalar(t,e){let n;if(e instanceof Uint8Array||(e=Ng(gg(e))),t.byteLength==3*this.F.n8)n=this.prefix+"_timesScalar";else{if(t.byteLength!=2*this.F.n8)throw new Error("invalid point size");n=this.prefix+"_timesScalarAffine"}return this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[n](this.pOp1,this.pOp2,e.byteLength,this.pOp3),this.tm.getBuff(this.pOp3,3*this.F.n8)}timesFr(t,e){let n;if(t.byteLength==3*this.F.n8)n=this.prefix+"_timesFr";else{if(t.byteLength!=2*this.F.n8)throw new Error("invalid point size");n=this.prefix+"_timesFrAffine"}return this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[n](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,3*this.F.n8)}eq(t,e){if(t.byteLength==3*this.F.n8){if(e.byteLength==3*this.F.n8)return this.op2bool("_eq",t,e);if(e.byteLength==2*this.F.n8)return this.op2bool("_eqMixed",t,e);throw new Error("invalid point size")}if(t.byteLength==2*this.F.n8){if(e.byteLength==3*this.F.n8)return this.op2bool("_eqMixed",e,t);if(e.byteLength==2*this.F.n8)return this.op2bool("_eqAffine",t,e);throw new Error("invalid point size")}throw new Error("invalid point size")}toAffine(t){if(t.byteLength==3*this.F.n8)return this.op1Affine("_toAffine",t);if(t.byteLength==2*this.F.n8)return t;throw new Error("invalid point size")}toJacobian(t){if(t.byteLength==3*this.F.n8)return t;if(t.byteLength==2*this.F.n8)return this.op1("_toJacobian",t);throw new Error("invalid point size")}toRprUncompressed(t,e,n){if(this.tm.setBuff(this.pOp1,n),n.byteLength==3*this.F.n8)this.tm.instance.exports[this.prefix+"_toAffine"](this.pOp1,this.pOp1);else if(n.byteLength!=2*this.F.n8)throw new Error("invalid point size");this.tm.instance.exports[this.prefix+"_LEMtoU"](this.pOp1,this.pOp1);const o=this.tm.getBuff(this.pOp1,2*this.F.n8);t.set(o,e)}fromRprUncompressed(t,e){const n=t.slice(e,e+2*this.F.n8);return this.tm.setBuff(this.pOp1,n),this.tm.instance.exports[this.prefix+"_UtoLEM"](this.pOp1,this.pOp1),this.tm.getBuff(this.pOp1,2*this.F.n8)}toRprCompressed(t,e,n){if(this.tm.setBuff(this.pOp1,n),n.byteLength==3*this.F.n8)this.tm.instance.exports[this.prefix+"_toAffine"](this.pOp1,this.pOp1);else if(n.byteLength!=2*this.F.n8)throw new Error("invalid point size");this.tm.instance.exports[this.prefix+"_LEMtoC"](this.pOp1,this.pOp1);const o=this.tm.getBuff(this.pOp1,this.F.n8);t.set(o,e)}fromRprCompressed(t,e){const n=t.slice(e,e+this.F.n8);return this.tm.setBuff(this.pOp1,n),this.tm.instance.exports[this.prefix+"_CtoLEM"](this.pOp1,this.pOp2),this.tm.getBuff(this.pOp2,2*this.F.n8)}toUncompressed(t){const e=new Uint8Array(2*this.F.n8);return this.toRprUncompressed(e,0,t),e}toRprLEM(t,e,n){if(n.byteLength!=2*this.F.n8){if(n.byteLength!=3*this.F.n8)throw new Error("invalid point size");{this.tm.setBuff(this.pOp1,n),this.tm.instance.exports[this.prefix+"_toAffine"](this.pOp1,this.pOp1);const o=this.tm.getBuff(this.pOp1,2*this.F.n8);t.set(o,e)}}else t.set(n,e)}fromRprLEM(t,e){return e=e||0,t.slice(e,e+2*this.F.n8)}toString(t,e){if(t.byteLength==3*this.F.n8){const n=this.F.toString(t.slice(0,this.F.n8),e),o=this.F.toString(t.slice(this.F.n8,2*this.F.n8),e),i=this.F.toString(t.slice(2*this.F.n8),e);return"[ ".concat(n,", ").concat(o,", ").concat(i," ]")}if(t.byteLength==2*this.F.n8){const n=this.F.toString(t.slice(0,this.F.n8),e),o=this.F.toString(t.slice(this.F.n8),e);return"[ ".concat(n,", ").concat(o," ]")}throw new Error("invalid point size")}isValid(t){if(this.isZero(t))return!0;const e=this.F,n=this.toAffine(t),o=n.slice(0,this.F.n8),i=n.slice(this.F.n8,2*this.F.n8),r=e.add(e.mul(e.square(o),o),this.b),a=e.square(i);return e.eq(r,a)}fromRng(t){const e=this.F;let n,o,i=[];do{i[0]=e.fromRng(t),n=t.nextBool(),o=e.add(e.mul(e.square(i[0]),i[0]),this.b)}while(!e.isSquare(o));i[1]=e.sqrt(o),n^e.isNegative(i[1])&&(i[1]=e.neg(i[1]));let r=new Uint8Array(2*this.F.n8);return r.set(i[0]),r.set(i[1],this.F.n8),this.cofactor&&(r=this.timesScalar(r,this.cofactor)),r}toObject(t){if(this.isZero(t))return[this.F.toObject(this.F.zero),this.F.toObject(this.F.one),this.F.toObject(this.F.zero)];const e=this.F.toObject(t.slice(0,this.F.n8)),n=this.F.toObject(t.slice(this.F.n8,2*this.F.n8));let o;return o=t.byteLength==3*this.F.n8?this.F.toObject(t.slice(2*this.F.n8,3*this.F.n8)):this.F.toObject(this.F.one),[e,n,o]}fromObject(t){const e=this.F.fromObject(t[0]),n=this.F.fromObject(t[1]);let o;if(o=3==t.length?this.F.fromObject(t[2]):this.F.one,this.F.isZero(o,this.F.one))return this.zeroAffine;if(this.F.eq(o,this.F.one)){const t=new Uint8Array(2*this.F.n8);return t.set(e),t.set(n,this.F.n8),t}{const t=new Uint8Array(3*this.F.n8);return t.set(e),t.set(n,this.F.n8),t.set(o,2*this.F.n8),t}}e(t){return t instanceof Uint8Array?t:this.fromObject(t)}x(t){return this.toAffine(t).slice(0,this.F.n8)}y(t){return this.toAffine(t).slice(this.F.n8)}}class Kp{constructor(){this.promise=new Promise(((t,e)=>{this.reject=e,this.resolve=t}))}}let Vp;const Hp="(".concat('function thread(self) {\n const MAXMEM = 32767;\n let instance;\n let memory;\n\n if (self) {\n self.onmessage = function(e) {\n let data;\n if (e.data) {\n data = e.data;\n } else {\n data = e;\n }\n\n if (data[0].cmd == "INIT") {\n init(data[0]).then(function() {\n self.postMessage(data.result);\n });\n } else if (data[0].cmd == "TERMINATE") {\n self.close();\n } else {\n const res = runTask(data);\n self.postMessage(res);\n }\n };\n }\n\n async function init(data) {\n const code = new Uint8Array(data.code);\n const wasmModule = await WebAssembly.compile(code);\n memory = new WebAssembly.Memory({initial:data.init, maximum: MAXMEM});\n\n instance = await WebAssembly.instantiate(wasmModule, {\n env: {\n "memory": memory\n }\n });\n }\n\n\n\n function alloc(length) {\n const u32 = new Uint32Array(memory.buffer, 0, 1);\n while (u32[0] & 3) u32[0]++; // Return always aligned pointers\n const res = u32[0];\n u32[0] += length;\n if (u32[0] + length > memory.buffer.byteLength) {\n const currentPages = memory.buffer.byteLength / 0x10000;\n let requiredPages = Math.floor((u32[0] + length) / 0x10000)+1;\n if (requiredPages>MAXMEM) requiredPages=MAXMEM;\n memory.grow(requiredPages-currentPages);\n }\n return res;\n }\n\n function allocBuffer(buffer) {\n const p = alloc(buffer.byteLength);\n setBuffer(p, buffer);\n return p;\n }\n\n function getBuffer(pointer, length) {\n const u8 = new Uint8Array(memory.buffer);\n return new Uint8Array(u8.buffer, u8.byteOffset + pointer, length);\n }\n\n function setBuffer(pointer, buffer) {\n const u8 = new Uint8Array(memory.buffer);\n u8.set(new Uint8Array(buffer), pointer);\n }\n\n function runTask(task) {\n if (task[0].cmd == "INIT") {\n return init(task[0]);\n }\n const ctx = {\n vars: [],\n out: []\n };\n const u32a = new Uint32Array(memory.buffer, 0, 1);\n const oldAlloc = u32a[0];\n for (let i=0; i<task.length; i++) {\n switch (task[i].cmd) {\n case "ALLOCSET":\n ctx.vars[task[i].var] = allocBuffer(task[i].buff);\n break;\n case "ALLOC":\n ctx.vars[task[i].var] = alloc(task[i].len);\n break;\n case "SET":\n setBuffer(ctx.vars[task[i].var], task[i].buff);\n break;\n case "CALL": {\n const params = [];\n for (let j=0; j<task[i].params.length; j++) {\n const p = task[i].params[j];\n if (typeof p.var !== "undefined") {\n params.push(ctx.vars[p.var] + (p.offset || 0));\n } else if (typeof p.val != "undefined") {\n params.push(p.val);\n }\n }\n instance.exports[task[i].fnName](...params);\n break;\n }\n case "GET":\n ctx.out[task[i].out] = getBuffer(ctx.vars[task[i].var], task[i].len).slice();\n break;\n default:\n throw new Error("Invalid cmd");\n }\n }\n const u32b = new Uint32Array(memory.buffer, 0, 1);\n u32b[0] = oldAlloc;\n return ctx.out;\n }\n\n\n return runTask;\n}',")(self)");if(null!==globalThis&&void 0!==globalThis&&globalThis.Blob){const t=(new TextEncoder).encode(Hp),e=new Blob([t],{type:"application/javascript"});Vp=URL.createObjectURL(e)}else Vp="data:application/javascript;base64,"+globalThis.btoa(Hp);class Yp{constructor(){this.actionQueue=[],this.oldPFree=0}startSyncOp(){if(0!=this.oldPFree)throw new Error("Sync operation in progress");this.oldPFree=this.u32[0]}endSyncOp(){if(0==this.oldPFree)throw new Error("No sync operation in progress");this.u32[0]=this.oldPFree,this.oldPFree=0}postAction(t,e,n,o){if(this.working[t])throw new Error("Posting a job t a working worker");return this.working[t]=!0,this.pendingDeferreds[t]=o||new Kp,this.workers[t].postMessage(e,n),this.pendingDeferreds[t].promise}processWorks(){for(let t=0;t<this.workers.length&&this.actionQueue.length>0;t++)if(0==this.working[t]){const e=this.actionQueue.shift();this.postAction(t,e.data,e.transfers,e.deferred)}}queueAction(t,e){const n=new Kp;if(this.singleThread){const e=this.taskManager(t);n.resolve(e)}else this.actionQueue.push({data:t,transfers:e,deferred:n}),this.processWorks();return n.promise}resetMemory(){this.u32[0]=this.initalPFree}allocBuff(t){const e=this.alloc(t.byteLength);return this.setBuff(e,t),e}getBuff(t,e){return this.u8.slice(t,t+e)}setBuff(t,e){this.u8.set(new Uint8Array(e),t)}alloc(t){for(;3&this.u32[0];)this.u32[0]++;const e=this.u32[0];return this.u32[0]+=t,e}async terminate(){for(let t=0;t<this.workers.length;t++)this.workers[t].postMessage([{cmd:"TERMINATE"}]);await new Promise((t=>setTimeout(t,200)))}}function Jp(t,e){const n=t[e],o=t.Fr,i=t.tm;t[e].batchApplyKey=async function(t,r,a,c,s){let l,d,u,f,g;if(c=c||"affine",s=s||"affine","G1"==e)"jacobian"==c?(u=3*n.F.n8,l="g1m_batchApplyKey"):(u=2*n.F.n8,l="g1m_batchApplyKeyMixed"),f=3*n.F.n8,"jacobian"==s?g=3*n.F.n8:(d="g1m_batchToAffine",g=2*n.F.n8);else if("G2"==e)"jacobian"==c?(u=3*n.F.n8,l="g2m_batchApplyKey"):(u=2*n.F.n8,l="g2m_batchApplyKeyMixed"),f=3*n.F.n8,"jacobian"==s?g=3*n.F.n8:(d="g2m_batchToAffine",g=2*n.F.n8);else{if("Fr"!=e)throw new Error("Invalid group: "+e);l="frm_batchApplyKey",u=n.n8,f=n.n8,g=n.n8}const h=Math.floor(t.byteLength/u),p=Math.floor(h/i.concurrency),_=[];a=o.e(a);let m=o.e(r);for(let e=0;e<i.concurrency;e++){let n;if(n=e<i.concurrency-1?p:h-e*p,0==n)continue;const r=[];r.push({cmd:"ALLOCSET",var:0,buff:t.slice(e*p*u,e*p*u+n*u)}),r.push({cmd:"ALLOCSET",var:1,buff:m}),r.push({cmd:"ALLOCSET",var:2,buff:a}),r.push({cmd:"ALLOC",var:3,len:n*Math.max(f,g)}),r.push({cmd:"CALL",fnName:l,params:[{var:0},{val:n},{var:1},{var:2},{var:3}]}),d&&r.push({cmd:"CALL",fnName:d,params:[{var:3},{val:n},{var:3}]}),r.push({cmd:"GET",out:0,var:3,len:n*g}),_.push(i.queueAction(r)),m=o.mul(m,o.exp(a,n))}const y=await Promise.all(_);let L;L=t instanceof Qp?new Qp(h*g):new Uint8Array(h*g);let b=0;for(let t=0;t<y.length;t++)L.set(y[t][0],b),b+=y[t][0].byteLength;return L}}const Wp=[1,1,1,1,2,3,4,5,6,7,7,8,9,10,11,12,13,13,14,15,16,16,17,17,17,17,17,17,17,17,17,17];function Xp(t,e){const n=t[e],o=n.tm;async function i(t,o,i,r,a){if(!(t instanceof Uint8Array))throw r&&r.error("".concat(a," _multiExpChunk buffBases is not Uint8Array")),new Error("".concat(a," _multiExpChunk buffBases is not Uint8Array"));if(!(o instanceof Uint8Array))throw r&&r.error("".concat(a," _multiExpChunk buffScalars is not Uint8Array")),new Error("".concat(a," _multiExpChunk buffScalars is not Uint8Array"));let c,s;if(i=i||"affine","G1"==e)"affine"==i?(s="g1m_multiexpAffine_chunk",c=2*n.F.n8):(s="g1m_multiexp_chunk",c=3*n.F.n8);else{if("G2"!=e)throw new Error("Invalid group");"affine"==i?(s="g2m_multiexpAffine_chunk",c=2*n.F.n8):(s="g2m_multiexp_chunk",c=3*n.F.n8)}const l=Math.floor(t.byteLength/c);if(0==l)return n.zero;const d=Math.floor(o.byteLength/l);if(d*l!=o.byteLength)throw new Error("Scalar size does not match");const u=Wp[jp(l)],f=Math.floor((8*d-1)/u)+1,g=[];for(let e=0;e<f;e++){const i=[{cmd:"ALLOCSET",var:0,buff:t},{cmd:"ALLOCSET",var:1,buff:o},{cmd:"ALLOC",var:2,len:3*n.F.n8},{cmd:"CALL",fnName:s,params:[{var:0},{var:1},{val:d},{val:l},{val:e*u},{val:Math.min(8*d-e*u,u)},{var:2}]},{cmd:"GET",out:0,var:2,len:3*n.F.n8}];g.push(n.tm.queueAction(i))}const h=await Promise.all(g);let p=n.zero;for(let t=h.length-1;t>=0;t--){if(!n.isZero(p))for(let t=0;t<u;t++)p=n.double(p);p=n.add(p,h[t][0])}return p}async function r(t,r,a,c,s){const l=1<<22;let d;if("G1"==e)d="affine"==a?2*n.F.n8:3*n.F.n8;else{if("G2"!=e)throw new Error("Invalid group");d="affine"==a?2*n.F.n8:3*n.F.n8}const u=Math.floor(t.byteLength/d);if(0==u)return n.zero;const f=Math.floor(r.byteLength/u);if(f*u!=r.byteLength)throw new Error("Scalar size does not match");const g=Wp[jp(u)],h=Math.floor((8*f-1)/g)+1;let p;p=Math.floor(u/(o.concurrency/h)),p>l&&(p=l),p<1024&&(p=1024);const _=[];for(let e=0;e<u;e+=p){c&&c.debug("Multiexp start: ".concat(s,": ").concat(e,"/").concat(u));const n=Math.min(u-e,p),o=t.slice(e*d,(e+n)*d),l=r.slice(e*f,(e+n)*f);_.push(i(o,l,a,c,s).then((t=>(c&&c.debug("Multiexp end: ".concat(s,": ").concat(e,"/").concat(u)),t))))}const m=await Promise.all(_);let y=n.zero;for(let t=m.length-1;t>=0;t--)y=n.add(y,m[t]);return y}n.multiExp=async function(t,e,n,o){return await r(t,e,"jacobian",n,o)},n.multiExpAffine=async function(t,e,n,o){return await r(t,e,"affine",n,o)}}function Zp(t,e){const n=t[e],o=t.Fr,i=n.tm;async function r(t,c,s,l,d,u){let f,g,h,p,_,m,y,L;s=s||"affine",l=l||"affine","G1"==e?("affine"==s?(f=2*n.F.n8,p="g1m_batchToJacobian"):f=3*n.F.n8,g=3*n.F.n8,c&&(L="g1m_fftFinal"),y="g1m_fftJoin",m="g1m_fftMix","affine"==l?(h=2*n.F.n8,_="g1m_batchToAffine"):h=3*n.F.n8):"G2"==e?("affine"==s?(f=2*n.F.n8,p="g2m_batchToJacobian"):f=3*n.F.n8,g=3*n.F.n8,c&&(L="g2m_fftFinal"),y="g2m_fftJoin",m="g2m_fftMix","affine"==l?(h=2*n.F.n8,_="g2m_batchToAffine"):h=3*n.F.n8):"Fr"==e&&(f=n.n8,g=n.n8,h=n.n8,c&&(L="frm_fftFinal"),m="frm_fftMix",y="frm_fftJoin");let b=!1;Array.isArray(t)?(t=kp(t,f),b=!0):t=t.slice(0,t.byteLength);const A=t.byteLength/f,w=jp(A);if(1<<w!=A)throw new Error("fft must be multiple of 2");if(w==o.s+1){let e;return e=c?await async function(t,e,n,i,c){let s,l;s=t.slice(0,t.byteLength/2),l=t.slice(t.byteLength/2,t.byteLength);const d=[];d.push(r(s,!0,e,"jacobian",i,c)),d.push(r(l,!0,e,"jacobian",i,c)),[s,l]=await Promise.all(d);const u=await a(s,l,"fftJoinExtInv",o.one,o.shiftInv,"jacobian",n,i,c);let f;return f=u[0].byteLength>1<<28?new Qp(2*u[0].byteLength):new Uint8Array(2*u[0].byteLength),f.set(u[0]),f.set(u[1],u[0].byteLength),f}(t,s,l,d,u):await async function(t,e,n,i,c){let s,l;s=t.slice(0,t.byteLength/2),l=t.slice(t.byteLength/2,t.byteLength);const d=[];[s,l]=await a(s,l,"fftJoinExt",o.one,o.shift,e,"jacobian",i,c),d.push(r(s,!1,"jacobian",n,i,c)),d.push(r(l,!1,"jacobian",n,i,c));const u=await Promise.all(d);let f;return f=u[0].byteLength>1<<28?new Qp(2*u[0].byteLength):new Uint8Array(2*u[0].byteLength),f.set(u[0]),f.set(u[1],u[0].byteLength),f}(t,s,l,d,u),b?Mp(e,h):e}let I,C,x;c&&(I=o.inv(o.e(A))),Up(t,f);let v=Math.min(16384,A),E=A/v;for(;E<i.concurrency&&v>=16;)E*=2,v/=2;const B=jp(v),F=[];for(let e=0;e<E;e++){d&&d.debug("".concat(u,": fft ").concat(w," mix start: ").concat(e,"/").concat(E));const n=[];n.push({cmd:"ALLOC",var:0,len:g*v});const o=t.slice(v*e*f,v*(e+1)*f);n.push({cmd:"SET",var:0,buff:o}),p&&n.push({cmd:"CALL",fnName:p,params:[{var:0},{val:v},{var:0}]});for(let t=1;t<=B;t++)n.push({cmd:"CALL",fnName:m,params:[{var:0},{val:v},{val:t}]});B==w?(L&&(n.push({cmd:"ALLOCSET",var:1,buff:I}),n.push({cmd:"CALL",fnName:L,params:[{var:0},{val:v},{var:1}]})),_&&n.push({cmd:"CALL",fnName:_,params:[{var:0},{val:v},{var:0}]}),n.push({cmd:"GET",out:0,var:0,len:v*h})):n.push({cmd:"GET",out:0,var:0,len:g*v}),F.push(i.queueAction(n).then((t=>(d&&d.debug("".concat(u,": fft ").concat(w," mix end: ").concat(e,"/").concat(E)),t))))}x=await Promise.all(F);for(let t=0;t<E;t++)x[t]=x[t][0];for(let t=B+1;t<=w;t++){d&&d.debug("".concat(u,": fft ").concat(w," join: ").concat(t,"/").concat(w));const e=1<<w-t,n=E/e,r=[];for(let a=0;a<e;a++)for(let c=0;c<n/2;c++){const s=o.exp(o.w[t],c*v),l=o.w[t],f=a*n+c,p=a*n+c+n/2,m=[];m.push({cmd:"ALLOCSET",var:0,buff:x[f]}),m.push({cmd:"ALLOCSET",var:1,buff:x[p]}),m.push({cmd:"ALLOCSET",var:2,buff:s}),m.push({cmd:"ALLOCSET",var:3,buff:l}),m.push({cmd:"CALL",fnName:y,params:[{var:0},{var:1},{val:v},{var:2},{var:3}]}),t==w?(L&&(m.push({cmd:"ALLOCSET",var:4,buff:I}),m.push({cmd:"CALL",fnName:L,params:[{var:0},{val:v},{var:4}]}),m.push({cmd:"CALL",fnName:L,params:[{var:1},{val:v},{var:4}]})),_&&(m.push({cmd:"CALL",fnName:_,params:[{var:0},{val:v},{var:0}]}),m.push({cmd:"CALL",fnName:_,params:[{var:1},{val:v},{var:1}]})),m.push({cmd:"GET",out:0,var:0,len:v*h}),m.push({cmd:"GET",out:1,var:1,len:v*h})):(m.push({cmd:"GET",out:0,var:0,len:v*g}),m.push({cmd:"GET",out:1,var:1,len:v*g})),r.push(i.queueAction(m).then((o=>(d&&d.debug("".concat(u,": fft ").concat(w," join ").concat(t,"/").concat(w," ").concat(a+1,"/").concat(e," ").concat(c,"/").concat(n/2)),o))))}const a=await Promise.all(r);for(let t=0;t<e;t++)for(let e=0;e<n/2;e++){const o=t*n+e,i=t*n+e+n/2,r=a.shift();x[o]=r[0],x[i]=r[1]}}if(C=t instanceof Qp?new Qp(A*h):new Uint8Array(A*h),c){C.set(x[0].slice((v-1)*h));let t=h;for(let e=E-1;e>0;e--)C.set(x[e],t),t+=v*h,delete x[e];C.set(x[0].slice(0,(v-1)*h),t),delete x[0]}else for(let t=0;t<E;t++)C.set(x[t],v*h*t),delete x[t];return b?Mp(C,h):C}async function a(t,r,a,c,s,l,d,u,f){let g,h,p,_,m,y;if("G1"==e)"affine"==l?(m=2*n.F.n8,h="g1m_batchToJacobian"):m=3*n.F.n8,y=3*n.F.n8,g="g1m_"+a,"affine"==d?(p="g1m_batchToAffine",_=2*n.F.n8):_=3*n.F.n8;else if("G2"==e)"affine"==l?(m=2*n.F.n8,h="g2m_batchToJacobian"):m=3*n.F.n8,g="g2m_"+a,y=3*n.F.n8,"affine"==d?(p="g2m_batchToAffine",_=2*n.F.n8):_=3*n.F.n8;else{if("Fr"!=e)throw new Error("Invalid group");m=o.n8,_=o.n8,y=o.n8,g="frm_"+a}if(t.byteLength!=r.byteLength)throw new Error("Invalid buffer size");const L=Math.floor(t.byteLength/m);if(L!=1<<jp(L))throw new Error("Invalid number of points");let b=Math.floor(L/i.concurrency);b<16&&(b=16),b>65536&&(b=65536);const A=[];for(let e=0;e<L;e+=b){u&&u.debug("".concat(f,": fftJoinExt Start: ").concat(e,"/").concat(L));const n=Math.min(L-e,b),a=o.mul(c,o.exp(s,e)),l=[],d=t.slice(e*m,(e+n)*m),w=r.slice(e*m,(e+n)*m);l.push({cmd:"ALLOC",var:0,len:y*n}),l.push({cmd:"SET",var:0,buff:d}),l.push({cmd:"ALLOC",var:1,len:y*n}),l.push({cmd:"SET",var:1,buff:w}),l.push({cmd:"ALLOCSET",var:2,buff:a}),l.push({cmd:"ALLOCSET",var:3,buff:s}),h&&(l.push({cmd:"CALL",fnName:h,params:[{var:0},{val:n},{var:0}]}),l.push({cmd:"CALL",fnName:h,params:[{var:1},{val:n},{var:1}]})),l.push({cmd:"CALL",fnName:g,params:[{var:0},{var:1},{val:n},{var:2},{var:3},{val:o.s}]}),p&&(l.push({cmd:"CALL",fnName:p,params:[{var:0},{val:n},{var:0}]}),l.push({cmd:"CALL",fnName:p,params:[{var:1},{val:n},{var:1}]})),l.push({cmd:"GET",out:0,var:0,len:n*_}),l.push({cmd:"GET",out:1,var:1,len:n*_}),A.push(i.queueAction(l).then((t=>(u&&u.debug("".concat(f,": fftJoinExt End: ").concat(e,"/").concat(L)),t))))}const w=await Promise.all(A);let I,C;L*_>1<<28?(I=new Qp(L*_),C=new Qp(L*_)):(I=new Uint8Array(L*_),C=new Uint8Array(L*_));let x=0;for(let t=0;t<w.length;t++)I.set(w[t][0],x),C.set(w[t][1],x),x+=w[t][0].byteLength;return[I,C]}n.fft=async function(t,e,n,o,i){return await r(t,!1,e,n,o,i)},n.ifft=async function(t,e,n,o,i){return await r(t,!0,e,n,o,i)},n.lagrangeEvaluations=async function(t,i,c,s,l){let d;if(i=i||"affine",c=c||"affine","G1"==e)d="affine"==i?2*n.F.n8:3*n.F.n8;else if("G2"==e)d="affine"==i?2*n.F.n8:3*n.F.n8;else{if("Fr"!=e)throw new Error("Invalid group");d=o.n8}const u=t.byteLength/d,f=jp(u);if(2**f*d!=t.byteLength)throw s&&s.error("lagrangeEvaluations iinvalid input size"),new Error("lagrangeEvaluations invalid Input size");if(f<=o.s)return await n.ifft(t,i,c,s,l);if(f>o.s+1)throw s&&s.error("lagrangeEvaluations input too big"),new Error("lagrangeEvaluations input too big");let g=t.slice(0,t.byteLength/2),h=t.slice(t.byteLength/2,t.byteLength);const p=o.exp(o.shift,u/2),_=o.inv(o.sub(o.one,p));[g,h]=await a(g,h,"prepareLagrangeEvaluation",_,o.shiftInv,i,"jacobian",s,l+" prep");const m=[];let y;return m.push(r(g,!0,"jacobian",c,s,l+" t0")),m.push(r(h,!0,"jacobian",c,s,l+" t1")),[g,h]=await Promise.all(m),y=g.byteLength>1<<28?new Qp(2*g.byteLength):new Uint8Array(2*g.byteLength),y.set(g),y.set(h,g.byteLength),y},n.fftMix=async function(t){const r=3*n.F.n8;let a,c;if("G1"==e)a="g1m_fftMix",c="g1m_fftJoin";else if("G2"==e)a="g2m_fftMix",c="g2m_fftJoin";else{if("Fr"!=e)throw new Error("Invalid group");a="frm_fftMix",c="frm_fftJoin"}const s=Math.floor(t.byteLength/r),l=jp(s);let d=1<<jp(i.concurrency);s<=2*d&&(d=1);const u=s/d,f=jp(u),g=[];for(let e=0;e<d;e++){const n=[],o=t.slice(e*u*r,(e+1)*u*r);n.push({cmd:"ALLOCSET",var:0,buff:o});for(let t=1;t<=f;t++)n.push({cmd:"CALL",fnName:a,params:[{var:0},{val:u},{val:t}]});n.push({cmd:"GET",out:0,var:0,len:u*r}),g.push(i.queueAction(n))}const h=await Promise.all(g),p=[];for(let t=0;t<h.length;t++)p[t]=h[t][0];for(let t=f+1;t<=l;t++){const e=1<<l-t,n=d/e,a=[];for(let s=0;s<e;s++)for(let e=0;e<n/2;e++){const l=o.exp(o.w[t],e*u),d=o.w[t],f=s*n+e,g=s*n+e+n/2,h=[];h.push({cmd:"ALLOCSET",var:0,buff:p[f]}),h.push({cmd:"ALLOCSET",var:1,buff:p[g]}),h.push({cmd:"ALLOCSET",var:2,buff:l}),h.push({cmd:"ALLOCSET",var:3,buff:d}),h.push({cmd:"CALL",fnName:c,params:[{var:0},{var:1},{val:u},{var:2},{var:3}]}),h.push({cmd:"GET",out:0,var:0,len:u*r}),h.push({cmd:"GET",out:1,var:1,len:u*r}),a.push(i.queueAction(h))}const s=await Promise.all(a);for(let t=0;t<e;t++)for(let e=0;e<n/2;e++){const o=t*n+e,i=t*n+e+n/2,r=s.shift();p[o]=r[0],p[i]=r[1]}}let _;_=t instanceof Qp?new Qp(s*r):new Uint8Array(s*r);let m=0;for(let t=0;t<d;t++)_.set(p[t],m),m+=p[t].byteLength;return _},n.fftJoin=async function(t,r,a,c){const s=3*n.F.n8;let l;if("G1"==e)l="g1m_fftJoin";else if("G2"==e)l="g2m_fftJoin";else{if("Fr"!=e)throw new Error("Invalid group");l="frm_fftJoin"}if(t.byteLength!=r.byteLength)throw new Error("Invalid buffer size");const d=Math.floor(t.byteLength/s);if(d!=1<<jp(d))throw new Error("Invalid number of points");let u=1<<jp(i.concurrency);d<=2*u&&(u=1);const f=d/u,g=[];for(let e=0;e<u;e++){const n=[],d=o.mul(a,o.exp(c,e*f)),u=t.slice(e*f*s,(e+1)*f*s),h=r.slice(e*f*s,(e+1)*f*s);n.push({cmd:"ALLOCSET",var:0,buff:u}),n.push({cmd:"ALLOCSET",var:1,buff:h}),n.push({cmd:"ALLOCSET",var:2,buff:d}),n.push({cmd:"ALLOCSET",var:3,buff:c}),n.push({cmd:"CALL",fnName:l,params:[{var:0},{var:1},{val:f},{var:2},{var:3}]}),n.push({cmd:"GET",out:0,var:0,len:f*s}),n.push({cmd:"GET",out:1,var:1,len:f*s}),g.push(i.queueAction(n))}const h=await Promise.all(g);let p,_;t instanceof Qp?(p=new Qp(d*s),_=new Qp(d*s)):(p=new Uint8Array(d*s),_=new Uint8Array(d*s));let m=0;for(let t=0;t<h.length;t++)p.set(h[t][0],m),_.set(h[t][1],m),m+=h[t][0].byteLength;return[p,_]},n.fftFinal=async function(t,o){const r=3*n.F.n8,a=2*n.F.n8;let c,s;if("G1"==e)c="g1m_fftFinal",s="g1m_batchToAffine";else{if("G2"!=e)throw new Error("Invalid group");c="g2m_fftFinal",s="g2m_batchToAffine"}const l=Math.floor(t.byteLength/r);if(l!=1<<jp(l))throw new Error("Invalid number of points");const d=Math.floor(l/i.concurrency),u=[];for(let e=0;e<i.concurrency;e++){let n;if(n=e<i.concurrency-1?d:l-e*d,0==n)continue;const f=[],g=t.slice(e*d*r,(e*d+n)*r);f.push({cmd:"ALLOCSET",var:0,buff:g}),f.push({cmd:"ALLOCSET",var:1,buff:o}),f.push({cmd:"CALL",fnName:c,params:[{var:0},{val:n},{var:1}]}),f.push({cmd:"CALL",fnName:s,params:[{var:0},{val:n},{var:0}]}),f.push({cmd:"GET",out:0,var:0,len:n*a}),u.push(i.queueAction(f))}const f=await Promise.all(u);let g;g=t instanceof Qp?new Qp(l*a):new Uint8Array(l*a);let h=0;for(let t=f.length-1;t>=0;t--)g.set(f[t][0],h),h+=f[t][0].byteLength;return g}}async function $p(t){const e=await async function(t,e){const n=new Yp;n.memory=new WebAssembly.Memory({initial:25}),n.u8=new Uint8Array(n.memory.buffer),n.u32=new Uint32Array(n.memory.buffer);const o=await WebAssembly.compile(t.code);if(n.instance=await WebAssembly.instantiate(o,{env:{memory:n.memory}}),null!==globalThis&&void 0!==globalThis&&globalThis.Worker||(e=!0),n.singleThread=e,n.initalPFree=n.u32[0],n.pq=t.pq,n.pr=t.pr,n.pG1gen=t.pG1gen,n.pG1zero=t.pG1zero,n.pG2gen=t.pG2gen,n.pG2zero=t.pG2zero,n.pOneT=t.pOneT,e)n.code=t.code,n.taskManager=function(){const t=32767;let e,n;async function o(o){const i=new Uint8Array(o.code),r=await WebAssembly.compile(i);n=new WebAssembly.Memory({initial:o.init,maximum:t}),e=await WebAssembly.instantiate(r,{env:{memory:n}})}function i(e){const o=new Uint32Array(n.buffer,0,1);for(;3&o[0];)o[0]++;const i=o[0];if(o[0]+=e,o[0]+e>n.buffer.byteLength){const i=n.buffer.byteLength/65536;let r=Math.floor((o[0]+e)/65536)+1;r>t&&(r=t),n.grow(r-i)}return i}function r(t){const e=i(t.byteLength);return c(e,t),e}function a(t,e){const o=new Uint8Array(n.buffer);return new Uint8Array(o.buffer,o.byteOffset+t,e)}function c(t,e){new Uint8Array(n.buffer).set(new Uint8Array(e),t)}function s(t){if("INIT"==t[0].cmd)return o(t[0]);const s={vars:[],out:[]},l=new Uint32Array(n.buffer,0,1)[0];for(let n=0;n<t.length;n++)switch(t[n].cmd){case"ALLOCSET":s.vars[t[n].var]=r(t[n].buff);break;case"ALLOC":s.vars[t[n].var]=i(t[n].len);break;case"SET":c(s.vars[t[n].var],t[n].buff);break;case"CALL":{const o=[];for(let e=0;e<t[n].params.length;e++){const i=t[n].params[e];void 0!==i.var?o.push(s.vars[i.var]+(i.offset||0)):void 0!==i.val&&o.push(i.val)}e.exports[t[n].fnName](...o);break}case"GET":s.out[t[n].out]=a(s.vars[t[n].var],t[n].len).slice();break;default:throw new Error("Invalid cmd")}return new Uint32Array(n.buffer,0,1)[0]=l,s.out}return s}(),await n.taskManager([{cmd:"INIT",init:25,code:n.code.slice()}]),n.concurrency=1;else{n.workers=[],n.pendingDeferreds=[],n.working=[];let e=2;"object"==typeof navigator&&navigator.hardwareConcurrency&&(e=navigator.hardwareConcurrency),0==e&&(e=2),e>64&&(e=64),n.concurrency=e;for(let t=0;t<e;t++)n.workers[t]=new Worker(Vp),n.workers[t].addEventListener("message",i(t)),n.working[t]=!1;const o=[];for(let e=0;e<n.workers.length;e++){const i=t.code.slice();o.push(n.postAction(e,[{cmd:"INIT",init:25,code:i}],[i.buffer]))}await Promise.all(o)}return n;function i(t){return function(e){let o;o=e&&e.data?e.data:e,n.working[t]=!1,n.pendingDeferreds[t].resolve(o),n.processWorks()}}}(t.wasm,t.singleThread),n={};return n.q=gg(t.wasm.q.toString()),n.r=gg(t.wasm.r.toString()),n.name=t.name,n.tm=e,n.prePSize=t.wasm.prePSize,n.preQSize=t.wasm.preQSize,n.Fr=new Dp(e,"frm",t.n8r,t.r),n.F1=new Dp(e,"f1m",t.n8q,t.q),n.F2=new Rp(e,"f2m",n.F1),n.G1=new Gp(e,"g1m",n.F1,t.wasm.pG1gen,t.wasm.pG1b,t.cofactorG1),n.G2=new Gp(e,"g2m",n.F2,t.wasm.pG2gen,t.wasm.pG2b,t.cofactorG2),n.F6=new qp(e,"f6m",n.F2),n.F12=new Rp(e,"ftm",n.F6),n.Gt=n.F12,Jp(n,"G1"),Jp(n,"G2"),Jp(n,"Fr"),Xp(n,"G1"),Xp(n,"G2"),Zp(n,"G1"),Zp(n,"G2"),Zp(n,"Fr"),function(t){const e=t.tm;t.pairing=function(n,o){e.startSyncOp();const i=e.allocBuff(t.G1.toJacobian(n)),r=e.allocBuff(t.G2.toJacobian(o)),a=e.alloc(t.Gt.n8);e.instance.exports[t.name+"_pairing"](i,r,a);const c=e.getBuff(a,t.Gt.n8);return e.endSyncOp(),c},t.pairingEq=async function(){let n,o;arguments.length%2==1?(n=arguments[arguments.length-1],o=(arguments.length-1)/2):(n=t.Gt.one,o=arguments.length/2);const i=[];for(let n=0;n<o;n++){const o=[],r=t.G1.toJacobian(arguments[2*n]);o.push({cmd:"ALLOCSET",var:0,buff:r}),o.push({cmd:"ALLOC",var:1,len:t.prePSize});const a=t.G2.toJacobian(arguments[2*n+1]);o.push({cmd:"ALLOCSET",var:2,buff:a}),o.push({cmd:"ALLOC",var:3,len:t.preQSize}),o.push({cmd:"ALLOC",var:4,len:t.Gt.n8}),o.push({cmd:"CALL",fnName:t.name+"_prepareG1",params:[{var:0},{var:1}]}),o.push({cmd:"CALL",fnName:t.name+"_prepareG2",params:[{var:2},{var:3}]}),o.push({cmd:"CALL",fnName:t.name+"_millerLoop",params:[{var:1},{var:3},{var:4}]}),o.push({cmd:"GET",out:0,var:4,len:t.Gt.n8}),i.push(e.queueAction(o))}const r=await Promise.all(i);e.startSyncOp();const a=e.alloc(t.Gt.n8);e.instance.exports.ftm_one(a);for(let t=0;t<r.length;t++){const n=e.allocBuff(r[t][0]);e.instance.exports.ftm_mul(a,n,a)}e.instance.exports[t.name+"_finalExponentiation"](a,a);const c=e.allocBuff(n),s=!!e.instance.exports.ftm_eq(a,c);return e.endSyncOp(),s},t.prepareG1=function(t){this.tm.startSyncOp();const e=this.tm.allocBuff(t),n=this.tm.alloc(this.prePSize);this.tm.instance.exports[this.name+"_prepareG1"](e,n);const o=this.tm.getBuff(n,this.prePSize);return this.tm.endSyncOp(),o},t.prepareG2=function(t){this.tm.startSyncOp();const e=this.tm.allocBuff(t),n=this.tm.alloc(this.preQSize);this.tm.instance.exports[this.name+"_prepareG2"](e,n);const o=this.tm.getBuff(n,this.preQSize);return this.tm.endSyncOp(),o},t.millerLoop=function(t,e){this.tm.startSyncOp();const n=this.tm.allocBuff(t),o=this.tm.allocBuff(e),i=this.tm.alloc(this.Gt.n8);this.tm.instance.exports[this.name+"_millerLoop"](n,o,i);const r=this.tm.getBuff(i,this.Gt.n8);return this.tm.endSyncOp(),r},t.finalExponentiation=function(t){this.tm.startSyncOp();const e=this.tm.allocBuff(t),n=this.tm.alloc(this.Gt.n8);this.tm.instance.exports[this.name+"_finalExponentiation"](e,n);const o=this.tm.getBuff(n,this.Gt.n8);return this.tm.endSyncOp(),o}}(n),n.array2buffer=function(t,e){const n=new Uint8Array(e*t.length);for(let o=0;o<t.length;o++)n.set(t[o],o*e);return n},n.buffer2array=function(t,e){const n=t.byteLength/e,o=new Array(n);for(let i=0;i<n;i++)o[i]=t.slice(i*e,i*e+e);return o},n}function t_(t){return BigInt(t)}function e_(t){return t<0n}function n_(t){return 0n===t}function o_(t){const e=[],n=t_(t);return e.push(Number(0xFFn&n)),e.push(Number(n>>8n&0xFFn)),e.push(Number(n>>16n&0xFFn)),e.push(Number(n>>24n&0xFFn)),e}function i_(t){const e=function(t){for(var e=[],n=0;n<t.length;n++){var o=t.charCodeAt(n);o<128?e.push(o):o<2048?e.push(192|o>>6,128|63&o):o<55296||o>=57344?e.push(224|o>>12,128|o>>6&63,128|63&o):(n++,o=65536+((1023&o)<<10|1023&t.charCodeAt(n)),e.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|63&o))}return e}(t);return[...l_(e.length),...e]}function r_(t){const e=[];let n=t_(t);if(e_(n))throw new Error("Number cannot be negative");for(;!n_(n);)e.push(Number(0x7Fn&n)),n>>=7n;0==e.length&&e.push(0);for(let t=0;t<e.length-1;t++)e[t]=128|e[t];return e}function a_(t){let e,n;const o=function(t){return e_(t)?t.toString(2).length-1:t.toString(2).length}(t);t<0?(n=!0,e=(1n<<BigInt(o))+t):(n=!1,e=t_(t));const i=7-o%7,r=(1<<7-i)-1|128,a=r_(e+((1n<<BigInt(i))-1n<<BigInt(o)));return n||(a[a.length-1]=a[a.length-1]&r),a}function c_(t){let e=t_(t);if(e>0xFFFFFFFFn)throw new Error("Number too big");if(e>0x7FFFFFFFn&&(e-=0x100000000n),e<-2147483648n)throw new Error("Number too small");return a_(e)}function s_(t){let e=t_(t);if(e>0xFFFFFFFFFFFFFFFFn)throw new Error("Number too big");if(e>0x7FFFFFFFFFFFFFFFn&&(e-=0x10000000000000000n),e<-9223372036854775808n)throw new Error("Number too small");return a_(e)}function l_(t){let e=t_(t);if(e>0xFFFFFFFFn)throw new Error("Number too big");return r_(e)}function d_(t){return Array.from(t,(function(t){return("0"+(255&t).toString(16)).slice(-2)})).join("")}class u_{constructor(t){this.func=t,this.functionName=t.functionName,this.module=t.module}setLocal(t,e){const n=this.func.localIdxByName[t];if(void 0===n)throw new Error("Local Variable not defined: Function: ".concat(this.functionName," local: ").concat(t," "));return[...e,33,...l_(n)]}teeLocal(t,e){const n=this.func.localIdxByName[t];if(void 0===n)throw new Error("Local Variable not defined: Function: ".concat(this.functionName," local: ").concat(t," "));return[...e,34,...l_(n)]}getLocal(t){const e=this.func.localIdxByName[t];if(void 0===e)throw new Error("Local Variable not defined: Function: ".concat(this.functionName," local: ").concat(t," "));return[32,...l_(e)]}i64_load8_s(t,e,n){return[...t,48,void 0===n?0:n,...l_(e||0)]}i64_load8_u(t,e,n){return[...t,49,void 0===n?0:n,...l_(e||0)]}i64_load16_s(t,e,n){return[...t,50,void 0===n?1:n,...l_(e||0)]}i64_load16_u(t,e,n){return[...t,51,void 0===n?1:n,...l_(e||0)]}i64_load32_s(t,e,n){return[...t,52,void 0===n?2:n,...l_(e||0)]}i64_load32_u(t,e,n){return[...t,53,void 0===n?2:n,...l_(e||0)]}i64_load(t,e,n){return[...t,41,void 0===n?3:n,...l_(e||0)]}i64_store(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=3,a=e):Array.isArray(n)?(i=e,r=3,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,55,r,...l_(i)]}i64_store32(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=2,a=e):Array.isArray(n)?(i=e,r=2,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,62,r,...l_(i)]}i64_store16(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=1,a=e):Array.isArray(n)?(i=e,r=1,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,61,r,...l_(i)]}i64_store8(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=0,a=e):Array.isArray(n)?(i=e,r=0,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,60,r,...l_(i)]}i32_load8_s(t,e,n){return[...t,44,void 0===n?0:n,...l_(e||0)]}i32_load8_u(t,e,n){return[...t,45,void 0===n?0:n,...l_(e||0)]}i32_load16_s(t,e,n){return[...t,46,void 0===n?1:n,...l_(e||0)]}i32_load16_u(t,e,n){return[...t,47,void 0===n?1:n,...l_(e||0)]}i32_load(t,e,n){return[...t,40,void 0===n?2:n,...l_(e||0)]}i32_store(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=2,a=e):Array.isArray(n)?(i=e,r=2,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,54,r,...l_(i)]}i32_store16(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=1,a=e):Array.isArray(n)?(i=e,r=1,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,59,r,...l_(i)]}i32_store8(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=0,a=e):Array.isArray(n)?(i=e,r=0,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,58,r,...l_(i)]}call(t){const e=this.module.functionIdxByName[t];if(void 0===e)throw new Error("Function not defined: Function: ".concat(t));for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return[...[].concat(...o),16,...l_(e)]}call_indirect(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return[...[].concat(...n),...t,17,0,0]}if(t,e,n){return n?[...t,4,64,...e,5,...n,11]:[...t,4,64,...e,11]}block(t){return[2,64,...t,11]}loop(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return[3,64,...[].concat(...e),11]}br_if(t,e){return[...e,13,...l_(t)]}br(t){return[12,...l_(t)]}ret(t){return[...t,15]}drop(t){return[...t,26]}i64_const(t){return[66,...s_(t)]}i32_const(t){return[65,...c_(t)]}i64_eqz(t){return[...t,80]}i64_eq(t,e){return[...t,...e,81]}i64_ne(t,e){return[...t,...e,82]}i64_lt_s(t,e){return[...t,...e,83]}i64_lt_u(t,e){return[...t,...e,84]}i64_gt_s(t,e){return[...t,...e,85]}i64_gt_u(t,e){return[...t,...e,86]}i64_le_s(t,e){return[...t,...e,87]}i64_le_u(t,e){return[...t,...e,88]}i64_ge_s(t,e){return[...t,...e,89]}i64_ge_u(t,e){return[...t,...e,90]}i64_add(t,e){return[...t,...e,124]}i64_sub(t,e){return[...t,...e,125]}i64_mul(t,e){return[...t,...e,126]}i64_div_s(t,e){return[...t,...e,127]}i64_div_u(t,e){return[...t,...e,128]}i64_rem_s(t,e){return[...t,...e,129]}i64_rem_u(t,e){return[...t,...e,130]}i64_and(t,e){return[...t,...e,131]}i64_or(t,e){return[...t,...e,132]}i64_xor(t,e){return[...t,...e,133]}i64_shl(t,e){return[...t,...e,134]}i64_shr_s(t,e){return[...t,...e,135]}i64_shr_u(t,e){return[...t,...e,136]}i64_extend_i32_s(t){return[...t,172]}i64_extend_i32_u(t){return[...t,173]}i64_clz(t){return[...t,121]}i64_ctz(t){return[...t,122]}i32_eqz(t){return[...t,69]}i32_eq(t,e){return[...t,...e,70]}i32_ne(t,e){return[...t,...e,71]}i32_lt_s(t,e){return[...t,...e,72]}i32_lt_u(t,e){return[...t,...e,73]}i32_gt_s(t,e){return[...t,...e,74]}i32_gt_u(t,e){return[...t,...e,75]}i32_le_s(t,e){return[...t,...e,76]}i32_le_u(t,e){return[...t,...e,77]}i32_ge_s(t,e){return[...t,...e,78]}i32_ge_u(t,e){return[...t,...e,79]}i32_add(t,e){return[...t,...e,106]}i32_sub(t,e){return[...t,...e,107]}i32_mul(t,e){return[...t,...e,108]}i32_div_s(t,e){return[...t,...e,109]}i32_div_u(t,e){return[...t,...e,110]}i32_rem_s(t,e){return[...t,...e,111]}i32_rem_u(t,e){return[...t,...e,112]}i32_and(t,e){return[...t,...e,113]}i32_or(t,e){return[...t,...e,114]}i32_xor(t,e){return[...t,...e,115]}i32_shl(t,e){return[...t,...e,116]}i32_shr_s(t,e){return[...t,...e,117]}i32_shr_u(t,e){return[...t,...e,118]}i32_rotl(t,e){return[...t,...e,119]}i32_rotr(t,e){return[...t,...e,120]}i32_wrap_i64(t){return[...t,167]}i32_clz(t){return[...t,103]}i32_ctz(t){return[...t,104]}unreachable(){return[0]}current_memory(){return[63,0]}comment(){return[]}}const f_={i32:127,i64:126,f32:125,f64:124,anyfunc:112,func:96,emptyblock:64};class g_{constructor(t,e,n,o,i){if("import"==n)this.fnType="import",this.moduleName=o,this.fieldName=i;else{if("internal"!=n)throw new Error("Invalid function fnType: "+n);this.fnType="internal"}this.module=t,this.fnName=e,this.params=[],this.locals=[],this.localIdxByName={},this.code=[],this.returnType=null,this.nextLocal=0}addParam(t,e){if(this.localIdxByName[t])throw new Error("param already exists. Function: ".concat(this.fnName,", Param: ").concat(t," "));const n=this.nextLocal++;this.localIdxByName[t]=n,this.params.push({type:e})}addLocal(t,e,n){const o=n||1;if(this.localIdxByName[t])throw new Error("local already exists. Function: ".concat(this.fnName,", Param: ").concat(t," "));const i=this.nextLocal++;this.localIdxByName[t]=i,this.locals.push({type:e,length:o})}setReturnType(t){if(this.returnType)throw new Error("returnType already defined. Function: ".concat(this.fnName));this.returnType=t}getSignature(){return[96,...l_(this.params.length),...this.params.map((t=>f_[t.type])),...this.returnType?[1,f_[this.returnType]]:[0]]}getBody(){const t=this.locals.map((t=>[...l_(t.length),f_[t.type]])),e=[...l_(this.locals.length),...[].concat(...t),...this.code,11];return[...l_(e.length),...e]}addCode(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.code.push(...[].concat(...e))}getCodeBuilder(){return new u_(this)}}class h_{constructor(){this.functions=[],this.functionIdxByName={},this.nImportFunctions=0,this.nInternalFunctions=0,this.memory={pagesSize:1,moduleName:"env",fieldName:"memory"},this.free=8,this.datas=[],this.modules={},this.exports=[],this.functionsTable=[]}build(){return this._setSignatures(),new Uint8Array([...o_(1836278016),...o_(1),...this._buildType(),...this._buildImport(),...this._buildFunctionDeclarations(),...this._buildFunctionsTable(),...this._buildExports(),...this._buildElements(),...this._buildCode(),...this._buildData()])}addFunction(t){if(void 0!==this.functionIdxByName[t])throw new Error("Function already defined: ".concat(t));const e=this.functions.length;return this.functionIdxByName[t]=e,this.functions.push(new g_(this,t,"internal")),this.nInternalFunctions++,this.functions[e]}addIimportFunction(t,e,n){if(void 0!==this.functionIdxByName[t])throw new Error("Function already defined: ".concat(t));if(this.functions.length>0&&"internal"==this.functions[this.functions.length-1].type)throw new Error("Import functions must be declared before internal: ".concat(t));let o=n||t;const i=this.functions.length;return this.functionIdxByName[t]=i,this.functions.push(new g_(this,t,"import",e,o)),this.nImportFunctions++,this.functions[i]}setMemory(t,e,n){this.memory={pagesSize:t,moduleName:e||"env",fieldName:n||"memory"}}exportFunction(t,e){const n=e||t;if(void 0===this.functionIdxByName[t])throw new Error("Function not defined: ".concat(t));const o=this.functionIdxByName[t];n!=t&&(this.functionIdxByName[n]=o),this.exports.push({exportName:n,idx:o})}addFunctionToTable(t){const e=this.functionIdxByName[t];this.functionsTable.push(e)}addData(t,e){this.datas.push({offset:t,bytes:e})}alloc(t,e){let n,o;(Array.isArray(t)||ArrayBuffer.isView(t))&&void 0===e?(n=t.length,o=t):(n=t,o=e),n=1+(n-1>>3)<<3;const i=this.free;return this.free+=n,o&&this.addData(i,o),i}allocString(t){const e=(new globalThis.TextEncoder).encode(t);return this.alloc([...e,0])}_setSignatures(){this.signatures=[];const t={};if(this.functionsTable.length>0){const e=this.functions[this.functionsTable[0]].getSignature();t["s_"+d_(e)]=0,this.signatures.push(e)}for(let e=0;e<this.functions.length;e++){const n=this.functions[e].getSignature(),o="s_"+d_(n);void 0===t[o]&&(t[o]=this.signatures.length,this.signatures.push(n)),this.functions[e].signatureIdx=t[o]}}_buildSection(t,e){return[t,...l_(e.length),...e]}_buildType(){return this._buildSection(1,[...l_(this.signatures.length),...[].concat(...this.signatures)])}_buildImport(){const t=[];t.push([...i_(this.memory.moduleName),...i_(this.memory.fieldName),2,0,...l_(this.memory.pagesSize)]);for(let e=0;e<this.nImportFunctions;e++)t.push([...i_(this.functions[e].moduleName),...i_(this.functions[e].fieldName),0,...l_(this.functions[e].signatureIdx)]);return this._buildSection(2,l_(t.length).concat(...t))}_buildFunctionDeclarations(){const t=[];for(let e=this.nImportFunctions;e<this.nImportFunctions+this.nInternalFunctions;e++)t.push(...l_(this.functions[e].signatureIdx));return this._buildSection(3,[...l_(t.length),...t])}_buildFunctionsTable(){return 0==this.functionsTable.length?[]:this._buildSection(4,[...l_(1),112,0,...l_(this.functionsTable.length)])}_buildElements(){if(0==this.functionsTable.length)return[];const t=[];for(let e=0;e<this.functionsTable.length;e++)t.push(...l_(this.functionsTable[e]));return this._buildSection(9,[...l_(1),...l_(0),65,...c_(0),11,...l_(this.functionsTable.length),...t])}_buildExports(){const t=[];for(let e=0;e<this.exports.length;e++)t.push([...i_(this.exports[e].exportName),0,...l_(this.exports[e].idx)]);return this._buildSection(7,l_(t.length).concat(...t))}_buildCode(){const t=[];for(let e=this.nImportFunctions;e<this.nImportFunctions+this.nInternalFunctions;e++)t.push(this.functions[e].getBody());return this._buildSection(10,l_(t.length).concat(...t))}_buildData(){const t=[];t.push([0,65,0,11,4,...o_(this.free)]);for(let e=0;e<this.datas.length;e++)t.push([0,65,...c_(this.datas[e].offset),11,...l_(this.datas[e].bytes.length),...this.datas[e].bytes]);return this._buildSection(11,l_(t.length).concat(...t))}}async function p_(t,e){if(!t&&globalThis.curve_bn128)return globalThis.curve_bn128;const n=new h_;n.setMemory(25),Ep(n),e&&e(n);const o={};o.code=n.build(),o.pq=n.modules.f1m.pq,o.pr=n.modules.frm.pq,o.pG1gen=n.modules.bn128.pG1gen,o.pG1zero=n.modules.bn128.pG1zero,o.pG1b=n.modules.bn128.pG1b,o.pG2gen=n.modules.bn128.pG2gen,o.pG2zero=n.modules.bn128.pG2zero,o.pG2b=n.modules.bn128.pG2b,o.pOneT=n.modules.bn128.pOneT,o.prePSize=n.modules.bn128.prePSize,o.preQSize=n.modules.bn128.preQSize,o.n8q=32,o.n8r=32,o.q=n.modules.bn128.q,o.r=n.modules.bn128.r;const i={name:"bn128",wasm:o,q:gg("21888242871839275222246405745257275088696311157297823662689037894645226208583"),r:gg("21888242871839275222246405745257275088548364400416034343698204186575808495617"),n8q:32,n8r:32,cofactorG2:gg("30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d",16),singleThread:!!t},r=await $p(i);return r.terminate=async function(){i.singleThread||(globalThis.curve_bn128=null,await this.tm.terminate())},t||(globalThis.curve_bn128=r),r}async function __(t,e){if(!t&&globalThis.curve_bls12381)return globalThis.curve_bls12381;const n=new h_;n.setMemory(25),Bp(n),e&&e(n);const o={};o.code=n.build(),o.pq=n.modules.f1m.pq,o.pr=n.modules.frm.pq,o.pG1gen=n.modules.bls12381.pG1gen,o.pG1zero=n.modules.bls12381.pG1zero,o.pG1b=n.modules.bls12381.pG1b,o.pG2gen=n.modules.bls12381.pG2gen,o.pG2zero=n.modules.bls12381.pG2zero,o.pG2b=n.modules.bls12381.pG2b,o.pOneT=n.modules.bls12381.pOneT,o.prePSize=n.modules.bls12381.prePSize,o.preQSize=n.modules.bls12381.preQSize,o.n8q=48,o.n8r=32,o.q=n.modules.bls12381.q,o.r=n.modules.bls12381.r;const i={name:"bls12381",wasm:o,q:gg("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),r:gg("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),n8q:48,n8r:32,cofactorG1:gg("0x396c8c005555e1568c00aaab0000aaab",16),cofactorG2:gg("0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5",16),singleThread:!!t},r=await $p(i);return r.terminate=async function(){i.singleThread||(globalThis.curve_bls12381=null,await this.tm.terminate())},t||(globalThis.curve_bls12381=r),r}globalThis.curve_bn128=null,globalThis.curve_bls12381=null,gg("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),gg("21888242871839275222246405745257275088548364400416034343698204186575808495617"),gg("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),gg("21888242871839275222246405745257275088696311157297823662689037894645226208583");const m_=qg,y_=Tp;var L_={};async function b_(t,e,n,o){if(n=n||262144,"number"!=typeof e&&["w+","wx+","r","ax+","a+"].indexOf(e)<0)throw new Error("Invalid open option");const i=await L_.promises.open(t,e),r=await i.stat();return new A_(i,r,n,o,t)}class A_{constructor(t,e,n,o,i){for(this.fileName=i,this.fd=t,this.pos=0,this.pageSize=o||256;this.pageSize<e.blksize;)this.pageSize*=2;this.totalSize=e.size,this.totalPages=Math.floor((e.size-1)/this.pageSize)+1,this.maxPagesLoaded=Math.floor(n/this.pageSize)+1,this.pages={},this.pendingLoads=[],this.writing=!1,this.reading=!1,this.avBuffs=[],this.history={}}_loadPage(t){const e=this,n=new Promise(((n,o)=>{e.pendingLoads.push({page:t,resolve:n,reject:o})}));return e.__statusPage("After Load request: ",t),n}__statusPage(t,e){const n=[],o=this;if(!o.logHistory)return;n.push("=="+t+" "+e);let i="";for(let t=0;t<o.pendingLoads.length;t++)o.pendingLoads[t].page==e&&(i=i+" "+t);if(i&&n.push("Pending loads:"+i),void 0!==o.pages[e]){const t=o.pages[e];n.push("Loaded"),n.push("pendingOps: "+t.pendingOps),t.loading&&n.push("loading: "+t.loading),t.writing&&n.push("writing"),t.dirty&&n.push("dirty")}n.push("=="),o.history[e]||(o.history[e]=[]),o.history[e].push(n)}__printHistory(t){const e=this;e.history[t]||console.log("Empty History ",t),console.log("History "+t);for(let n=0;n<e.history[t].length;n++)for(let o=0;o<e.history[t][n].length;o++)console.log("-> "+e.history[t][n][o])}_triggerLoad(){const t=this;if(t.reading)return;if(0==t.pendingLoads.length)return;const e=Object.keys(t.pages),n=[];for(let o=0;o<e.length;o++){const i=t.pages[parseInt(e[o])];0!=i.dirty||0!=i.pendingOps||i.writing||i.loading||n.push(parseInt(e[o]))}let o=t.maxPagesLoaded-e.length;const i=[];for(;t.pendingLoads.length>0&&(void 0!==t.pages[t.pendingLoads[0].page]||o>0||n.length>0);){const e=t.pendingLoads.shift();if(void 0!==t.pages[e.page]){t.pages[e.page].pendingOps++;const o=n.indexOf(e.page);o>=0&&n.splice(o,1),t.pages[e.page].loading?t.pages[e.page].loading.push(e):e.resolve(),t.__statusPage("After Load (cached): ",e.page)}else{if(o)o--;else{const e=n.shift();t.__statusPage("Before Unload: ",e),t.avBuffs.unshift(t.pages[e]),delete t.pages[e],t.__statusPage("After Unload: ",e)}e.page>=t.totalPages?(t.pages[e.page]=r(),e.resolve(),t.__statusPage("After Load (new): ",e.page)):(t.reading=!0,t.pages[e.page]=r(),t.pages[e.page].loading=[e],i.push(t.fd.read(t.pages[e.page].buff,0,t.pageSize,e.page*t.pageSize).then((n=>{t.pages[e.page].size=n.bytesRead;const o=t.pages[e.page].loading;delete t.pages[e.page].loading;for(let t=0;t<o.length;t++)o[t].resolve();return t.__statusPage("After Load (loaded): ",e.page),n}),(t=>{e.reject(t)}))),t.__statusPage("After Load (loading): ",e.page))}}function r(){if(t.avBuffs.length>0){const e=t.avBuffs.shift();return e.dirty=!1,e.pendingOps=1,e.size=0,e}return{dirty:!1,buff:new Uint8Array(t.pageSize),pendingOps:1,size:0}}Promise.all(i).then((()=>{t.reading=!1,t.pendingLoads.length>0&&setImmediate(t._triggerLoad.bind(t)),t._tryClose()}))}_triggerWrite(){const t=this;if(t.writing)return;const e=Object.keys(t.pages),n=[];for(let o=0;o<e.length;o++){const i=t.pages[parseInt(e[o])];i.dirty&&(i.dirty=!1,i.writing=!0,t.writing=!0,n.push(t.fd.write(i.buff,0,i.size,parseInt(e[o])*t.pageSize).then((()=>{i.writing=!1}),(e=>{console.log("ERROR Writing: "+e),t.error=e,t._tryClose()}))))}t.writing&&Promise.all(n).then((()=>{t.writing=!1,setImmediate(t._triggerWrite.bind(t)),t._tryClose(),t.pendingLoads.length>0&&setImmediate(t._triggerLoad.bind(t))}))}_getDirtyPage(){for(let t in this.pages)if(this.pages[t].dirty)return t;return-1}async write(t,e){if(0==t.byteLength)return;const n=this;if(void 0===e&&(e=n.pos),n.pos=e+t.byteLength,n.totalSize<e+t.byteLength&&(n.totalSize=e+t.byteLength),n.pendingClose)throw new Error("Writing a closing file");const o=Math.floor(e/n.pageSize),i=Math.floor((e+t.byteLength-1)/n.pageSize),r=[];for(let t=o;t<=i;t++)r.push(n._loadPage(t));n._triggerLoad();let a=o,c=e%n.pageSize,s=t.byteLength;for(;s>0;){await r[a-o];const e=c+s>n.pageSize?n.pageSize-c:s,i=t.slice(t.byteLength-s,t.byteLength-s+e);new Uint8Array(n.pages[a].buff.buffer,c,e).set(i),n.pages[a].dirty=!0,n.pages[a].pendingOps--,n.pages[a].size=Math.max(c+e,n.pages[a].size),a>=n.totalPages&&(n.totalPages=a+1),s-=e,a++,c=0,n.writing||setImmediate(n._triggerWrite.bind(n))}}async read(t,e){let n=new Uint8Array(t);return await this.readToBuffer(n,0,t,e),n}async readToBuffer(t,e,n,o){if(0==n)return;const i=this;if(n>i.pageSize*i.maxPagesLoaded*.8){const t=Math.floor(1.1*n);this.maxPagesLoaded=Math.floor(t/i.pageSize)+1}if(void 0===o&&(o=i.pos),i.pos=o+n,i.pendingClose)throw new Error("Reading a closing file");const r=Math.floor(o/i.pageSize),a=Math.floor((o+n-1)/i.pageSize),c=[];for(let t=r;t<=a;t++)c.push(i._loadPage(t));i._triggerLoad();let s=r,l=o%i.pageSize,d=o+n>i.totalSize?n-(o+n-i.totalSize):n;for(;d>0;){await c[s-r],i.__statusPage("After Await (read): ",s);const o=l+d>i.pageSize?i.pageSize-l:d,a=new Uint8Array(i.pages[s].buff.buffer,i.pages[s].buff.byteOffset+l,o);t.set(a,e+n-d),i.pages[s].pendingOps--,i.__statusPage("After Op done: ",s),d-=o,s++,l=0,i.pendingLoads.length>0&&setImmediate(i._triggerLoad.bind(i))}this.pos=o+n}_tryClose(){const t=this;t.pendingClose&&(t.error&&t.pendingCloseReject(t.error),t._getDirtyPage()>=0||t.writing||t.reading||t.pendingLoads.length>0||t.pendingClose())}close(){const t=this;if(t.pendingClose)throw new Error("Closing the file twice");return new Promise(((e,n)=>{t.pendingClose=e,t.pendingCloseReject=n,t._tryClose()})).then((()=>{t.fd.close()}),(e=>{throw t.fd.close(),e}))}async discard(){await this.close(),await L_.promises.unlink(this.fileName)}async writeULE32(t,e){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t,!0),await this.write(n,e)}async writeUBE32(t,e){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t,!1),await this.write(n,e)}async writeULE64(t,e){const n=new Uint8Array(8),o=new DataView(n.buffer);o.setUint32(0,4294967295&t,!0),o.setUint32(4,Math.floor(t/4294967296),!0),await this.write(n,e)}async readULE32(t){const e=await this.read(4,t);return new Uint32Array(e.buffer)[0]}async readUBE32(t){const e=await this.read(4,t);return new DataView(e.buffer).getUint32(0,!1)}async readULE64(t){const e=await this.read(8,t),n=new Uint32Array(e.buffer);return 4294967296*n[1]+n[0]}async readString(t){const e=this;if(e.pendingClose)throw new Error("Reading a closing file");let n=void 0===t?e.pos:t,o=Math.floor(n/e.pageSize),i=!1,r="";for(;!i;){let t=e._loadPage(o);e._triggerLoad(),await t,e.__statusPage("After Await (read): ",o);let a=n%e.pageSize;const c=new Uint8Array(e.pages[o].buff.buffer,e.pages[o].buff.byteOffset+a,e.pageSize-a);let s=c.findIndex((t=>0===t));i=-1!==s,i?(r+=(new TextDecoder).decode(c.slice(0,s)),e.pos=o*this.pageSize+a+s+1):(r+=(new TextDecoder).decode(c),e.pos=o*this.pageSize+a+c.length),e.pages[o].pendingOps--,e.__statusPage("After Op done: ",o),n=e.pos,o++,e.pendingLoads.length>0&&setImmediate(e._triggerLoad.bind(e))}return r}}const w_=new Uint8Array(4),I_=new DataView(w_.buffer),C_=new Uint8Array(8),x_=new DataView(C_.buffer);class v_{constructor(){this.pageSize=16384}_resizeIfNeeded(t){if(t>this.allocSize){const e=Math.max(this.allocSize+(1<<20),Math.floor(1.1*this.allocSize),t),n=new Uint8Array(e);n.set(this.o.data),this.o.data=n,this.allocSize=e}}async write(t,e){if(void 0===e&&(e=this.pos),this.readOnly)throw new Error("Writing a read only file");this._resizeIfNeeded(e+t.byteLength),this.o.data.set(t.slice(),e),e+t.byteLength>this.totalSize&&(this.totalSize=e+t.byteLength),this.pos=e+t.byteLength}async readToBuffer(t,e,n,o){if(void 0===o&&(o=this.pos),this.readOnly&&o+n>this.totalSize)throw new Error("Reading out of bounds");this._resizeIfNeeded(o+n);const i=new Uint8Array(this.o.data.buffer,this.o.data.byteOffset+o,n);t.set(i,e),this.pos=o+n}async read(t,e){const n=new Uint8Array(t);return await this.readToBuffer(n,0,t,e),n}close(){this.o.data.byteLength!=this.totalSize&&(this.o.data=this.o.data.slice(0,this.totalSize))}async discard(){}async writeULE32(t,e){I_.setUint32(0,t,!0),await this.write(w_,e)}async writeUBE32(t,e){I_.setUint32(0,t,!1),await this.write(w_,e)}async writeULE64(t,e){x_.setUint32(0,4294967295&t,!0),x_.setUint32(4,Math.floor(t/4294967296),!0),await this.write(C_,e)}async readULE32(t){const e=await this.read(4,t);return new Uint32Array(e.buffer)[0]}async readUBE32(t){const e=await this.read(4,t);return new DataView(e.buffer).getUint32(0,!1)}async readULE64(t){const e=await this.read(8,t),n=new Uint32Array(e.buffer);return 4294967296*n[1]+n[0]}async readString(t){const e=this;let n=void 0===t?e.pos:t;if(n>this.totalSize){if(this.readOnly)throw new Error("Reading out of bounds");this._resizeIfNeeded(t)}const o=new Uint8Array(e.o.data.buffer,n,this.totalSize-n);let i=o.findIndex((t=>0===t)),r="";return-1!==i?(r=(new TextDecoder).decode(o.slice(0,i)),e.pos=n+i+1):e.pos=n,r}}const E_=1<<22,B_=new Uint8Array(4),F_=new DataView(B_.buffer),O_=new Uint8Array(8),S_=new DataView(O_.buffer);class P_{constructor(){this.pageSize=16384}_resizeIfNeeded(t){if(t<=this.totalSize)return;if(this.readOnly)throw new Error("Reading out of file bounds");const e=Math.floor((t-1)/E_)+1;for(let n=Math.max(this.o.data.length-1,0);n<e;n++){const o=new Uint8Array(n<e-1?E_:t-(e-1)*E_);n==this.o.data.length-1&&o.set(this.o.data[n]),this.o.data[n]=o}this.totalSize=t}async write(t,e){const n=this;if(void 0===e&&(e=n.pos),this.readOnly)throw new Error("Writing a read only file");this._resizeIfNeeded(e+t.byteLength);let o=Math.floor(e/E_),i=e%E_,r=t.byteLength;for(;r>0;){const e=i+r>E_?E_-i:r,a=t.slice(t.byteLength-r,t.byteLength-r+e);new Uint8Array(n.o.data[o].buffer,i,e).set(a),r-=e,o++,i=0}this.pos=e+t.byteLength}async readToBuffer(t,e,n,o){const i=this;if(void 0===o&&(o=i.pos),this.readOnly&&o+n>this.totalSize)throw new Error("Reading out of bounds");this._resizeIfNeeded(o+n);let r=Math.floor(o/E_),a=o%E_,c=n;for(;c>0;){const o=a+c>E_?E_-a:c,s=new Uint8Array(i.o.data[r].buffer,a,o);t.set(s,e+n-c),c-=o,r++,a=0}this.pos=o+n}async read(t,e){const n=new Uint8Array(t);return await this.readToBuffer(n,0,t,e),n}close(){}async discard(){}async writeULE32(t,e){F_.setUint32(0,t,!0),await this.write(B_,e)}async writeUBE32(t,e){F_.setUint32(0,t,!1),await this.write(B_,e)}async writeULE64(t,e){S_.setUint32(0,4294967295&t,!0),S_.setUint32(4,Math.floor(t/4294967296),!0),await this.write(O_,e)}async readULE32(t){const e=await this.read(4,t);return new Uint32Array(e.buffer)[0]}async readUBE32(t){const e=await this.read(4,t);return new DataView(e.buffer).getUint32(0,!1)}async readULE64(t){const e=await this.read(8,t),n=new Uint32Array(e.buffer);return 4294967296*n[1]+n[0]}async readString(t){const e=this;let n=void 0===t?e.pos:t;if(n>this.totalSize){if(this.readOnly)throw new Error("Reading out of bounds");this._resizeIfNeeded(t)}let o=!1,i="";for(;!o;){let t=Math.floor(n/E_),r=n%E_;if(void 0===e.o.data[t])throw new Error("ERROR");let a=Math.min(2048,e.o.data[t].length-r);const c=new Uint8Array(e.o.data[t].buffer,r,a);let s=c.findIndex((t=>0===t));o=-1!==s,o?(i+=(new TextDecoder).decode(c.slice(0,s)),e.pos=t*E_+r+s+1):(i+=(new TextDecoder).decode(c),e.pos=t*E_+r+c.length),n=e.pos}return i}}async function j_(t,e,n){if("string"==typeof t&&(t={type:"file",fileName:t,cacheSize:e||65536,pageSize:n||8192}),"file"==t.type)return await b_(t.fileName,1538,t.cacheSize,t.pageSize);if("mem"==t.type)return function(t){const e=t.initialSize||1<<20,n=new v_;return n.o=t,n.o.data=new Uint8Array(e),n.allocSize=e,n.totalSize=0,n.readOnly=!1,n.pos=0,n}(t);if("bigMem"==t.type)return function(t){const e=t.initialSize||0,n=new P_;n.o=t;const o=e?Math.floor((e-1)/E_)+1:0;n.o.data=[];for(let t=0;t<o-1;t++)n.o.data.push(new Uint8Array(E_));return o&&n.o.data.push(new Uint8Array(e-E_*(o-1))),n.totalSize=0,n.readOnly=!1,n.pos=0,n}(t);throw new Error("Invalid FastFile type: "+t.type)}async function U_(t,e,n){if(t instanceof Uint8Array&&(t={type:"mem",data:t}),"string"==typeof t&&(t={type:"mem",data:await fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return new Uint8Array(t)}))}),"file"==t.type)return await b_(t.fileName,0,t.cacheSize,t.pageSize);if("mem"==t.type)return await function(t){const e=new v_;return e.o=t,e.allocSize=t.data.byteLength,e.totalSize=t.data.byteLength,e.readOnly=!0,e.pos=0,e}(t);if("bigMem"==t.type)return await function(t){const e=new P_;return e.o=t,e.totalSize=(t.data.length-1)*E_+t.data[t.data.length-1].byteLength,e.readOnly=!0,e.pos=0,e}(t);throw new Error("Invalid FastFile type: "+t.type)}async function k_(t,e,n,o,i){const r=await U_(t),a=await r.read(4);let c="";for(let t=0;t<4;t++)c+=String.fromCharCode(a[t]);if(c!=e)throw new Error(t+": Invalid File format");if(await r.readULE32()>n)throw new Error("Version not supported");const s=await r.readULE32();let l=[];for(let t=0;t<s;t++){let t=await r.readULE32(),e=await r.readULE64();void 0===l[t]&&(l[t]=[]),l[t].push({p:r.pos,size:e}),r.pos+=e}return{fd:r,sections:l}}async function M_(t,e){if(void 0!==t.writingSection)throw new Error("Already writing a section");await t.writeULE32(e),t.writingSection={pSectionSize:t.pos},await t.writeULE64(0)}async function T_(t){if(void 0===t.writingSection)throw new Error("Not writing a section");const e=t.pos-t.writingSection.pSectionSize-8,n=t.pos;t.pos=t.writingSection.pSectionSize,await t.writeULE64(e),t.pos=n,delete t.writingSection}async function z_(t,e,n){if(void 0!==t.readingSection)throw new Error("Already reading a section");if(!e[n])throw new Error(t.fileName+": Missing section "+n);if(e[n].length>1)throw new Error(t.fileName+": Section Duplicated "+n);t.pos=e[n][0].p,t.readingSection=e[n][0]}async function Q_(t,e){if(void 0===t.readingSection)throw new Error("Not reading a section");if(!e&&t.pos-t.readingSection.p!=t.readingSection.size)throw new Error("Invalid section size reading");delete t.readingSection}async function N_(t,e,n){const o=await t.read(e,n);return m_.fromRprLE(o,0,e)}async function D_(t,e,n,o,i){if((o=void 0===o?0:o)+(i=void 0===i?e[n][0].size-o:i)>e[n][0].size)throw new Error("Reading out of the range of the section");let r;return r=i<1<<30?new Uint8Array(i):new Qp(i),await t.readToBuffer(r,0,i,e[n][0].p+o),r}m_.e("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),m_.e("21888242871839275222246405745257275088548364400416034343698204186575808495617");const R_=m_.e("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),q_=m_.e("21888242871839275222246405745257275088696311157297823662689037894645226208583");async function G_(t,e){let n,o=e&&e.singleThread;if(m_.eq(t,q_))n=await p_(o);else{if(!m_.eq(t,R_))throw new Error("Curve not supported: ".concat(m_.toString(t)));n=await __(o)}return n}var K_="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},V_={exports:{}};class H_ extends Error{}H_.prototype.name="AssertionError";var Y_={exports:{}};function J_(t){return t.length}var W_={byteLength:J_,toString:function(t){const e=t.byteLength;let n="";for(let o=0;o<e;o++)n+=String.fromCharCode(t[o]);return n},write:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:J_(e);const i=Math.min(o,t.byteLength-n);for(let o=0;o<i;o++)t[n+o]=e.charCodeAt(o);return i}};const X_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Z_=new Uint8Array(256);for(let t=0;t<64;t++)Z_[X_.charCodeAt(t)]=t;function $_(t){let e=t.length;return 61===t.charCodeAt(e-1)&&e--,e>1&&61===t.charCodeAt(e-1)&&e--,3*e>>>2}Z_[45]=62,Z_[95]=63;var tm={byteLength:$_,toString:function(t){const e=t.byteLength;let n="";for(let o=0;o<e;o+=3)n+=X_[t[o]>>2]+X_[(3&t[o])<<4|t[o+1]>>4]+X_[(15&t[o+1])<<2|t[o+2]>>6]+X_[63&t[o+2]];return e%3==2?n=n.substring(0,n.length-1)+"=":e%3==1&&(n=n.substring(0,n.length-2)+"=="),n},write:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$_(e);const i=Math.min(o,t.byteLength-n);for(let n=0,o=0;o<i;n+=4){const i=Z_[e.charCodeAt(n)],r=Z_[e.charCodeAt(n+1)],a=Z_[e.charCodeAt(n+2)],c=Z_[e.charCodeAt(n+3)];t[o++]=i<<2|r>>4,t[o++]=(15&r)<<4|a>>2,t[o++]=(3&a)<<6|63&c}return i}};function em(t){return t.length>>>1}var nm={byteLength:em,toString:function(t){const e=t.byteLength;t=new DataView(t.buffer,t.byteOffset,e);let n="",o=0;for(let i=e-e%4;o<i;o+=4)n+=t.getUint32(o).toString(16).padStart(8,"0");for(;o<e;o++)n+=t.getUint8(o).toString(16).padStart(2,"0");return n},write:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:em(e);const i=Math.min(o,t.byteLength-n);for(let o=0;o<i;o++){const i=om(e.charCodeAt(2*o)),r=om(e.charCodeAt(2*o+1));if(void 0===i||void 0===r)return t.subarray(0,o);t[n+o]=i<<4|r}return i}};function om(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:void 0}function im(t){let e=0;for(let n=0,o=t.length;n<o;n++){const i=t.charCodeAt(n);if(i>=55296&&i<=56319&&n+1<o){const o=t.charCodeAt(n+1);if(o>=56320&&o<=57343){e+=4,n++;continue}}e+=i<=127?1:i<=2047?2:3}return e}let rm,am;if("undefined"!=typeof TextDecoder){const t=new TextDecoder;rm=function(e){return t.decode(e)}}else rm=function(t){const e=t.byteLength;let n="",o=0;for(;o<e;){let i=t[o];if(i<=127){n+=String.fromCharCode(i),o++;continue}let r=0,a=0;if(i<=223?(r=1,a=31&i):i<=239?(r=2,a=15&i):i<=244&&(r=3,a=7&i),e-o-r>0){let e=0;for(;e<r;)i=t[o+e+1],a=a<<6|63&i,e+=1}else a=65533,r=e-o;n+=String.fromCodePoint(a),o+=r+1}return n};if("undefined"!=typeof TextEncoder){const t=new TextEncoder;am=function(e,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:im(n);const r=Math.min(i,e.byteLength-o);return t.encodeInto(n,e.subarray(o,o+r)),r}}else am=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:im(e);const i=Math.min(o,t.byteLength-n);t=t.subarray(n,n+i);let r=0,a=0;for(;r<e.length;){const n=e.codePointAt(r);if(n<=127){t[a++]=n,r++;continue}let o=0,i=0;for(n<=2047?(o=6,i=192):n<=65535?(o=12,i=224):n<=2097151&&(o=18,i=240),t[a++]=i|n>>o,o-=6;o>=0;)t[a++]=128|n>>o&63,o-=6;r+=n>=65536?2:1}return i};var cm={byteLength:im,toString:rm,write:am};function sm(t){return 2*t.length}var lm,dm,um={byteLength:sm,toString:function(t){const e=t.byteLength;let n="";for(let o=0;o<e-1;o+=2)n+=String.fromCharCode(t[o]+256*t[o+1]);return n},write:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:sm(e);const i=Math.min(o,t.byteLength-n);let r=i;for(let o=0;o<e.length&&!((r-=2)<0);++o){const i=e.charCodeAt(o),r=i>>8,a=i%256;t[n+2*o]=a,t[n+2*o+1]=r}return i}};!function(t,e){const n=W_,o=tm,i=nm,r=cm,a=um,c=255===new Uint8Array(Uint16Array.of(255).buffer)[0];function s(t){switch(t){case"ascii":return n;case"base64":return o;case"hex":return i;case"utf8":case"utf-8":case void 0:return r;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a;default:throw new Error("Unknown encoding: ".concat(t))}}function l(t){return t instanceof Uint8Array}function d(t,e,n){return"string"==typeof t?function(t,e){const n=s(e),o=new Uint8Array(n.byteLength(t));return n.write(o,t,0,o.byteLength),o}(t,e):Array.isArray(t)?function(t){const e=new Uint8Array(t.length);return e.set(t),e}(t):ArrayBuffer.isView(t)?function(t){const e=new Uint8Array(t.byteLength);return e.set(t),e}(t):function(t,e,n){return new Uint8Array(t,e,n)}(t,e,n)}function u(t,e,n,o,i){if(0===t.byteLength)return-1;if("string"==typeof n?(o=n,n=0):void 0===n?n=i?0:t.length-1:n<0&&(n+=t.byteLength),n>=t.byteLength){if(i)return-1;n=t.byteLength-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e)e=d(e,o);else if("number"==typeof e)return e&=255,i?t.indexOf(e,n):t.lastIndexOf(e,n);if(0===e.byteLength)return-1;if(i){let o=-1;for(let i=n;i<t.byteLength;i++)if(t[i]===e[-1===o?0:i-o]){if(-1===o&&(o=i),i-o+1===e.byteLength)return o}else-1!==o&&(i-=i-o),o=-1}else{n+e.byteLength>t.byteLength&&(n=t.byteLength-e.byteLength);for(let o=n;o>=0;o--){let n=!0;for(let i=0;i<e.byteLength;i++)if(t[o+i]!==e[i]){n=!1;break}if(n)return o}}return-1}function f(t,e,n,o){return u(t,e,n,o,!0)}function g(t,e,n){const o=t[e];t[e]=t[n],t[n]=o}t.exports=e={isBuffer:l,isEncoding:function(t){try{return s(t),!0}catch(t){return!1}},alloc:function(t,n,o){const i=new Uint8Array(t);return void 0!==n&&e.fill(i,n,0,i.byteLength,o),i},allocUnsafe:function(t){return new Uint8Array(t)},allocUnsafeSlow:function(t){return new Uint8Array(t)},byteLength:function(t,e){return s(e).byteLength(t)},compare:function(t,e){if(t===e)return 0;const n=Math.min(t.byteLength,e.byteLength);t=new DataView(t.buffer,t.byteOffset,t.byteLength),e=new DataView(e.buffer,e.byteOffset,e.byteLength);let o=0;for(let i=n-n%4;o<i&&t.getUint32(o,c)===e.getUint32(o,c);o+=4);for(;o<n;o++){const n=t.getUint8(o),i=e.getUint8(o);if(n<i)return-1;if(n>i)return 1}return t.byteLength>e.byteLength?1:t.byteLength<e.byteLength?-1:0},concat:function(t,e){void 0===e&&(e=t.reduce(((t,e)=>t+e.byteLength),0));const n=new Uint8Array(e);let o=0;for(const e of t){if(o+e.byteLength>n.byteLength){const t=e.subarray(0,n.byteLength-o);return n.set(t,o),n}n.set(e,o),o+=e.byteLength}return n},copy:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t.byteLength;if(i>0&&i<o)return 0;if(i===o)return 0;if(0===t.byteLength||0===e.byteLength)return 0;if(n<0)throw new RangeError("targetStart is out of range");if(o<0||o>=t.byteLength)throw new RangeError("sourceStart is out of range");if(i<0)throw new RangeError("sourceEnd is out of range");n>=e.byteLength&&(n=e.byteLength),i>t.byteLength&&(i=t.byteLength),e.byteLength-n<i-o&&(i=e.length-n+o);const r=i-o;return t===e?e.copyWithin(n,o,i):e.set(t.subarray(o,i),n),r},equals:function(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;const n=t.byteLength;t=new DataView(t.buffer,t.byteOffset,t.byteLength),e=new DataView(e.buffer,e.byteOffset,e.byteLength);let o=0;for(let i=n-n%4;o<i;o+=4)if(t.getUint32(o,c)!==e.getUint32(o,c))return!1;for(;o<n;o++)if(t.getUint8(o)!==e.getUint8(o))return!1;return!0},fill:function(t,e,n,o,i){if("string"==typeof e?"string"==typeof n?(i=n,n=0,o=t.byteLength):"string"==typeof o&&(i=o,o=t.byteLength):"number"==typeof e?e&=255:"boolean"==typeof e&&(e=+e),n<0||t.byteLength<n||t.byteLength<o)throw new RangeError("Out of range index");if(void 0===n&&(n=0),void 0===o&&(o=t.byteLength),o<=n)return t;if(e||(e=0),"number"==typeof e)for(let i=n;i<o;++i)t[i]=e;else{const r=(e=l(e)?e:d(e,i)).byteLength;for(let i=0;i<o-n;++i)t[i+n]=e[i%r]}return t},from:d,includes:function(t,e,n,o){return-1!==f(t,e,n,o)},indexOf:f,lastIndexOf:function(t,e,n,o){return u(t,e,n,o,!1)},swap16:function(t){const e=t.byteLength;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let n=0;n<e;n+=2)g(t,n,n+1);return t},swap32:function(t){const e=t.byteLength;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let n=0;n<e;n+=4)g(t,n,n+3),g(t,n+1,n+2);return t},swap64:function(t){const e=t.byteLength;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let n=0;n<e;n+=8)g(t,n,n+7),g(t,n+1,n+6),g(t,n+2,n+5),g(t,n+3,n+4);return t},toBuffer:function(t){return t},toString:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.byteLength;const i=t.byteLength;return n>=i||o<=n?"":(n<0&&(n=0),o>i&&(o=i),(0!==n||o<i)&&(t=t.subarray(n,o)),s(e).toString(t))},write:function(t,e,n,o,i){return void 0===n?i="utf8":void 0===o&&"string"==typeof n?(i=n,n=void 0):void 0===i&&"string"==typeof o&&(i=o,o=void 0),s(i).write(t,e,n,o)},writeDoubleLE:function(t,e,n){return void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(n,e,!0),n+8},writeFloatLE:function(t,e,n){return void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(n,e,!0),n+4},writeUInt32LE:function(t,e,n){return void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setUint32(n,e,!0),n+4},writeInt32LE:function(t,e,n){return void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setInt32(n,e,!0),n+4},readDoubleLE:function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e,!0)},readFloatLE:function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e,!0)},readUInt32LE:function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getUint32(e,!0)},readInt32LE:function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getInt32(e,!0)}}}(Y_,Y_.exports);var fm=function t(e,n){if(!e){var o=new H_(n);throw Error.captureStackTrace&&Error.captureStackTrace(o,t),o}},gm=Y_.exports,hm=null,pm="undefined"!=typeof WebAssembly&&function(){if(dm)return lm;dm=1;var t=(()=>{for(var t=new Uint8Array(128),e=0;e<64;e++)t[e<26?e+65:e<52?e+71:e<62?e-4:4*e-205]=e;return e=>{for(var n=e.length,o=new Uint8Array(3*(n-("="==e[n-1])-("="==e[n-2]))/4|0),i=0,r=0;i<n;){var a=t[e.charCodeAt(i++)],c=t[e.charCodeAt(i++)],s=t[e.charCodeAt(i++)],l=t[e.charCodeAt(i++)];o[r++]=a<<2|c>>4,o[r++]=c<<4|s>>2,o[r++]=s<<6|l}return o}})(),e=((t,e)=>function(){return e||(0,t[Object.keys(t)[0]])((e={exports:{}}).exports,e),e.exports})({"wasm-binary:./blake2b.wat"(e,n){n.exports=t("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMKvz8EwAIAIABCADcDACAAQgA3AwggAEIANwMQIABCADcDGCAAQgA3AyAgAEIANwMoIABCADcDMCAAQgA3AzggAEIANwNAIABCADcDSCAAQgA3A1AgAEIANwNYIABCADcDYCAAQgA3A2ggAEIANwNwIABCADcDeCAAQoiS853/zPmE6gBBACkDAIU3A4ABIABCu86qptjQ67O7f0EIKQMAhTcDiAEgAEKr8NP0r+68tzxBECkDAIU3A5ABIABC8e30+KWn/aelf0EYKQMAhTcDmAEgAELRhZrv+s+Uh9EAQSApAwCFNwOgASAAQp/Y+dnCkdqCm39BKCkDAIU3A6gBIABC6/qG2r+19sEfQTApAwCFNwOwASAAQvnC+JuRo7Pw2wBBOCkDAIU3A7gBIABCADcDwAEgAEIANwPIASAAQgA3A9ABC20BA38gAEHAAWohAyAAQcgBaiEEIAQpAwCnIQUCQANAIAEgAkYNASAFQYABRgRAIAMgAykDACAFrXw3AwBBACEFIAAQAwsgACAFaiABLQAAOgAAIAVBAWohBSABQQFqIQEMAAsLIAQgBa03AwALYQEDfyAAQcABaiEBIABByAFqIQIgASABKQMAIAIpAwB8NwMAIABCfzcD0AEgAikDAKchAwJAA0AgA0GAAUYNASAAIANqQQA6AAAgA0EBaiEDDAALCyACIAOtNwMAIAAQAwuqOwIgfgl/IABBgAFqISEgAEGIAWohIiAAQZABaiEjIABBmAFqISQgAEGgAWohJSAAQagBaiEmIABBsAFqIScgAEG4AWohKCAhKQMAIQEgIikDACECICMpAwAhAyAkKQMAIQQgJSkDACEFICYpAwAhBiAnKQMAIQcgKCkDACEIQoiS853/zPmE6gAhCUK7zqqm2NDrs7t/IQpCq/DT9K/uvLc8IQtC8e30+KWn/aelfyEMQtGFmu/6z5SH0QAhDUKf2PnZwpHagpt/IQ5C6/qG2r+19sEfIQ9C+cL4m5Gjs/DbACEQIAApAwAhESAAKQMIIRIgACkDECETIAApAxghFCAAKQMgIRUgACkDKCEWIAApAzAhFyAAKQM4IRggACkDQCEZIAApA0ghGiAAKQNQIRsgACkDWCEcIAApA2AhHSAAKQNoIR4gACkDcCEfIAApA3ghICANIAApA8ABhSENIA8gACkD0AGFIQ8gASAFIBF8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSASfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgE3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBR8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAVfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBd8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAYfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgGXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBp8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAbfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgHHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIB18fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAefHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgH3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFICB8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAffHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgG3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBV8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAZfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHICB8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAefHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggF3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBJ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAdfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgEXx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBN8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAcfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGHx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBZ8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAUfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHHx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBl8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAdfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgEXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBZ8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByATfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggIHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIB58fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAbfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgH3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBR8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAXfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBJ8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAafHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFXx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBh8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAafHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFHx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBJ8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAefHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHXx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBx8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAffHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgE3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBd8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAWfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgG3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBV8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCARfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgIHx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBl8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAafHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEXx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBZ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAYfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgE3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBV8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAbfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggIHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIB98fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiASfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgHHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB18fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAXfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBR8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAefHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgE3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIB18fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAXfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgG3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBF8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAcfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggGXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBR8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAVfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBh8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAWfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggIHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB98fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSASfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgGnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB18fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAWfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgEnx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGICB8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAffHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBV8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAbfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBh8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAXfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBp8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCATfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGXx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBx8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAefHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgHHx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBh8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAffHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBJ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAUfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBZ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiARfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgIHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBV8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAZfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggF3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBN8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAbfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgF3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFICB8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAffHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGnx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBx8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAUfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggEXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBl8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAdfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgE3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIB58fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAYfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggEnx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBV8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAbfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBt8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSATfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgGXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBV8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAYfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgF3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBJ8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAWfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgIHx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBx8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAafHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgH3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBR8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAdfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgHnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBF8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgISAhKQMAIAEgCYWFNwMAICIgIikDACACIAqFhTcDACAjICMpAwAgAyALhYU3AwAgJCAkKQMAIAQgDIWFNwMAICUgJSkDACAFIA2FhTcDACAmICYpAwAgBiAOhYU3AwAgJyAnKQMAIAcgD4WFNwMAICggKCkDACAIIBCFhTcDAAs=")}}),n=e(),o=WebAssembly.compile(n);return lm=async t=>(await WebAssembly.instantiate(await o,t)).exports}()().then((t=>{hm=t})),_m=64,mm=[];V_.exports=Cm;var ym=V_.exports.BYTES_MIN=16,Lm=V_.exports.BYTES_MAX=64;V_.exports.BYTES=32;var bm=V_.exports.KEYBYTES_MIN=16,Am=V_.exports.KEYBYTES_MAX=64;V_.exports.KEYBYTES=32;var wm=V_.exports.SALTBYTES=16,Im=V_.exports.PERSONALBYTES=16;function Cm(t,e,n,o,i){if(!(this instanceof Cm))return new Cm(t,e,n,o,i);if(!hm)throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");t||(t=32),!0!==i&&(fm(t>=ym,"digestLength must be at least "+ym+", was given "+t),fm(t<=Lm,"digestLength must be at most "+Lm+", was given "+t),null!=e&&(fm(e instanceof Uint8Array,"key must be Uint8Array or Buffer"),fm(e.length>=bm,"key must be at least "+bm+", was given "+e.length),fm(e.length<=Am,"key must be at least "+Am+", was given "+e.length)),null!=n&&(fm(n instanceof Uint8Array,"salt must be Uint8Array or Buffer"),fm(n.length===wm,"salt must be exactly "+wm+", was given "+n.length)),null!=o&&(fm(o instanceof Uint8Array,"personal must be Uint8Array or Buffer"),fm(o.length===Im,"personal must be exactly "+Im+", was given "+o.length))),mm.length||(mm.push(_m),_m+=216),this.digestLength=t,this.finalized=!1,this.pointer=mm.pop(),this._memory=new Uint8Array(hm.memory.buffer),this._memory.fill(0,0,64),this._memory[0]=this.digestLength,this._memory[1]=e?e.length:0,this._memory[2]=1,this._memory[3]=1,n&&this._memory.set(n,32),o&&this._memory.set(o,48),this.pointer+216>this._memory.length&&this._realloc(this.pointer+216),hm.blake2b_init(this.pointer,this.digestLength),e&&(this.update(e),this._memory.fill(0,_m,_m+e.length),this._memory[this.pointer+200]=128)}function xm(){}function vm(t){return(4294901760&t?(t&=4294901760,16):0)|(4278255360&t?(t&=4278255360,8):0)|(4042322160&t?(t&=4042322160,4):0)|(3435973836&t?(t&=3435973836,2):0)|!!(2863311530&t)}Cm.prototype._realloc=function(t){hm.memory.grow(Math.max(0,Math.ceil(Math.abs(t-this._memory.length)/65536))),this._memory=new Uint8Array(hm.memory.buffer)},Cm.prototype.update=function(t){return fm(!1===this.finalized,"Hash instance finalized"),fm(t instanceof Uint8Array,"input must be Uint8Array or Buffer"),_m+t.length>this._memory.length&&this._realloc(_m+t.length),this._memory.set(t,_m),hm.blake2b_update(this.pointer,_m,_m+t.length),this},Cm.prototype.digest=function(t){if(fm(!1===this.finalized,"Hash instance finalized"),this.finalized=!0,mm.push(this.pointer),hm.blake2b_final(this.pointer),!t||"binary"===t)return this._memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if("string"==typeof t)return gm.toString(this._memory,t,this.pointer+128,this.pointer+128+this.digestLength);fm(t instanceof Uint8Array&&t.length>=this.digestLength,"input must be Uint8Array or Buffer");for(var e=0;e<this.digestLength;e++)t[e]=this._memory[this.pointer+128+e];return t},Cm.prototype.final=Cm.prototype.digest,Cm.WASM=hm,Cm.SUPPORTED="undefined"!=typeof WebAssembly,Cm.ready=function(t){return t||(t=xm),pm?pm.then((()=>t()),t):t(new Error("WebAssembly not supported"))},Cm.prototype.ready=Cm.ready,Cm.prototype.getPartialHash=function(){return this._memory.slice(this.pointer,this.pointer+216)},Cm.prototype.setPartialHash=function(t){this._memory.set(t,this.pointer)};async function Em(t,e,n){const o=await t.read(2*e.G1.F.n8),i=e.G1.fromRprLEM(o,0);return n?e.G1.toObject(i):i}async function Bm(t,e,n){const o=await t.read(2*e.G2.F.n8),i=e.G2.fromRprLEM(o,0);return n?e.G2.toObject(i):i}const{stringifyBigInts:Fm}=y_;async function Om(t,e,n,o){const{fd:i,sections:r}=await k_(e,"wtns",2),a=await async function(t,e){await z_(t,e,1);const n=await t.readULE32(),o=await N_(t,n),i=await t.readULE32();return await Q_(t),{n8:n,q:o,nWitness:i}}(i,r),{fd:c,sections:s}=await k_(t,"zkey",2),l=await async function(t,e,n,o){await z_(t,e,1);const i=await t.readULE32();if(await Q_(t),1===i)return await async function(t,e,n,o){const i={protocol:"groth16"};await z_(t,e,2);const r=await t.readULE32();i.n8q=r,i.q=await N_(t,r);const a=await t.readULE32();return i.n8r=a,i.r=await N_(t,a),i.curve=await G_(i.q,o),i.nVars=await t.readULE32(),i.nPublic=await t.readULE32(),i.domainSize=await t.readULE32(),i.power=vm(i.domainSize),i.vk_alpha_1=await Em(t,i.curve,n),i.vk_beta_1=await Em(t,i.curve,n),i.vk_beta_2=await Bm(t,i.curve,n),i.vk_gamma_2=await Bm(t,i.curve,n),i.vk_delta_1=await Em(t,i.curve,n),i.vk_delta_2=await Bm(t,i.curve,n),await Q_(t),i}(t,e,n,o);if(2===i)return await async function(t,e,n,o){const i={protocol:"plonk"};await z_(t,e,2);const r=await t.readULE32();i.n8q=r,i.q=await N_(t,r);const a=await t.readULE32();return i.n8r=a,i.r=await N_(t,a),i.curve=await G_(i.q,o),i.nVars=await t.readULE32(),i.nPublic=await t.readULE32(),i.domainSize=await t.readULE32(),i.power=vm(i.domainSize),i.nAdditions=await t.readULE32(),i.nConstraints=await t.readULE32(),i.k1=await t.read(a),i.k2=await t.read(a),i.Qm=await Em(t,i.curve,n),i.Ql=await Em(t,i.curve,n),i.Qr=await Em(t,i.curve,n),i.Qo=await Em(t,i.curve,n),i.Qc=await Em(t,i.curve,n),i.S1=await Em(t,i.curve,n),i.S2=await Em(t,i.curve,n),i.S3=await Em(t,i.curve,n),i.X_2=await Bm(t,i.curve,n),await Q_(t),i}(t,e,n,o);if(10===i)return await async function(t,e,n,o){const i={protocol:"fflonk",protocolId:10};await z_(t,e,2);const r=await t.readULE32();i.n8q=r,i.q=await N_(t,r),i.curve=await G_(i.q,o);const a=await t.readULE32();return i.n8r=a,i.r=await N_(t,a),i.nVars=await t.readULE32(),i.nPublic=await t.readULE32(),i.domainSize=await t.readULE32(),i.power=vm(i.domainSize),i.nAdditions=await t.readULE32(),i.nConstraints=await t.readULE32(),i.k1=await t.read(a),i.k2=await t.read(a),i.w3=await t.read(a),i.w4=await t.read(a),i.w8=await t.read(a),i.wr=await t.read(a),i.X_2=await Bm(t,i.curve,n),i.C0=await Em(t,i.curve,n),await Q_(t),i}(t,e,n,o);throw new Error("Protocol not supported: ")}(c,s,void 0,o);if("groth16"!=l.protocol)throw new Error("zkey file is not groth16");if(!m_.eq(l.r,a.q))throw new Error("Curve of the witness does not match the curve of the proving key");if(a.nWitness!=l.nVars)throw new Error("Invalid witness length. Circuit: ".concat(l.nVars,", witness: ").concat(a.nWitness));const d=l.curve,u=d.Fr,f=d.G1,g=d.G2,h=vm(l.domainSize);n&&n.debug("Reading Wtns");const p=await D_(i,r,2);n&&n.debug("Reading Coeffs");const _=await D_(c,s,4);n&&n.debug("Building ABC");const[m,y,L]=await async function(t,e,n,o,i){const r=t.Fr.n8,a=12+e.n8r,c=(o.byteLength-4)/a,s=new Qp(e.domainSize*r),l=new Qp(e.domainSize*r),d=new Qp(e.domainSize*r),u=[s,l];for(let e=0;e<c;e++){i&&e%1e6==0&&i.debug("QAP AB: ".concat(e,"/").concat(c));const s=o.slice(4+e*a,4+e*a+a),l=new DataView(s.buffer),d=l.getUint32(0,!0),f=l.getUint32(4,!0),g=l.getUint32(8,!0),h=s.slice(12,12+r);u[d].set(t.Fr.add(u[d].slice(f*r,f*r+r),t.Fr.mul(h,n.slice(g*r,g*r+r))),f*r)}for(let n=0;n<e.domainSize;n++)i&&n%1e6==0&&i.debug("QAP C: ".concat(n,"/").concat(e.domainSize)),d.set(t.Fr.mul(s.slice(n*r,n*r+r),l.slice(n*r,n*r+r)),n*r);return[s,l,d]}(d,l,p,_,n),b=h==u.s?d.Fr.shift:d.Fr.w[h+1],A=await u.ifft(m,"","",n,"IFFT_A"),w=await u.batchApplyKey(A,u.e(1),b),I=await u.fft(w,"","",n,"FFT_A"),C=await u.ifft(y,"","",n,"IFFT_B"),x=await u.batchApplyKey(C,u.e(1),b),v=await u.fft(x,"","",n,"FFT_B"),E=await u.ifft(L,"","",n,"IFFT_C"),B=await u.batchApplyKey(E,u.e(1),b),F=await u.fft(B,"","",n,"FFT_C");n&&n.debug("Join ABC");const O=await async function(t,e,n,o,i,r){const a=1<<22,c=t.Fr.n8,s=Math.floor(n.byteLength/t.Fr.n8),l=[];for(let e=0;e<s;e+=a){r&&r.debug("JoinABC: ".concat(e,"/").concat(s));const d=Math.min(s-e,a),u=[],f=n.slice(e*c,(e+d)*c),g=o.slice(e*c,(e+d)*c),h=i.slice(e*c,(e+d)*c);u.push({cmd:"ALLOCSET",var:0,buff:f}),u.push({cmd:"ALLOCSET",var:1,buff:g}),u.push({cmd:"ALLOCSET",var:2,buff:h}),u.push({cmd:"ALLOC",var:3,len:d*c}),u.push({cmd:"CALL",fnName:"qap_joinABC",params:[{var:0},{var:1},{var:2},{val:d},{var:3}]}),u.push({cmd:"CALL",fnName:"frm_batchFromMontgomery",params:[{var:3},{val:d},{var:3}]}),u.push({cmd:"GET",out:0,var:3,len:d*c}),l.push(t.tm.queueAction(u))}const d=await Promise.all(l);let u;u=n instanceof Qp?new Qp(n.byteLength):new Uint8Array(n.byteLength);let f=0;for(let t=0;t<d.length;t++)u.set(d[t][0],f),f+=d[t][0].byteLength;return u}(d,0,I,v,F,n);let S={};n&&n.debug("Reading A Points");const P=await D_(c,s,5);S.pi_a=await d.G1.multiExpAffine(P,p,n,"multiexp A"),n&&n.debug("Reading B1 Points");const j=await D_(c,s,6);let U=await d.G1.multiExpAffine(j,p,n,"multiexp B1");n&&n.debug("Reading B2 Points");const k=await D_(c,s,7);S.pi_b=await d.G2.multiExpAffine(k,p,n,"multiexp B2"),n&&n.debug("Reading C Points");const M=await D_(c,s,8);S.pi_c=await d.G1.multiExpAffine(M,p.slice((l.nPublic+1)*d.Fr.n8),n,"multiexp C"),n&&n.debug("Reading H Points");const T=await D_(c,s,9),z=await d.G1.multiExpAffine(T,O,n,"multiexp H"),Q=d.Fr.random(),N=d.Fr.random();S.pi_a=f.add(S.pi_a,l.vk_alpha_1),S.pi_a=f.add(S.pi_a,f.timesFr(l.vk_delta_1,Q)),S.pi_b=g.add(S.pi_b,l.vk_beta_2),S.pi_b=g.add(S.pi_b,g.timesFr(l.vk_delta_2,N)),U=f.add(U,l.vk_beta_1),U=f.add(U,f.timesFr(l.vk_delta_1,N)),S.pi_c=f.add(S.pi_c,z),S.pi_c=f.add(S.pi_c,f.timesFr(S.pi_a,N)),S.pi_c=f.add(S.pi_c,f.timesFr(U,Q)),S.pi_c=f.add(S.pi_c,f.timesFr(l.vk_delta_1,u.neg(u.mul(Q,N))));let D=[];for(let t=1;t<=l.nPublic;t++){const e=p.slice(t*u.n8,t*u.n8+u.n8);D.push(m_.fromRprLE(e))}return S.pi_a=f.toObject(f.toAffine(S.pi_a)),S.pi_b=g.toObject(g.toAffine(S.pi_b)),S.pi_c=f.toObject(f.toAffine(S.pi_c)),S.protocol="groth16",S.curve=d.name,await c.close(),await i.close(),S=Fm(S),D=Fm(D),{proof:S,publicSignals:D}}function Sm(t){let e=[];return function t(e,n){if(Array.isArray(n))for(let o=0;o<n.length;o++)t(e,n[o]);else e.push(n)}(e,t),e}function Pm(t,e){let n=BigInt(t)%e;return n<0&&(n+=e),n}function jm(t){const e=BigInt(2)**BigInt(64);let n=BigInt("0xCBF29CE484222325");for(let o=0;o<t.length;o++)n^=BigInt(t[o].charCodeAt(0)),n*=BigInt(1099511628211),n%=e;let o=n.toString(16),i=16-o.length;return o="0".repeat(i).concat(o),o}function Um(t,e){const n=[];let o=BigInt(t);const i=BigInt(4294967296);for(;o;)n.unshift(Number(o%i)),o/=i;if(e){let t=e-n.length;for(;t>0;)n.unshift(0),t--}return n}class km{constructor(t,e,n){this.memory=t,this.i32=new Uint32Array(t.buffer),this.instance=e,this.n32=(this.instance.exports.getFrLen()>>2)-2;const o=this.instance.exports.getPRawPrime(),i=new Array(this.n32);for(let t=0;t<this.n32;t++)i[this.n32-1-t]=this.i32[(o>>2)+t];this.prime=m_.fromArray(i,4294967296),this.Fr=new eh(this.prime),this.mask32=m_.fromString("FFFFFFFF",16),this.NVars=this.instance.exports.getNVars(),this.n64=Math.floor((this.Fr.bitLength-1)/64)+1,this.R=this.Fr.e(m_.shiftLeft(1,64*this.n64)),this.RInv=this.Fr.inv(this.R),this.sanityCheck=n}circom_version(){return 1}async _doCalculateWitness(t,e){this.instance.exports.init(this.sanityCheck||e?1:0);const n=this.allocInt(),o=this.allocFr();Object.keys(t).forEach((e=>{const i=jm(e),r=parseInt(i.slice(0,8),16),a=parseInt(i.slice(8,16),16);try{this.instance.exports.getSignalOffset32(n,0,r,a)}catch(t){throw new Error("Signal ".concat(e," is not an input of the circuit."))}const c=this.getInt(n),s=Sm(t[e]);for(let t=0;t<s.length;t++)this.setFr(o,s[t]),this.instance.exports.setSignal(0,0,c+t,o)}))}async calculateWitness(t,e){const n=this,o=n.i32[0],i=[];await n._doCalculateWitness(t,e);for(let t=0;t<n.NVars;t++){const e=n.instance.exports.getPWitness(t);i.push(n.getFr(e))}return n.i32[0]=o,i}async calculateBinWitness(t,e){const n=this,o=n.i32[0];await n._doCalculateWitness(t,e);const i=n.instance.exports.getWitnessBuffer();n.i32[0]=o;const r=n.memory.buffer.slice(i,i+n.NVars*n.n64*8);return new Uint8Array(r)}allocInt(){const t=this.i32[0];return this.i32[0]=t+8,t}allocFr(){const t=this.i32[0];return this.i32[0]=t+4*this.n32+8,t}getInt(t){return this.i32[t>>2]}setInt(t,e){this.i32[t>>2]=e}getFr(t){const e=this,n=t>>2;if(2147483648&e.i32[n+1]){const t=new Array(e.n32);for(let o=0;o<e.n32;o++)t[e.n32-1-o]=e.i32[n+2+o];const o=e.Fr.e(m_.fromArray(t,4294967296));return 1073741824&e.i32[n+1]?function(t){return e.Fr.mul(e.RInv,t)}(o):o}return 2147483648&e.i32[n]?e.Fr.e(e.i32[n]-4294967296):e.Fr.e(e.i32[n])}setFr(t,e){const n=this;e=n.Fr.e(e);const o=n.Fr.neg(n.Fr.e("80000000",16)),i=n.Fr.e("7FFFFFFF",16);if(n.Fr.geq(e,o)&&n.Fr.leq(e,i)){let i;return n.Fr.geq(e,n.Fr.zero)?i=m_.toNumber(e):(i=m_.toNumber(n.Fr.sub(e,o)),i-=2147483648,i=4294967296+i),n.i32[t>>2]=i,void(n.i32[1+(t>>2)]=0)}n.i32[t>>2]=0,n.i32[1+(t>>2)]=2147483648;const r=m_.toArray(e,4294967296);for(let e=0;e<n.n32;e++){const o=r.length-1-e;n.i32[2+(t>>2)+e]=o>=0?r[o]:0}}}class Mm{constructor(t,e){this.instance=t,this.version=this.instance.exports.getVersion(),this.n32=this.instance.exports.getFieldNumLen32(),this.instance.exports.getRawPrime();const n=new Uint32Array(this.n32);for(let t=0;t<this.n32;t++)n[this.n32-1-t]=this.instance.exports.readSharedRWMemory(t);this.prime=m_.fromArray(n,4294967296),this.witnessSize=this.instance.exports.getWitnessSize(),this.sanityCheck=e}circom_version(){return this.instance.exports.getVersion()}async _doCalculateWitness(t,e){this.instance.exports.init(this.sanityCheck||e?1:0);const n=Object.keys(t);let o=0;if(n.forEach((e=>{const n=jm(e),i=parseInt(n.slice(0,8),16),r=parseInt(n.slice(8,16),16),a=Sm(t[e]);if("function"==typeof this.instance.exports.getInputSignalSize){let t=this.instance.exports.getInputSignalSize(i,r);if(t<0)throw new Error("Signal ".concat(e," not found\n"));if(a.length<t)throw new Error("Not enough values for input signal ".concat(e,"\n"));if(a.length>t)throw new Error("Too many values for input signal ".concat(e,"\n"))}for(let t=0;t<a.length;t++){const e=Um(Pm(a[t],this.prime),this.n32);for(let t=0;t<this.n32;t++)this.instance.exports.writeSharedRWMemory(t,e[this.n32-1-t]);try{this.instance.exports.setInputSignal(i,r,t),o++}catch(t){throw new Error(t)}}})),o<this.instance.exports.getInputSize())throw new Error("Not all inputs have been set. Only ".concat(o," out of ").concat(this.instance.exports.getInputSize()))}async calculateWitness(t,e){const n=[];await this._doCalculateWitness(t,e);for(let t=0;t<this.witnessSize;t++){this.instance.exports.getWitness(t);const e=new Uint32Array(this.n32);for(let t=0;t<this.n32;t++)e[this.n32-1-t]=this.instance.exports.readSharedRWMemory(t);n.push(m_.fromArray(e,4294967296))}return n}async calculateWTNSBin(t,e){const n=new Uint32Array(this.witnessSize*this.n32+this.n32+11),o=new Uint8Array(n.buffer);await this._doCalculateWitness(t,e),o[0]="w".charCodeAt(0),o[1]="t".charCodeAt(0),o[2]="n".charCodeAt(0),o[3]="s".charCodeAt(0),n[1]=2,n[2]=2,n[3]=1;const i=4*this.n32,r=(8+i).toString(16);n[4]=parseInt(r.slice(0,8),16),n[5]=parseInt(r.slice(8,16),16),n[6]=i,this.instance.exports.getRawPrime();let a=7;for(let t=0;t<this.n32;t++)n[a+t]=this.instance.exports.readSharedRWMemory(t);a+=this.n32,n[a]=this.witnessSize,a++,n[a]=2,a++;const c=(i*this.witnessSize).toString(16);n[a]=parseInt(c.slice(0,8),16),n[a+1]=parseInt(c.slice(8,16),16),a+=2;for(let t=0;t<this.witnessSize;t++){this.instance.exports.getWitness(t);for(let t=0;t<this.n32;t++)n[a+t]=this.instance.exports.readSharedRWMemory(t);a+=this.n32}return o}}const{unstringifyBigInts:Tm}=y_;async function zm(t,e,n,o){const i=Tm(t),r=await U_(e),a=await r.read(r.totalSize);await r.close();const c=await async function(t,e){let n,o,i;e=e||{};let r=1,a=0,c=0,s=!1;if(t instanceof WebAssembly.Instance)n=t,s=!0;else{let s=32767;if(e.memorySize&&(s=parseInt(e.memorySize),s<0))throw new Error("Invalid memory size");let l=!1;for(;!l;)try{i=new WebAssembly.Memory({initial:s}),l=!0}catch(t){if(s<=1)throw t;console.warn("Could not allocate "+1024*s*64+" bytes. This may cause severe instability. Trying with "+1024*s*64/2+" bytes"),s=Math.floor(s/2)}const f=await WebAssembly.compile(t);let g="",h="";n=await WebAssembly.instantiate(f,{env:{memory:i},runtime:{printDebug:function(t){console.log("printDebug:",t)},exceptionHandler:function(t){let e;throw e=1===t?"Signal not found. ":2===t?"Too many signals set. ":3===t?"Signal already set. ":4===t?"Assert Failed. ":5===t?"Not enough memory. ":6===t?"Input signal array access exceeds the size. ":"Unknown error. ",console.error("ERROR: ",t,g),new Error(e+g)},printErrorMessage:function(){g+=d()+"\n"},writeBufferMessage:function(){const t=d();"\n"===t?(console.log(h),h=""):(""!==h&&(h+=" "),h+=t)},showSharedRWMemory:function(){const t=n.exports.getFieldNumLen32(),e=new Uint32Array(t);for(let o=0;o<t;o++)e[t-1-o]=n.exports.readSharedRWMemory(o);if(r>=2&&(a>=1||c>=7)){""!==h&&(h+=" ");const t=m_.fromArray(e,4294967296).toString();h+=t}else console.log(m_.fromArray(e,4294967296))},error:function(t,n,i,r,a,c){let s;throw s=7===t?u(n)+" "+o.getFr(r).toString()+" != "+o.getFr(a).toString()+" "+u(c):9===t?u(n)+" "+o.getFr(r).toString()+" "+u(a):5===t&&e.sym?u(n)+" "+e.sym.labelIdx2Name[a]:u(n)+" "+i+" "+r+" "+a+" "+c,console.log("ERROR: ",t,s),new Error(s)},log:function(t){console.log(o.getFr(t).toString())},logGetSignal:function(t,n){e.logGetSignal&&e.logGetSignal(t,o.getFr(n))},logSetSignal:function(t,n){e.logSetSignal&&e.logSetSignal(t,o.getFr(n))},logStartComponent:function(t){e.logStartComponent&&e.logStartComponent(t)},logFinishComponent:function(t){e.logFinishComponent&&e.logFinishComponent(t)}}})}"function"==typeof n.exports.getVersion&&(r=n.exports.getVersion()),"function"==typeof n.exports.getMinorVersion&&(a=n.exports.getMinorVersion()),"function"==typeof n.exports.getPatchVersion&&(c=n.exports.getPatchVersion());const l=e&&(e.sanityCheck||e.logGetSignal||e.logSetSignal||e.logStartComponent||e.logFinishComponent);if(2===r)o=new Mm(n,l);else{if(1!==r)throw new Error("Unsupported circom version: ".concat(r));if(s)throw new Error("Loading code from WebAssembly instance is not supported for circom version 1");o=new km(i,n,l)}return o;function d(){let t="",e=n.exports.getMessageChar();for(;0!==e;)t+=String.fromCharCode(e),e=n.exports.getMessageChar();return t}function u(t){const e=new Uint8Array(i.buffer),n=[];for(let o=0;e[t+o]>0;o++)n.push(e[t+o]);return String.fromCharCode.apply(null,n)}}(a,o);if(1===c.circom_version()){const t=await c.calculateBinWitness(i),e=await async function(t,e,n,o,i,r){const a=await j_(t,i,r),c=new Uint8Array(4);for(let t=0;t<4;t++)c[t]=e.charCodeAt(t);return await a.write(c,0),await a.writeULE32(n),await a.writeULE32(o),a}(n,"wtns",2,2);await async function(t,e,n){await M_(t,1);const o=8*(Math.floor((m_.bitLength(n)-1)/64)+1);if(await t.writeULE32(o),await async function(t,e,n,o){const i=new Uint8Array(n);m_.toRprLE(i,0,e,n),await t.write(i,o)}(t,n,o),e.byteLength%o!=0)throw new Error("Invalid witness length");await t.writeULE32(e.byteLength/o),await T_(t),await M_(t,2),await t.write(e),await T_(t)}(e,t,c.prime),await e.close()}else{const t=await j_(n),e=await c.calculateWTNSBin(i);await t.write(e),await t.close()}}const{unstringifyBigInts:Qm}=y_,{unstringifyBigInts:Nm}=y_,{unstringifyBigInts:Dm}=y_;function Rm(t){let e=t.toString(16);for(;e.length<64;)e="0"+e;return e='"0x'.concat(e,'"'),e}var qm=Object.freeze({__proto__:null,fullProve:async function(t,e,n,o,i,r){const a=Qm(t),c={type:"mem"};return await zm(a,e,c,i),await Om(n,c,o,r)},prove:Om,verify:async function(t,e,n,o){const i=Nm(t),r=Nm(n),a=Nm(e),c=await async function(t,e){let n,o=e&&e.singleThread;const i=function(t){return t.toUpperCase().match(/[A-Za-z0-9]+/g).join("")}(t);if(["BN128","BN254","ALTBN128"].indexOf(i)>=0)n=await p_(o);else{if(!(["BLS12381"].indexOf(i)>=0))throw new Error("Curve not supported: ".concat(t));n=await __(o)}return n}(i.curve),s=c.G1.fromObject(i.IC[0]),l=new Uint8Array(2*c.G1.F.n8*a.length),d=new Uint8Array(c.Fr.n8*a.length);if(!function(t,e){for(let n=0;n<e.length;n++)if(!m_.lt(e[n],t.r))return!1;return!0}(c,a))return o&&o.error("Public inputs are not valid."),!1;for(let t=0;t<a.length;t++){const e=c.G1.fromObject(i.IC[t+1]);l.set(e,t*c.G1.F.n8*2),m_.toRprLE(d,c.Fr.n8*t,a[t],c.Fr.n8)}let u=await c.G1.multiExpAffine(l,d);u=c.G1.add(u,s);const f=c.G1.fromObject(r.pi_a),g=c.G2.fromObject(r.pi_b),h=c.G1.fromObject(r.pi_c);if(!function(t,e){const n=t.G1,o=t.G2;return n.isValid(e.pi_a)&&o.isValid(e.pi_b)&&n.isValid(e.pi_c)}(c,{pi_a:f,pi_b:g,pi_c:h}))return o&&o.error("Proof commitments are not valid."),!1;const p=c.G2.fromObject(i.vk_gamma_2),_=c.G2.fromObject(i.vk_delta_2),m=c.G1.fromObject(i.vk_alpha_1),y=c.G2.fromObject(i.vk_beta_2);return await c.pairingEq(c.G1.neg(f),g,u,p,h,_,m,y)?(o&&o.info("OK!"),!0):(o&&o.error("Invalid proof"),!1)},exportSolidityCallData:async function(t,e){const n=Dm(t),o=Dm(e);let i,r="";for(let t=0;t<o.length;t++)""!=r&&(r+=","),r+=Rm(o[t]);return i="[".concat(Rm(n.pi_a[0]),", ").concat(Rm(n.pi_a[1]),"],")+"[[".concat(Rm(n.pi_b[0][1]),", ").concat(Rm(n.pi_b[0][0]),"],[").concat(Rm(n.pi_b[1][1]),", ").concat(Rm(n.pi_b[1][0]),"]],")+"[".concat(Rm(n.pi_c[0]),", ").concat(Rm(n.pi_c[1]),"],")+"[".concat(r,"]"),i}});m_.e("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),m_.e("21888242871839275222246405745257275088548364400416034343698204186575808495617");const{unstringifyBigInts:Gm}=y_,{stringifyBigInts:Km}=y_,{unstringifyBigInts:Vm,stringifyBigInts:Hm}=y_;var Ym={exports:{}};!function(t){!function(){var e="input is invalid type",n="object"==typeof window,o=n?window:{};o.JS_SHA3_NO_WINDOW&&(n=!1);var i=!n&&"object"==typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?o=K_:i&&(o=self);var r=!o.JS_SHA3_NO_COMMON_JS&&t.exports,a=!o.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),s=[4,1024,262144,67108864],l=[0,8,16,24],d=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],u=[224,256,384,512],f=[128,256],g=["hex","buffer","arrayBuffer","array","digest"],h={128:168,256:136};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!a||!o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var p=function(t,e,n){return function(o){return new O(t,e,t).update(o)[n]()}},_=function(t,e,n){return function(o,i){return new O(t,e,i).update(o)[n]()}},m=function(t,e,n){return function(e,o,i,r){return w["cshake"+t].update(e,o,i,r)[n]()}},y=function(t,e,n){return function(e,o,i,r){return w["kmac"+t].update(e,o,i,r)[n]()}},L=function(t,e,n,o){for(var i=0;i<g.length;++i){var r=g[i];t[r]=e(n,o,r)}return t},b=function(t,e){var n=p(t,e,"hex");return n.create=function(){return new O(t,e,t)},n.update=function(t){return n.create().update(t)},L(n,p,t,e)},A=[{name:"keccak",padding:[1,256,65536,16777216],bits:u,createMethod:b},{name:"sha3",padding:[6,1536,393216,100663296],bits:u,createMethod:b},{name:"shake",padding:[31,7936,2031616,520093696],bits:f,createMethod:function(t,e){var n=_(t,e,"hex");return n.create=function(n){return new O(t,e,n)},n.update=function(t,e){return n.create(e).update(t)},L(n,_,t,e)}},{name:"cshake",padding:s,bits:f,createMethod:function(t,e){var n=h[t],o=m(t,0,"hex");return o.create=function(o,i,r){return i||r?new O(t,e,o).bytepad([i,r],n):w["shake"+t].create(o)},o.update=function(t,e,n,i){return o.create(e,n,i).update(t)},L(o,m,t,e)}},{name:"kmac",padding:s,bits:f,createMethod:function(t,e){var n=h[t],o=y(t,0,"hex");return o.create=function(o,i,r){return new S(t,e,i).bytepad(["KMAC",r],n).bytepad([o],n)},o.update=function(t,e,n,i){return o.create(t,n,i).update(e)},L(o,y,t,e)}}],w={},I=[],C=0;C<A.length;++C)for(var x=A[C],v=x.bits,E=0;E<v.length;++E){var B=x.name+"_"+v[E];if(I.push(B),w[B]=x.createMethod(v[E],x.padding),"sha3"!==x.name){var F=x.name+v[E];I.push(F),w[F]=w[B]}}function O(t,e,n){this.blocks=[],this.s=[],this.padding=e,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var o=0;o<50;++o)this.s[o]=0}function S(t,e,n){O.call(this,t,e,n)}O.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var n,o=typeof t;if("string"!==o){if("object"!==o)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var i,r,c=this.blocks,s=this.byteCount,d=t.length,u=this.blockCount,f=0,g=this.s;f<d;){if(this.reset)for(this.reset=!1,c[0]=this.block,i=1;i<u+1;++i)c[i]=0;if(n)for(i=this.start;f<d&&i<s;++f)c[i>>2]|=t[f]<<l[3&i++];else for(i=this.start;f<d&&i<s;++f)(r=t.charCodeAt(f))<128?c[i>>2]|=r<<l[3&i++]:r<2048?(c[i>>2]|=(192|r>>6)<<l[3&i++],c[i>>2]|=(128|63&r)<<l[3&i++]):r<55296||r>=57344?(c[i>>2]|=(224|r>>12)<<l[3&i++],c[i>>2]|=(128|r>>6&63)<<l[3&i++],c[i>>2]|=(128|63&r)<<l[3&i++]):(r=65536+((1023&r)<<10|1023&t.charCodeAt(++f)),c[i>>2]|=(240|r>>18)<<l[3&i++],c[i>>2]|=(128|r>>12&63)<<l[3&i++],c[i>>2]|=(128|r>>6&63)<<l[3&i++],c[i>>2]|=(128|63&r)<<l[3&i++]);if(this.lastByteIndex=i,i>=s){for(this.start=i-s,this.block=c[u],i=0;i<u;++i)g[i]^=c[i];P(g),this.reset=!0}else this.start=i}return this},O.prototype.encode=function(t,e){var n=255&t,o=1,i=[n];for(n=255&(t>>=8);n>0;)i.unshift(n),n=255&(t>>=8),++o;return e?i.push(o):i.unshift(o),this.update(i),i.length},O.prototype.encodeString=function(t){var n,o=typeof t;if("string"!==o){if("object"!==o)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}var i=0,r=t.length;if(n)i=r;else for(var c=0;c<t.length;++c){var s=t.charCodeAt(c);s<128?i+=1:s<2048?i+=2:s<55296||s>=57344?i+=3:(s=65536+((1023&s)<<10|1023&t.charCodeAt(++c)),i+=4)}return i+=this.encode(8*i),this.update(t),i},O.prototype.bytepad=function(t,e){for(var n=this.encode(e),o=0;o<t.length;++o)n+=this.encodeString(t[o]);var i=e-n%e,r=[];return r.length=i,this.update(r),this},O.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,n=this.blockCount,o=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[n],e=1;e<n+1;++e)t[e]=0;for(t[n-1]|=2147483648,e=0;e<n;++e)o[e]^=t[e];P(o)}},O.prototype.toString=O.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,r=0,a=0,s="";a<o;){for(r=0;r<e&&a<o;++r,++a)t=n[r],s+=c[t>>4&15]+c[15&t]+c[t>>12&15]+c[t>>8&15]+c[t>>20&15]+c[t>>16&15]+c[t>>28&15]+c[t>>24&15];a%e==0&&(P(n),r=0)}return i&&(t=n[r],s+=c[t>>4&15]+c[15&t],i>1&&(s+=c[t>>12&15]+c[t>>8&15]),i>2&&(s+=c[t>>20&15]+c[t>>16&15])),s},O.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,r=0,a=0,c=this.outputBits>>3;t=i?new ArrayBuffer(o+1<<2):new ArrayBuffer(c);for(var s=new Uint32Array(t);a<o;){for(r=0;r<e&&a<o;++r,++a)s[a]=n[r];a%e==0&&P(n)}return i&&(s[r]=n[r],t=t.slice(0,c)),t},O.prototype.buffer=O.prototype.arrayBuffer,O.prototype.digest=O.prototype.array=function(){this.finalize();for(var t,e,n=this.blockCount,o=this.s,i=this.outputBlocks,r=this.extraBytes,a=0,c=0,s=[];c<i;){for(a=0;a<n&&c<i;++a,++c)t=c<<2,e=o[a],s[t]=255&e,s[t+1]=e>>8&255,s[t+2]=e>>16&255,s[t+3]=e>>24&255;c%n==0&&P(o)}return r&&(t=c<<2,e=o[a],s[t]=255&e,r>1&&(s[t+1]=e>>8&255),r>2&&(s[t+2]=e>>16&255)),s},S.prototype=new O,S.prototype.finalize=function(){return this.encode(this.outputBits,!0),O.prototype.finalize.call(this)};var P=function(t){var e,n,o,i,r,a,c,s,l,u,f,g,h,p,_,m,y,L,b,A,w,I,C,x,v,E,B,F,O,S,P,j,U,k,M,T,z,Q,N,D,R,q,G,K,V,H,Y,J,W,X,Z,$,tt,et,nt,ot,it,rt,at,ct,st,lt,dt;for(o=0;o<48;o+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],r=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],c=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],u=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(g=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|c>>>31),n=(h=t[9]^t[19]^t[29]^t[39]^t[49])^(c<<1|a>>>31),t[0]^=e,t[1]^=n,t[10]^=e,t[11]^=n,t[20]^=e,t[21]^=n,t[30]^=e,t[31]^=n,t[40]^=e,t[41]^=n,e=i^(s<<1|l>>>31),n=r^(l<<1|s>>>31),t[2]^=e,t[3]^=n,t[12]^=e,t[13]^=n,t[22]^=e,t[23]^=n,t[32]^=e,t[33]^=n,t[42]^=e,t[43]^=n,e=a^(u<<1|f>>>31),n=c^(f<<1|u>>>31),t[4]^=e,t[5]^=n,t[14]^=e,t[15]^=n,t[24]^=e,t[25]^=n,t[34]^=e,t[35]^=n,t[44]^=e,t[45]^=n,e=s^(g<<1|h>>>31),n=l^(h<<1|g>>>31),t[6]^=e,t[7]^=n,t[16]^=e,t[17]^=n,t[26]^=e,t[27]^=n,t[36]^=e,t[37]^=n,t[46]^=e,t[47]^=n,e=u^(i<<1|r>>>31),n=f^(r<<1|i>>>31),t[8]^=e,t[9]^=n,t[18]^=e,t[19]^=n,t[28]^=e,t[29]^=n,t[38]^=e,t[39]^=n,t[48]^=e,t[49]^=n,p=t[0],_=t[1],H=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,F=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,ct=t[31]<<9|t[30]>>>23,st=t[30]<<9|t[31]>>>23,q=t[40]<<18|t[41]>>>14,G=t[41]<<18|t[40]>>>14,k=t[2]<<1|t[3]>>>31,M=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,lt=t[42]<<2|t[43]>>>30,dt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,nt=t[4]<<30|t[5]>>>2,T=t[14]<<6|t[15]>>>26,z=t[15]<<6|t[14]>>>26,L=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,U=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,v=t[7]<<28|t[6]>>>4,ot=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,Q=t[26]<<25|t[27]>>>7,N=t[27]<<25|t[26]>>>7,A=t[36]<<21|t[37]>>>11,w=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,V=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,rt=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,D=t[38]<<8|t[39]>>>24,R=t[39]<<8|t[38]>>>24,I=t[48]<<14|t[49]>>>18,C=t[49]<<14|t[48]>>>18,t[0]=p^~m&L,t[1]=_^~y&b,t[10]=x^~E&F,t[11]=v^~B&O,t[20]=k^~T&Q,t[21]=M^~z&N,t[30]=K^~H&J,t[31]=V^~Y&W,t[40]=et^~ot&rt,t[41]=nt^~it&at,t[2]=m^~L&A,t[3]=y^~b&w,t[12]=E^~F&S,t[13]=B^~O&P,t[22]=T^~Q&D,t[23]=z^~N&R,t[32]=H^~J&X,t[33]=Y^~W&Z,t[42]=ot^~rt&ct,t[43]=it^~at&st,t[4]=L^~A&I,t[5]=b^~w&C,t[14]=F^~S&j,t[15]=O^~P&U,t[24]=Q^~D&q,t[25]=N^~R&G,t[34]=J^~X&$,t[35]=W^~Z&tt,t[44]=rt^~ct<,t[45]=at^~st&dt,t[6]=A^~I&p,t[7]=w^~C&_,t[16]=S^~j&x,t[17]=P^~U&v,t[26]=D^~q&k,t[27]=R^~G&M,t[36]=X^~$&K,t[37]=Z^~tt&V,t[46]=ct^~lt&et,t[47]=st^~dt&nt,t[8]=I^~p&m,t[9]=C^~_&y,t[18]=j^~x&E,t[19]=U^~v&B,t[28]=q^~k&T,t[29]=G^~M&z,t[38]=$^~K&H,t[39]=tt^~V&Y,t[48]=lt^~et&ot,t[49]=dt^~nt&it,t[0]^=d[o],t[1]^=d[o+1]};if(r)t.exports=w;else for(C=0;C<I.length;++C)o[I[C]]=w[I[C]]}()}(Ym);var Jm=Ym.exports;const{keccak256:Wm}=Jm,{stringifyBigInts:Xm}=y_,{unstringifyBigInts:Zm}=y_,{unstringifyBigInts:$m}=y_,{unstringifyBigInts:ty}=y_,{stringifyBigInts:ey}=y_,{unstringifyBigInts:ny}=y_,{unstringifyBigInts:oy}=y_,{unstringifyBigInts:iy}=y_;function ry(t,e,n){const o=e.split("|").map((t=>t.trim()));for(let n=0;n<o.length;n++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error("invalid value for type ".concat(e));throw i.code="INVALID_ARGUMENT",i.argument="value.".concat(n),i.value=t,i}function ay(t,e,n){for(let o in e){let i=e[o];const r=n?n[o]:null;r&&ry(i,r,o),Object.defineProperty(t,o,{enumerable:!0,value:i,writable:!1})}}function cy(t){if(null==t)return"null";if(Array.isArray(t))return"[ "+t.map(cy).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let o=0;o<t.length;o++)n+=e[t[o]>>4],n+=e[15&t[o]];return n}if("object"==typeof t&&"function"==typeof t.toJSON)return cy(t.toJSON());switch(typeof t){case"boolean":case"symbol":case"number":return t.toString();case"bigint":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map((e=>"".concat(cy(e),": ").concat(cy(t[e])))).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function sy(t,e,n,o){if(!t)throw function(t,e,n){let o,i=t;{const o=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error("value will overwrite populated values: ".concat(cy(n)));for(const t in n){if("shortMessage"===t)continue;const e=n[t];o.push(t+"="+cy(e))}}o.push("code=".concat(e)),o.push("version=".concat("6.13.4")),o.length&&(t+=" ("+o.join(", ")+")")}switch(e){case"INVALID_ARGUMENT":o=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":o=new RangeError(t);break;default:o=new Error(t)}return ay(o,{code:e}),n&&Object.assign(o,n),null==o.shortMessage&&ay(o,{shortMessage:i}),o}(e,n,o)}function ly(t,e,n,o){sy(t,e,"INVALID_ARGUMENT",{argument:n,value:o})}const dy=["NFD","NFC","NFKD","NFKC"].reduce(((t,e)=>{try{if("test"!=="test".normalize(e))throw new Error("bad");if("NFD"===e){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}t.push(e)}catch(t){}return t}),[]);function uy(t,e){return function(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if("string"==typeof t&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const e=new Uint8Array((t.length-2)/2);let n=2;for(let o=0;o<e.length;o++)e[o]=parseInt(t.substring(n,n+2),16),n+=2;return e}ly(!1,"invalid BytesLike value",e||"value",t)}(t,e,!1)}const fy="0123456789abcdef";function gy(t){const e=uy(t);let n="0x";for(let t=0;t<e.length;t++){const o=e[t];n+=fy[(240&o)>>4]+fy[15&o]}return n}let hy=!1;const py=function(t){return jt(t)};let _y=py;function my(t){const e=uy(t,"data");return gy(_y(e))}my._=py,my.lock=function(){hy=!0},my.register=function(t){if(hy)throw new TypeError("keccak256 is locked");_y=t},Object.freeze(my);const yy=BigInt(0),Ly=(BigInt(1),9007199254740991);function by(t,e){switch(typeof t){case"bigint":return t;case"number":return ly(Number.isInteger(t),"underflow",e||"value",t),ly(t>=-Ly&&t<=Ly,"overflow",e||"value",t),BigInt(t);case"string":try{if(""===t)throw new Error("empty string");return"-"===t[0]&&"-"!==t[1]?-BigInt(t.substring(1)):BigInt(t)}catch(n){ly(!1,"invalid BigNumberish string: ".concat(n.message),e||"value",t)}}ly(!1,"invalid BigNumberish value",e||"value",t)}const Ay="0123456789abcdef";function wy(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=Ay[n>>4],e+=Ay[15&n];return BigInt(e)}return by(t)}function Iy(t,e){switch(typeof t){case"bigint":return ly(t>=-Ly&&t<=Ly,"overflow",e||"value",t),Number(t);case"number":return ly(Number.isInteger(t),"underflow",e||"value",t),ly(t>=-Ly&&t<=Ly,"overflow",e||"value",t),t;case"string":try{if(""===t)throw new Error("empty string");return Iy(BigInt(t),e)}catch(n){ly(!1,"invalid numeric string: ".concat(n.message),e||"value",t)}}ly(!1,"invalid numeric value",e||"value",t)}function Cy(t,e,n,o,i){if("BAD_PREFIX"===t||"UNEXPECTED_CONTINUE"===t){let t=0;for(let o=e+1;o<n.length&&n[o]>>6==2;o++)t++;return t}return"OVERRUN"===t?n.length-e-1:0}function xy(t){const e=function(t,e){ly("string"==typeof t,"invalid string value","str",t),null!=e&&(function(t){sy(dy.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}(e),t=t.normalize(e));let n=[];for(let e=0;e<t.length;e++){const o=t.charCodeAt(e);if(o<128)n.push(o);else if(o<2048)n.push(o>>6|192),n.push(63&o|128);else if(55296==(64512&o)){e++;const i=t.charCodeAt(e);ly(e<t.length&&56320==(64512&i),"invalid surrogate pair","str",t);const r=65536+((1023&o)<<10)+(1023&i);n.push(r>>18|240),n.push(r>>12&63|128),n.push(r>>6&63|128),n.push(63&r|128)}else n.push(o>>12|224),n.push(o>>6&63|128),n.push(63&o|128)}return new Uint8Array(n)}(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return function(t,e,n){const o=uy(t);sy(e>=o.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(o),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(o,e-o.length):i.set(o,0),gy(i)}(e,32,!1)}function vy(t){return(BigInt(my(function(t){let e=function(t,e){const n=by(t,e);return sy(n>=yy,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}(t,"value").toString(16);{const n=Iy(32,"width");for(sy(2*n>=e.length,"value exceeds width (".concat(n," bytes)"),"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});e.length<2*n;)e="0"+e}return"0x"+e}(t)))>>8n).toString()}function Ey(t){try{return wy(t)}catch(e){if("string"==typeof t)return wy(xy(t));throw TypeError(e instanceof Error?e.message:e.toString())}}async function By(t,e,n,o,i,r){var a;let c;if(Fo(t,"identity"),Fo(e,"groupOrMerkleProof"),Fo(n,"message"),Fo(o,"scope"),So(t,"identity"),So(e,"groupOrMerkleProof"),Po(n,"message",["string","bigint","number","Uint8Array"]),Po(o,"scope",["string","bigint","number","Uint8Array"]),i&&function(t){if(!Lo(t))throw new TypeError("Parameter '".concat("merkleTreeDepth","' is not a number, received type: ").concat(typeof t))}(i),r&&So(r,"snarkArtifacts"),n=Ey(n),o=Ey(o),"siblings"in e)c=e;else{const n=e.indexOf(t.commitment);c=e.generateMerkleProof(n)}const s=c.siblings.length;if(void 0!==i){if(i<1||i>32)throw new TypeError("The tree depth must be a number between ".concat(1," and ").concat(32))}else i=0!==s?s:1;null!==(a=r)&&void 0!==a||(r=await async function(t){var e;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!dg.includes(t))throw new Error("Project '".concat(t,"' is not supported"));null!==(e=n.version)&&void 0!==e||(n.version="latest");const o=((t,e)=>"".concat("https://snark-artifacts.pse.dev","/").concat(t,"/").concat(e,"/").concat(t))(t,n.version),i=n.parameters?"-".concat(n.parameters.join("-")):"";return{wasm:"".concat(o).concat(i,".wasm"),zkey:"".concat(o).concat(i,".zkey")}}(lg.SEMAPHORE,{parameters:[i],version:"4.13.0"}));const{wasm:l,zkey:d}=r,u=c.siblings;for(let t=0;t<i;t+=1)void 0===u[t]&&(u[t]=0n);const{proof:f,publicSignals:g}=await qm.fullProve({secret:t.secretScalar,merkleProofLength:s,merkleProofIndex:c.index,merkleProofSiblings:u,scope:vy(o),message:vy(n)},l,d);return{merkleTreeDepth:i,merkleTreeRoot:c.root.toString(),nullifier:g[1],message:n.toString(),scope:o.toString(),points:sg(f)}}Object.freeze({error:function(t,e,n,o,i){ly(!1,"invalid codepoint at offset ".concat(e,"; ").concat(t),"bytes",n)},ignore:Cy,replace:function(t,e,n,o,i){return"OVERLONG"===t?(ly("number"==typeof i,"invalid bad code point for replacement","badCodepoint",i),o.push(i),0):(o.push(65533),Cy(t,e,n))}});const Fy=(t,e)=>{if(t>e)return!0},Oy=(t,e,n,o)=>t?null:(0,Ka.jsxs)($f,{title:"Insufficient trust level",status:"warning",children:["You need ",e-n," more points."," ",(0,Ka.jsx)(tg,{onClick:async()=>{o()},children:"Complete verifications"})," ","to increase your trust score."]}),Sy=(t,e)=>t?null:(0,Ka.jsxs)(Jf,{status:"error",children:[(0,Ka.jsx)("span",{children:"Required:"}),(0,Ka.jsxs)(ss,{status:"error",children:[e," pts"]})]}),Py=(t,e,n,o,i,r,a,c,s,l,d)=>n?(0,Ka.jsxs)(Xf,{loading:a,size:"default",disabled:Fy(o,i),appearance:"action",onClick:async()=>{c(!0);try{if(!t)throw alert("USER HAS NO KEY"),new Error("USER HAS NO KEY");const n=await(async(t,e,n,o,i)=>{if(!t)throw new Error("userKey is not available");const r=[];let a=0;if(!e||0===e.length)throw new Error("no verifications found");if(e)for(let c=0;c<e.length;c++){if(!i.includes(e[c].credentialGroupId))continue;const{credentialGroupId:s,status:l}=e[c];if(a>=o)break;if("completed"!==l)continue;const d=Do(s,!0);if(!d)continue;const{group:u}=d;a+=u.points;const f=cg.createIdentity(t,s),{commitment:g}=f,h=await cg.getProof(String(g),u.semaphoreGroupId,!0);if(!h)throw new Error("no proof found");const p=Ro(n),{merkleTreeDepth:_,merkleTreeRoot:m,message:y,points:L,nullifier:b}=await By(f,h,"verification",p);r.push({credential_group_id:s,semaphore_proof:{merkle_tree_depth:_,merkle_tree_root:m,nullifier:b,message:y,scope:p,points:L}})}return r})(t,e,r,i,s);d(n),l(),window.close()}catch(t){c(!1),console.log({err:t})}c(!1)},children:["Confirm (",i," pts)"]}):(0,Ka.jsx)(Xf,{onClick:l,appearance:"action",children:"Verify"}),jy=t=>{let{onClose:e,dropAddress:n,pointsRequired:o,points:i,onAccept:r}=t;const[a,c]=(0,Zo.useState)(!1),s=i>=o,l=lu(),d=No(!0),u=jl(),[f,g]=(0,Zo.useState)([]),h=(0,Zo.useMemo)((()=>{let t=0;return u.verifications.forEach((e=>{const n=Do(e.credentialGroupId,!0);n&&"completed"===e.status&&f.includes(n.group.credentialGroupId)&&n&&(t+=n.group.points)})),t}),[f]);return(0,Zo.useEffect)((()=>{u.verifications&&g(u.verifications.reduce(((t,e)=>"completed"===e.status?[...t,e.credentialGroupId]:t),[]))}),[u.verifications]),(0,Ka.jsx)(Gf,{children:(0,Ka.jsxs)(Vf,{children:[(0,Ka.jsx)(Hf,{icon:(0,Ka.jsx)(Zf,{src:ng})}),(0,Ka.jsx)(Kf,{children:"Prove your trust level"}),(0,Ka.jsx)(Yf,{children:"A website is requesting verification of your trust score. This process is completely private and no personal information will be shared."}),Oy(s,o,i,e),Sy(s,o),(0,Ka.jsxs)(Jf,{children:[(0,Ka.jsx)("span",{children:"Current:"}),(0,Ka.jsxs)(ss,{status:"info",children:[i," pts"]})]}),s&&(0,Ka.jsx)(eg,{tasks:d,devMode:!0,verifications:u.verifications,selected:f,onSelect:(t,e)=>{g(e?[...f,t]:f.filter((e=>e!==t)))}}),(0,Ka.jsxs)(Wf,{children:[Py(l.key,u.verifications,s,o,h,n,a,c,f,e,r),(0,Ka.jsx)(Xf,{size:"default",onClick:async()=>{e()},children:"Cancel"})]})]})})};var Uy,ky,My,Ty,zy;function Qy(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Ny=Da.div(Uy||(Uy=Qy(["\n padding: 12px;\n height: 100%;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n z-index: 1;\n left: 0;\n background-color: ",";\n"])),(t=>t.theme.overlayBackgroundColor)),Dy=Da(Uc)(ky||(ky=Qy(["\n text-align: center;\n font-size: 24px;\n margin-bottom: 20px;\n"]))),Ry=Da.div(My||(My=Qy(["\n padding: 24px;\n border-radius: 8px;\n border: 1px solid ",";\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n"])),(t=>t.theme.secondaryBorderColor)),qy=(Da.div(Ty||(Ty=Qy(["\n height: 100%;\n"]))),Da(Va)(zy||(zy=Qy(["\n margin: 0 auto;\n border-color: ",";\n"])),(t=>t.theme.primaryTextColor))),Gy=t=>{let{title:e}=t;return(0,Ka.jsx)(Ny,{children:(0,Ka.jsxs)(Ry,{children:[(0,Ka.jsx)(Dy,{children:e}),(0,Ka.jsx)(qy,{size:"large"})]})})};var Ky,Vy,Hy;function Yy(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Jy=Da.div(Ky||(Ky=Yy(["\n padding: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n"]))),Wy=Da.h3(Vy||(Vy=Yy(["\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n margin: 0;\n color: ",";\n text-align: center;\n"])),(t=>t.theme.secondaryTextColor)),Xy=Da(oc)(Hy||(Hy=Yy(["\n width: max-content;\n margin: 10px auto;\n"]))),Zy=t=>{let{className:e,generateSignature:n}=t;const o=Il();return(0,Ka.jsxs)(Jy,{className:e,children:[(0,Ka.jsx)(Wy,{children:"Connect your wallet to start verifying"}),(0,Ka.jsx)(Xy,{onClick:async()=>{if(!n)return void alert("generateSignature method is not passed");const t=await n("Sign to derive your BringID key.\nRecoverable by re-signing with the same wallet.");var e;console.log({sig:t}),o((e=t,{type:cu["/user/setKey"],payload:e}))},children:"Create BringID key"})]})};var $y,tL;function eL(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const nL=Da.div($y||($y=eL(["\n padding: 16px;\n"]))),oL=Da((t=>{let{verifications:e,onAddVerifications:n,className:o,devMode:i}=t;const r=e.find((t=>"scheduled"===t.status||"pending"===t.status));return(0,Ka.jsxs)(wf,{className:o,children:[r&&(0,Ka.jsxs)(If,{children:["We batch verifications for better privacy."," ",(0,Ka.jsx)(Cf,{href:"https://bringid.org/privacy-policy",target:"_blank",children:"Learn more"})]}),0===e.length&&(0,Ka.jsx)(ff,{title:"No verifications yet"}),e.length>0&&e.map((t=>{const e=Do(t.credentialGroupId,i);if(e)return(0,Ka.jsx)(td,{fetched:t.fetched,title:e.title,description:e.description,taskId:t.taskId,points:e.group.points,scheduledTime:t.scheduledTime,status:t.status,selectable:!1,credentialGroupId:t.credentialGroupId},e.taskId)})),(0,Ka.jsx)(Af,{onClick:n,appearance:"action",children:"Add verifications"})]})}))(tL||(tL=eL(["\n margin-bottom: 20px;\n"]))),iL=(t,e,n,o,i,r)=>t?(0,Ka.jsx)(oL,{tasks:e,devMode:o,verifications:n,onAddVerifications:()=>{i("tasks")}}):(0,Ka.jsx)(Zy,{generateSignature:r}),rL=t=>{let{generateSignature:e,setPage:n}=t;const o=jl(),{verifications:i,loading:r}=o,a=lu(),c=No(!0),s=Jo(i,!0);return(0,Ka.jsxs)(nL,{children:[r&&(0,Ka.jsx)(Gy,{title:"Processing verification..."}),(0,Ka.jsx)(af,{points:s,address:a.address,userKey:a.key}),iL(a.key,c,i,!0,n,e)]})};var aL,cL,sL,lL,dL,uL,fL,gL,hL;function pL(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const _L=Da.div(aL||(aL=pL([""]))),mL=Da(Uc)(cL||(cL=pL(["\n margin-bottom: 5px;\n"]))),yL=Da((t=>{let{children:e,className:n}=t;return(0,Ka.jsx)(Mc,{className:n,children:e})}))(sL||(sL=pL(["\n margin: 0;\n"]))),LL=Da.header(lL||(lL=pL(["\n padding: 24px;\n display: flex;\n align-items: center;\n color: ",";\n gap: 12px;\n"])),(t=>t.theme.primaryTextColor)),bL=Da.div(dL||(dL=pL([""]))),AL=Da.div(uL||(uL=pL(["\n padding: 20px;\n"]))),wL=Da(Oc)(fL||(fL=pL(["\n cursor: pointer;\n"]))),IL=Da(Rc)(gL||(gL=pL(["\n text-align: center;\n font-size: 12px;\n padding: 0 12px;\n"]))),CL=Da(Qc)(hL||(hL=pL(["\n font-size: 12px;\n color: ",";\n text-decoration: underline;\n"])),(t=>t.theme.secondaryTextColor)),xL=t=>{let{setPage:e}=t;lu();const n=No(!0),{verifications:o}=jl();return(0,Ka.jsxs)(_L,{children:[(0,Ka.jsxs)(LL,{children:[(0,Ka.jsx)(wL,{onClick:()=>e("home")}),(0,Ka.jsxs)(bL,{children:[(0,Ka.jsx)(mL,{children:"Add Verifications"}),(0,Ka.jsx)(yL,{children:"Connect accounts to build your score"})]})]}),(0,Ka.jsx)(AL,{children:(0,Ka.jsx)(pf,{tasks:n,verifications:o})}),(0,Ka.jsxs)(IL,{children:["No verifications available? Request new ones in our"," ",(0,Ka.jsx)(CL,{target:"_blank",href:"https://t.me/bringid_chat",children:"Telegram group"})]})]})};let vL=null,EL=null;const BL=()=>{vL&&vL()},FL=(t,e)=>EL?EL?EL(t,e):void 0:Promise.reject("requestProofs is not registered");function OL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function SL(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?OL(Object(n),!0).forEach((function(e){PL(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):OL(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function PL(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let jL=null,UL=null;const kL=(t,e,n)=>{switch(t){case"home":default:return(0,Ka.jsx)(rL,{setPage:e,generateSignature:n});case"tasks":return(0,Ka.jsx)(xL,{setPage:e})}},ML=t=>{let{apiKey:e,address:n,generateSignature:o}=t;const i=Il(),{isOpen:r,loading:a}=pl((t=>t.modal),kl()),{isOpen:c,pointsRequired:s,dropAddress:l}=pl((t=>t.requestProofs));(0,Zo.useEffect)((()=>(vL=()=>{h("home"),i({type:"/modal/setIsOpen",payload:!0})},EL=async(t,e)=>(i(((t,e)=>({type:gu["/requestProofs/registerRequest"],payload:{pointsRequired:t,dropAddress:e}}))(e,t)),i(pu(!0)),i({type:"/modal/setIsOpen",payload:!0}),new Promise(((t,e)=>{jL=t,UL=e}))),()=>{jL=null,UL=null})),[]);const{verifications:d}=jl();(0,Zo.useEffect)((()=>{if(!d)return;const t=setInterval((async()=>{try{if(0===d.filter((t=>"completed"!==t.status)).length)return;let t=!1;const e=d.map((e=>{if("completed"!==e.status){const n=+new Date;if(e.scheduledTime-n<=0)return t=!0,SL(SL({},e),{},{status:"completed"})}return e}));console.log({verificationsUpdated:e}),t&&i(Pl(e))}catch(t){console.log({err:t})}}),1e3);return()=>clearInterval(t)}),[d]);const u=lu(),f=No(!0),[g,h]=(0,Zo.useState)("home");(0,Zo.useEffect)((()=>{n&&i((t=>({type:cu["/user/setAddress"],payload:t}))(n)),e&&i((t=>({type:cu["/user/setApiKey"],payload:t}))(e))}),[e,n]),(0,Zo.useEffect)((()=>{u.key&&(async(t,e,n)=>{n(!0);for(const n of t)for(const t of n.groups){const r=cg.createIdentity(String(e),t.credentialGroupId),{commitment:a}=r;try{await cg.getProof(String(a),t.semaphoreGroupId)&&(o={credentialGroupId:t.credentialGroupId,status:"completed",scheduledTime:+new Date,fetched:!0,taskId:n.id},i(Sl(o)))}catch(t){console.log("proof for ".concat(a," was not added before"))}}var o;n(!1)})(f,u.key,(t=>i(Dl(t))))}),[u.key]);const p=Jo(d,!0);return(0,Ka.jsx)(Qu,{children:(0,Ka.jsxs)(zu,{dialogClassName:Tu,visible:r,onClose:()=>i({type:"/modal/setIsOpen",payload:!1}),children:[c&&s&&l&&(0,Ka.jsx)(jy,{pointsRequired:s,dropAddress:l,points:p,onClose:()=>{var t;null===(t=UL)||void 0===t||t("User cancelled"),UL=null,i(pu(!1)),i(pu(!1))},onAccept:t=>{var e;null===(e=jL)||void 0===e||e(t),jL=null,i(pu(!1))}}),a&&(0,Ka.jsx)(Gy,{title:"Loading..."}),kL(g,h,o)]})})},TL=t=>{let{apiKey:e,address:n,generateSignature:o}=t;return(0,Ka.jsx)(Oa,{theme:qd,children:(0,Ka.jsx)(Ll,{store:yu,children:(0,Ka.jsx)(ML,{apiKey:e,address:n,generateSignature:o})})})}})(),r})()));
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.BringSDK=e(require("react"),require("react-dom")):t.BringSDK=e(t.react,t["react-dom"])}(this,((t,e)=>(()=>{var n={768:(t,e)=>{"use strict";e.byteLength=function(t){var e=c(t),n=e[0],o=e[1];return 3*(n+o)/4-o},e.toByteArray=function(t){var e,n,r=c(t),a=r[0],s=r[1],l=new i(function(t,e,n){return 3*(e+n)/4-n}(0,a,s)),d=0,u=s>0?a-4:a;for(n=0;n<u;n+=4)e=o[t.charCodeAt(n)]<<18|o[t.charCodeAt(n+1)]<<12|o[t.charCodeAt(n+2)]<<6|o[t.charCodeAt(n+3)],l[d++]=e>>16&255,l[d++]=e>>8&255,l[d++]=255&e;return 2===s&&(e=o[t.charCodeAt(n)]<<2|o[t.charCodeAt(n+1)]>>4,l[d++]=255&e),1===s&&(e=o[t.charCodeAt(n)]<<10|o[t.charCodeAt(n+1)]<<4|o[t.charCodeAt(n+2)]>>2,l[d++]=e>>8&255,l[d++]=255&e),l},e.fromByteArray=function(t){for(var e,o=t.length,i=o%3,r=[],a=16383,c=0,l=o-i;c<l;c+=a)r.push(s(t,c,c+a>l?l:c+a));return 1===i?(e=t[o-1],r.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[o-2]<<8)+t[o-1],r.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),r.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=r[a],o[r.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function s(t,e,o){for(var i,r,a=[],c=e;c<o;c+=3)i=(t[c]<<16&16711680)+(t[c+1]<<8&65280)+(255&t[c+2]),a.push(n[(r=i)>>18&63]+n[r>>12&63]+n[r>>6&63]+n[63&r]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},545:(t,e,n)=>{"use strict";const o=n(768),i=n(773),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=s,e.IS=50;const a=2147483647;function c(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return l(t,e,n)}function l(t,e,n){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|p(t,e);let o=c(n);const i=o.write(t,e);return i!==n&&(o=o.slice(0,i)),o}(t,e);if(ArrayBuffer.isView(t))return function(t){if(J(t,Uint8Array)){const e=new Uint8Array(t);return g(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(J(t,ArrayBuffer)||t&&J(t.buffer,ArrayBuffer))return g(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(J(t,SharedArrayBuffer)||t&&J(t.buffer,SharedArrayBuffer)))return g(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const o=t.valueOf&&t.valueOf();if(null!=o&&o!==t)return s.from(o,e,n);const i=function(t){if(s.isBuffer(t)){const e=0|h(t.length),n=c(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||W(t.length)?c(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function d(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return d(t),c(t<0?0:0|h(t))}function f(t){const e=t.length<0?0:0|h(t.length),n=c(e);for(let o=0;o<e;o+=1)n[o]=255&t[o];return n}function g(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let o;return o=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(o,s.prototype),o}function h(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||J(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===n)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(t).length;default:if(i)return o?-1:V(t).length;e=(""+e).toLowerCase(),i=!0}}function _(t,e,n){let o=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,n);case"utf8":case"utf-8":return v(this,e,n);case"ascii":return B(this,e,n);case"latin1":case"binary":return F(this,e,n);case"base64":return C(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,n);default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function m(t,e,n){const o=t[e];t[e]=t[n],t[n]=o}function y(t,e,n,o,i){if(0===t.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),W(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=s.from(e,o)),s.isBuffer(e))return 0===e.length?-1:L(t,e,n,o,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):L(t,[e],n,o,i);throw new TypeError("val must be string, number or Buffer")}function L(t,e,n,o,i){let r,a=1,c=t.length,s=e.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(t.length<2||e.length<2)return-1;a=2,c/=2,s/=2,n/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){let o=-1;for(r=n;r<c;r++)if(l(t,r)===l(e,-1===o?0:r-o)){if(-1===o&&(o=r),r-o+1===s)return o*a}else-1!==o&&(r-=r-o),o=-1}else for(n+s>c&&(n=c-s),r=n;r>=0;r--){let n=!0;for(let o=0;o<s;o++)if(l(t,r+o)!==l(e,o)){n=!1;break}if(n)return r}return-1}function b(t,e,n,o){n=Number(n)||0;const i=t.length-n;o?(o=Number(o))>i&&(o=i):o=i;const r=e.length;let a;for(o>r/2&&(o=r/2),a=0;a<o;++a){const o=parseInt(e.substr(2*a,2),16);if(W(o))return a;t[n+a]=o}return a}function A(t,e,n,o){return Y(V(e,t.length-n),t,n,o)}function w(t,e,n,o){return Y(function(t){const e=[];for(let n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,o)}function I(t,e,n,o){return Y(H(e),t,n,o)}function x(t,e,n,o){return Y(function(t,e){let n,o,i;const r=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),o=n>>8,i=n%256,r.push(i),r.push(o);return r}(e,t.length-n),t,n,o)}function C(t,e,n){return 0===e&&n===t.length?o.fromByteArray(t):o.fromByteArray(t.slice(e,n))}function v(t,e,n){n=Math.min(t.length,n);const o=[];let i=e;for(;i<n;){const e=t[i];let r=null,a=e>239?4:e>223?3:e>191?2:1;if(i+a<=n){let n,o,c,s;switch(a){case 1:e<128&&(r=e);break;case 2:n=t[i+1],128==(192&n)&&(s=(31&e)<<6|63&n,s>127&&(r=s));break;case 3:n=t[i+1],o=t[i+2],128==(192&n)&&128==(192&o)&&(s=(15&e)<<12|(63&n)<<6|63&o,s>2047&&(s<55296||s>57343)&&(r=s));break;case 4:n=t[i+1],o=t[i+2],c=t[i+3],128==(192&n)&&128==(192&o)&&128==(192&c)&&(s=(15&e)<<18|(63&n)<<12|(63&o)<<6|63&c,s>65535&&s<1114112&&(r=s))}}null===r?(r=65533,a=1):r>65535&&(r-=65536,o.push(r>>>10&1023|55296),r=56320|1023&r),o.push(r),i+=a}return function(t){const e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);let n="",o=0;for(;o<e;)n+=String.fromCharCode.apply(String,t.slice(o,o+=E));return n}(o)}s.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,n){return l(t,e,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,n){return function(t,e,n){return d(t),t<=0?c(t):void 0!==e?"string"==typeof n?c(t).fill(e,n):c(t).fill(e):c(t)}(t,e,n)},s.allocUnsafe=function(t){return u(t)},s.allocUnsafeSlow=function(t){return u(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(J(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),J(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,o=e.length;for(let i=0,r=Math.min(n,o);i<r;++i)if(t[i]!==e[i]){n=t[i],o=e[i];break}return n<o?-1:o<n?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const o=s.allocUnsafe(e);let i=0;for(n=0;n<t.length;++n){let e=t[n];if(J(e,Uint8Array))i+e.length>o.length?(s.isBuffer(e)||(e=s.from(e)),e.copy(o,i)):Uint8Array.prototype.set.call(o,e,i);else{if(!s.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(o,i)}i+=e.length}return o},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},s.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},s.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},s.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?v(this,0,t):_.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){let t="";const n=e.IS;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(t,e,n,o,i){if(J(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),e<0||n>t.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&e>=n)return 0;if(o>=i)return-1;if(e>=n)return 1;if(this===t)return 0;let r=(i>>>=0)-(o>>>=0),a=(n>>>=0)-(e>>>=0);const c=Math.min(r,a),l=this.slice(o,i),d=t.slice(e,n);for(let t=0;t<c;++t)if(l[t]!==d[t]){r=l[t],a=d[t];break}return r<a?-1:a<r?1:0},s.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},s.prototype.indexOf=function(t,e,n){return y(this,t,e,n,!0)},s.prototype.lastIndexOf=function(t,e,n){return y(this,t,e,n,!1)},s.prototype.write=function(t,e,n,o){if(void 0===e)o="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)o=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===o&&(o="utf8")):(o=n,n=void 0)}const i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let r=!1;for(;;)switch(o){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return A(this,t,e,n);case"ascii":case"latin1":case"binary":return w(this,t,e,n);case"base64":return I(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,n);default:if(r)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),r=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const E=4096;function B(t,e,n){let o="";n=Math.min(t.length,n);for(let i=e;i<n;++i)o+=String.fromCharCode(127&t[i]);return o}function F(t,e,n){let o="";n=Math.min(t.length,n);for(let i=e;i<n;++i)o+=String.fromCharCode(t[i]);return o}function O(t,e,n){const o=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>o)&&(n=o);let i="";for(let o=e;o<n;++o)i+=X[t[o]];return i}function S(t,e,n){const o=t.slice(e,n);let i="";for(let t=0;t<o.length-1;t+=2)i+=String.fromCharCode(o[t]+256*o[t+1]);return i}function P(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,n,o,i,r){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<r)throw new RangeError('"value" argument is out of bounds');if(n+o>t.length)throw new RangeError("Index out of range")}function U(t,e,n,o,i){R(e,o,i,t,n,7);let r=Number(e&BigInt(4294967295));t[n++]=r,r>>=8,t[n++]=r,r>>=8,t[n++]=r,r>>=8,t[n++]=r;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,a>>=8,t[n++]=a,n}function k(t,e,n,o,i){R(e,o,i,t,n,7);let r=Number(e&BigInt(4294967295));t[n+7]=r,r>>=8,t[n+6]=r,r>>=8,t[n+5]=r,r>>=8,t[n+4]=r;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=a,a>>=8,t[n+2]=a,a>>=8,t[n+1]=a,a>>=8,t[n]=a,n+8}function M(t,e,n,o,i,r){if(n+o>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function T(t,e,n,o,r){return e=+e,n>>>=0,r||M(t,0,n,4),i.write(t,e,n,o,23,4),n+4}function z(t,e,n,o,r){return e=+e,n>>>=0,r||M(t,0,n,8),i.write(t,e,n,o,52,8),n+8}s.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);const o=this.subarray(t,e);return Object.setPrototypeOf(o,s.prototype),o},s.prototype.readUintLE=s.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||P(t,e,this.length);let o=this[t],i=1,r=0;for(;++r<e&&(i*=256);)o+=this[t+r]*i;return o},s.prototype.readUintBE=s.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||P(t,e,this.length);let o=this[t+--e],i=1;for(;e>0&&(i*=256);)o+=this[t+--e]*i;return o},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readBigUInt64LE=Z((function(t){q(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const o=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(o)+(BigInt(i)<<BigInt(32))})),s.prototype.readBigUInt64BE=Z((function(t){q(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const o=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(o)<<BigInt(32))+BigInt(i)})),s.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||P(t,e,this.length);let o=this[t],i=1,r=0;for(;++r<e&&(i*=256);)o+=this[t+r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},s.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||P(t,e,this.length);let o=e,i=1,r=this[t+--o];for(;o>0&&(i*=256);)r+=this[t+--o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},s.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readBigInt64LE=Z((function(t){q(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const o=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(o)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),s.prototype.readBigInt64BE=Z((function(t){q(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const o=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(o)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+n)})),s.prototype.readFloatLE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,n,o){t=+t,e>>>=0,n>>>=0,o||j(this,t,e,n,Math.pow(2,8*n)-1,0);let i=1,r=0;for(this[e]=255&t;++r<n&&(i*=256);)this[e+r]=t/i&255;return e+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(t,e,n,o){t=+t,e>>>=0,n>>>=0,o||j(this,t,e,n,Math.pow(2,8*n)-1,0);let i=n-1,r=1;for(this[e+i]=255&t;--i>=0&&(r*=256);)this[e+i]=t/r&255;return e+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigUInt64LE=Z((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeBigUInt64BE=Z((function(t){return k(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeIntLE=function(t,e,n,o){if(t=+t,e>>>=0,!o){const o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}let i=0,r=1,a=0;for(this[e]=255&t;++i<n&&(r*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/r|0)-a&255;return e+n},s.prototype.writeIntBE=function(t,e,n,o){if(t=+t,e>>>=0,!o){const o=Math.pow(2,8*n-1);j(this,t,e,n,o-1,-o)}let i=n-1,r=1,a=0;for(this[e+i]=255&t;--i>=0&&(r*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/r|0)-a&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigInt64LE=Z((function(t){return U(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeBigInt64BE=Z((function(t){return k(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeFloatLE=function(t,e,n){return T(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return T(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return z(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return z(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,o){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),o||0===o||(o=this.length),e>=t.length&&(e=t.length),e||(e=0),o>0&&o<n&&(o=n),o===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),t.length-e<o-n&&(o=t.length-e+n);const i=o-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,o):Uint8Array.prototype.set.call(t,this.subarray(n,o),e),i},s.prototype.fill=function(t,e,n,o){if("string"==typeof t){if("string"==typeof e?(o=e,e=0,n=this.length):"string"==typeof n&&(o=n,n=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!s.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(1===t.length){const e=t.charCodeAt(0);("utf8"===o&&e<128||"latin1"===o)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{const r=s.isBuffer(t)?t:s.from(t,o),a=r.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<n-e;++i)this[i+e]=r[i%a]}return this};const Q={};function N(t,e,n){Q[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name="".concat(this.name," [").concat(t,"]"),this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return"".concat(this.name," [").concat(t,"]: ").concat(this.message)}}}function D(t){let e="",n=t.length;const o="-"===t[0]?1:0;for(;n>=o+4;n-=3)e="_".concat(t.slice(n-3,n)).concat(e);return"".concat(t.slice(0,n)).concat(e)}function R(t,e,n,o,i,r){if(t>n||t<e){const o="bigint"==typeof e?"n":"";let i;throw i=r>3?0===e||e===BigInt(0)?">= 0".concat(o," and < 2").concat(o," ** ").concat(8*(r+1)).concat(o):">= -(2".concat(o," ** ").concat(8*(r+1)-1).concat(o,") and < 2 ** ")+"".concat(8*(r+1)-1).concat(o):">= ".concat(e).concat(o," and <= ").concat(n).concat(o),new Q.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,n){q(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||G(e,t.length-(n+1))}(o,i,r)}function q(t,e){if("number"!=typeof t)throw new Q.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,n){if(Math.floor(t)!==t)throw q(t,n),new Q.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new Q.ERR_BUFFER_OUT_OF_BOUNDS;throw new Q.ERR_OUT_OF_RANGE(n||"offset",">= ".concat(n?1:0," and <= ").concat(e),t)}N("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),N("ERR_INVALID_ARG_TYPE",(function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(typeof e)}),TypeError),N("ERR_OUT_OF_RANGE",(function(t,e,n){let o='The value of "'.concat(t,'" is out of range.'),i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=D(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),o+=" It must be ".concat(e,". Received ").concat(i),o}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function V(t,e){let n;e=e||1/0;const o=t.length;let i=null;const r=[];for(let a=0;a<o;++a){if(n=t.charCodeAt(a),n>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&r.push(239,191,189);continue}if(a+1===o){(e-=3)>-1&&r.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&r.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&r.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;r.push(n)}else if(n<2048){if((e-=2)<0)break;r.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function H(t){return o.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Y(t,e,n,o){let i;for(i=0;i<o&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function J(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function W(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const o=16*n;for(let i=0;i<16;++i)e[o+i]=t[n]+t[i]}return e}();function Z(t){return"undefined"==typeof BigInt?$:t}function $(){throw new Error("BigInt not supported")}},532:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,o,i,r){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(o)for(var c=0;c<this.length;c++){var s=this[c][0];null!=s&&(a[s]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);o&&a[d[0]]||(void 0!==r&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),e.push(d))}},e}},151:t=>{"use strict";t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},547:t=>{"use strict";t.exports=function(t){return t[1]}},495:t=>{"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var o,i,r;if(Array.isArray(e)){if((o=e.length)!=n.length)return!1;for(i=o;0!=i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((o=(r=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=o;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,r[i]))return!1;for(i=o;0!=i--;){var a=r[i];if(!t(e[a],n[a]))return!1}return!0}return e!=e&&n!=n}},416:(t,e,n)=>{"use strict";var o=n(386),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};function s(t){return o.isMemo(t)?a:c[t.$$typeof]||i}c[o.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},c[o.Memo]=a;var l=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,h=Object.prototype;t.exports=function t(e,n,o){if("string"!=typeof n){if(h){var i=g(n);i&&i!==h&&t(e,i,o)}var a=d(n);u&&(a=a.concat(u(n)));for(var c=s(e),p=s(n),_=0;_<a.length;++_){var m=a[_];if(!(r[m]||o&&o[m]||p&&p[m]||c&&c[m])){var y=f(n,m);try{l(e,m,y)}catch(t){}}}}return e}},518:(t,e)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,o=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,d=n?Symbol.for("react.async_mode"):60111,u=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,g=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,p=n?Symbol.for("react.memo"):60115,_=n?Symbol.for("react.lazy"):60116,m=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,L=n?Symbol.for("react.responder"):60118,b=n?Symbol.for("react.scope"):60119;function A(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case o:switch(t=t.type){case d:case u:case r:case c:case a:case g:return t;default:switch(t=t&&t.$$typeof){case l:case f:case _:case p:case s:return t;default:return e}}case i:return e}}}function w(t){return A(t)===u}e.AsyncMode=d,e.ConcurrentMode=u,e.ContextConsumer=l,e.ContextProvider=s,e.Element=o,e.ForwardRef=f,e.Fragment=r,e.Lazy=_,e.Memo=p,e.Portal=i,e.Profiler=c,e.StrictMode=a,e.Suspense=g,e.isAsyncMode=function(t){return w(t)||A(t)===d},e.isConcurrentMode=w,e.isContextConsumer=function(t){return A(t)===l},e.isContextProvider=function(t){return A(t)===s},e.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===o},e.isForwardRef=function(t){return A(t)===f},e.isFragment=function(t){return A(t)===r},e.isLazy=function(t){return A(t)===_},e.isMemo=function(t){return A(t)===p},e.isPortal=function(t){return A(t)===i},e.isProfiler=function(t){return A(t)===c},e.isStrictMode=function(t){return A(t)===a},e.isSuspense=function(t){return A(t)===g},e.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===u||t===c||t===a||t===g||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===_||t.$$typeof===p||t.$$typeof===s||t.$$typeof===l||t.$$typeof===f||t.$$typeof===y||t.$$typeof===L||t.$$typeof===b||t.$$typeof===m)},e.typeOf=A},386:(t,e,n)=>{"use strict";t.exports=n(518)},773:(t,e)=>{e.read=function(t,e,n,o,i){var r,a,c=8*i-o-1,s=(1<<c)-1,l=s>>1,d=-7,u=n?i-1:0,f=n?-1:1,g=t[e+u];for(u+=f,r=g&(1<<-d)-1,g>>=-d,d+=c;d>0;r=256*r+t[e+u],u+=f,d-=8);for(a=r&(1<<-d)-1,r>>=-d,d+=o;d>0;a=256*a+t[e+u],u+=f,d-=8);if(0===r)r=1-l;else{if(r===s)return a?NaN:1/0*(g?-1:1);a+=Math.pow(2,o),r-=l}return(g?-1:1)*a*Math.pow(2,r-o)},e.write=function(t,e,n,o,i,r){var a,c,s,l=8*r-i-1,d=(1<<l)-1,u=d>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,g=o?0:r-1,h=o?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-a))<1&&(a--,s*=2),(e+=a+u>=1?f/s:f*Math.pow(2,1-u))*s>=2&&(a++,s/=2),a+u>=d?(c=0,a=d):a+u>=1?(c=(e*s-1)*Math.pow(2,i),a+=u):(c=e*Math.pow(2,u-1)*Math.pow(2,i),a=0));i>=8;t[n+g]=255&c,g+=h,c/=256,i-=8);for(a=a<<i|c,l+=i;l>0;t[n+g]=255&a,g+=h,a/=256,l-=8);t[n+g-h]|=128*p}},53:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default={C:["DumlkrqalRjQWYbWVvQMIRTEmTwRuymTjSHUcwTNjm4=","APFEUjXyFIxZhlhxafwbzYh7CNTQCGjfVpb/9AlW6GQ=","CN/zSH6KyZ4fKaBY0PqAuTDHKHMLerNs6HnziQ7Pc/U=","Lye+aQ/a7kbDzij3UysTyFbDU0LIS9puIJZjEPrcAdA=","KyrhrPaLe40kFr6/PU9iNLdj/gS4BD7ki4MnvryhbPI=","AxnQYgcr737MperAb5fU1VlSwXWrawPq5ktEx9vxHPo=","KIE9yuuuqoKKN234evSmO8i3vyetScYpjvezh78oUm0=","JydnOyzLyQPxgb844cHUDSAzhlIAw1K8FQkord35y3g=","I07EXKJ3J8LnSr0rKhSUzW771D40BYfWuPueMeZcxjI=","FbUlNAMa4Y9/hiyyz3z3YKsQqBUKM3sczZn/boeX1Cg=","Dcj61tnks19e2aPRhrec444Oio0bWLEy1wHU7s9o0fY=","G82V/8IR+8pgD3BfrT+1Z+pOs3j2Lh/sl4BVGKR+TZw=","EFILCrchyt/p7/gbAW/DTcdto2wleJN4F8uXjQad5Vk=","H21IFJuOf32bJX2O1fu69CkySYB1/tCs6IqeuB9WJ/Y=","HZZV9lIwkBTSngDvNaIIm//43ByBbw3JyjS9tUYMhwU=","BN9aVv+VvK+wUfexzUOpm6cx/2fkcDIFj+PUGFaXzH0=","BnLZlfj/9kAVGz0pDO2vFIaQoQqMhCSn9uwoK25L6Cg=","CZlStBSIRFSyEgDX/6/dXwyancwG8nCOn8HYIJtcdbk=","BSy6IlXf0Ax8SDFDuo1GlEjkNYaptM2Rg/0OhDprn6Y=","C4ut7mkK246wvXRxK3mZr4LeVXByUa13Fgd8uTxGTdw=","EZsVkPEzB69aHuZRAgwHx0nBXWBoOoBQuWPQqOSyvdE=","AxULfNbV0XslKdNr4PZ7gyxKz8iE707lzhW+C/tKjQk=","LMYYLF4UVG488ZUfFzkSNVN077g9gImKvmnLMXyepWU=","AFAyVR5jeMRQz+EppASzdkIYyt7awU4rktLNcxEb8Pk=","IzI34yibqjS7FH6XLry5UWRpw5n8wGn7iPnaLMKCdrU=","Bcj09OvUpuPJgNMWdL++YyMDfyGzSuWk6AwtTCTWAoA=","CnsdsTBC05a6BdgYoxnyUlK8817zru2R7h8JslkPxls=","KnO3H5shDPWxQpZXLJ0y2/FW4rCG/0fcXfVCNlpATsA=","GsmwQXq8yaGTUQfp/8kdw+wY8sTb5/Ipdqdgu1xQxGA=","EsAzmuCDdII/q7B2cH70eSafPk1ssQQ0kBXuBG3JP8A=","C3R1sQKhZa1/WxjbTh5wT1KQCqMlO6rGgkZoLlbpoo4=","A3woSeGRyj7bHF5J9ui4kXyEPjeTZvLqMqs6qI1/hEg=","BaaBH4VW8BTpJnRmHiF+m9UgbFyToH3BRf2xdqcWNG8=","KaeV59mAKJRulHt11U6fBEB26Hp7KIO0e2de9fOL1m4=","IEOaDISzIutFo4V6/Bj1gm6Mc4LIoVhcUHvhmZgf0i8=","Lguo2U2ez0qU7CBQxzcf8btQ8neZqEttSipvKgmCyIc=","FD/RFc4I+yfKOOt8zoIrRReCLNIQkEjS5tDdzKF9ccg=","DGTL7LHHNLhXlo273PgTzfhhFlkyPby/yEMjYjvpyvE=","AoowWEfGg/ZG/KklwWP/WudPNI1iwrZw8UJs75QD2lM=","Lk71EP8Lb9pfqUCrTEOA8mpry2TYlCe4JNZ1W1254ww=","AIHJW8QzhOZj15JwyVbOO4kltPbQM7B4uWOE9QV5QA4=","LtXwyRy9l0kYfi+t5ofgXuJJGzScA5oLuoqfQCOguzg=","MFCZkfiNo1BLvzdO1ari8DRIoix2I0yMmQ8B8zpzUgY=","HD8g/VVAmlMiG3xNSaNWufChEZ+yBntBp1KQlEJOxq0=","ELTn86td8AMElRRFm24Y7sRrsiE+jhMeFwiHtH3cuWw=","KhmCl5w/9/Q93VQ9iRwqvd2A+ATAd9d1A5qjUC5Dre8=","HHTuZPFeHbb+3b6tVtbVXbpDHrw5bJr5XK0PExW9XJE=","B1M+yFC6f5jquTA8rOAbS55PLouCcIz6nC/kWgrhRqA=","IVdrQ45QBEmhUeTurxexVChcaPQtQsGAihGr83ZMB1A=","LxfAVZuP55YIrVyhk9YvELzoOEyBXwkGdD1pMINtSp4=","LUd+OGLQdwinnoqulGFwvJd1pCATGEdK5mWwsbficw4=","Fi9SQ5ZwZMOQ4JVXeYTyka+6ImbDj1q82Jvg9bJ0fqs=","K0yyM+3pukgmTs0siuUNGteoWWqH8p+Kd3enAJI5MxE=","LI+8st2Fc9wduvj0YihUd22y7s5thcTPQlTnw14DsHo=","HW80dyXkgWry/0U/DNVrGZ4bYen2Aemt5eiNuHCUnak=","IEsMOX9OvnHrwtiz31uRPfnmrAK2jTEyTNSa9cRWVSk=","DEy53DxP2BdPEUmzxjw8L57LgnzX3CVTT/j7dbx5xQI=","F0rWGhRIyJmiVBZHT0kwMB5cSUdSeeBjmmFt3EW8e1Q=","GpYXe89NjYn3Wd9OwvPN4uqqKMF3zA+hOpgW1Jo40u8=","Bm0EskMx1xzQ74BUvGDE/wUgLBJqIzwagkKs42C4owo=","KkxPxuwLDPUhlXgoccbdOzgcxl9y4CrVJwN6Yqob2AQ=","E6stE2zPN9RH6fLhSnztyV5yf4RG9tnX5Vr8ASGf1kk=","ESFVL8omBhYZ0k2EPcgnacGwT87Cb1UZTC4+hprMapo=","AO9lMyKxPWyIm8gXFcN9d6bNJn1ZXEqJCaVUbHyXz/E=","DiVIPkWmZSCLJh2Lp0BR5kAMd21lJZXZhFrKNdijl9M=","KfU23LnddoIkUmRlnhXYjjlaw9Td6S2MRkSNuXnuuok=","KlbvnyxT/rrf2jNXXb29iFoSTieAu+oXDkVrqs4Ppb4=","HINhx461z13s+3otF7XECfKuKZmkZ2Lo7kFiQKjLmvE=","FRr/XziyCg/ARzCJqvAga4Po5op2RQe/09CrS+dDGcU=","BMYYfkHtiB3BsjnIj3+dQ6n1L8jIts3R525HYVtR8QA=","E7N72A9NJ/sQ2EMx9vttU0uBxh7RV3ZEnoAbfdycKWc=","AaXFNic8LZ31eL+9MsF7eizjZkwqUgMskyHOscToqOQ=","KrNWGDTKc4Na0F9desuVC0qaLGZrlybagyI5Blt8OwI=","HU2OwpHnINsgD+bWhsDWE6yvavTpXTv2n37VFqWXtkY=","BBKU0sxITSKPV4T+eRn9K7klNRJAoEtxFRTJyAtlrx0=","FUrJjgFwjGEcT6cVmR8ASJj1eTnRJuOSBClx3ZDoH8Y=","CzOdisyn1Pg+7dhAk671EFCzaEyI+LCwRSRWO8bqTaQ=","CVXknmYQyUJUpPhM+6s0RZjw5x6v9Kfdge2VtQg5yC4=","BnRqYVbrpUQmueIiBvFavKmm9B5vU1xvNSVAHqBlRiY=","Dxj1oOzRQjxJbzggxUnCeDjleQ4r0KGWrJF8f/Mgd/s=","BPbuyhdR9zCKxZ7/W+smHku1Y1g+3nvJKnOCI9b3bhM=","K1aXM2TExPXBo+xNo83OA4gR6xFvs+RbwXaNJvwLN1g=","Ejdp3UnVsFTc12uJgEsby44TkrOFcWpdg/62XUN/Ke8=","IUe0JPxIyAqI7lK5EWmqzqmJ9kRkcRUJlCV7L7AcY+k=","D9wfWFSLhXAabFUF6jMqKWR+bzStQkPC6lStiXzr5U0=","Ejc6glH+oATfaKvPD3eG1Lzv8oxdu+DDlE9oXMCgsfI=","IeT06l81+FutfqUv90LJ6KZCdWtq9EID3YofNcGpADU=","FiQ5FtadLKPftHIiJNTEYrVzZkkvRekNioGTTxvDsUc=","HvvkbdeleLT2b5rbyItDeKvCFWbhoEU8oTpBWcrASsI=","B+pehTfPXdCIhgIOI6fzh9Ro1VJb5m+FO2csyWqIlpo=","BajE+ZaLiqO3tHijD5pbY2UPGadefOEcqf4WwLdsALw=","IPBXcSzCFlT7/lm9NF6NrD94GMcBuceILZ1Xtyoy6D8=","BKEu3tqd/WiWcvjGf+4xY23NjojQHUkBm9kLM+sz22k=","J+iNjBXzfc7kTx5UJaUd7L0TbOUJGmdn5J7JVEzNEBo=","L+7Re4QoXtm4pcjF6VpB9m4JZhmncDIjF2xB7kM95NE=","HtfMdu30XHxAQkFCD3Kc85TllCkRMSoNaXK4vVOv8rg=","FXQumbm/oyMVf/jFhvVmDqxng0dhRM3K3yh0vkVGaxo=","GqwoU4f2XoLIlfxoh930BXcQdFTG7AMXKE8DPyfQx4U=","JYUcPIRdR5D53a29tgVzV4MuLnpJd19x7HWpZVTWfHc=","FaWCFWXMLsLOeEV9sZft81O367osVSM3DdzMPZ8Uamc=","JBHVekgTuZgO+n4xodtZZtz2TzYEQndQLxVIXyjHFyc=","AC5vjWUgzUcT4zW4wLbS5kfpqY4S9M0lWIKLXvbLTJs=","L/e8j0OAzemX2gC2FrD80a+PDpHi/h7XOYg0YJ4DFdI=","ALmDG5SFJVle4CckRxvNGC6VIfa3u2jx6Tvk/rsNPL4=","Ci9TdouOv2qGkTsOV8BOARykCGSKR0OofXetvwycNRI=","ACSBVhQv0Dc6R5+R/yOelg9Zn/fpS+abfyopAwXhGY0=","Fx1WILh7+xMoz4wCqz8MmjlxlqpqVCwjUOtRKisrzak=","FwpPVVNvfclwCHx8ENb612DJUhct1U3ZnRBF5Ow0qAg=","KaujP3mf5mwu8xNK6gQzbsw344wc0hG6SC7KF+Lb+uE=","HpvBeaT911j90bsZRQiNR+cNEUoD9qDotbplA2nmSXM=","HdJpeZtmD61Y9/SJLfsLWv6q2GmpxLRPnJ4cQ72vjwk=","Is28i3ARetFAEYHQLhVFnnzNQm/oacfJXR3Syw8krzg=","DvBC5FR3HFM6n1elXFA/zv0xUPUu2Up81bqTucfazv0=","EWCeBq1sj+Lyh/MDYDfohRMY6LCKA1mgOzBP/KYugoQ=","EWbZ5VRhbbqedT7qQnwXt/7NWMB23+QnCLCPW3g6qa8=","LeUpiUMahZWTQTAmNUQT2xd/v0zSrAtW+FWoiDV+5GY=","MAbrT/x6hYGabaSS86isHfUa7lsXuOiddL8Bz19x6a0=","KvQfu2G6ioD9z2//nj9vQimT/o8KRjn5YjRMgiUUUIY=","EZ5oTeR2FV/lprQajryF24cYqyeInoXngbIUus5IJ8M=","GDW3huLokl4Yi+pZrjY1N7USSMI4KPBHz/eEuXs/2AA=","KCAaNMWU36NNeUmWxkM6INFSusKnkFySbEDihasy7rY=","CD79eifRdRCU6A/vr3iwAIZMgutXEYdySnYfiMIsxOc=","C2+Io1dxmVJhWOYc7qJ76BHBbfd3TdhRngeVZPYf0Ts=","Dsho5tFeUdlkT2bh1kcalFiVEcoA0p4QFDkObuQlT1s=","KvM+P4ZncScawMmz7S4RQuzT50uTnNQNANk3q4TJhZE=","C1ICEfkEtefQm12WHGrOdzRWjFR91oWLNkzl5HlR8Xg=","Cy1yLQkZoarY21jxAGKpLqDFasQnDoIsyiKGIBiKHUA=","H3kNTX+M8JTZgM6zfCRT6Ve1SpmRyji74AYdHtblYtQ=","AXHrld+/fR6uqXzThfeAFQiFwWI1oqao2pLOsB5QQjM=","DC0OO1/VdUkym/aIXaZrm3kLQN79LIZQdiMFOBsWiHM=","EWL7KGicJxVOWoIotOcrN3y8r6WJ4oPDXTgDBUQHoY0=","LxRZtl3uRBtkrThqkegxDygsWpKonhmSFiPvgklxG8A=","Hm/zIWtojD2ZbXQ2fVzUwbxInUZ1TrcSwkP3DRtTz7s=","AcqL5zgyuNBoFIfSfRV4AtdBpvNs3CoFdogfkyZHiHU=","H3c1cG/+n8WG+XbVvfIj3GgChggLEM6gC5td4xX5ZQ4=","JSK2D06jMHZAoMLc4EH7qSGsEKPV8JbvR0XKg4KF8Bk=","I/C+4AGxAp1SVQdd3JV/gzQYytT1K2w/jOFsI1VyV1s=","K8Gui43buB/KrC1EVV7VaF0UJjPp35BfZtlAEJMILVk=","D5QGuCllZKNzBFB7jbo+0WI3EnOgex/JgBH81q1yIF8=","I2Co6wzH3vpntymY3pBxThfnWxdKUu5KyxJsjNmV8Kg=","FYcaXN3q2XaATIA8uu8lXrSBWl6W34sAbcu8J2f4iUg=","GTpWdmmY7p4KhlLdLzsdoDYvT1T3I3lUT5V8ze77Qg8=","KjlKQ5NPhpgvm+Vv9PqxcDsuY8itM0g05DCYBed3rg8=","GFmVTP64aV8+i2NdyzRRkoks0RIjRDuntBZuiHbA0UI=","BOEYF2MFDlgBNETby5nxkCsRvCXZC73KQI04GfT+0ys=","D9slPe6Dhp1AwzXqZN6MW7EOuC2wi16LH15VUr/QXyM=","BYy+ippQJ72qTvtiOt6tYnXwhobxwImEqdfFuum08cA=","E4Ltzplx4YZJfq2xrrH1KyO0uDvvAjqw0VIotMzspZo=","A0ZJkPBFxu4IGcpR/RGwvn9huOuZ8Ut34eZjRgHZ6LU=","I/e/yHINwpb/8ztB+Y/4PG/KtGBdsutaqlvBN663Clg=","ClmhWOPuwhF+bpTn8OnezxjD/9XhUxqSGWNhWLuvYvI=","BuxUyAOBwFK1i/I7MS/9POLE66BlQgr49MI+0Adf0Hs=","EYhy3IMuDrVHa1ZkjoZ+yLCTQPenvLG0li8P+e0fnQE=","E9afoSfYNBZa1cfLp61Z7VLgsPDkLX/qleGQa1IJIbE=","FpoXf2PqaBJwscaHenPSG94UOUL7cdxV/YpJ8Z8Qx3s=","BO9RWRxurZfvQvKHrc5A2Tq+sDK5IvZv+36aWnRQVE0=","JW4XWh3AeTkOzXynA/suOxnsYYBdTwPO1fRe5t0Paew=","MBAtKGNqvV/l8q9BL/YAT3XMNg0yBd0toAKBPT4s7rI=","EJmOQt/NO78cBxS8c+sb9ARDo/qZvvSjH9Mb4YL8x5I=","GT7djp/PPXYl+n0ktZih2J8zYur01YLv7K12+HnjaGA=","GBaK/TTy2RXQNozoC3szR9HHpWHOYRQl8mZNeqUfC10=","KTg8AevTtqsMAXZW6+ZYtqMo7He8M2JuKeLpWzPqYRE=","EGRtLyYD3jmh9K5ed3GmSnAttuhvt2q2AL9XP5AQxxE=","C+teB9GycUX1dfE5WlW/Ey+QwltA2ns4ZNAkLcsRF/s=","FtaFJSB4wTPcDT7K1itciDD5W7LlS1mr3/vwGNlvozY=","Cmq9HYM5OPM8dBVOBAS0tApVW7vsId36/Wct1iBH8Bo=","GmefXTbre1yOoSpMLe3I/rEt/+7EUDFycKbxmzTPGGA=","CYD7IzvUVsI5dNUODr/eRyakI+raTo9v+8dZLj8bk9Y=","FhtCIy5huEy/GBCvk6OPwM7OPVYoySggA+ustcMSxys=","CtoQqQx/BSCVD31Hpg1eakk/CXh/FWTl0JID20feGgs=","GnMNNyMQuoIyA0WimsQjjtPweoorThIbtQ3bmvQH9FE=","LIEg8mjvBU+BcGTDad2n6pCDd/6rpcTf+9oQ71joxVY=","HHyIJPdYdT+lfAB4nGhCF7kw6VMTvLc+bnuGSaSWj3A=","LNntMfX4aRyOOeQHenT6oPQArYtJHrP3tHsn+j/Rz3c=","I/9PnUaBNFfPYNkvV2GDmaXgIqwyHKVQhUriORiiLuo=","CZRaXRR6T2bO7OZAXd3Z0K9aLFEDUpQH3/HqWPGAQm0=","GI2cUoAl1MK2dmDGt3G5D3x9puqinT8mim3SI+xvxjA=","MFDjeZZZa3+B9oMRQx2HNNun2SbTYzWV4MDY3fTw9H8=","Fa8RaTloMKkWAMqBAsNcQmzq5UYeP5XYnYKVGNMK/Xg=","HabQmIVDLqmgbZ83+HPZhdrpM+NRRmspBChNozINisw=","J5bqkNJpryn1+KzzOSESTk5PrT2+ZYlF5UbuQR3aqcs=","IC190doPa0sDJcizMHdC8B4VYS7I6TBKfLAxngHTLWA=","CW1nkNBbt1kVapUromPWcqLX+ceI9Mgxop2s5MD4vl8=","BU76H2Ww/OKDgIllJ12He0ONojzlsT4ZY3mMsUR9JaQ=","GxYvg9kX6T7bMwjCmALeudiqaQETsuFIZMz24Y5BZfE=","IeUkHhJWTdb9nxzdKg3jnu3+/BRmzFaOxc63RaBQbtw=","HPtWYujPWskiaoDuF7Nqvstzq1+H4WGSe0NJ4Q5L3wg=","DyEXfjAqdxu65tjR7LNztiyZrzRiIKwBKcU/Zm6yQQA=","FnFSI3RgaZKv+w3X9xsSvsQjau3mKQVGvO9+H1FcIyA=","D6PsW5SIJZwutM8kUBv62b4uyeQsXMjM1BnSppLK2HA=","GTwOBOC9KYNXyyZsFQYIDtNu3OhcZIzAhejFexq1S7o=","ECrfjvdHNaJ+kSgwbcvDyZ9vcpHNQGV4zhTqKtq6aPg=","D+CveFjkmFnipU1vGtlFsTFqokv73SOuQKbQy3DD6rE=","IW9nF7vH3tsIU2oiIIQ/Ti2l8dqp69796KXqc0R5jSI=","HaVcyQDw0h9KPmlDkZGKGzwjsqx3PGs++I4uQigyUWE="],M:[["EJt/QRug5MmytwyvXDansZS+fBGtJDeL/ttoWSuoEYs=","Fu1B4Tu5wMZq4RlCT928vJMU3J/b3upV1sZFQ9xJA+A=","K5C7oA/KBYn2F+fcv+guDfcGq2QM6yR7eRqTt042c20="],["KWnyfu0xpIC5w2x2Q3nbyizI/dFBXD3e1ilAvN4L13E=","LiQZ+ewC7DlMmHHIMpY9wbiddDyMe5ZAKbIxFoex/iM=","EBBx8AMjebaXMVh2aQ8FPRSNThCfX7BlyKrMVaD4m/o="],["FDAh7GhqPzMNX55lRjgGXObNeeKMWzdTMmJE7mWhsac=","F2zAKWla0CWCpw7/CKb9mdBX4S5Y59e2sWzfq8juKRE=","GaP8ClZwK/QXun/uOAJZP6ZERwMHBD93cyec1x0l1eA="]]}},552:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default={C:["FEhhRZjgD5jnrn3qRfvYO9loZT74OQzeLoa3Bq1AxlE=","CreykTiOXJ5DwNwfWR+4Ps22UCLhtwr0O4p7QMHf98M=","K3y7IXiW9SyajAiOZUryHoTN51SjzvWxXE1UZmEtat8=","K8aw3b4dcBtlcEKL3Byhvw2ln/O7u5X8K8ccDG5nplw=","EjpVoxmAOE89ILLOy8RO1gw4wR99IOknHvq5qQXu/Tw=","A3UBzIydyBkwmnafTfCY5YiwGFi8jrfieeKIO+n7jFM=","HCEW5H4DqGuxFpWwpfbatrmkYLHrlRqwHCWeyj/UfVE=","LBghNIkDLoWpyMuOmmWDm/rtE+V7wPrknb2uv1T1b5M=","Luj+09TSxxoEKer9jl2xcY8p4iJ5hf3yrYcDyDW54DE=","KMZNj17XqsAEySAp2em/kbqUNtHM6UuTFtERxwoMFxQ=","GKAdn/t0euDePoPHB/iyT2gshPFav1cbNCVKA0eGZeA=","HCHZK+8ZfnOyNOR3e2DbFOZCpWzucVFdVOGscc3nK9M=","CtQEzLyx4ZWJfLYMgJgeu51mpmd9u+2ti2RV/mLYB7E=","Cptt6DMGT5O2rbma9sAFlFy2VMt70UyLl6+LYMwfs4c=","ExKeP5MK7W1HaQMx/wncUWDvpY3c4sPmGA1FvsOqOm8=","DXphTImRUIqxzkiVgTuxyC8Yv3v8nigMzKGAeYOTh/E=","BTL37DbjAEGwSGmGh1yROkm93y9a9f6+jDHy9AlP/qU=","BrvLjo4YAgEpPnEvSVDxsLvugIydZCY8hNnYrhVcuJI=","D1WKTbGjrAf2Hi5r7pR/c1hr9A8hHOtPaHylZ4qdyzM=","K+FApgtbXy+O3XioGKlpsgxkPkGbzwtXfCSg0Oes/pg=","HEnEuanwn3ua1fdOusxxBRK46Ge6zifLDeoG6JuW9jE=","FwwacychsSzefzPkdqOaGqd6gcBuLqxQOEewDVl2Uts=","GcJ9DlL2XKNPTjGgaOSTMca/w52SQfnUwwIEFhXPJ/E=","LxvcUlT5Igwacx/FJ2lk2rJrOF+kC2sEvtmWDiVDugg=","BbQtL7zL9NOdK+kznKvp0Nxtkh6FXNkRVLY50o1KHPA=","EiAEBxWkGtWfT0EODAWkLF/TKsUv6dBviBiNcfYeCTU=","JflSZSYVW4OUZgn3u5UH3Ukl74cd7pFtkUTrtOzhNDw=","AXv+QoQpmud0C20OIElR4xSopdBFJBkUeXipWzR0JEQ=","Kl1HZAIcpx14qWdMtnCPFYjSzq81eMQRHPizWe7wic8=","F/Atq3RfvjwIEyH+XO+EXnuNBwslFNKbKnt9icwIFdo=","GdpiYm23GZtl9K3PV/pKPbqhdkp70VVwjubzeMie8BM=","D4jilfou2BtCbJH6aTZqc+33Xzm/GGNM0mbsQDiCngU=","H+McVUhUbHlI/k7hvXQS4ygO/30gywmqhfSfJ2YUgBc=","EP3BYTvb9n84vd5WGy+R5MxItZ+Y1kNjj9wK+tv+Em4=","HyYYwuvpV0UIucUvAADjPr/drRoD/da8pu9/AJMSe+8=","Ep/n/D76xqirI9um2IbzlNoR9ZU8+Y4oJpoNuip0XdM=","Fa/UzfHk+CDBYx1KuFykujuvz+5yvq3p+uYFIxAkSOM=","Hyx0ulw2fjcNco5x4VsmiFGnu4tFUoy3NJVgeayZsBI=","ETDhhy128vk2nPWble35zhnwH6icnDaybgne9nhtrTw=","E1I9Fz9+a623O2P8HJu9vuJCxhvGhlZJMydTOlwbHco=","FNpA0K9CemXxhBta3JZThlM2j3JUy1Zn3a27rXpXTNQ=","AJH5ZADkKX6oW7GGwXswToJjjlf9Yx/2MVl24aXdi4Y=","MDMpv5AxxVFbmjTUmmS7agJnvHtUoN7KXEUCd6ACzcs=","FO1H5VwdocLwXTwaGy5sGFCfyDNuz+nbc3kW4oP6ghs=","EWHxCzV3ddgQrVO8xKINWt0rAyUcdH3rBO6UxWXljWs=","F6ilCucs5wfyK8Bw65koUcqRTrlMxo6vu4qWpxTrgiE=","Gmxh15Xbr2L5klCzfsXfiGRaHBU3kdtjErky3CUOT2I=","H4vSq4qoQGZMTu4ZjEaE3EsFdyuyoIadpnIrFfRHoTM=","H/y4UqTwAnqXmfExzXS5jM+4y8BjSdj+/MYvEMj7Pi8=","A150LsUvGbNtSJxyD0Z/+td81TvC213dskayMCH3nxg=","Hfqu5BvflNeDqin8Yrfse1VnOqgY0wX9QtF1oF8uPYY=","KCE3hHegLplQBaVjUIhUCUW9Mz8tFFXwOKIZuMR5azo=","HbSk0PI4pXCxBhxu7IHALzH/3Up8GedjF08jjQSJdCE=","FL94iUV7ILehNns0o6U4IX1pO1JCav9ApLtyiTsXhMo=","LO1Swr8pb4fldBDD7JqUg6eW0WT2BJEnEJ/w06nAhGU=","Hd6sWAWn9K2k0EQe0QjjFJ1M5lhPSa5b39RtZ2buozQ=","Lja05enJe0YjBOjitfnciOHJ8hYboEBnP5ERI/BCrnA=","DGhA0csGZtxZ6JsYZSddihZLRHxe1kNHyu5jUCwjjV4=","E34uPonnHUYfTJvD6PEhgyYqTR21XFibLK6qwBI49Yw=","JQky57CtzyyE7Uv7YKNra4LlWqlHURV7HUV5Swgciq0=","FwpykvVjTAbdO/CatcnE7NSwDVzi81+XK0VVOR8WtC0=","DWjLvnconnjVy/UdcPG3W6IV30570BSdELLFDypPO4E=","DK90VjuQUl9kWm0gNuzRMG+h3GgLSdnOTtJMl0mXMXg=","IKfRwKJ/zOeP/jcvTFgwaxZvlFbtRs3rJV45W30w1Co=","BiPzImtUcLJ4m4pTBA5ERDOF6Wuc+gvk01AVFYpGhGU=","FjIwhojCXnkPV9aKU1AkEkKlYwU0feSlAJzka4zcuR8=","LeR5Om+ZzRTj9mQiEfTQt7z6NhWXxUT/y1pWfpB29H8=","HU0G0Z6hsJyteQhtUb3hFyWlVPqZVZyi8J87tz1yjGY=","BIDnR5pmp82ephyLKJdDiZCDUKvEqvwYzXXjPdEwwUQ=","MEMLAzaOvKqRJGlgSQvPkX14aBRj4ufXRL+0QzXawk0=","C1ezcyASfUxQ8mkSSw29yysfE1IkGl0SEDKD4InAx0I=","LPSJBlDSckDhlfYKT2mO2iSbjdYUsjN2tQF40t9tK48=","HiIcVSaJi/0S3oaFGg2XA3UaLyOQCKtfm307aRHGQYQ=","KOB0ha19mS7RpY8ynKEq3OTsaT6927KVLlTTOfLuvaU=","L0TWT4TeFtxnvV6tUe+x3IOByEUgwShU3V7zoHms1OA=","BQp2vDLr0d/ivjMPME7ces5xZ6t7oVFvQCHGLPDU+sI=","L1jEXl1lmmfXgTZyQfbDXYy0Y2HZeyiUfSlCHCcFlKk=","JejamuDkLoQOBLIwNw54K9tnU0hEMlujb8fl4WDGanQ=","L+xzTaIP4yAD6gTxJ/hEck84o2i6EMKVRCUr55YED38=","KIpnePOoOYio7Rcn8V6TtMsU9OOju7kd1tH6yv/9Xu8=","INzGx1/Yklm+f0BnULPbZ5olqM0nFdJFuRdTkKySLIQ=","F/QroQlC3yXLilQXgqGLb9Mc+WXREXjHsErEW03qXdM=","Ao7rhdEVqQQCDgxhSO7GYD6c7avGZKvudkqv1FWYa6U=","Cx187POnmyrT+imPbOp66V2AwCmezJGOn4ycPTjVnUA=","BEAznJdkzsecFu/bg0omJh244/Es4c9yLSPA4R/0zwc=","BspkfClyfBlioAIXfaLVBPSwel9+tXx5uI5reru9rVw=","LqEgqGT1xAk90ali6PATx7jvd4sE0rpb/DyrKGGbqeM=","K7c3VGxK7nwMwrqHwRV+KnfEeev7Xcdq27Oc+Gl2M/0=","DjDaZJBiXTPnnNUBdvVo+aLCjC9EmivVGiXRVoaAOpM=","DffKcnihNlC5GdhUl7LrsPcQNafCBDDUEx2QOrf1dSE=","J8xYn1v1hXlKus5Yn7inSi94TAmQuA/KppRAl/hw4tU=","IlXDajjIc13kXO30Uq+oQjMtMwQveOYMQ8dFVCGzJb8=","Ez2WAr0zeNafaBwnsFvf/Ji32GzKY9c6YMrtSFeE0Ic=","DhVI6UKunT4mhgaZuTcnyBeplIYWyT70rM2YGx3D14o=","DyDw5V2TaJ/gnsMS9q9HYnSC5L3goWAqjiyNboTopq4=","LlIyhIPLW3/y605FsS5RsmIyybwXtykpVMCp9r+lG7k=","ArIWLVM+BZpu2iq7dHEu2zp4YL7qld2KSr/JV2YIBPQ=","GeCSdxXRzG04lCmUf7Nzfa1zOXTGsuE+Wz1DJRlRbHQ=","DTqABFfXd4VjYwO4uU8X3P/LRgSIcqyfdO9/J+5XNwU=","LJdNGVJVehqsX3uuSZZhbaYZtz9EHE5QTcj+nPtVnjI=","B2a/7u3izPNwjhtP8wcUwiwdQ0zb6PVVFLq8LdXZe+8=","I9rI6lQIL8Ex4XOuVeRjDNTKfIcbKgpHnB505/GR5iw=","F9X7bCyzcBDj41irLVdTdocO0zGGuOrkmtO0fjQKjX8=","F13Kx22KgSYTm1g644hTKQJG5D54P6aQPsgAfxeMACM=","DE/Qj+3l0iGtt6v1SYmMkeW+foW/H9KmEb8YLMLnFlU=","J3k0uQnnLTo0dbsex2arejitWbEoMD/FAC8Cplvf5yk=","Dog0mZjf5wPxsYRST5w5TWAEzKz5y5UolujP2wsHi2g=","HxsgeLYLD84Hgk4qK8jK6O5nNRSwBwqLRXEMx4y7mUI=","LrFVlWbFNt28MW9kgtUfo0BVdldwD1uKhG6BKg7TNNE=","HE29wzXPZ2Q1Ugi0ydJD00VB1iPGad7Cw7oGa76vZ3M=","I3SmstpvjKuOXP6NgF3Tot/KHot+ul3IV0Ah/RJB47Q=","Gd00JTPMxgOplzjj+1pWm5TvcbPkn5D7h09hYXMwcvQ=","IX1m22x/s+/6UIgAWH0us8bQPYOFEy8vzOfzXycFzM8=","CBX7hZH+AQOM06OziyNvnvynfGGNO/xsKn+okpbH5k8=","K7lDtAwr1FamwXhTscqI6w/zb1l0sv+aX1CT6b9joW8=","EaUVP85llRPufLmXSubLpYHjtM0UVwxXCf7D2NP8guk=","G3K/0HY12FAbLv+HhaJJW650x2U8+Q5tXJ8URCaDbfQ=","FJAsBwDuyJeuF4uoyvhQ15Px2HUSvqDs6jnPax/uIz0=","CcE4xuCmFqSf+Q1DprBD87dFt4hlhW3EwaReL9hMs/Q=","BbWKPc5XsoGicdaYlQUtiHRYpxV4PoMX4CSmGjXsELw=","K+jSlSXAz91eazEl473jv1WOVfvoZ/AkRXqWdlR00Dc=","Bh1y948bqdxrTX93hCJdaoG9/Bta1sJDafnAVgUj2a0=","C/GK78rP+r30ES7drcphRXOLSAOzYUW7lRbbUBoGkuk=","LnPdEF+osuyTHYzfKexnnjqYAakwcafV6jBlklXwO8Y=","D4RA72Z8mugTN7pdjJJ6U0fecpaGCyEcrR7L+101mO8=","AE0wOy3qYnsnMb6D+TrDTn0U0XihOABVjKc5Y5XrEY8=","I0VBrXIECnDaKZajUmkjDJRpnu8xOk1IBQgAjLw9N8E=","DRI/HnLSa5K92P1z0UKGwxKtTCOstGsuCMFXEEQJ4XQ=","L7Ngd28N551wmO56pBI8Be5rBai+Rgp3TzoEjhOFRbs=","A2hcB5Q04WcnbFfTzHlwO339xBwVbqHot/mbaValUyY=","Jgrw4P/8yXcsFjGxeTRFZrR6qto2geuQNMb3XDcFwcc=","KGK0E3T4m2lSdLM7dz8lVJFuK/+f9nJUX8L0lWP2J2c=","AqmRL+FwMQInGJ6h5pHQNi8Ys4tACw7/GSyllRPrqNU=","COUTreaUoNisHz6/GpZEDTLHE9UFjhIk4HA0jCgfSm8=","FApKQx4u55QA7XRll42EdzITxigmT/gPIax6a2c9Cas=","KWr00BnLXffZWbKdVJw/BxICtOuotT3F7pee0UM3eSc=","AYMuKEp/TIFhSIK2k5/A8YVXO9ICPj5QV2VHC7gSs0k=","GoTVame/3T2WWr3NMpqnjU/pNDRJby0QOGH9GdZtcmA=","BAy4KEd3OSfSrv3AdIkDep0fdjHsp1yfsN2gy5294UM=","AQ3PCEzCnLfK7PJqpjO85O0rAZ8oh87nsaePidP6vi8=","B+3CKgkR6iFEJe9UK3dtsjsP5YF4ENQMcsqYqr2a+oM=","LupKsIrsd18hSEeeo2+7lpNtpYuki9HS06zUgXOqq+c=","HkDA6CV/5KYQBc3PrRSM9/R9G1z936oIJzhpVRgkXxk=","I6J4CVg70epR9DbeVEPhCPadRM31HcHwPiGUi0mAuHY=","LkZSsETb/kDmO2sjL81fPzmr+9IFHuaK3HVAgNSSUKk=","Eeer227Lr8Ln2M3v6ce5xQR160dds8LK9/fWf0hXdfI=","GZ1SNQzDDoxzgh+AIJbw5UehNVGye/a4mTlvY6xc+Oc=","D1ddbuZ8vs2YNFYk4DKjfIWafL7zCz/dyUnNCXhIQQE=","HEtvmiritBjmJlrLqclrBhhNBwKOX7eE80da53cv8Fc=","Lctc+Ilt458ijhV8DFWT9GJvubwiUgY4PbIDYKvwySU=","E0CrufThExhr3CbL30vMpQtTGhB/hjylRFdePPhw+OE=","I2jmkrcnh8uIcOqIjnFOAG9Z0rRGDPt0xIqMxzsdGls=","H6ua3ZuqSk9W8jFld1xvLZIqdjKpT5Y3S33IUnVvVLY=","DH97gjANPGzj+JV7oeSt1UxMAV4g2XZdIgVxwWq4aA8=","FdY+hr6s2Txgg2iOXZyPPGlHkp+fH5mrV4pMOpIu/wM=","C+hDrl+bB+UlcheK99ro7QXTaxLAYHhikpNV6nQCPZ4=","EzJ0nFI2lMtpNeCWOgfoGwWWfOHZUMC3MQWOySp6DJo=","JUOUCIEOB0wL3UWYuYFf7okruVylECns8Am/+lubloI=","BX6NGd2ZmpGNopsJQLODup/RXbCw9kmW3/Z/61X5p0I=","HgFON+mxF887SHDZmfK1XTU00Ka+mOnjV/pD8B5wop0=","Gk7STm4DrrzWvbEAUz3JZll6/hXIUbS4Y/boiQhMZHk=","JTQgAHCD8aqGOtR2CQXBA57UERyfBT8ncQRS+DzjapA=","InahRBlxcJr/5tKpkyAAHsRexyFVxXXd7srA4ydZqwY=","KJV90SGOp5n9NBHrGTJYU633rorhKB91MwL+fTHfp7A=","L9klcmq3lMiL11eWqj5/HmaS8pFM+AImfd8B43kCoAg=","HPilycdqhLFHyCONklPNVbR8DEPYKWbEY2ooZ0cF/Zo=","A3PLvDBuG6uecHc2hxXmIwtLLi5KHbnGdLjDWaQekQg=","BgKD0v5/I9/1E9kRCz3GJEi8SPUxzgweq1kgvyMpCkA=","DatGXW2RB0DzPvbMDq3HG/gRm9/Vo1J9yLv636pAJjw=","DLp7y8giSyqOSroXl3IwpobNZCHcDKU0bzRGtiQ5xMM=","HkNl2weQycT0RbBlPEZv8h25bDi0B2uovWi8tN6mkR0=","G7LbohmamrO8hu9fnef2xcoT1g6rQs7WjemPxkOACo0=","CtPBhwxtbvQO661SEjzRopE9nWLoC/usroEuCCAh+co=","AbCYyR57DLtcNFiAd8Dd+VMA3fYUk1YwwM46JickUwg=","Gf1cDqwU+udZi9TO6jseKZiwwWhJO21yrkG1duVbnD8=","DUdJ15zBY/FxEKQEpG/kJ8ZDTz/me357TM+mq5W9fhg=","Hrv+gRSkG7gJ4LMzmSQSMuuUCthyjIpRbUCtpEDb/c8=","JwTlthM9l2TW0/F9SdgzIj45N/gOufrqu/upuvS0wbg=","IWXhyAJzBbGuDjI1cWNeXVQNE9cQw/mjkLaRPxTQNeM=","LjSX5NNf2llsBq+mO8Og8uVdTuukrOtg5lCBrWOqi4o=","Ax2kNF7s1ttsD3sHx4Fdet0f4FRtc49NeatcV6qEHt8=","CJ7OVOR6pckI5D5fCHN8FDaWcIkAasqxyc0Z6sSiCHY=","L1PBXire0zxH9VoHBIPmzH84Ifv4qkBnfQVS7Z0Q2Ec=","FCqjT0suitDfeiGz45wAyLCqKFcJSAHqr9cr7+0Hf5M=","F66k2kx7zw11iLAU64tAl53Scl7aTmrOMxmCRnx/8r8=","DpcMGdGXSNjEZRBNjwIgA2P5pBeG8C8YJ3QrINwNFyc=","BLytnlU3lWQvWbr3FKa9tDL8RaCgt38aujqYI0dt+bk=","JCwL+82qdvcV29S6glxx/P7WccGxkB+khMh/gQMV0M4=","JdsTQ8JBBAcQI/tu002ZCQeDEeHv6FrwoRsZEU+p55A=","L/5NnEIKWenNx8Masr81GHyhR8uJijlC3rNnd4YDaoA=","EluwOvPizxi75vW1kOs7+NDRumO+aWSD6Y8oO8fNB6M=","CBa+QnRbfbtM7/5bjiTqYP2LcZ3rpQA3rHt1lIdFxrw=","ERFg+az27DYNG2pxIxOg28viPmRCAFVHHS7kxd7bNdQ=","E3eXjhsfaokl+o57eUG9+PtZq5VCNCQZKD2CA0Nck5E=","De/B2IghZu88zeU6TyNvuoPThGIZN87lfkIaUT0NM5c=","L4+lx4xwbjpdSgPyp6OVMEbX6Uy4in7zUOZ7W6Dw3r8=","GiqVfsCnI9phwhNLqwvxe+sA5tzYRpDCMNy55Y2pSCc=","HN+HEJlfXgNBK0p/aZUy+f0B8OoWeo38Hd834oBa3e8=","Jv0xRxgow2rjbCe3SAVLDAxP5SObMBaZ43Ze6+zBiUY=","B3XZlswsRFbzA6LB+QB2R+Eakh2f6j97kmFDuZ0voL4=","AW+5M3cIymOM39qRvQ2uprlyJO97IGJnKt3RvRi7iQA=","LDkvvn0/3kL8pPlHi7Q5MxJYJVNW8YSvb3bxGQVBF9c=","GHoqO/eaafo+UInvnx/Vb9tHxV7s53qiKKo94bSGvLE=","AnGoY6KAoyZB/6M1ELLt0njJhjA1lTLz5Qaydf1dIM4=","FVdFnJx0yUqgDlr2mh4xEvtpU3zol+wMcYlY2WUW8qs=","Ko4myo1kfZpjiFFuqdz/iQg9U55YFowqUMba4w8QnyE=","Ict1IZTPQ/O1GULrAEDrqd4rz7HCo/rpeSS3EPJoMs0=","LCba+Za+JHrNbdSsrWDTi1pHHmMiGI0CwTfny0hDd+w=","AkAXbuDnmC7r6Spo0+OjjCaCGswPXQWM+ME3vKLSbxs=","JjbglzyGXBvZdN142qqNCoTNr2vhrUfs8qDRjxFzGPI=","GehPTyWnmUlgQWYdxdl1toH24GdEzuibe+XZ/eF0SsA=","Dr+JBko68kfKHzb281cBiOJx4LMmxPsmZk6J4UVMoRA=","Jcfpe0db4A6LVZo4xFI2T0ycUx/suKxpj3/XPOIucew=","BETJnlkjU+WuyqMCrdkBwU2MVScKFgr+1EKe9VmK108=","E424iHgwVl8mk9Dg8C5OeeFEln8LpTsDUZq6dktcmUo=","JNQPRiEU/p7gKq/PdLT8ok4a42XcdcO1K7E8u7LyHt0=","IeZdbY7kN2C8pA5zC130xM86inMtsUj0spUbTGHWjow=","JI3XlmnsCdvwNQoV1sdcapvarO/KFNUTAJePE9GrbRw=","K4I4wVSPnL4p/TXPkee0jw69p+Y57faf6NWrp5JNU2I=","JDn9I5JX84GBx7489RPxv3I166lPa4lCqUy93s9vYvc=","IAlYI1KBphuixL4KoygqGMdLbSYvXefC4z0rs+iT3+w=","Dh7KXfiO5fYM+n4f5b77txn62CEfqbLQL8wjMZDBfxI=","JrU0J/mz6ix2nZxmD8YIgaFpwScy0AG3FY7ksbhCyiQ=","IPOz9Kyv6fivPgZmGzqPd4+igSUiudcKZ0As/42ysbQ=","IR5dKznWJSCnpifs6MrLrJ+XUG3vTsKGkoumwn1GOxc=","C7dD7jSAISnFVnMa7Z0wLc0IUxPOVy9iQtE4MuU2tLQ=","I8smYbSI7nHkx1P/I65L0l2KRAlPZrZTKXfiIUDrpcs=","A6NaoxI5Ec20U1uu0zWfX2pSBbnJPvMdNTI6R4B7i8k=","J4A4SKCu2WqT+pQ7ZjXkUCF+E39K3nSmLXkXMicUtpc=","DLN4OcLJp/95iEy+x19B6b5eR8dtYVOCMb2BYpltb2c=","HwAm0L8fjh3VQjzC/sH7XNqh7NxMPLIY287vd8ANL5M=","AqfXu5cLim7S7mb6u7qVa22jsQD1tfuSju9C+XCCc8k=","DP1/QhXkNMjaF+wyWLC8YFrRqy6QqklDUeTuQLvEkfo=","GAsRtyBiKhVoSdxvf25/VxZZvmloIjDF7ZrDOXAKfN4=","BOlqllvOPToKJKSkV8lRWCyHE0nOfu4aq/5XipTGUBE=","FZMfeCtF9/tlbyzb0fdwXDU6I/4dMKWkahUi7RYN860=","LiluV8l6Uwms0m/r9VrJY6VETBxfcDrYig17l7ndOLE=","JhV7zreOhGu7Ji+aHgbUJxveWlvOjwQZlS+X/9E+rKg=","IZTriYR9aw8Yl/Z18ZwMVrYbEySO/zyjbjT7nRx57kM=","I1C/NUd2VomRUa193pbqeFfhVQFEcAjatrPSfI/6J08=","GkhvCuWRys2vCcWKScTReVQFQ1NAgZ4APwRp0RC3dSs=","G1bc92+yPMSoNNRVpAZeEzVxQCt98wnVm8MQXUKowwE=","GnSdeWSvC3ICkT7yBMZT8rS/tlzqt7aFIzq1nOO7aSU=","GK5ZAHP5aWlq92L/pOjw67+X+Mx4fjfN3R8yG+O+rbs=","IcR7J12C3eZGDV52mplCEUSxxanaWSlK3py7MXED8kk=","BHPdvVLnN+UnNk6OtjIHl1w41f1swysnIQKwgs0VGPs=","CxL6yVttOogdiSZXyEJOZFrE5rAFFfkC1ZRXQwKybgI=","CK52FqJgz2ZX+Pc6woRYjSxfB/9CXYN6p83O9j4+IQM=","A52vaHYoC4Doc78qMv0oNKg8aXV7rdWKiI74Gekmzig=","Jeex10cKPHXxPwtWVGyOCfLY7+/wbvdm+ceDyoadEw0=","Ho/TY0w/92QYTQNDX5hYSxG1sVrrnHUmLaPx6iwqnno=","JB3MUaw3gIpBXdHjwoHwWv8ReJ3Ayv3XejVITgmT+aQ=","H/wxU8Vu+XVZMs6ivgVzdJva/hxPoHgaS4tAeM6ddUc=","F2MNYtmj5RDIik1Dw2D5K8D6ALZgMa3sKb2VQ/06F+4=","KYBADt0ddOPWnbVFjSzNX6vbI27BaoKkMBoKtZ6kpuk=","MDT7JDZhI+xtyvytNXJtv7FhlMA23NZI+mlDm/zQDNQ=","Gqfo9Bicqd/z2yq3ZIvgojkplc5GBB4EaA3KitcjLfA=","H6GV+DSmnmI3L2DrSX2hZ2RurhQVPYA7OdxdEfXXgAs=","DyPxx01fv2GVrVpq7l5WmTxUd+hFP1uToNe6/TMwNtM=","AWVW+sk0inNatQqgiclxUbPKrwogo0+52TcFBaFRVyk=","I9kreTZIEQ/Fru8GM/DHfKyw27yhh5uKb25d9EXl9ws=","LkwQ7F5l4vI5u8Q8EwMd8mhqtA/XmjBLBdYRuCPyO3M=","EkGLv9d7Y61eFoZK2cMv+/xaPdm3jsK3kyn+XgqNKVM=","HkqKrOFavB1bdqnoSEMdLAanj3K2vrsSk+bFjlGFaW0=","Dz6WEH3s29aHLCDqCaz5LN8Xo+4dEzFIgJLZYXbet1U=","ASw3gCB/OVzCHesKvZUWge6jJJjdumzol6j58MI1cGc=","E+qxtOZyuhscG7kBdpMB8eVlnQPqEMYd4kd/8KwiFCE=","INxmSrsgt0VsBmKc43oeyxonpOiyTjG0i5xGNaowMj4=","LGseLP6njiw2eF52qM+xsFfpRx8k9bORF1w97LAeAA8=","GIySYlX1t689qWNVcpwqhnCrTCxwQASBsqyQN0Dgxas=","L5kTII4J49bp5vumOE/QdquJ8mYpduPjDghwuzDrVPI=","KzOAPZCIlwbnFPcgtWKNJvtgtUWh8+nOSaaukSsCQIY=","JsyrwQ6wQyfLXMPd4quzbwlwhsl+c4wTPJ9XB350iwk=","GxauDXxUQIy3X9kx8kZ1HysMPcINeegqJTG3bCK01d8=","EdC7RhvYryhE9J8PhAyU75UYslETRHQtH1Q4/j1BWuQ=","IzAxhHtHa+rQEY09szjokTPsQg1nPlBK1kclnfZVVx4=","H4TpeJW+5DjrPJLcmxhGya0pwWQ4ewautu0YQe2MTco=","J39/m1QvDCu19FvtBU8JYkU2AQw8+UUtInMZMyf4AdY=","HvyckGnlBouqwT0uZkVkG30n6A/CMHcWFTXERoLuV6k=","DW7Ed3YeLvusTxSzvz1SV6meZMPyX+EE+vmIsg/l/0Q=","Dg59fFUBmZt9Fhc7WbfK4fIDvvIa6/ACUYgUOcz5MBM=","IXvvL08SxtzJHCBYojORy3feU8puRNzcbqPTb+oybqY=","BXgMiK3wFTG1D4F+P+RER9KbNaqKOJxx6M8SJqzvaLo=","GHM4h6ays7TJDY5JkBluI0ReR9fqWTnr+4mj7j1ntL0=","ILrOY6z8rgscnyvuJLjp2oW6WX03sJBXIMTxXbIxsHo=","Fm6llTdaZ4asUn7p7O1z7Wv1UIdqvK86yStCyAiwDY8=","MEJiqe/0BArPQ+Mi1vUmdq4vhT7C56gNsAxIjPkXx04=","ImuscFAWbl9tt4zQsS028wW26MmgVRFK13Ceb1ckW2s=","JrL1OcVzgp9qypG6qVRQW8XD604d8dY4WCcX+98jiMw=","BqD79M1S6Tul5MbEr2XbAu6WKX+K0gDy8c/yUudptVE=","LLnCQRLTU0Gs6siDYPtSiSTli27KwyG5+ynmqjNo/yM=","IOiKTWB1Jt0H/gijVSpEZpEp64f8wLE6rI/or9kwFSE=","FURkmivXPjunLzlt+R3WVAHdj69R3jJfuu251TatlPw=","GYAHdFeZVxLETafhdxMljj+Os1S/2A7Z6vPsuvaWAQU=","JdHSL/E+dwXTwIX5f8Tk9pFLgv+qXSCR7GTaxCN2Xvc=","L+yZDvVW7+EDWkZP9VgedAZ0Rc1Uq8r2uMA5n+DSTPw=","G9lWNQbZVE7z5IMOE1RQEsV5N5wtzBMwQWxK5JvE7GE=","AK/80XumADxW36hVcfwpc3siWoDUgOfdft7AHxTyMBA=","I2cNuu+WaIHwf5GaLYgxKMeyPPdnpHeysuB2K8DbwYs=","H5OlMpFzlMfiL9F6vupjicZv164t2fAvhg9tlpR/Dt0=","LeQun1N7fWGwITdxwOdPVVUSvge2pQk0c04sW+tAvjc=","JcVX9FuZeBzTfTuyKTFmKmf3izd4LIhbRWu5bVXohAQ=","IHTItwlwXJiIU4p/ijxK/2R3Mb0W+OJU+nTqnyvnZiw=","Jzg1WVYpgTiUnkQhcdak5LdO8gZXQNt8/DoLYP1XOss=","E9Nq0KTr64GWl3hkllnGXLfQxBzFGYcf23Gp6moMqlY=","CKLBi6QTgTSMGs+/lhdxaAa0YqFpG8LjQ7ebgIXjdrA=","BZCS/Dla7ShYB7v1V62aEEH1nAeYIrEIhFeIL+57YSw=","FhkkFRtaWtLYysEZUiqZGpBvFehTHccFZ/ayg3HMJOM=","HGjKj3qhdlkHVAXvY0G45popi5pNcvO7hUswnkuoehs=","J/XQO8ocggf3I5pLLPc65VmhWqN+e93fOqsF7sXOVZI=","Dsv/SEaWKpddNH6pqPxGX7RoYVV2IvLCVkp+Y5gzwWk=","J3xN4jY9i1tFbPxaf/jkb/LsjapZhV9a1kvAUh86xWc=","GxGGLFKs01G3pGR5P0+7V/7Jn4MrYyJvldF1yNL8CLI=","BqcZxYTHT/vdchjrVly0yL2GyS49+zxz4VJyAapRI04=","Iw5K3uy3mYd/fOmljINrmdUzWEoZXB13oxOr4cfRJr0=","ELEJuGSAnEdnoTPM5sutbIhigXO46lHozKhYMMp95SI=","DiEReXDc+9SxUmslNjbzd1ONO0+q61qLJL9iANFMxZE=","Jmc0mXhAE2L2sXk57rDmT/VWB+vbNccHHbRrs+e6R3g=","BQAPpf2lBeApoTv+MEwmew2GxywDm6v20/8C7iRr4C4=","Jk2eCUrtX0GmAkIiCjSihAiQh7JDapv86BdMyb6MLiA=","CAdvnEdD3mEw/2Is9AHt0skvJL/hFPPF5ySJF0YxXEc=","EyNwq927Cx3VfypSDCUza9fO3pS5W79cIVHW2I5kG2Q=","CP8RFreiJ7/f1EZaZ4kIgrYVyMTBfyjY0klY7fYC3cs=","K8sLDbi54+ArfpwclGD92cbNmFYjMuZI2KPgq5RZdSA=","EupozmiBvsrX+KaxF7A6uXb3q9WX+QOwvyMNINIalDo=","J0OcmKdmiAZ6CXsZtv3X141fiOJ04Nj+peprdAb92n8=","AvQNCtBfVlLjHvlECtcevIQZ45NJOTfwXwBJnQKpnjY=","L78EKEMn7k9oDwa9OQ4wnQ0TrMdLnFsUtjBZuMx6v/U=","G+aG1T4qitV6gosGUUJc/Gl4xwJ+2/JH9rZyPCHfhuc=","JoO0JehaUI+WhS8UtCIPz+n3rYsXv+/A40jEfKeLtX8=","FtrOmy6AEuMdscfr5nLYa75hoao+FpPg7d/A3gqd2VE=","J6Mh+MfTyQIuli9/7y48hItFOdu3WqE58wQw/lRbzts=","BszXIQ3uHWsOIreeEtGQgtgHi3iNcQB7leendO2GplE=","CkHdQiIWU3Ur7zUPbXSpF7bLsf12o6EhZvTQvpeOQCY=","IgoCiB5NR6yU2VDN+DhidNF4LifL0NhFl43uyRKY8WU=","DiFVpUX+Xzy7Y5dgZYnqwZzZJjkznGsBcpikrTQItLk=","Dw8ZxikeUVRqJnxgzHdOX7nQiLrFMHgtiR7Br0uEcHM=","DpJbzRxt20o6HGfsje771AxTwNM+eu7xtGeVrtWUPJ0=","KtAAsXSKu4Es1uVBEoa5/z7wpb09JZo25F7wW561vus=","CmWqIy0y7W6N5j0c3/68Lz+mFkZcJ6r5fozT3P9khlI=","AmPYRwq0scYddNjoliQvTyYdyxZ6OgaSOJPXyyyT1qE=","KQHZRq3clLBA/VgATZpfjNGSZUDHqGEs7BxYy2DCs6U=","GInPqCCfSVLfkCLbncWDtXF6BpbaQc7mSTfQzWMh5pM=","I2Bk1xy2xkyEdHrCX8+NiBUC5fA7/4dWG4WhFrHzmso=","L/ehdP/Owphi4E9dvcc+vzZhVwAzV2KQwMH2zYztJ64=","GeckoddCyrEDRV8AQO33RaJpanEITJPjInFUUN1Nb1s=","A+7TiStvDmxdoQWcXzeTmFg1qig1AKgSmQSpTIfxYb8=","COK4Jzv6MMGshQMG2R5Gip6NBQkq7ky8gMaHJIRjujA=","B63Mp22DN3KIOaG2rDs+1Cr7h9cq+Y9S9Bby7FiyjOw=","Fx7zeJa64rECCgpYOb1ReEzhG7QjfVSMFxFp0y+hm0A=","IP/fy4b00AUGTtvClpGMMy0y++/xcp3lBWomq7w6Nfo=","COzXpvFzXu2GuqCU5gj0iPONuzmPz+1LmUODoMqORkc=","HD9dhuWSH96YkBifHYxhh1QohgDmkovBgqxNXkyfDMs=","KcYRhO2dRg8zdVihr2Oap+PAl15AFO2OvK1KJdUeq/M=","De/UWyiVhygiituy29rval6bGmSQKnNPQCuM77irO1Y=","CnTqItigkzYGBhAXmsHYL/+pSS33be7U6mDgEzsIEag=","A6N78S2vFADSl6xKwTuiTBfcJi2xbIUj3u5ODM3ppoA=","Ef4XkNWrv1k1/yIxjk9//mmWatovkTa1T4MOrLCmU2g=","AYFlhC9AY3XyNGaGkVr7FL8f4FZMiFjuO94Kuj3l9o8=","Jh2yXnz/Wp+3LydrH5JgtmcwD7fTYbUP1cDotplbBfk=","KjrDMUsrZueW++Nt93jF5GlyMgzEPsgHBIgmtnBLp8Q=","I8qkuA7PqZ6dP+orvB2782nRv8iTfQPQdAYcMP2M12s=","J9smAIXiJImN8UXyP2NfIGbY5OEk5YHoxiYZKbHf4Qc=","J09sX9NKeE1rkV7wXUJO5sC6u/Np55qxOLgWe1YY7H8=","LDop4TqE0moJEckona8apM9YQKraBwHVfiPfx5babaE=","HqIQ8gAaM00+gB9OUycNQtp6rzF6VTtCgqp46qIoLm0=","JU2+tSiEtpnBun+g1ugNYQkDsYo+UJw2NRzMOwJJRuM=","BZ54HWWJbr4OS6JtwvKZB/R7ze2kososcT2FBeox/V0=","C1sc7GPULV5hXcJpuIWiTO8wPseMly3RfNuz6RXMT/s=","KnwBXpw7LFfKi30m05obzIXW/6y32fvWbSqPHWTtDJI=","Kbc2uRHXGnnPY9im94bxG9Wr7iQWHcVnp8hR6uHkO1E=","KFdFqQp/49Ca9agIcEvGnG8XAeVzkS31zB4mXVlsQUE=","LZAbgZXDyWyMNuuZ/sATTsK4MEroEL0w2lVOMICCZxU=","GQXTUYNV6rp4WbWR7XuMnCU5gPBFDb31TXp3groFg5I=","I+gTAm/AuABk0ZtcVCiUL99+/qgL+o7ECVJyv9t7TJ8=","I8ChmiUsh+axwcIbGnmAAgDD+/8+MwDn5VaAcd6e+4E=","EcSuYHuuSSQTv2LNqiwoaO0f7G3AYxsGfKYPqxJbnio=","LNBV67fuRoY2XepFDwRv9iQF+uGxr8n7AXB8+B2g47k=","BTyf7y4CH6miD62iL96hUFtYoxWbu0czfb95GyFbFFI=","CjW9dOh8urqr6JrRMZ0snoY7TGMcIZOMmlOVv5eHKp8=","HBFQVlOc4gzVoE0aXEPisA++g7JZAb429d3EZm/Dg/4=","JClUBH5Xcv073tWQ7IvrTFQvLiZMjD4oTNxHNQXFGpA=","Diq9MVtHwNyThJwM3yZ+gRy9vbIApufCtn7ffLAXQhQ=","KCs3AgwIkNdRw/12lQ2AaGaOHf6uYh3VUtLeiH2i6nU=","KJM4UiZrUtnqa1u5I9nZTy5aW+XHeOdeB5QsI0tkO9k=","CZq2dlUFuhGY7xQOd7eVTU++eaBWznK6zjnASMANo88=","KvIR2OCsLY/af4SbjyKaIlxhhrVXYsensq4tHdhcV8s=","DNBw8jQBSigJq5DHHB2mHpipYyL+3Zm2qq4coQTz+s8=","Jnk+KryNPDDGBib7qhWPJjWH1r0Vgz1EixFiZLkwJWo=","IlvjbtDuheH4Ra2oTldIpWaZFSET/2G1BWtti95gwZ0=","AhdPSe2wLVFU0r7KLckrnMWVOD2h/ejwnkte4+paBl4=","D2SJHCyLAg5Gw1lMt1jwvdzb0JvQMIgW+0FzSoaYcsM=","GSqEyi+Z02mR4tKx3v85idHBVsI54Q6fVhQOGFRXYGc=","Kd/Ne2PwWr8nU6jDQda3pgxiQ7BMmhuLMyC7oEpNR4c=","HuJ61rm1qGdzOvxhorPnalK6PkvV5let6R/AOIGduls=","CrR3PxUMP4rTvJU49DzsOVp+NzGulz/v62I6CSF+ZMc=","E8NSoC9ZUYYgLLC5n6WMVUKrZ/m206Cv0QPe7/bYD0E=","KpfPLBDEv7/SmfZ8UqFp+SwFt9rFakHE3U/ofIJGzhQ=","AL7LtHBCvX+Mn2u0IhYtGu0ImihIL3/RarBqEyhf5wI=","AI5E2iHXOGkbiBdX7zftKcW9n3pEUPz1MpCpLMLKIXY=","KyBai21LcGPZMfO7XTRkBThD/n++S4PBeIP4ZSeIKhg=","LZ4yp8kFVv4QjSVawB513zOPzWOyv4TBkoDUJymIY/w=","KaMiqEwlvS3fbi5CACKNlavWNJoCJmrB27pSBzjOypc=","BnjJv8by3wEvT+VeM7torBTO0d8NAhUnkgidBG2CjEM=","D6/zpedCV5T+IKfg62FbixdgOUt/IwQoajrkAJEk2yM=","H49bYRr5/rnOqGwIQFgSBVPkBBA67iE/WkHR0CVBwNM=","Fgh12EeWAvlvQKzC0ELuUsFYi2op3kKEllptxskw6gc=","Fth6UYOjFqHXCvyVHv4s1mfHcyj8/aRYy/X+MEX0bZ4="],M:[["EkZm+AVh7VkW8vBwsb0kjG1T9E0nPZVqDIe5F2kqTRg=","EZJPAv0ZsJJVqqHPRuoFGOPXv+70dCFglJEBHbC9CwI=","JH+n8CIwShmU/1BUVsIgHvm3FzaUmNP/zkRmAe2d+EU=","A/17Ge8shh8i93/4EPVOJ3vJTrdsAtedmGvj3N8FHD8=","GL1BI5w+cVeaZ3RD7P+9VVqB7u6mk1Kmi2fIVjwMKgY=","LXjDpdKN6f81vwoldjUZblcwyn9ASTJ3B4zXXai069w="],["ClFKXCJ/TOyV36Ap6N0STDSJWqRrsnwJEfN4DVAVVAo=","GS4W0X2VayV7haZS7v3y7glYnqxb6AkVd1cj0ssdoG0=","KYzgweMRO7k1xwWOd3K1M7GqnbDAkmvciRflYFyjrBA=","CUy06DYhr9Jx5BvHFyfwFY69YSI5rJ1pixf+S+Bbf8g=","A9iAOVvpPCfWSa9f0ULnazORjLiEHVooFzvVz30yh5E=","KO6ua1hmrWjkQ7uvkWgNt9fiswN+OP72G0LLzP/OyoE="],["J4u0mntORK6kbrD4gstpKAGm5g/dW1wjxjzWXMzk/go=","Bj7ewb7YMfUGr422SNb96hRTRYh+i9z/EJA1odm2dNc=","G67xy1UJtSakIGH7U2V/mbMjJQDoVRksvoyUDgaMR18=","EyRWSse9+eIhZOmFjX+o42ixZerqPa9Otn7lnA3y5dQ=","AFdhuMauyxqMpOpN/CyDdgZKSoAEzu2iEKVSQFYt3BM=","EMnigxWdWMtMsuNf3oOjuh/cKAAu2ZY9KpnxhheKFI0="],["DDmen2eqQHB6ID/u+wuVi72tzsXKNJAdJT0CaiQZ9qI=","CD8N8/GgNR0DMOw/9gLKjMNTt/bnYscQcYTNe0I0SfY=","Gmdk1ZQ/xKcgtMChn9uMcRmEMHKHpYubX59dWCEssmM=","ARpjom/qv4f6Zr3mbMJakiyWOC12xqf/SPFTe+rtaDo=","CMp7ZGV8NUjzK+9bY60kKIpBwLJRCZrSf5Q0MH4+ZNQ=","AZmCcEcek2GVVEawzbi+qRXsBnXxzWSN3LBDA1B6RIk="],["HWs9X26jacJvgl0jYpM+qjHqNewKd8H72eAcoVI+RDI=","EZ7xiLs90NMjBpdsGZQehmS+aH56aWkton2iFabwbUA=","LZ4KtcBok9/f0DSBOBuoa25ikt9WCdcfLGSy2aefgJ4=","JfFmMb93Bg9+o0CHwCW/E1eEMZ7wjNouMUGe4KUp5lg=","FEx6EdpafF2rrj8z+9A8rYbRi8WUx5pJfsuYlO21VPE=","D5cRYmJ3I/P+rayyiwwQTLj3TeUIdS+o18DbKvE96O4="],["JL5RAJVDYgbdCr0LDLuVyIOrMEqlJZixppMG7JgaaI0=","IRYQ4q1KN3Qm+t9waLDBpsKZoWTBwaYD6u2USHDQubk=","FaZ9mBBBsfbwnz+evv2GTnedOvCBV3hqwHdQXlDsefw=","BJMn+nnSjBKiyCQGlH938Gd1sCh0aLMTaHdwHb58lZg=","IwlA3MUjJlj/nClpej/UFtFw6MmY8aqF3qDELXn5Uao=","GxIcBJzRFZ4okAfgydqZlcxLq0wm+4iOw5cqii5laWQ="]]}},143:t=>{"use strict";const e=BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617"),n=[56,57,56,60,60,63,64,63,60,66,60,65,70,60,64,68],o=t=>{let n=t*t;return t*n*n%e};function i(t,n){const o=[];for(let i=0;i<t.length;i++){let r=0n;for(let e=0;e<t.length;e++)r+=n[i][e]*t[e];o.push(r%e)}return o}t.exports=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const a=t.map((t=>BigInt(t)));if(a.length<=0)throw new Error("poseidon-lite: Not enough inputs");if(a.length>n.length)throw new Error("poseidon-lite: Too many inputs");const c=a.length+1,s=n[c-2],{C:l,M:d}=e;if(d.length!==c)throw new Error("poseidon-lite: Incorrect M length, expected ".concat(c," got ").concat(d.length));let u=[0n,...a];for(let t=0;t<8+s;t++){for(let e=0;e<u.length;e++)u[e]=u[e]+l[t*c+e],(t<4||t>=4+s||0===e)&&(u[e]=o(u[e]));u=i(u,d)}if("number"!=typeof r)throw new Error("poseidon-lite: expected nOuts to be number got ".concat(typeof r));if(1===r)return u[0];if(r<=u.length)return u.slice(0,r);throw new Error("poseidon-lite: Invalid number of outputs requested ".concat(r,", max ").concat(u.length))}},851:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e){if(Array.isArray(e))return e.map(t);if("object"==typeof e){const n={};for(const[o,i]of Object.entries(e))n[o]=t(i);return n}const n=[...Uint8Array.from(atob(e),(t=>t.charCodeAt(0)))].map((t=>t.toString(16).padStart(2,"0"))).join("");return BigInt("0x".concat(n))}},544:(t,e,n)=>{"use strict";e.S=function(t,e){return(0,o.default)(t,c,e)};var o=a(n(143)),i=a(n(851)),r=a(n(53));function a(t){return t&&t.__esModule?t:{default:t}}const c=(0,i.default)(r.default)},869:(t,e,n)=>{"use strict";e.Z=function(t,e){return(0,o.default)(t,c,e)};var o=a(n(143)),i=a(n(851)),r=a(n(552));function a(t){return t&&t.__esModule?t:{default:t}}const c=(0,i.default)(r.default)},493:(t,e)=>{"use strict";Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen");Symbol.for("react.module.reference")},409:(t,e,n)=>{"use strict";n(493)},568:(t,e)=>{"use strict";var n=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function i(t,e,o){var i=null;if(void 0!==o&&(i=""+o),void 0!==e.key&&(i=""+e.key),"key"in e)for(var r in o={},e)"key"!==r&&(o[r]=e[r]);else o=e;return e=o.ref,{$$typeof:n,type:t,key:i,ref:void 0!==e?e:null,props:o}}e.Fragment=o,e.jsx=i,e.jsxs=i},74:(t,e,n)=>{"use strict";t.exports=n(568)},966:function(t,e,n){!function(t){"use strict";function e(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}function o(t,e){Object.defineProperty(this,"kind",{value:t,enumerable:!0}),e&&e.length&&Object.defineProperty(this,"path",{value:e,enumerable:!0})}function i(t,e,n){i.super_.call(this,"E",t),Object.defineProperty(this,"lhs",{value:e,enumerable:!0}),Object.defineProperty(this,"rhs",{value:n,enumerable:!0})}function r(t,e){r.super_.call(this,"N",t),Object.defineProperty(this,"rhs",{value:e,enumerable:!0})}function a(t,e){a.super_.call(this,"D",t),Object.defineProperty(this,"lhs",{value:e,enumerable:!0})}function c(t,e,n){c.super_.call(this,"A",t),Object.defineProperty(this,"index",{value:e,enumerable:!0}),Object.defineProperty(this,"item",{value:n,enumerable:!0})}function s(t,e,n){var o=t.slice((n||e)+1||t.length);return t.length=e<0?t.length+e:e,t.push.apply(t,o),t}function l(t){var e=void 0===t?"undefined":C(t);return"object"!==e?e:t===Math?"math":null===t?"null":Array.isArray(t)?"array":"[object Date]"===Object.prototype.toString.call(t)?"date":"function"==typeof t.toString&&/^\/.*\//.test(t.toString())?"regexp":"object"}function d(t,e,n,o,u,f,g){g=g||[];var h=(u=u||[]).slice(0);if(void 0!==f){if(o){if("function"==typeof o&&o(h,f))return;if("object"===(void 0===o?"undefined":C(o))){if(o.prefilter&&o.prefilter(h,f))return;if(o.normalize){var p=o.normalize(h,f,t,e);p&&(t=p[0],e=p[1])}}}h.push(f)}"regexp"===l(t)&&"regexp"===l(e)&&(t=t.toString(),e=e.toString());var _=void 0===t?"undefined":C(t),m=void 0===e?"undefined":C(e),y="undefined"!==_||g&&g[g.length-1].lhs&&g[g.length-1].lhs.hasOwnProperty(f),L="undefined"!==m||g&&g[g.length-1].rhs&&g[g.length-1].rhs.hasOwnProperty(f);if(!y&&L)n(new r(h,e));else if(!L&&y)n(new a(h,t));else if(l(t)!==l(e))n(new i(h,t,e));else if("date"===l(t)&&t-e!=0)n(new i(h,t,e));else if("object"===_&&null!==t&&null!==e)if(g.filter((function(e){return e.lhs===t})).length)t!==e&&n(new i(h,t,e));else{if(g.push({lhs:t,rhs:e}),Array.isArray(t)){var b;for(t.length,b=0;b<t.length;b++)b>=e.length?n(new c(h,b,new a(void 0,t[b]))):d(t[b],e[b],n,o,h,b,g);for(;b<e.length;)n(new c(h,b,new r(void 0,e[b++])))}else{var A=Object.keys(t),w=Object.keys(e);A.forEach((function(i,r){var a=w.indexOf(i);a>=0?(d(t[i],e[i],n,o,h,i,g),w=s(w,a)):d(t[i],void 0,n,o,h,i,g)})),w.forEach((function(t){d(void 0,e[t],n,o,h,t,g)}))}g.length=g.length-1}else t!==e&&("number"===_&&isNaN(t)&&isNaN(e)||n(new i(h,t,e)))}function u(t,e,n,o){return o=o||[],d(t,e,(function(t){t&&o.push(t)}),n),o.length?o:void 0}function f(t,e,n){if(n.path&&n.path.length){var o,i=t[e],r=n.path.length-1;for(o=0;o<r;o++)i=i[n.path[o]];switch(n.kind){case"A":f(i[n.path[o]],n.index,n.item);break;case"D":delete i[n.path[o]];break;case"E":case"N":i[n.path[o]]=n.rhs}}else switch(n.kind){case"A":f(t[e],n.index,n.item);break;case"D":t=s(t,e);break;case"E":case"N":t[e]=n.rhs}return t}function g(t,e,n){if(t&&e&&n&&n.kind){for(var o=t,i=-1,r=n.path?n.path.length-1:0;++i<r;)void 0===o[n.path[i]]&&(o[n.path[i]]="number"==typeof n.path[i]?[]:{}),o=o[n.path[i]];switch(n.kind){case"A":f(n.path?o[n.path[i]]:o,n.index,n.item);break;case"D":delete o[n.path[i]];break;case"E":case"N":o[n.path[i]]=n.rhs}}}function h(t,e,n){if(n.path&&n.path.length){var o,i=t[e],r=n.path.length-1;for(o=0;o<r;o++)i=i[n.path[o]];switch(n.kind){case"A":h(i[n.path[o]],n.index,n.item);break;case"D":case"E":i[n.path[o]]=n.lhs;break;case"N":delete i[n.path[o]]}}else switch(n.kind){case"A":h(t[e],n.index,n.item);break;case"D":case"E":t[e]=n.lhs;break;case"N":t=s(t,e)}return t}function p(t){return"color: "+B[t].color+"; font-weight: bold"}function _(t,e,n,o){var i=u(t,e);try{o?n.groupCollapsed("diff"):n.group("diff")}catch(t){n.log("diff")}i?i.forEach((function(t){var e=t.kind,o=function(t){var e=t.kind,n=t.path,o=t.lhs,i=t.rhs,r=t.index,a=t.item;switch(e){case"E":return[n.join("."),o,"→",i];case"N":return[n.join("."),i];case"D":return[n.join(".")];case"A":return[n.join(".")+"["+r+"]",a];default:return[]}}(t);n.log.apply(n,["%c "+B[e].text,p(e)].concat(v(o)))})):n.log("—— no diff ——");try{n.groupEnd()}catch(t){n.log("—— diff end —— ")}}function m(t,e,n,o){switch(void 0===t?"undefined":C(t)){case"object":return"function"==typeof t[o]?t[o].apply(t,v(n)):t[o];case"function":return t(e);default:return t}}function y(t,e){var n=e.logger,o=e.actionTransformer,i=e.titleFormatter,r=void 0===i?function(t){var e=t.timestamp,n=t.duration;return function(t,o,i){var r=["action"];return r.push("%c"+String(t.type)),e&&r.push("%c@ "+o),n&&r.push("%c(in "+i.toFixed(2)+" ms)"),r.join(" ")}}(e):i,a=e.collapsed,c=e.colors,s=e.level,l=e.diff,d=void 0===e.titleFormatter;t.forEach((function(i,u){var f=i.started,g=i.startedTime,h=i.action,p=i.prevState,y=i.error,L=i.took,b=i.nextState,A=t[u+1];A&&(b=A.prevState,L=A.started-f);var w=o(h),x="function"==typeof a?a((function(){return b}),h,i):a,C=I(g),v=c.title?"color: "+c.title(w)+";":"",E=["color: gray; font-weight: lighter;"];E.push(v),e.timestamp&&E.push("color: gray; font-weight: lighter;"),e.duration&&E.push("color: gray; font-weight: lighter;");var B=r(w,C,L);try{x?c.title&&d?n.groupCollapsed.apply(n,["%c "+B].concat(E)):n.groupCollapsed(B):c.title&&d?n.group.apply(n,["%c "+B].concat(E)):n.group(B)}catch(t){n.log(B)}var F=m(s,w,[p],"prevState"),O=m(s,w,[w],"action"),S=m(s,w,[y,p],"error"),P=m(s,w,[b],"nextState");if(F)if(c.prevState){var j="color: "+c.prevState(p)+"; font-weight: bold";n[F]("%c prev state",j,p)}else n[F]("prev state",p);if(O)if(c.action){var U="color: "+c.action(w)+"; font-weight: bold";n[O]("%c action ",U,w)}else n[O]("action ",w);if(y&&S)if(c.error){var k="color: "+c.error(y,p)+"; font-weight: bold;";n[S]("%c error ",k,y)}else n[S]("error ",y);if(P)if(c.nextState){var M="color: "+c.nextState(b)+"; font-weight: bold";n[P]("%c next state",M,b)}else n[P]("next state",b);l&&_(p,b,n,x);try{n.groupEnd()}catch(t){n.log("—— log end ——")}}))}function L(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},F,t),n=e.logger,o=e.stateTransformer,i=e.errorTransformer,r=e.predicate,a=e.logErrors,c=e.diffPredicate;if(void 0===n)return function(){return function(t){return function(e){return t(e)}}};if(t.getState&&t.dispatch)return console.error("[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:\n// Logger with default options\nimport { logger } from 'redux-logger'\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n// Or you can create your own logger with custom options http://bit.ly/redux-logger-options\nimport createLogger from 'redux-logger'\nconst logger = createLogger({\n // ...options\n});\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n"),function(){return function(t){return function(e){return t(e)}}};var s=[];return function(t){var n=t.getState;return function(t){return function(l){if("function"==typeof r&&!r(n,l))return t(l);var d={};s.push(d),d.started=x.now(),d.startedTime=new Date,d.prevState=o(n()),d.action=l;var u=void 0;if(a)try{u=t(l)}catch(t){d.error=i(t)}else u=t(l);d.took=x.now()-d.started,d.nextState=o(n());var f=e.diff&&"function"==typeof c?c(n,l):e.diff;if(y(s,Object.assign({},e,{diff:f})),s.length=0,d.error)throw d.error;return u}}}}var b,A,w=function(t,e){return function(t,e){return new Array(e+1).join(t)}("0",e-t.toString().length)+t},I=function(t){return w(t.getHours(),2)+":"+w(t.getMinutes(),2)+":"+w(t.getSeconds(),2)+"."+w(t.getMilliseconds(),3)},x="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance:Date,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)},E=[];b="object"===(void 0===n.g?"undefined":C(n.g))&&n.g?n.g:"undefined"!=typeof window?window:{},(A=b.DeepDiff)&&E.push((function(){void 0!==A&&b.DeepDiff===u&&(b.DeepDiff=A,A=void 0)})),e(i,o),e(r,o),e(a,o),e(c,o),Object.defineProperties(u,{diff:{value:u,enumerable:!0},observableDiff:{value:d,enumerable:!0},applyDiff:{value:function(t,e,n){t&&e&&d(t,e,(function(o){n&&!n(t,e,o)||g(t,e,o)}))},enumerable:!0},applyChange:{value:g,enumerable:!0},revertChange:{value:function(t,e,n){if(t&&e&&n&&n.kind){var o,i,r=t;for(i=n.path.length-1,o=0;o<i;o++)void 0===r[n.path[o]]&&(r[n.path[o]]={}),r=r[n.path[o]];switch(n.kind){case"A":h(r[n.path[o]],n.index,n.item);break;case"D":case"E":r[n.path[o]]=n.lhs;break;case"N":delete r[n.path[o]]}}},enumerable:!0},isConflict:{value:function(){return void 0!==A},enumerable:!0},noConflict:{value:function(){return E&&(E.forEach((function(t){t()})),E=null),u},enumerable:!0}});var B={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}},F={level:"log",logger:console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(t){return t},actionTransformer:function(t){return t},errorTransformer:function(t){return t},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},O=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.dispatch,n=t.getState;return"function"==typeof e||"function"==typeof n?L()({dispatch:e,getState:n}):void console.error("\n[redux-logger v3] BREAKING CHANGE\n[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.\n[redux-logger v3] Change\n[redux-logger v3] import createLogger from 'redux-logger'\n[redux-logger v3] to\n[redux-logger v3] import { createLogger } from 'redux-logger'\n")};t.defaults=F,t.createLogger=L,t.logger=O,t.default=O,Object.defineProperty(t,"__esModule",{value:!0})}(e)},863:t=>{t.exports=function(t,e,n,o){var i=n?n.call(o,t,e):void 0;if(void 0!==i)return!!i;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var r=Object.keys(t),a=Object.keys(e);if(r.length!==a.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(e),s=0;s<r.length;s++){var l=r[s];if(!c(l))return!1;var d=t[l],u=e[l];if(!1===(i=n?n.call(o,d,u,l):void 0)||void 0===i&&d!==u)return!1}return!0}},795:(t,e,n)=>{"use strict";var o=n(155),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},r=o.useState,a=o.useEffect,c=o.useLayoutEffect,s=o.useDebugValue;function l(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!i(t,n)}catch(t){return!0}}var d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),o=r({inst:{value:n,getSnapshot:e}}),i=o[0].inst,d=o[1];return c((function(){i.value=n,i.getSnapshot=e,l(i)&&d({inst:i})}),[t,n,e]),a((function(){return l(i)&&d({inst:i}),t((function(){l(i)&&d({inst:i})}))}),[t]),s(n),n};e.useSyncExternalStore=void 0!==o.useSyncExternalStore?o.useSyncExternalStore:d},120:(t,e,n)=>{"use strict";var o=n(155),i=n(614),r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},a=i.useSyncExternalStore,c=o.useRef,s=o.useEffect,l=o.useMemo,d=o.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,o,i){var u=c(null);if(null===u.current){var f={hasValue:!1,value:null};u.current=f}else f=u.current;u=l((function(){function t(t){if(!s){if(s=!0,a=t,t=o(t),void 0!==i&&f.hasValue){var e=f.value;if(i(e,t))return c=e}return c=t}if(e=c,r(a,t))return e;var n=o(t);return void 0!==i&&i(e,n)?(a=t,e):(a=t,c=n)}var a,c,s=!1,l=void 0===n?null:n;return[function(){return t(e())},null===l?void 0:function(){return t(l())}]}),[e,n,o,i]);var g=a(t,u[0],u[1]);return s((function(){f.hasValue=!0,f.value=g}),[g]),d(g),g}},614:(t,e,n)=>{"use strict";t.exports=n(795)},368:(t,e,n)=>{"use strict";t.exports=n(120)},35:(t,e,n)=>{"use strict";n.d(e,{A:()=>b});var o=n(547),i=n.n(o),r=n(532),a=n.n(r),c=n(151),s=n.n(c),l=new URL(n(76),n.b),d=new URL(n(346),n.b),u=new URL(n(209),n.b),f=new URL(n(729),n.b),g=new URL(n(172),n.b),h=a()(i()),p=s()(l),_=s()(d),m=s()(u),y=s()(f),L=s()(g);h.push([t.id,`@font-face{font-family:"Inter";font-weight:400;src:url(${p}) format("woff2"),url(${_}) format("woff")}@font-face{font-family:"Inter";font-weight:700;src:url(${m}) format("woff2"),url(${y}) format("woff")}@font-face{font-family:"Inter";font-weight:500;src:url(${L}) format("opentype")}`,""]);const b=h},32:t=>{t.exports=[{title:"GitHub",id:"1",service:"GitHub",description:"Authorize you GitHub account",icon:"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/GitHub_Invertocat_Logo.svg/2560px-GitHub_Invertocat_Logo.svg.png",groups:[{points:10,semaphoreGroupId:"110",credentialGroupId:"6"}]}]},704:t=>{t.exports=[{title:"GitHub",id:"1",service:"GitHub",description:"Authorize you GitHub account",icon:"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/GitHub_Invertocat_Logo.svg/2560px-GitHub_Invertocat_Logo.svg.png",groups:[{points:10,semaphoreGroupId:"110",credentialGroupId:"6"}]}]},72:t=>{"use strict";var e=[];function n(t){for(var n=-1,o=0;o<e.length;o++)if(e[o].identifier===t){n=o;break}return n}function o(t,o){for(var r={},a=[],c=0;c<t.length;c++){var s=t[c],l=o.base?s[0]+o.base:s[0],d=r[l]||0,u="".concat(l," ").concat(d);r[l]=d+1;var f=n(u),g={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==f)e[f].references++,e[f].updater(g);else{var h=i(g,o);o.byIndex=c,e.splice(c,0,{identifier:u,updater:h,references:1})}a.push(u)}return a}function i(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,i){var r=o(t=t||[],i=i||{});return function(t){t=t||[];for(var a=0;a<r.length;a++){var c=n(r[a]);e[c].references--}for(var s=o(t,i),l=0;l<r.length;l++){var d=n(r[l]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}r=s}}},659:t=>{"use strict";var e={};t.exports=function(t,n){var o=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},56:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var o="";n.supports&&(o+="@supports (".concat(n.supports,") {")),n.media&&(o+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(o+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),o+=n.css,i&&(o+="}"),n.media&&(o+="}"),n.supports&&(o+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleTagTransform(o,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},729:(t,e,n)=>{"use strict";t.exports=n.p+"225dac4c8f3394d7770e.woff"},209:(t,e,n)=>{"use strict";t.exports=n.p+"3717db0be15085acc210.woff2"},172:(t,e,n)=>{"use strict";t.exports=n.p+"8386f9c82a1101e6a8d4.otf"},346:(t,e,n)=>{"use strict";t.exports=n.p+"0be946bd9dff2d19df7a.woff"},76:(t,e,n)=>{"use strict";t.exports=n.p+"f80c55a7aedf386182e8.woff2"},155:e=>{"use strict";e.exports=t},514:t=>{"use strict";t.exports=e}},o={};function i(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={id:t,exports:{}};return n[t].call(r.exports,r,r.exports,i),r.exports}i.m=n,i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;i.g.importScripts&&(t=i.g.location+"");var e=i.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=n[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=t})(),i.b=document.baseURI||self.location.href,i.nc=void 0;var r={};return(()=>{"use strict";i.r(r),i.d(r,{BringIDExtensionSDK:()=>Kd,BringIDRequestsSDK:()=>Xo,ConnectDialog:()=>Gd,VerificationsDialog:()=>TL,openModal:()=>BL,requestProofs:()=>FL});const t={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let e;const n=new Uint8Array(16),o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));function a(t,i,r){var a,c,s,l;const d=null!==(a=null!==(c=(t=t||{}).random)&&void 0!==c?c:null===(s=(l=t).rng)||void 0===s?void 0:s.call(l))&&void 0!==a?a:function(){if(!e){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");e=crypto.getRandomValues.bind(crypto)}return e(n)}();if(d.length<16)throw new Error("Random bytes length must be >= 16");if(d[6]=15&d[6]|64,d[8]=63&d[8]|128,i){if((r=r||0)<0||r+16>i.length)throw new RangeError("UUID byte range ".concat(r,":").concat(r+15," is out of buffer bounds"));for(let t=0;t<16;++t)i[r+t]=d[t];return i}return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]).toLowerCase()}(d)}const c=()=>function(e,n,o){return!t.randomUUID||n||e?a(e,n,o):t.randomUUID()}();function s(t,e,n){const o=e.split("|").map((t=>t.trim()));for(let n=0;n<o.length;n++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error("invalid value for type ".concat(e));throw i.code="INVALID_ARGUMENT",i.argument="value.".concat(n),i.value=t,i}function l(t,e,n){for(let o in e){let i=e[o];const r=n?n[o]:null;r&&s(i,r,o),Object.defineProperty(t,o,{enumerable:!0,value:i,writable:!1})}}function d(t){if(null==t)return"null";if(Array.isArray(t))return"[ "+t.map(d).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let o=0;o<t.length;o++)n+=e[t[o]>>4],n+=e[15&t[o]];return n}if("object"==typeof t&&"function"==typeof t.toJSON)return d(t.toJSON());switch(typeof t){case"boolean":case"symbol":case"number":return t.toString();case"bigint":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map((e=>"".concat(d(e),": ").concat(d(t[e])))).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function u(t,e){return t&&t.code===e}function f(t,e,n){let o,i=t;{const o=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error("value will overwrite populated values: ".concat(d(n)));for(const t in n){if("shortMessage"===t)continue;const e=n[t];o.push(t+"="+d(e))}}o.push("code=".concat(e)),o.push("version=".concat("6.13.5")),o.length&&(t+=" ("+o.join(", ")+")")}switch(e){case"INVALID_ARGUMENT":o=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":o=new RangeError(t);break;default:o=new Error(t)}return l(o,{code:e}),n&&Object.assign(o,n),null==o.shortMessage&&l(o,{shortMessage:i}),o}function g(t,e,n,o){if(!t)throw f(e,n,o)}function h(t,e,n,o){g(t,e,"INVALID_ARGUMENT",{argument:n,value:o})}function p(t,e,n){null==n&&(n=""),n&&(n=": "+n),g(t>=e,"missing argument"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),g(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const _=["NFD","NFC","NFKD","NFKC"].reduce(((t,e)=>{try{if("test"!=="test".normalize(e))throw new Error("bad");if("NFD"===e){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}t.push(e)}catch(t){}return t}),[]);function m(t,e,n){if(null==n&&(n=""),t!==e){let t=n,e="new";n&&(t+=".",e+=" "+n),g(!1,"private constructor; use ".concat(t,"from* methods"),"UNSUPPORTED_OPERATION",{operation:e})}}const y=BigInt(0),L=BigInt(1),b=9007199254740991;function A(t,e){const n=I(t,"value"),o=BigInt(v(e,"bits"));return n&(L<<o)-L}function w(t,e){switch(typeof t){case"bigint":return t;case"number":return h(Number.isInteger(t),"underflow",e||"value",t),h(t>=-b&&t<=b,"overflow",e||"value",t),BigInt(t);case"string":try{if(""===t)throw new Error("empty string");return"-"===t[0]&&"-"!==t[1]?-BigInt(t.substring(1)):BigInt(t)}catch(n){h(!1,"invalid BigNumberish string: ".concat(n.message),e||"value",t)}}h(!1,"invalid BigNumberish value",e||"value",t)}function I(t,e){const n=w(t,e);return g(n>=y,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const x="0123456789abcdef";function C(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=x[n>>4],e+=x[15&n];return BigInt(e)}return w(t)}function v(t,e){switch(typeof t){case"bigint":return h(t>=-b&&t<=b,"overflow",e||"value",t),Number(t);case"number":return h(Number.isInteger(t),"underflow",e||"value",t),h(t>=-b&&t<=b,"overflow",e||"value",t),t;case"string":try{if(""===t)throw new Error("empty string");return v(BigInt(t),e)}catch(n){h(!1,"invalid numeric string: ".concat(n.message),e||"value",t)}}h(!1,"invalid numeric value",e||"value",t)}function E(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if("string"==typeof t&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const e=new Uint8Array((t.length-2)/2);let n=2;for(let o=0;o<e.length;o++)e[o]=parseInt(t.substring(n,n+2),16),n+=2;return e}h(!1,"invalid BytesLike value",e||"value",t)}function B(t,e){return E(t,e,!1)}function F(t,e){return E(t,e,!0)}const O="0123456789abcdef";function S(t){const e=B(t);let n="0x";for(let t=0;t<e.length;t++){const o=e[t];n+=O[(240&o)>>4]+O[15&o]}return n}function P(t){return"0x"+t.map((t=>S(t).substring(2))).join("")}function j(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var U=0;function k(t){return"__private_"+U+++"_"+t}const M=32,T=new Uint8Array(M),z=["then"],Q={},N=new WeakMap;function D(t){return N.get(t)}function R(t,e){N.set(t,e)}function q(t,e){const n=new Error("deferred error during ABI decoding triggered accessing ".concat(t));throw n.error=e,n}function G(t,e,n){return t.indexOf(null)>=0?e.map(((t,e)=>t instanceof V?G(D(t),t,n):t)):t.reduce(((t,o,i)=>{let r=e.getValue(o);return o in t||(n&&r instanceof V&&(r=G(D(r),r,n)),t[o]=r),t}),{})}var K=k("names");class V extends Array{constructor(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const o=e[0];let i=e[1],r=(e[2]||[]).slice(),a=!0;o!==Q&&(i=e,r=[],a=!1),super(i.length),Object.defineProperty(this,K,{writable:!0,value:void 0}),i.forEach(((t,e)=>{this[e]=t}));const c=r.reduce(((t,e)=>("string"==typeof e&&t.set(e,(t.get(e)||0)+1),t)),new Map);if(R(this,Object.freeze(i.map(((t,e)=>{const n=r[e];return null!=n&&1===c.get(n)?n:null})))),j(this,K)[K]=[],null==j(this,K)[K]&&j(this,K)[K],!a)return;Object.freeze(this);const s=new Proxy(this,{get:(t,e,n)=>{if("string"==typeof e){if(e.match(/^[0-9]+$/)){const n=v(e,"%index");if(n<0||n>=this.length)throw new RangeError("out of result range");const o=t[n];return o instanceof Error&&q("index ".concat(n),o),o}if(z.indexOf(e)>=0)return Reflect.get(t,e,n);const o=t[e];if(o instanceof Function)return function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return o.apply(this===n?t:this,i)};if(!(e in t))return t.getValue.apply(this===n?t:this,[e])}return Reflect.get(t,e,n)}});return R(s,D(this)),s}toArray(t){const e=[];return this.forEach(((n,o)=>{n instanceof Error&&q("index ".concat(o),n),t&&n instanceof V&&(n=n.toArray(t)),e.push(n)})),e}toObject(t){const e=D(this);return e.reduce(((n,o,i)=>(g(null!=o,"value at index ".concat(i," unnamed"),"UNSUPPORTED_OPERATION",{operation:"toObject()"}),G(e,this,t))),{})}slice(t,e){null==t&&(t=0),t<0&&(t+=this.length)<0&&(t=0),null==e&&(e=this.length),e<0&&(e+=this.length)<0&&(e=0),e>this.length&&(e=this.length);const n=D(this),o=[],i=[];for(let r=t;r<e;r++)o.push(this[r]),i.push(n[r]);return new V(Q,o,i)}filter(t,e){const n=D(this),o=[],i=[];for(let r=0;r<this.length;r++){const a=this[r];a instanceof Error&&q("index ".concat(r),a),t.call(e,a,r,this)&&(o.push(a),i.push(n[r]))}return new V(Q,o,i)}map(t,e){const n=[];for(let o=0;o<this.length;o++){const i=this[o];i instanceof Error&&q("index ".concat(o),i),n.push(t.call(e,i,o,this))}return n}getValue(t){const e=D(this).indexOf(t);if(-1===e)return;const n=this[e];return n instanceof Error&&q("property ".concat(JSON.stringify(t)),n.error),n}static fromItems(t,e){return new V(Q,t,e)}}function H(t){let e=function(t){const e=I(t,"value");if(e===y)return new Uint8Array([]);let n=e.toString(16);n.length%2&&(n="0"+n);const o=new Uint8Array(n.length/2);for(let t=0;t<o.length;t++){const e=2*t;o[t]=parseInt(n.substring(e,e+2),16)}return o}(t);return g(e.length<=M,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:M,offset:e.length}),e.length!==M&&(e=F(P([T.slice(e.length%M),e]))),e}class Y{constructor(t,e,n,o){this.name=void 0,this.type=void 0,this.localName=void 0,this.dynamic=void 0,l(this,{name:t,type:e,localName:n,dynamic:o},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,e){h(!1,t,this.localName,e)}}var J=k("data"),W=k("dataLength"),X=k("writeData");class Z{constructor(){Object.defineProperty(this,X,{value:$}),Object.defineProperty(this,J,{writable:!0,value:void 0}),Object.defineProperty(this,W,{writable:!0,value:void 0}),j(this,J)[J]=[],j(this,W)[W]=0}get data(){return P(j(this,J)[J])}get length(){return j(this,W)[W]}appendWriter(t){return j(this,X)[X](F(t.data))}writeBytes(t){let e=F(t);const n=e.length%M;return n&&(e=F(P([e,T.slice(n)]))),j(this,X)[X](e)}writeValue(t){return j(this,X)[X](H(t))}writeUpdatableValue(){const t=j(this,J)[J].length;return j(this,J)[J].push(T),j(this,W)[W]+=M,e=>{j(this,J)[J][t]=H(e)}}}function $(t){return j(this,J)[J].push(t),j(this,W)[W]+=t.length,t.length}var tt=k("data"),et=k("offset"),nt=k("bytesRead"),ot=k("parent"),it=k("maxInflation"),rt=k("incrementBytesRead"),at=k("peekBytes");class ct{constructor(t,e,n){Object.defineProperty(this,at,{value:lt}),Object.defineProperty(this,rt,{value:st}),this.allowLoose=void 0,Object.defineProperty(this,tt,{writable:!0,value:void 0}),Object.defineProperty(this,et,{writable:!0,value:void 0}),Object.defineProperty(this,nt,{writable:!0,value:void 0}),Object.defineProperty(this,ot,{writable:!0,value:void 0}),Object.defineProperty(this,it,{writable:!0,value:void 0}),l(this,{allowLoose:!!e}),j(this,tt)[tt]=F(t),j(this,nt)[nt]=0,j(this,ot)[ot]=null,j(this,it)[it]=null!=n?n:1024,j(this,et)[et]=0}get data(){return S(j(this,tt)[tt])}get dataLength(){return j(this,tt)[tt].length}get consumed(){return j(this,et)[et]}get bytes(){return new Uint8Array(j(this,tt)[tt])}subReader(t){const e=new ct(j(this,tt)[tt].slice(j(this,et)[et]+t),this.allowLoose,j(this,it)[it]);return j(e,ot)[ot]=this,e}readBytes(t,e){let n=j(this,at)[at](0,t,!!e);return j(this,rt)[rt](t),j(this,et)[et]+=n.length,n.slice(0,t)}readValue(){return C(this.readBytes(M))}readIndex(){return v(C(this.readBytes(M)))}}function st(t){if(j(this,ot)[ot])return j(j(this,ot)[ot],rt)[rt](t);j(this,nt)[nt]+=t,g(j(this,it)[it]<1||j(this,nt)[nt]<=j(this,it)[it]*this.dataLength,"compressed ABI data exceeds inflation ratio of ".concat(j(this,it)[it]," ( see: https://github.com/ethers-io/ethers.js/issues/4537 )"),"BUFFER_OVERRUN",{buffer:F(j(this,tt)[tt]),offset:j(this,et)[et],length:t,info:{bytesRead:j(this,nt)[nt],dataLength:this.dataLength}})}function lt(t,e,n){let o=Math.ceil(e/M)*M;return j(this,et)[et]+o>j(this,tt)[tt].length&&(this.allowLoose&&n&&j(this,et)[et]+e<=j(this,tt)[tt].length?o=e:g(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:F(j(this,tt)[tt]),length:j(this,tt)[tt].length,offset:j(this,et)[et]+o})),j(this,tt)[tt].slice(j(this,et)[et],j(this,et)[et]+o)}function dt(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("Wrong positive integer: ".concat(t))}function ut(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];if(n.length>0&&!n.includes(t.length))throw new Error("Expected Uint8Array of length ".concat(n,", not of length=").concat(t.length))}function ft(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}const gt=BigInt(2**32-1),ht=BigInt(32);function pt(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?{h:Number(t>),l:Number(t>>ht>)}:{h:0|Number(t>>ht>),l:0|Number(t>)}}function _t(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Uint32Array(t.length),o=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:r,l:a}=pt(t[i],e);[n[i],o[i]]=[r,a]}return[n,o]}if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function mt(t){if("string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got ".concat(typeof t));return new Uint8Array((new TextEncoder).encode(t))}(t)),!(t=>t instanceof Uint8Array)(t))throw new Error("expected Uint8Array, got ".concat(typeof t));return t}class yt{clone(){return this._cloneInto()}}const[Lt,bt,At]=[[],[],[]],wt=BigInt(0),It=BigInt(1),xt=BigInt(2),Ct=BigInt(7),vt=BigInt(256),Et=BigInt(113);for(let t=0,e=It,n=1,o=0;t<24;t++){[n,o]=[o,(2*n+3*o)%5],Lt.push(2*(5*o+n)),bt.push((t+1)*(t+2)/2%64);let i=wt;for(let t=0;t<7;t++)e=(e<<It^(e>>Ct)*Et)%vt,e&xt&&(i^=It<<(It<<BigInt(t))-It);At.push(i)}const[Bt,Ft]=_t(At,!0),Ot=(t,e,n)=>n>32?((t,e,n)=>e<<n-32|t>>>64-n)(t,e,n):((t,e,n)=>t<<n|e>>>32-n)(t,e,n),St=(t,e,n)=>n>32?((t,e,n)=>t<<n-32|e>>>64-n)(t,e,n):((t,e,n)=>e<<n|t>>>32-n)(t,e,n);class Pt extends yt{constructor(t,e,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:24;if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=o,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,dt(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var r;this.state=new Uint8Array(200),this.state32=(r=this.state,new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)))}keccak(){!function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24;const n=new Uint32Array(10);for(let o=24-e;o<24;o++){for(let e=0;e<10;e++)n[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const o=(e+8)%10,i=(e+2)%10,r=n[i],a=n[i+1],c=Ot(r,a,1)^n[o],s=St(r,a,1)^n[o+1];for(let n=0;n<50;n+=10)t[e+n]^=c,t[e+n+1]^=s}let e=t[2],i=t[3];for(let n=0;n<24;n++){const o=bt[n],r=Ot(e,i,o),a=St(e,i,o),c=Lt[n];e=t[c],i=t[c+1],t[c]=r,t[c+1]=a}for(let e=0;e<50;e+=10){for(let o=0;o<10;o++)n[o]=t[e+o];for(let o=0;o<10;o++)t[e+o]^=~n[(o+2)%10]&n[(o+4)%10]}t[0]^=Bt[o],t[1]^=Ft[o]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){ft(this);const{blockLen:e,state:n}=this,o=(t=mt(t)).length;for(let i=0;i<o;){const r=Math.min(e-this.pos,o-i);for(let e=0;e<r;e++)n[this.pos++]^=t[i++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:n,blockLen:o}=this;t[n]^=e,128&e&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){ft(this,!1),ut(t),this.finish();const e=this.state,{blockLen:n}=this;for(let o=0,i=t.length;o<i;){this.posOut>=n&&this.keccak();const r=Math.min(n-this.posOut,i-o);t.set(e.subarray(this.posOut,this.posOut+r),o),this.posOut+=r,o+=r}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return dt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(function(t,e){ut(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least ".concat(n))}(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:n,outputLen:o,rounds:i,enableXOF:r}=this;return t||(t=new Pt(e,n,o,r,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=o,t.enableXOF=r,t.destroyed=this.destroyed,t}}const jt=((t,e,n)=>function(t){const e=e=>t().update(mt(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}((()=>new Pt(e,t,n))))(1,136,32);let Ut=!1;const kt=function(t){return jt(t)};let Mt=kt;function Tt(t){const e=B(t,"data");return S(Mt(e))}Tt._=kt,Tt.lock=function(){Ut=!0},Tt.register=function(t){if(Ut)throw new TypeError("keccak256 is locked");Mt=t},Object.freeze(Tt);const zt=BigInt(0),Qt=BigInt(36);function Nt(t){const e=(t=t.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let t=0;t<40;t++)n[t]=e[t].charCodeAt(0);const o=B(Tt(n));for(let t=0;t<40;t+=2)o[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&o[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const Dt={};for(let t=0;t<10;t++)Dt[String(t)]=String(t);for(let t=0;t<26;t++)Dt[String.fromCharCode(65+t)]=String(10+t);const Rt=function(){const t={};for(let e=0;e<36;e++)t["0123456789abcdefghijklmnopqrstuvwxyz"[e]]=BigInt(e);return t}();function qt(t){if(h("string"==typeof t,"invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=Nt(t);return h(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){h(t.substring(2,4)===function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>Dt[t])).join("");for(;e.length>=15;){let t=e.substring(0,15);e=parseInt(t,10)%97+e.substring(t.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}(t),"bad icap checksum","address",t);let e=function(t){t=t.toLowerCase();let e=zt;for(let n=0;n<t.length;n++)e=e*Qt+Rt[t[n]];return e}(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return Nt("0x"+e)}h(!1,"invalid address","address",t)}function Gt(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Kt=0;function Vt(t){return"__private_"+Kt+++"_"+t}const Ht={};function Yt(t,e){let n=!1;return e<0&&(n=!0,e*=-1),new Zt(Ht,"".concat(n?"":"u","int").concat(e),t,{signed:n,width:e})}function Jt(t,e){return new Zt(Ht,"bytes".concat(e||""),t,{size:e})}const Wt=Symbol.for("_ethers_typed");var Xt=Vt("options");class Zt{constructor(t,e,n,o){this.type=void 0,this.value=void 0,Object.defineProperty(this,Xt,{writable:!0,value:void 0}),this._typedSymbol=void 0,null==o&&(o=null),m(Ht,t,"Typed"),l(this,{_typedSymbol:Wt,type:e,value:n}),Gt(this,Xt)[Xt]=o,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?"tuple(".concat(this.value.map((t=>t.format())).join(","),")"):this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return Gt(this,Xt)[Xt]}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===Gt(this,Xt)[Xt]?-1:!1===Gt(this,Xt)[Xt]?this.value.length:null}static from(t,e){return new Zt(Ht,t,e)}static uint8(t){return Yt(t,8)}static uint16(t){return Yt(t,16)}static uint24(t){return Yt(t,24)}static uint32(t){return Yt(t,32)}static uint40(t){return Yt(t,40)}static uint48(t){return Yt(t,48)}static uint56(t){return Yt(t,56)}static uint64(t){return Yt(t,64)}static uint72(t){return Yt(t,72)}static uint80(t){return Yt(t,80)}static uint88(t){return Yt(t,88)}static uint96(t){return Yt(t,96)}static uint104(t){return Yt(t,104)}static uint112(t){return Yt(t,112)}static uint120(t){return Yt(t,120)}static uint128(t){return Yt(t,128)}static uint136(t){return Yt(t,136)}static uint144(t){return Yt(t,144)}static uint152(t){return Yt(t,152)}static uint160(t){return Yt(t,160)}static uint168(t){return Yt(t,168)}static uint176(t){return Yt(t,176)}static uint184(t){return Yt(t,184)}static uint192(t){return Yt(t,192)}static uint200(t){return Yt(t,200)}static uint208(t){return Yt(t,208)}static uint216(t){return Yt(t,216)}static uint224(t){return Yt(t,224)}static uint232(t){return Yt(t,232)}static uint240(t){return Yt(t,240)}static uint248(t){return Yt(t,248)}static uint256(t){return Yt(t,256)}static uint(t){return Yt(t,256)}static int8(t){return Yt(t,-8)}static int16(t){return Yt(t,-16)}static int24(t){return Yt(t,-24)}static int32(t){return Yt(t,-32)}static int40(t){return Yt(t,-40)}static int48(t){return Yt(t,-48)}static int56(t){return Yt(t,-56)}static int64(t){return Yt(t,-64)}static int72(t){return Yt(t,-72)}static int80(t){return Yt(t,-80)}static int88(t){return Yt(t,-88)}static int96(t){return Yt(t,-96)}static int104(t){return Yt(t,-104)}static int112(t){return Yt(t,-112)}static int120(t){return Yt(t,-120)}static int128(t){return Yt(t,-128)}static int136(t){return Yt(t,-136)}static int144(t){return Yt(t,-144)}static int152(t){return Yt(t,-152)}static int160(t){return Yt(t,-160)}static int168(t){return Yt(t,-168)}static int176(t){return Yt(t,-176)}static int184(t){return Yt(t,-184)}static int192(t){return Yt(t,-192)}static int200(t){return Yt(t,-200)}static int208(t){return Yt(t,-208)}static int216(t){return Yt(t,-216)}static int224(t){return Yt(t,-224)}static int232(t){return Yt(t,-232)}static int240(t){return Yt(t,-240)}static int248(t){return Yt(t,-248)}static int256(t){return Yt(t,-256)}static int(t){return Yt(t,-256)}static bytes1(t){return Jt(t,1)}static bytes2(t){return Jt(t,2)}static bytes3(t){return Jt(t,3)}static bytes4(t){return Jt(t,4)}static bytes5(t){return Jt(t,5)}static bytes6(t){return Jt(t,6)}static bytes7(t){return Jt(t,7)}static bytes8(t){return Jt(t,8)}static bytes9(t){return Jt(t,9)}static bytes10(t){return Jt(t,10)}static bytes11(t){return Jt(t,11)}static bytes12(t){return Jt(t,12)}static bytes13(t){return Jt(t,13)}static bytes14(t){return Jt(t,14)}static bytes15(t){return Jt(t,15)}static bytes16(t){return Jt(t,16)}static bytes17(t){return Jt(t,17)}static bytes18(t){return Jt(t,18)}static bytes19(t){return Jt(t,19)}static bytes20(t){return Jt(t,20)}static bytes21(t){return Jt(t,21)}static bytes22(t){return Jt(t,22)}static bytes23(t){return Jt(t,23)}static bytes24(t){return Jt(t,24)}static bytes25(t){return Jt(t,25)}static bytes26(t){return Jt(t,26)}static bytes27(t){return Jt(t,27)}static bytes28(t){return Jt(t,28)}static bytes29(t){return Jt(t,29)}static bytes30(t){return Jt(t,30)}static bytes31(t){return Jt(t,31)}static bytes32(t){return Jt(t,32)}static address(t){return new Zt(Ht,"address",t)}static bool(t){return new Zt(Ht,"bool",!!t)}static bytes(t){return new Zt(Ht,"bytes",t)}static string(t){return new Zt(Ht,"string",t)}static array(t,e){throw new Error("not implemented yet")}static tuple(t,e){throw new Error("not implemented yet")}static overrides(t){return new Zt(Ht,"overrides",Object.assign({},t))}static isTyped(t){return t&&"object"==typeof t&&"_typedSymbol"in t&&t._typedSymbol===Wt}static dereference(t,e){if(Zt.isTyped(t)){if(t.type!==e)throw new Error("invalid type: expecetd ".concat(e,", got ").concat(t.type));return t.value}return t}}class $t extends Y{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){let n=Zt.dereference(e,"string");try{n=qt(n)}catch(t){return this._throwError(t.message,e)}return t.writeValue(n)}decode(t){return qt(function(t){let e=I(t,"value").toString(16);{const n=v(20,"width");for(g(2*n>=e.length,"value exceeds width (".concat(n," bytes)"),"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});e.length<2*n;)e="0"+e}return"0x"+e}(t.readValue()))}}class te extends Y{constructor(t){super(t.name,t.type,"_",t.dynamic),this.coder=void 0,this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}function ee(t,e,n){let o=[];if(Array.isArray(n))o=n;else if(n&&"object"==typeof n){let t={};o=e.map((e=>{const o=e.localName;return g(o,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:n}),g(!t[o],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:n}),t[o]=!0,n[o]}))}else h(!1,"invalid tuple value","tuple",n);h(e.length===o.length,"types/value length mismatch","tuple",n);let i=new Z,r=new Z,a=[];e.forEach(((t,e)=>{let n=o[e];if(t.dynamic){let e=r.length;t.encode(r,n);let o=i.writeUpdatableValue();a.push((t=>{o(t+e)}))}else t.encode(i,n)})),a.forEach((t=>{t(i.length)}));let c=t.appendWriter(i);return c+=t.appendWriter(r),c}function ne(t,e){let n=[],o=[],i=t.subReader(0);return e.forEach((e=>{let r=null;if(e.dynamic){let n=t.readIndex(),o=i.subReader(n);try{r=e.decode(o)}catch(t){if(u(t,"BUFFER_OVERRUN"))throw t;r=t,r.baseType=e.name,r.name=e.localName,r.type=e.type}}else try{r=e.decode(t)}catch(t){if(u(t,"BUFFER_OVERRUN"))throw t;r=t,r.baseType=e.name,r.name=e.localName,r.type=e.type}if(null==r)throw new Error("investigate");n.push(r),o.push(e.localName||null)})),V.fromItems(n,o)}class oe extends Y{constructor(t,e,n){super("array",t.type+"["+(e>=0?e:"")+"]",n,-1===e||t.dynamic),this.coder=void 0,this.length=void 0,l(this,{coder:t,length:e})}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let n=0;n<this.length;n++)e.push(t);return e}encode(t,e){const n=Zt.dereference(e,"array");Array.isArray(n)||this._throwError("expected array value",n);let o=this.length;-1===o&&(o=n.length,t.writeValue(n.length)),p(n.length,o,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let t=0;t<n.length;t++)i.push(this.coder);return ee(t,i,n)}decode(t){let e=this.length;-1===e&&(e=t.readIndex(),g(e*M<=t.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:t.bytes,offset:e*M,length:t.dataLength}));let n=[];for(let t=0;t<e;t++)n.push(new te(this.coder));return ne(t,n)}}class ie extends Y{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){const n=Zt.dereference(e,"bool");return t.writeValue(n?1:0)}decode(t){return!!t.readValue()}}class re extends Y{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=F(e);let n=t.writeValue(e.length);return n+=t.writeBytes(e),n}decode(t){return t.readBytes(t.readIndex(),!0)}}class ae extends re{constructor(t){super("bytes",t)}decode(t){return S(super.decode(t))}}class ce extends Y{constructor(t,e){let n="bytes"+String(t);super(n,n,e,!1),this.size=void 0,l(this,{size:t},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let n=F(Zt.dereference(e,this.type));return n.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(n)}decode(t){return S(t.readBytes(this.size))}}const se=new Uint8Array([]);class le extends Y{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes(se)}decode(t){return t.readBytes(0),null}}const de=BigInt(0),ue=BigInt(1),fe=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class ge extends Y{constructor(t,e,n){const o=(e?"int":"uint")+8*t;super(o,o,n,!1),this.size=void 0,this.signed=void 0,l(this,{size:t,signed:e},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(t,e){let n=w(Zt.dereference(e,this.type)),o=A(fe,256);if(this.signed){let t=A(o,8*this.size-1);(n>t||n<-(t+ue))&&this._throwError("value out-of-bounds",e),n=function(t){let e=w(t,"value");const n=BigInt(v(256,"width")),o=L<<n-L;return e<y?(e=-e,g(e<=o,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t}),(~e&(L<<n)-L)+L):(g(e<o,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t}),e)}(n)}else(n<de||n>A(o,8*this.size))&&this._throwError("value out-of-bounds",e);return t.writeValue(n)}decode(t){let e=A(t.readValue(),8*this.size);return this.signed&&(e=function(t,e){const n=I(t,"value"),o=BigInt(v(e,"width"));return g(n>>o===y,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>o-L?-((~n&(L<<o)-L)+L):n}(e,8*this.size)),e}}function he(t,e,n,o,i){if("BAD_PREFIX"===t||"UNEXPECTED_CONTINUE"===t){let t=0;for(let o=e+1;o<n.length&&n[o]>>6==2;o++)t++;return t}return"OVERRUN"===t?n.length-e-1:0}const pe=Object.freeze({error:function(t,e,n,o,i){h(!1,"invalid codepoint at offset ".concat(e,"; ").concat(t),"bytes",n)},ignore:he,replace:function(t,e,n,o,i){return"OVERLONG"===t?(h("number"==typeof i,"invalid bad code point for replacement","badCodepoint",i),o.push(i),0):(o.push(65533),he(t,e,n))}});function _e(t,e){return function(t,e){null==e&&(e=pe.error);const n=B(t,"bytes"),o=[];let i=0;for(;i<n.length;){const t=n[i++];if(!(t>>7)){o.push(t);continue}let r=null,a=null;if(192==(224&t))r=1,a=127;else if(224==(240&t))r=2,a=2047;else{if(240!=(248&t)){i+=e(128==(192&t)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",i-1,n,o);continue}r=3,a=65535}if(i-1+r>=n.length){i+=e("OVERRUN",i-1,n,o);continue}let c=t&(1<<8-r-1)-1;for(let t=0;t<r;t++){let t=n[i];if(128!=(192&t)){i+=e("MISSING_CONTINUE",i,n,o),c=null;break}c=c<<6|63&t,i++}null!==c&&(c>1114111?i+=e("OUT_OF_RANGE",i-1-r,n,o,c):c>=55296&&c<=57343?i+=e("UTF16_SURROGATE",i-1-r,n,o,c):c<=a?i+=e("OVERLONG",i-1-r,n,o,c):o.push(c))}return o}(t,e).map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}class me extends re{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,function(t,e){h("string"==typeof t,"invalid string value","str",t),null!=e&&(function(t){g(_.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}(e),t=t.normalize(e));let n=[];for(let e=0;e<t.length;e++){const o=t.charCodeAt(e);if(o<128)n.push(o);else if(o<2048)n.push(o>>6|192),n.push(63&o|128);else if(55296==(64512&o)){e++;const i=t.charCodeAt(e);h(e<t.length&&56320==(64512&i),"invalid surrogate pair","str",t);const r=65536+((1023&o)<<10)+(1023&i);n.push(r>>18|240),n.push(r>>12&63|128),n.push(r>>6&63|128),n.push(63&r|128)}else n.push(o>>12|224),n.push(o>>6&63|128),n.push(63&o|128)}return new Uint8Array(n)}(Zt.dereference(e,"string")))}decode(t){return _e(super.decode(t))}}class ye extends Y{constructor(t,e){let n=!1;const o=[];t.forEach((t=>{t.dynamic&&(n=!0),o.push(t.type)})),super("tuple","tuple("+o.join(",")+")",e,n),this.coders=void 0,l(this,{coders:Object.freeze(t.slice())})}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});return this.coders.forEach(((n,o)=>{let i=n.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[o]))})),Object.freeze(t)}encode(t,e){const n=Zt.dereference(e,"tuple");return ee(t,this.coders,n)}decode(t){return ne(t,this.coders)}}var Le;function be(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Ae=0;function we(t){return"__private_"+Ae+++"_"+t}function Ie(t){const e=new Set;return t.forEach((t=>e.add(t))),Object.freeze(e)}Ie("external public payable override".split(" "));const xe="constant external internal payable private public pure view override",Ce=(Ie(xe.split(" ")),"constructor error event fallback function receive struct"),ve=(Ie(Ce.split(" ")),"calldata memory storage payable indexed"),Ee=Ie(ve.split(" ")),Be=Ie([Ce,ve,"tuple returns",xe].join(" ").split(" ")),Fe={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Oe=new RegExp("^(\\s*)"),Se=new RegExp("^([0-9]+)"),Pe=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),je=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),Ue=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var ke=we("offset"),Me=we("tokens"),Te=we("subTokenString");class ze{get offset(){return be(this,ke)[ke]}get length(){return be(this,Me)[Me].length-be(this,ke)[ke]}constructor(t){Object.defineProperty(this,Te,{value:Qe}),Object.defineProperty(this,ke,{writable:!0,value:void 0}),Object.defineProperty(this,Me,{writable:!0,value:void 0}),be(this,ke)[ke]=0,be(this,Me)[Me]=t.slice()}clone(){return new ze(be(this,Me)[Me])}reset(){be(this,ke)[ke]=0}popKeyword(t){const e=this.peek();if("KEYWORD"!==e.type||!t.has(e.text))throw new Error("expected keyword ".concat(e.text));return this.pop().text}popType(t){if(this.peek().type!==t){const e=this.peek();throw new Error("expected ".concat(t,"; got ").concat(e.type," ").concat(JSON.stringify(e.text)))}return this.pop().text}popParen(){const t=this.peek();if("OPEN_PAREN"!==t.type)throw new Error("bad start");const e=be(this,Te)[Te](be(this,ke)[ke]+1,t.match+1);return be(this,ke)[ke]=t.match+1,e}popParams(){const t=this.peek();if("OPEN_PAREN"!==t.type)throw new Error("bad start");const e=[];for(;be(this,ke)[ke]<t.match-1;){const t=this.peek().linkNext;e.push(be(this,Te)[Te](be(this,ke)[ke]+1,t)),be(this,ke)[ke]=t}return be(this,ke)[ke]=t.match+1,e}peek(){if(be(this,ke)[ke]>=be(this,Me)[Me].length)throw new Error("out-of-bounds");return be(this,Me)[Me][be(this,ke)[ke]]}peekKeyword(t){const e=this.peekType("KEYWORD");return null!=e&&t.has(e)?e:null}peekType(t){if(0===this.length)return null;const e=this.peek();return e.type===t?e.text:null}pop(){const t=this.peek();return be(this,ke)[ke]++,t}toString(){const t=[];for(let e=be(this,ke)[ke];e<be(this,Me)[Me].length;e++){const n=be(this,Me)[Me][e];t.push("".concat(n.type,":").concat(n.text))}return"<TokenString ".concat(t.join(" "),">")}}function Qe(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Le(be(this,Me)[Me].slice(t,e).map((e=>Object.freeze(Object.assign({},e,{match:e.match-t,linkBack:e.linkBack-t,linkNext:e.linkNext-t})))))}function Ne(t,e){const n=new Set;for(;;){const o=t.peekType("KEYWORD");if(null==o||e&&!e.has(o))break;if(t.pop(),n.has(o))throw new Error("duplicate keywords: ".concat(JSON.stringify(o)));n.add(o)}return Object.freeze(n)}Le=ze;const De=new RegExp(/^(.*)\[([0-9]*)\]$/);function Re(t){const e=t.match(Ue);if(h(e,"invalid type","type",t),"uint"===t)return"uint256";if("int"===t)return"int256";if(e[2]){const n=parseInt(e[2]);h(0!==n&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);h(0!==n&&n<=256&&n%8==0,"invalid numeric width","type",t)}return t}const qe={},Ge=Symbol.for("_ethers_internal"),Ke="_ParamTypeInternal";var Ve=we("walkAsync");class He{constructor(t,e,n,o,i,r,a,c){if(Object.defineProperty(this,Ve,{value:Ye}),this.name=void 0,this.type=void 0,this.baseType=void 0,this.indexed=void 0,this.components=void 0,this.arrayLength=void 0,this.arrayChildren=void 0,m(t,qe,"ParamType"),Object.defineProperty(this,Ge,{value:Ke}),r&&(r=Object.freeze(r.slice())),"array"===o){if(null==a||null==c)throw new Error("")}else if(null!=a||null!=c)throw new Error("");if("tuple"===o){if(null==r)throw new Error("")}else if(null!=r)throw new Error("");l(this,{name:e,type:n,baseType:o,indexed:i,components:r,arrayLength:a,arrayChildren:c})}format(t){if(null==t&&(t="sighash"),"json"===t){const e=this.name||"";if(this.isArray()){const t=JSON.parse(this.arrayChildren.format("json"));return t.name=e,t.type+="[".concat(this.arrayLength<0?"":String(this.arrayLength),"]"),JSON.stringify(t)}const n={type:"tuple"===this.baseType?"tuple":this.type,name:e};return"boolean"==typeof this.indexed&&(n.indexed=this.indexed),this.isTuple()&&(n.components=this.components.map((e=>JSON.parse(e.format(t))))),JSON.stringify(n)}let e="";return this.isArray()?(e+=this.arrayChildren.format(t),e+="[".concat(this.arrayLength<0?"":String(this.arrayLength),"]")):this.isTuple()?e+="("+this.components.map((e=>e.format(t))).join("full"===t?", ":",")+")":e+=this.type,"sighash"!==t&&(!0===this.indexed&&(e+=" indexed"),"full"===t&&this.name&&(e+=" "+this.name)),e}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(t,e){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(-1!==this.arrayLength&&t.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return t.map((t=>n.arrayChildren.walk(t,e)))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");const n=this;return t.map(((t,o)=>n.components[o].walk(t,e)))}return e(this.type,t)}async walkAsync(t,e){const n=[],o=[t];return be(this,Ve)[Ve](n,t,e,(t=>{o[0]=t})),n.length&&await Promise.all(n),o[0]}static from(t,e){if(He.isParamType(t))return t;if("string"==typeof t)try{return He.from(function(t){const e=[],n=e=>{const n=r<t.length?JSON.stringify(t[r]):"$EOI";throw new Error("invalid token ".concat(n," at ").concat(r,": ").concat(e))};let o=[],i=[],r=0;for(;r<t.length;){let a=t.substring(r),c=a.match(Oe);c&&(r+=c[1].length,a=t.substring(r));const s={depth:o.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:r,value:-1};e.push(s);let l=Fe[a[0]]||"";if(l){if(s.type=l,s.text=a[0],r++,"OPEN_PAREN"===l)o.push(e.length-1),i.push(e.length-1);else if("CLOSE_PAREN"==l)0===o.length&&n("no matching open bracket"),s.match=o.pop(),e[s.match].match=e.length-1,s.depth--,s.linkBack=i.pop(),e[s.linkBack].linkNext=e.length-1;else if("COMMA"===l)s.linkBack=i.pop(),e[s.linkBack].linkNext=e.length-1,i.push(e.length-1);else if("OPEN_BRACKET"===l)s.type="BRACKET";else if("CLOSE_BRACKET"===l){let t=e.pop().text;if(e.length>0&&"NUMBER"===e[e.length-1].type){const n=e.pop().text;t=n+t,e[e.length-1].value=v(n)}if(0===e.length||"BRACKET"!==e[e.length-1].type)throw new Error("missing opening bracket");e[e.length-1].text+=t}}else if(c=a.match(Pe),c){if(s.text=c[1],r+=s.text.length,Be.has(s.text)){s.type="KEYWORD";continue}if(s.text.match(Ue)){s.type="TYPE";continue}s.type="ID"}else{if(c=a.match(Se),!c)throw new Error("unexpected token ".concat(JSON.stringify(a[0])," at position ").concat(r));s.text=c[1],s.type="NUMBER",r+=s.text.length}}return new ze(e.map((t=>Object.freeze(t))))}(t),e)}catch(e){h(!1,"invalid param type","obj",t)}else if(t instanceof ze){let n="",o="",i=null;Ne(t,Ie(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(o="tuple",i=t.popParams().map((t=>He.from(t))),n="tuple(".concat(i.map((t=>t.format())).join(","),")")):(n=Re(t.popType("TYPE")),o=n);let r=null,a=null;for(;t.length&&t.peekType("BRACKET");){const e=t.pop();r=new He(qe,"",n,o,null,i,a,r),a=e.value,n+=e.text,o="array",i=null}let c=null;if(Ne(t,Ee).has("indexed")){if(!e)throw new Error("");c=!0}const s=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new He(qe,s,n,o,c,i,a,r)}const n=t.name;h(!n||"string"==typeof n&&n.match(je),"invalid name","obj.name",n);let o=t.indexed;null!=o&&(h(e,"parameter cannot be indexed","obj.indexed",t.indexed),o=!!o);let i=t.type,r=i.match(De);if(r){const e=parseInt(r[2]||"-1"),a=He.from({type:r[1],components:t.components});return new He(qe,n||"",i,"array",o,null,e,a)}if("tuple"===i||i.startsWith("tuple(")||i.startsWith("(")){const e=null!=t.components?t.components.map((t=>He.from(t))):null;return new He(qe,n||"",i,"tuple",o,e,null,null)}return i=Re(t.type),new He(qe,n||"",i,i,o,null,null,null)}static isParamType(t){return t&&t[Ge]===Ke}}function Ye(t,e,n,o){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const i=this.arrayChildren,r=e.slice();return r.forEach(((e,o)=>{be(i,Ve)[Ve](t,e,n,(t=>{r[o]=t}))})),void o(r)}if(this.isTuple()){const i=this.components;let r;if(Array.isArray(e))r=e.slice();else{if(null==e||"object"!=typeof e)throw new Error("invalid tuple value");r=i.map((t=>{if(!t.name)throw new Error("cannot use object value with unnamed components");if(!(t.name in e))throw new Error("missing value for component ".concat(t.name));return e[t.name]}))}if(r.length!==this.components.length)throw new Error("array is wrong length");return r.forEach(((e,o)=>{be(i[o],Ve)[Ve](t,e,n,(t=>{r[o]=t}))})),void o(r)}const i=n(this.type,e);i.then?t.push(async function(){o(await i)}()):o(i)}function Je(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var We=0;function Xe(t){return"__private_"+We+++"_"+t}const Ze=new Map;Ze.set(0,"GENERIC_PANIC"),Ze.set(1,"ASSERT_FALSE"),Ze.set(17,"OVERFLOW"),Ze.set(18,"DIVIDE_BY_ZERO"),Ze.set(33,"ENUM_RANGE_ERROR"),Ze.set(34,"BAD_STORAGE_DATA"),Ze.set(49,"STACK_UNDERFLOW"),Ze.set(50,"ARRAY_RANGE_ERROR"),Ze.set(65,"OUT_OF_MEMORY"),Ze.set(81,"UNINITIALIZED_FUNCTION_CALL");const $e=new RegExp(/^bytes([0-9]*)$/),tn=new RegExp(/^(u?int)([0-9]*)$/);let en=null,nn=1024;var on=Xe("getCoder");class rn{constructor(){Object.defineProperty(this,on,{value:an})}getDefaultValue(t){const e=t.map((t=>Je(this,on)[on](He.from(t))));return new ye(e,"_").defaultValue()}encode(t,e){p(e.length,t.length,"types/values length mismatch");const n=t.map((t=>Je(this,on)[on](He.from(t)))),o=new ye(n,"_"),i=new Z;return o.encode(i,e),i.data}decode(t,e,n){const o=t.map((t=>Je(this,on)[on](He.from(t))));return new ye(o,"_").decode(new ct(e,n,nn))}static _setDefaultMaxInflation(t){h("number"==typeof t&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),nn=t}static defaultAbiCoder(){return null==en&&(en=new rn),en}static getBuiltinCallException(t,e,n){return function(t,e,n,o){let i="missing revert data",r=null,a=null;if(n){i="execution reverted";const t=B(n);if(n=S(n),0===t.length)i+=" (no data present; likely require(false) occurred",r="require(false)";else if(t.length%32!=4)i+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===S(t.slice(0,4)))try{r=o.decode(["string"],t.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[r]},i+=": ".concat(JSON.stringify(r))}catch(t){i+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===S(t.slice(0,4)))try{const e=Number(o.decode(["uint256"],t.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[e]},r="Panic due to ".concat(Ze.get(e)||"UNKNOWN","(").concat(e,")"),i+=": ".concat(r)}catch(t){i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const c={to:e.to?qt(e.to):null,data:e.data||"0x"};return e.from&&(c.from=qt(e.from)),f(i,"CALL_EXCEPTION",{action:t,data:n,reason:r,transaction:c,invocation:null,revert:a})}(t,e,n,rn.defaultAbiCoder())}}function an(t){if(t.isArray())return new oe(Je(this,on)[on](t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new ye(t.components.map((t=>Je(this,on)[on](t))),t.name);switch(t.baseType){case"address":return new $t(t.name);case"bool":return new ie(t.name);case"string":return new me(t.name);case"bytes":return new ae(t.name);case"":return new le(t.name)}let e=t.type.match(tn);if(e){let n=parseInt(e[2]||"256");return h(0!==n&&n<=256&&n%8==0,"invalid "+e[1]+" bit length","param",t),new ge(n/8,"int"===e[1],t.name)}if(e=t.type.match($e),e){let n=parseInt(e[1]);return h(0!==n&&n<=32,"invalid bytes length","param",t),new ce(n,t.name)}h(!1,"invalid type","type",t.type)}var cn=i(545);const sn=["number","string","function","Array","Uint8Array","Buffer","object","bigint","stringified-bigint","hexadecimal","bignumber","bignumberish"];function ln(t){return"number"==typeof t}function dn(t){return"string"==typeof t}function un(t){return"object"==typeof t}function fn(t){return t instanceof Uint8Array}function gn(t){return cn.hp.isBuffer(t)}function hn(t){return"bigint"==typeof t}function pn(t){if(!dn(t))return!1;try{return BigInt(t),!0}catch(t){return!1}}function _n(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!!dn(t)&&(e?/^(0x|0X)[0-9a-fA-F]+$/.test(t):/^[0-9a-fA-F]+$/.test(t))}function mn(t,e){switch(e){case"number":return ln(t);case"string":return dn(t);case"function":return function(t){return"function"==typeof t}(t);case"Array":return function(t){return un(t)&&Array.isArray(t)}(t);case"Uint8Array":return fn(t);case"Buffer":return gn(t);case"object":return un(t);case"bigint":return hn(t);case"stringified-bigint":return pn(t);case"hexadecimal":return _n(t);case"bignumber":return function(t){return hn(t)||pn(t)}(t);case"bignumberish":return function(t){return ln(t)||hn(t)||pn(t)||_n(t)||gn(t)||fn(t)}(t);default:return!1}}function yn(t){return sn.includes(t)}function Ln(t){return!t}function bn(t){return(t&BigInt(1))===BigInt(1)}function An(t,e){return t>>e}const wn=BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617"),In=new class{constructor(t){this.one=1n,this.zero=0n,this._order=t,this._half=t>>this.one,this._negone=this._order-this.one}e(t){return(t%=this._order)<0?t+this._order:t}mul(t,e){return t*e%this._order}sub(t,e){return t>=e?t-e:this._order-e+t}add(t,e){const n=t+e;return n>=this._order?n-this._order:n}inv(t){if(t===this.zero)throw new Error("Zero has no inverse");let e=this.zero,n=this._order,o=this.one,i=t%this._order;for(;i;){const t=n/i;[e,o]=[o,e-t*o],[n,i]=[i,n-t*i]}return e<this.zero&&(e+=this._order),e}div(t,e){return this.mul(t,this.inv(e))}eq(t,e){return t===e}square(t){return t*t%this._order}lt(t,e){return(t>this._half?t-this._order:t)<(e>this._half?e-this._order:e)}geq(t,e){return(t>this._half?t-this._order:t)>=(e>this._half?e-this._order:e)}neg(t){return t?this._order-t:t}isZero(t){return t===this.zero}pow(t,e){if(Ln(e))return this.one;e<0n&&(t=this.inv(t),e=-e);const n=function(t){const e=[];let n=t;for(;n;)n&BigInt(1)?e.push(1):e.push(0),n>>=BigInt(1);return e}(e);if(0===n.length)return this.one;let o=t;for(let e=n.length-2;e>=0;e-=1)o=this.square(o),n[e]&&(o=this.mul(o,t));return o}}(wn),xn=[In.e(BigInt("5299619240641551281634865583518297030282874472190772894086521144482721001553")),In.e(BigInt("16950150798460657717958625567821834550301663161624707787222815936182638968203"))],Cn=In.e(BigInt("168700")),vn=In.e(BigInt("168696")),En=An(BigInt("21888242871839275222246405745257275088614511777268538073601725287587578984328"),BigInt(3));function Bn(t,e){const n=In.mul(t[0],e[1]),o=In.mul(t[1],e[0]),i=In.mul(In.sub(t[1],In.mul(Cn,t[0])),In.add(e[0],e[1])),r=In.mul(n,o),a=In.mul(vn,r);return[In.div(In.add(n,o),In.add(In.one,a)),In.div(In.add(i,In.sub(In.mul(Cn,n),o)),In.sub(In.one,a))]}function Fn(t,e){let n=[In.e(BigInt(0)),In.e(BigInt(1))],o=e,i=t;for(;!Ln(o);)bn(o)&&(n=Bn(n,i)),i=Bn(i,i),o=An(o,BigInt(1));return n}function On(t){const e=BigInt(t[0]),n=BigInt(t[1]),o=In.square(e),i=In.square(n);return In.eq(In.add(In.mul(Cn,o),i),In.add(In.one,In.mul(In.mul(o,i),vn)))}function Sn(t){const e=function(t,e){const n=function(t){!function(t){if(!hn(t))throw new TypeError("Parameter '".concat("value","' is not a bigint, received type: ").concat(typeof t))}(t);let e=t.toString(16);return e.length%2!=0&&(e="0".concat(e)),e}(t),o=Math.ceil(n.length/2);if(e){if(e<o)throw Error("Size ".concat(e," is too small, need at least ").concat(o," bytes"))}else e=o;const i=cn.hp.alloc(e,0);return cn.hp.from(n,"hex").reverse().copy(i,0),i}(t[1],32);return In.lt(t[0],In.zero)&&(e[31]|=128),function(t,e,n){for(const t of n)if(!yn(t))throw new Error("Type '".concat(t,"' is not supported"));for(const e of n)if(mn(t,e))return;throw new TypeError("Parameter '".concat("value","' is none of the following types: ").concat(n.join(", ")))}(n=e,0,["Buffer","Uint8Array"]),BigInt("0x".concat(cn.hp.from(n).reverse().toString("hex")));var n}var Pn=Object.freeze({__proto__:null,getRandomValues:function(t){if(t<=0)throw Error("size ".concat(t," is too small, need at least 1"));return crypto.getRandomValues(new Uint8Array(t))}});const jn=["number","string","function","Array","Uint8Array","Buffer","object","bigint","stringified-bigint","hexadecimal","bignumber","bignumberish"];function Un(t){return"number"==typeof t}function kn(t){return"string"==typeof t}function Mn(t){return"object"==typeof t}function Tn(t){return Mn(t)&&Array.isArray(t)}function zn(t){return t instanceof Uint8Array}function Qn(t){return cn.hp.isBuffer(t)}function Nn(t){return"bigint"==typeof t}function Dn(t){if(!kn(t))return!1;try{return BigInt(t),!0}catch(t){return!1}}function Rn(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!!kn(t)&&(e?/^(0x|0X)[0-9a-fA-F]+$/.test(t):/^[0-9a-fA-F]+$/.test(t))}function qn(t){return Nn(t)||Dn(t)}function Gn(t){return Un(t)||Nn(t)||Dn(t)||Rn(t)||Qn(t)||zn(t)}function Kn(t,e){switch(e){case"number":return Un(t);case"string":return kn(t);case"function":return function(t){return"function"==typeof t}(t);case"Array":return Tn(t);case"Uint8Array":return zn(t);case"Buffer":return Qn(t);case"object":return Mn(t);case"bigint":return Nn(t);case"stringified-bigint":return Dn(t);case"hexadecimal":return Rn(t);case"bignumber":return qn(t);case"bignumberish":return Gn(t);default:return!1}}function Vn(t){return jn.includes(t)}function Hn(t,e,n){for(const t of n)if(!Vn(t))throw new Error("Type '".concat(t,"' is not supported"));for(const e of n)if(Kn(t,e))return;throw new TypeError("Parameter '".concat(e,"' is none of the following types: ").concat(n.join(", ")))}function Yn(t){return Hn(t,"value",["Buffer","Uint8Array"]),BigInt("0x".concat(cn.hp.from(t).reverse().toString("hex")))}function Jn(t){return function(t){return Hn(t,"value",["Buffer","Uint8Array"]),BigInt("0x".concat(cn.hp.from(t).toString("hex")))}(t)}function Wn(t,e){return t>>e}class Xn{constructor(t){this.one=1n,this.zero=0n,this._order=t,this._half=t>>this.one,this._negone=this._order-this.one}e(t){return(t%=this._order)<0?t+this._order:t}mul(t,e){return t*e%this._order}sub(t,e){return t>=e?t-e:this._order-e+t}add(t,e){const n=t+e;return n>=this._order?n-this._order:n}inv(t){if(t===this.zero)throw new Error("Zero has no inverse");let e=this.zero,n=this._order,o=this.one,i=t%this._order;for(;i;){const t=n/i;[e,o]=[o,e-t*o],[n,i]=[i,n-t*i]}return e<this.zero&&(e+=this._order),e}div(t,e){return this.mul(t,this.inv(e))}eq(t,e){return t===e}square(t){return t*t%this._order}lt(t,e){return(t>this._half?t-this._order:t)<(e>this._half?e-this._order:e)}geq(t,e){return(t>this._half?t-this._order:t)>=(e>this._half?e-this._order:e)}neg(t){return t?this._order-t:t}isZero(t){return t===this.zero}pow(t,e){if(function(t){return!t}(e))return this.one;e<0n&&(t=this.inv(t),e=-e);const n=function(t){const e=[];let n=t;for(;n;)n&BigInt(1)?e.push(1):e.push(0),n>>=BigInt(1);return e}(e);if(0===n.length)return this.one;let o=t;for(let e=n.length-2;e>=0;e-=1)o=this.square(o),n[e]&&(o=this.mul(o,t));return o}}var Zn=i(869);const $n=cn.hp.from([1]),to=cn.hp.from([129]),eo=[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],[11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4],[7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8],[9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13],[2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9],[12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11],[13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10],[6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5],[10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],[11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4],[7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8],[9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13],[2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]],no=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731,3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113],oo=cn.hp.from([128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function io(t,e,n,o){let i=t[2*e]^t[2*n],r=t[2*e+1]^t[2*n+1];o>=32&&(r^=i,i^=r,r^=i,o-=32),0===o?(t[2*e]=i>>>0,t[2*e+1]=r>>>0):(t[2*e]=(i>>>o|r<<32-o)>>>0,t[2*e+1]=(r>>>o|i<<32-o)>>>0)}function ro(t,e,n,o,i,r,a,c){let s;s=t[2*o+1]+((e[2*eo[n][c]+1]^no[2*eo[n][c+1]+1])>>>0)+t[2*i+1],t[2*o]=t[2*o]+((e[2*eo[n][c]]^no[2*eo[n][c+1]])>>>0)+t[2*i]+~~(s/4294967296)>>>0,t[2*o+1]=s>>>0,io(t,a,o,32),s=t[2*r+1]+t[2*a+1],t[2*r]=t[2*r]+t[2*a]+~~(s/4294967296)>>>0,t[2*r+1]=s>>>0,io(t,i,r,25),s=t[2*o+1]+((e[2*eo[n][c+1]+1]^no[2*eo[n][c]+1])>>>0)+t[2*i+1],t[2*o]=t[2*o]+((e[2*eo[n][c+1]]^no[2*eo[n][c]])>>>0)+t[2*i]+~~(s/4294967296)>>>0,t[2*o+1]=s>>>0,io(t,a,o,16),s=t[2*r+1]+t[2*a+1],t[2*r]=t[2*r]+t[2*a]+~~(s/4294967296)>>>0,t[2*r+1]=s>>>0,io(t,i,r,11)}function ao(t){for(let e=0;e<t.length&&!(t[e]<4294967296);e+=1)t[e]-=4294967296,t[e+1]+=1}class co{constructor(){this._h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this._s=[0,0,0,0,0,0,0,0],this._block=cn.hp.alloc(128),this._blockOffset=0,this._length=[0,0,0,0],this._nullt=!1,this._zo=$n,this._oo=to}_compress(){const t=new Array(32),e=new Array(32);let n;for(n=0;n<32;n+=1)e[n]=this._block.readUInt32BE(4*n);for(n=0;n<16;n+=1)t[n]=this._h[n]>>>0;for(n=16;n<24;n+=1)t[n]=(this._s[n-16]^no[n-16])>>>0;for(n=24;n<32;n+=1)t[n]=no[n-16];for(this._nullt||(t[24]=(t[24]^this._length[1])>>>0,t[25]=(t[25]^this._length[0])>>>0,t[26]=(t[26]^this._length[1])>>>0,t[27]=(t[27]^this._length[0])>>>0,t[28]=(t[28]^this._length[3])>>>0,t[29]=(t[29]^this._length[2])>>>0,t[30]=(t[30]^this._length[3])>>>0,t[31]=(t[31]^this._length[2])>>>0),n=0;n<16;n+=1)ro(t,e,n,0,4,8,12,0),ro(t,e,n,1,5,9,13,2),ro(t,e,n,2,6,10,14,4),ro(t,e,n,3,7,11,15,6),ro(t,e,n,0,5,10,15,8),ro(t,e,n,1,6,11,12,10),ro(t,e,n,2,7,8,13,12),ro(t,e,n,3,4,9,14,14);for(n=0;n<16;n+=1)this._h[n%8*2]=(this._h[n%8*2]^t[2*n])>>>0,this._h[n%8*2+1]=(this._h[n%8*2+1]^t[2*n+1])>>>0;for(n=0;n<8;n+=1)this._h[2*n]=(this._h[2*n]^this._s[n%4*2])>>>0,this._h[2*n+1]=(this._h[2*n+1]^this._s[n%4*2+1])>>>0}_padding(){const t=this._length.slice();t[0]+=8*this._blockOffset,ao(t);const e=cn.hp.alloc(16);for(let n=0;n<4;n+=1)e.writeUInt32BE(t[3-n],4*n);111===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<111?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(111-this._blockOffset),this.update(oo.subarray(0,111-this._blockOffset))):(this._length[0]-=8*(128-this._blockOffset),this.update(oo.subarray(0,128-this._blockOffset)),this._length[0]-=888,this.update(oo.subarray(1,112)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=128,this.update(e)}digest(){this._padding();const t=cn.hp.alloc(64);for(let e=0;e<16;e+=1)t.writeUInt32BE(this._h[e],4*e);return t}update(t){const e=this._block;let n=0;for(;this._blockOffset+t.length-n>=e.length;){for(let o=this._blockOffset;o<e.length;)e[o++]=t[n++];this._length[0]+=8*e.length,ao(this._length),this._compress(),this._blockOffset=0}for(;n<t.length;)e[this._blockOffset++]=t[n++];return this}}function so(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function lo(t){return Tn(t)&&2===t.length&&qn(t[0])&&qn(t[1])}function uo(t){return Hn(t,"privateKey",["Buffer","Uint8Array","string"]),cn.hp.from(t)}function fo(t){return Hn(t,"message",["bignumberish","string"]),Gn(t)?(function(t){if(!Gn(t))throw new TypeError("Parameter '".concat("value","' is not a bignumber-ish"))}(e=t),Qn(e)||zn(e)?Jn(e):BigInt(e)):Jn(cn.hp.from(t));var e}function go(t){const e=new co;return e.update(cn.hp.from(t)),e.digest()}function ho(t){let e=go(t=uo(t));return e=e.slice(0,32),e=so(e),Wn(Yn(e),BigInt(3))%En}function po(t,e){t=uo(t),e=fo(e);const n=go(t),o=Yn(so(n.slice(0,32))),i=Fn(xn,Wn(o,BigInt(3))),r=function(t,e){const n=function(t){!function(t){if(!Nn(t))throw new TypeError("Parameter '".concat("value","' is not a bigint, received type: ").concat(typeof t))}(t);let e=t.toString(16);return e.length%2!=0&&(e="0".concat(e)),e}(t),o=Math.ceil(n.length/2);if(e){if(e<o)throw Error("Size ".concat(e," is too small, need at least ").concat(o," bytes"))}else e=o;const i=cn.hp.alloc(e,0);return cn.hp.from(n,"hex").reverse().copy(i,0),i}(e,32),a=go(cn.hp.concat([n.slice(32,64),r])),c=new Xn(En),s=c.e(Yn(a)),l=Fn(xn,s),d=(0,Zn.Z)([l[0],l[1],i[0],i[1],e]);return{R8:l,S:c.add(s,c.mul(d,o))}}function _o(t,e,n){if(!lo(n)||!function(t){return Mn(t)&&Object.prototype.hasOwnProperty.call(t,"R8")&&Object.prototype.hasOwnProperty.call(t,"S")&&lo(t.R8)&&qn(t.S)}(e)||!On(e.R8)||!On(n)||BigInt(e.S)>=En)return!1;t=fo(t);const o={R8:[BigInt(e.R8[0]),BigInt(e.R8[1])],S:BigInt(e.S)},i=[BigInt(n[0]),BigInt(n[1])],r=(0,Zn.Z)([e.R8[0],e.R8[1],n[0],n[1],t]),a=Fn(xn,BigInt(e.S));let c=Fn(i,function(t){return t*BigInt(8)}(r));return c=Bn(o.R8,c),In.eq(a[0],c[0])&&In.eq(a[1],c[1])}class mo{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pn.getRandomValues(32);this.privateKey=t,this.secretScalar=ho(t),this.publicKey=function(t){const e=ho(t);return Fn(xn,e)}(t),this.packedPublicKey=function(t){if(!lo(t)||!On(t))throw new Error("Invalid public key");return Sn([BigInt(t[0]),BigInt(t[1])])}(this.publicKey)}signMessage(t){return po(this.privateKey,t)}verifySignature(t,e){return _o(t,e,this.publicKey)}}const yo=["number","boolean","string","function","Array","Uint8Array","Buffer","object","bigint","stringified-bigint","hexadecimal","bignumber","bignumberish"];function Lo(t){return"number"==typeof t}function bo(t){return"string"==typeof t}function Ao(t){return"object"==typeof t}function wo(t){return t instanceof Uint8Array}function Io(t){return cn.hp.isBuffer(t)}function xo(t){return"bigint"==typeof t}function Co(t){if(!bo(t))return!1;try{return BigInt(t),!0}catch(t){return!1}}function vo(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!!bo(t)&&(e?/^(0x|0X)[0-9a-fA-F]+$/.test(t):/^[0-9a-fA-F]+$/.test(t))}function Eo(t,e){switch(e){case"number":return Lo(t);case"boolean":return function(t){return"boolean"==typeof t}(t);case"string":return bo(t);case"function":return function(t){return"function"==typeof t}(t);case"Array":return function(t){return Ao(t)&&Array.isArray(t)}(t);case"Uint8Array":return wo(t);case"Buffer":return Io(t);case"object":return Ao(t);case"bigint":return xo(t);case"stringified-bigint":return Co(t);case"hexadecimal":return vo(t);case"bignumber":return function(t){return xo(t)||Co(t)}(t);case"bignumberish":return function(t){return Lo(t)||xo(t)||Co(t)||vo(t)||Io(t)||wo(t)}(t);default:return!1}}function Bo(t){return yo.includes(t)}function Fo(t,e){if(void 0===t)throw new TypeError("Parameter '".concat(e,"' is not defined"))}function Oo(t,e){if(!bo(t))throw new TypeError("Parameter '".concat(e,"' is not a string, received type: ").concat(typeof t))}function So(t,e){if(!Ao(t))throw new TypeError("Parameter '".concat(e,"' is not an object, received type: ").concat(typeof t))}function Po(t,e,n){for(const t of n)if(!Bo(t))throw new Error("Type '".concat(t,"' is not supported"));for(const e of n)if(Eo(t,e))return;throw new TypeError("Parameter '".concat(e,"' is none of the following types: ").concat(n.join(", ")))}var jo=i(544);class Uo{constructor(t){const e=new mo(t);this._privateKey=e.privateKey,this._secretScalar=e.secretScalar,this._publicKey=e.publicKey,this._commitment=(0,jo.S)(this._publicKey)}get privateKey(){return this._privateKey}get secretScalar(){return this._secretScalar}get publicKey(){return this._publicKey}get commitment(){return this._commitment}export(){return bo(this._privateKey)?(Oo(t=this._privateKey,"value"),cn.hp.from(t,"utf8").toString("base64")):function(t){return Po(t,"value",["Buffer","Uint8Array"]),cn.hp.from(t).toString("base64")}(this.privateKey);var t}static import(t){return new Uo((Oo(e=t,"value"),cn.hp.from(e,"base64")));var e}signMessage(t){return po(this.privateKey,t)}static verifySignature(t,e,n){return _o(t,e,n)}static generateCommitment(t){return(0,jo.S)(t)}}const ko=(t,e)=>{if(!t)throw new Error("MASTER KEY IS NOT PROVIDED");const n=Tt((new rn).encode(["string","string"],[t,e]));return new Uo(n)},Mo=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return t?t.length<=e?t:"".concat(t.slice(0,e),"...").concat(t.slice(-e)):"..."},To="zpka_52e44068bb9745f2be776b343e96cdab_1a60a93b",zo="https://api.bringid.org",Qo="https://oauth-verifier-production.up.railway.app";function No(t){const e=function(t){try{const e=i(t?32:704);return Array.isArray(e)?e.map((t=>{if("string"!=typeof t.title||!t.groups)throw console.warn("Invalid task format:",t),new Error("Invalid task format");return{title:t.title,id:t.id,description:t.description,icon:t.icon,groups:t.groups,service:t.service}})):(console.error("Tasks config is not an array"),[])}catch(t){return console.error("Failed to parse tasks config:",t),[]}}(t);return[...e]}const Do=(t,e)=>{const n=No(e);for(const e of n)for(const n of e.groups)if(n.credentialGroupId===t)return{taskId:e.id,title:e.title,description:e.description,icon:e.icon,group:n}},Ro=function(t){const e=t.toLowerCase().replace("0x","");if(40!==e.length)throw new Error("Invalid contract address length");const n=["0x"+e,0];return w(Tt(rn.defaultAbiCoder().encode(["address","uint256"],n))).toString()};function qo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Go(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qo(Object(n),!0).forEach((function(e){Ko(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ko(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Vo=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return fetch(t,{method:e,body:"GET"===e||"OPTIONS"===e?void 0:JSON.stringify(o),headers:Go(Go({},n),{},{"content-type":"application/json"})}).then((async t=>{if(!t.ok){const e=await t.json();throw new Error(e.error)}return t.json()}))},Ho=t=>Object.entries(t).reduce(((t,e)=>{let[n,o]=e;return o?""===t?"".concat(n,"=").concat(o):"".concat(t,"&").concat(n,"=").concat(o):t}),""),Yo=t=>{switch(t){case"8453":default:return"base";case"84532":return"base-sepolia"}},Jo=function(t,e){let n=0;return t.forEach((t=>{if("completed"!==t.status)return;const o=Do(t.credentialGroupId,e);if(!o)return;const{group:i}=o;n+=i.points||0})),n},Wo=t=>{if(t<=0)return"00:00:00";const e=Math.floor(t/1e3%60),n=Math.floor(t/6e4%60),o=Math.floor(t/36e5%24);return(o<10?"0"+o:o)+":"+(n<10?"0"+n:n)+":"+(e<10?"0"+e:e)},Xo=class{constructor(){this.dialogWindowOrigin=window.location.origin,this.connectDialogReady=!1,this.pendingRequests=new Map,this.handleMessage=t=>{if(console.log("handleMessage: ",{event:t,dialogWindowOrigin:this.dialogWindowOrigin}),t.origin!==this.dialogWindowOrigin)return;const e=t.data;if(!e.requestId)return;const n=this.pendingRequests.get(e.requestId);console.log("handleMessage: ",{pending:n}),n&&(console.log({data:e,pending:n}),n.requestType!==e.type&&(this.pendingRequests.delete(e.requestId),e.error?n.reject(e.error):n.resolve(e.payload)))},this.checkExtensionStatus=async()=>this.request("CHECK_EXTENSION_STATUS_REQUEST"),this.requestProofs=async t=>this.request("PROOFS_REQUEST",t),window.addEventListener("message",this.handleMessage)}markDialogReady(){this.connectDialogReady=!0}sendMessageToDialog(t){if(!this.connectDialogReady)throw new Error("ConnectDialog is not mounted.");console.log("sendMessageToDialog: ",{msg:t,dialogWindowOrigin:this.dialogWindowOrigin}),window.postMessage(t,this.dialogWindowOrigin)}request(t,e){return new Promise(((n,o)=>{const i=c();this.pendingRequests.set(i,{resolve:n,reject:o,requestType:t}),this.sendMessageToDialog({type:t,requestId:i,payload:e})}))}};var Zo=i(155),$o=i.n(Zo),ti=function(){return ti=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ti.apply(this,arguments)};function ei(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var ni=i(863),oi=i.n(ni),ii="-ms-",ri="-moz-",ai="-webkit-",ci="comm",si="rule",li="decl",di="@keyframes",ui=Math.abs,fi=String.fromCharCode,gi=Object.assign;function hi(t){return t.trim()}function pi(t,e){return(t=e.exec(t))?t[0]:t}function _i(t,e,n){return t.replace(e,n)}function mi(t,e,n){return t.indexOf(e,n)}function yi(t,e){return 0|t.charCodeAt(e)}function Li(t,e,n){return t.slice(e,n)}function bi(t){return t.length}function Ai(t){return t.length}function wi(t,e){return e.push(t),t}function Ii(t,e){return t.filter((function(t){return!pi(t,e)}))}var xi=1,Ci=1,vi=0,Ei=0,Bi=0,Fi="";function Oi(t,e,n,o,i,r,a,c){return{value:t,root:e,parent:n,type:o,props:i,children:r,line:xi,column:Ci,length:a,return:"",siblings:c}}function Si(t,e){return gi(Oi("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function Pi(t){for(;t.root;)t=Si(t.root,{children:[t]});wi(t,t.siblings)}function ji(){return Bi=Ei>0?yi(Fi,--Ei):0,Ci--,10===Bi&&(Ci=1,xi--),Bi}function Ui(){return Bi=Ei<vi?yi(Fi,Ei++):0,Ci++,10===Bi&&(Ci=1,xi++),Bi}function ki(){return yi(Fi,Ei)}function Mi(){return Ei}function Ti(t,e){return Li(Fi,t,e)}function zi(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Qi(t){return hi(Ti(Ei-1,Ri(91===t?t+2:40===t?t+1:t)))}function Ni(t){for(;(Bi=ki())&&Bi<33;)Ui();return zi(t)>2||zi(Bi)>3?"":" "}function Di(t,e){for(;--e&&Ui()&&!(Bi<48||Bi>102||Bi>57&&Bi<65||Bi>70&&Bi<97););return Ti(t,Mi()+(e<6&&32==ki()&&32==Ui()))}function Ri(t){for(;Ui();)switch(Bi){case t:return Ei;case 34:case 39:34!==t&&39!==t&&Ri(Bi);break;case 40:41===t&&Ri(t);break;case 92:Ui()}return Ei}function qi(t,e){for(;Ui()&&t+Bi!==57&&(t+Bi!==84||47!==ki()););return"/*"+Ti(e,Ei-1)+"*"+fi(47===t?t:Ui())}function Gi(t){for(;!zi(ki());)Ui();return Ti(t,Ei)}function Ki(t,e){for(var n="",o=0;o<t.length;o++)n+=e(t[o],o,t,e)||"";return n}function Vi(t,e,n,o){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case li:return t.return=t.return||t.value;case ci:return"";case di:return t.return=t.value+"{"+Ki(t.children,o)+"}";case si:if(!bi(t.value=t.props.join(",")))return""}return bi(n=Ki(t.children,o))?t.return=t.value+"{"+n+"}":""}function Hi(t,e,n){switch(function(t,e){return 45^yi(t,0)?(((e<<2^yi(t,0))<<2^yi(t,1))<<2^yi(t,2))<<2^yi(t,3):0}(t,e)){case 5103:return ai+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ai+t+t;case 4789:return ri+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return ai+t+ri+t+ii+t+t;case 5936:switch(yi(t,e+11)){case 114:return ai+t+ii+_i(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return ai+t+ii+_i(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return ai+t+ii+_i(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return ai+t+ii+t+t;case 6165:return ai+t+ii+"flex-"+t+t;case 5187:return ai+t+_i(t,/(\w+).+(:[^]+)/,ai+"box-$1$2"+ii+"flex-$1$2")+t;case 5443:return ai+t+ii+"flex-item-"+_i(t,/flex-|-self/g,"")+(pi(t,/flex-|baseline/)?"":ii+"grid-row-"+_i(t,/flex-|-self/g,""))+t;case 4675:return ai+t+ii+"flex-line-pack"+_i(t,/align-content|flex-|-self/g,"")+t;case 5548:return ai+t+ii+_i(t,"shrink","negative")+t;case 5292:return ai+t+ii+_i(t,"basis","preferred-size")+t;case 6060:return ai+"box-"+_i(t,"-grow","")+ai+t+ii+_i(t,"grow","positive")+t;case 4554:return ai+_i(t,/([^-])(transform)/g,"$1"+ai+"$2")+t;case 6187:return _i(_i(_i(t,/(zoom-|grab)/,ai+"$1"),/(image-set)/,ai+"$1"),t,"")+t;case 5495:case 3959:return _i(t,/(image-set\([^]*)/,ai+"$1$`$1");case 4968:return _i(_i(t,/(.+:)(flex-)?(.*)/,ai+"box-pack:$3"+ii+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ai+t+t;case 4200:if(!pi(t,/flex-|baseline/))return ii+"grid-column-align"+Li(t,e)+t;break;case 2592:case 3360:return ii+_i(t,"template-","")+t;case 4384:case 3616:return n&&n.some((function(t,n){return e=n,pi(t.props,/grid-\w+-end/)}))?~mi(t+(n=n[e].value),"span",0)?t:ii+_i(t,"-start","")+t+ii+"grid-row-span:"+(~mi(n,"span",0)?pi(n,/\d+/):+pi(n,/\d+/)-+pi(t,/\d+/))+";":ii+_i(t,"-start","")+t;case 4896:case 4128:return n&&n.some((function(t){return pi(t.props,/grid-\w+-start/)}))?t:ii+_i(_i(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return _i(t,/(.+)-inline(.+)/,ai+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(bi(t)-1-e>6)switch(yi(t,e+1)){case 109:if(45!==yi(t,e+4))break;case 102:return _i(t,/(.+:)(.+)-([^]+)/,"$1"+ai+"$2-$3$1"+ri+(108==yi(t,e+3)?"$3":"$2-$3"))+t;case 115:return~mi(t,"stretch",0)?Hi(_i(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return _i(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(e,n,o,i,r,a,c){return ii+n+":"+o+c+(i?ii+n+"-span:"+(r?a:+a-+o)+c:"")+t}));case 4949:if(121===yi(t,e+6))return _i(t,":",":"+ai)+t;break;case 6444:switch(yi(t,45===yi(t,14)?18:11)){case 120:return _i(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+ai+(45===yi(t,14)?"inline-":"")+"box$3$1"+ai+"$2$3$1"+ii+"$2box$3")+t;case 100:return _i(t,":",":"+ii)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return _i(t,"scroll-","scroll-snap-")+t}return t}function Yi(t,e,n,o){if(t.length>-1&&!t.return)switch(t.type){case li:return void(t.return=Hi(t.value,t.length,n));case di:return Ki([Si(t,{value:_i(t.value,"@","@"+ai)})],o);case si:if(t.length)return function(t,e){return t.map(e).join("")}(n=t.props,(function(e){switch(pi(e,o=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Pi(Si(t,{props:[_i(e,/:(read-\w+)/,":-moz-$1")]})),Pi(Si(t,{props:[e]})),gi(t,{props:Ii(n,o)});break;case"::placeholder":Pi(Si(t,{props:[_i(e,/:(plac\w+)/,":"+ai+"input-$1")]})),Pi(Si(t,{props:[_i(e,/:(plac\w+)/,":-moz-$1")]})),Pi(Si(t,{props:[_i(e,/:(plac\w+)/,ii+"input-$1")]})),Pi(Si(t,{props:[e]})),gi(t,{props:Ii(n,o)})}return""}))}}function Ji(t){return function(t){return Fi="",t}(Wi("",null,null,null,[""],t=function(t){return xi=Ci=1,vi=bi(Fi=t),Ei=0,[]}(t),0,[0],t))}function Wi(t,e,n,o,i,r,a,c,s){for(var l=0,d=0,u=a,f=0,g=0,h=0,p=1,_=1,m=1,y=0,L="",b=i,A=r,w=o,I=L;_;)switch(h=y,y=Ui()){case 40:if(108!=h&&58==yi(I,u-1)){-1!=mi(I+=_i(Qi(y),"&","&\f"),"&\f",ui(l?c[l-1]:0))&&(m=-1);break}case 34:case 39:case 91:I+=Qi(y);break;case 9:case 10:case 13:case 32:I+=Ni(h);break;case 92:I+=Di(Mi()-1,7);continue;case 47:switch(ki()){case 42:case 47:wi(Zi(qi(Ui(),Mi()),e,n,s),s);break;default:I+="/"}break;case 123*p:c[l++]=bi(I)*m;case 125*p:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+d:-1==m&&(I=_i(I,/\f/g,"")),g>0&&bi(I)-u&&wi(g>32?$i(I+";",o,n,u-1,s):$i(_i(I," ","")+";",o,n,u-2,s),s);break;case 59:I+=";";default:if(wi(w=Xi(I,e,n,l,d,i,c,L,b=[],A=[],u,r),r),123===y)if(0===d)Wi(I,e,w,w,b,r,u,c,A);else switch(99===f&&110===yi(I,3)?100:f){case 100:case 108:case 109:case 115:Wi(t,w,w,o&&wi(Xi(t,w,w,0,0,i,c,L,i,b=[],u,A),A),i,A,u,c,o?b:A);break;default:Wi(I,w,w,w,[""],A,0,c,A)}}l=d=g=0,p=m=1,L=I="",u=a;break;case 58:u=1+bi(I),g=h;default:if(p<1)if(123==y)--p;else if(125==y&&0==p++&&125==ji())continue;switch(I+=fi(y),y*p){case 38:m=d>0?1:(I+="\f",-1);break;case 44:c[l++]=(bi(I)-1)*m,m=1;break;case 64:45===ki()&&(I+=Qi(Ui())),f=ki(),d=u=bi(L=I+=Gi(Mi())),y++;break;case 45:45===h&&2==bi(I)&&(p=0)}}return r}function Xi(t,e,n,o,i,r,a,c,s,l,d,u){for(var f=i-1,g=0===i?r:[""],h=Ai(g),p=0,_=0,m=0;p<o;++p)for(var y=0,L=Li(t,f+1,f=ui(_=a[p])),b=t;y<h;++y)(b=hi(_>0?g[y]+" "+L:_i(L,/&\f/g,g[y])))&&(s[m++]=b);return Oi(t,e,n,0===i?si:c,s,l,d,u)}function Zi(t,e,n,o){return Oi(t,e,n,ci,fi(Bi),Li(t,2,-2),0,o)}function $i(t,e,n,o,i){return Oi(t,e,n,li,Li(t,0,o),Li(t,o+1,-1),o,i)}var tr={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},er="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",nr="active",or="data-styled-version",ir="6.1.19",rr="/*!sc*/\n",ar="undefined"!=typeof window&&"undefined"!=typeof document,cr=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY),sr=(new Set,Object.freeze([])),lr=Object.freeze({});var dr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),ur=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,fr=/(^-|-$)/g;function gr(t){return t.replace(ur,"-").replace(fr,"")}var hr=/(a)(d)/gi,pr=function(t){return String.fromCharCode(t+(t>25?39:97))};function _r(t){var e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=pr(e%52)+n;return(pr(e%52)+n).replace(hr,"$1-$2")}var mr,yr=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},Lr=function(t){return yr(5381,t)};function br(t){return _r(Lr(t)>>>0)}function Ar(t){return"string"==typeof t&&!0}var wr="function"==typeof Symbol&&Symbol.for,Ir=wr?Symbol.for("react.memo"):60115,xr=wr?Symbol.for("react.forward_ref"):60112,Cr={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},vr={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Er={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Br=((mr={})[xr]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},mr[Ir]=Er,mr);function Fr(t){return("type"in(e=t)&&e.type.$$typeof)===Ir?Er:"$$typeof"in t?Br[t.$$typeof]:Cr;var e}var Or=Object.defineProperty,Sr=Object.getOwnPropertyNames,Pr=Object.getOwnPropertySymbols,jr=Object.getOwnPropertyDescriptor,Ur=Object.getPrototypeOf,kr=Object.prototype;function Mr(t,e,n){if("string"!=typeof e){if(kr){var o=Ur(e);o&&o!==kr&&Mr(t,o,n)}var i=Sr(e);Pr&&(i=i.concat(Pr(e)));for(var r=Fr(t),a=Fr(e),c=0;c<i.length;++c){var s=i[c];if(!(s in vr||n&&n[s]||a&&s in a||r&&s in r)){var l=jr(e,s);try{Or(t,s,l)}catch(t){}}}}return t}function Tr(t){return"function"==typeof t}function zr(t){return"object"==typeof t&&"styledComponentId"in t}function Qr(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function Nr(t,e){if(0===t.length)return"";for(var n=t[0],o=1;o<t.length;o++)n+=e?e+t[o]:t[o];return n}function Dr(t){return null!==t&&"object"==typeof t&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function Rr(t,e,n){if(void 0===n&&(n=!1),!n&&!Dr(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var o=0;o<e.length;o++)t[o]=Rr(t[o],e[o]);else if(Dr(e))for(var o in e)t[o]=Rr(t[o],e[o]);return t}function qr(t,e){Object.defineProperty(t,"toString",{value:e})}function Gr(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var Kr=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return t.prototype.indexOfGroup=function(t){for(var e=0,n=0;n<t;n++)e+=this.groupSizes[n];return e},t.prototype.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,i=o;t>=i;)if((i<<=1)<0)throw Gr(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var r=o;r<i;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(t+1),c=(r=0,e.length);r<c;r++)this.tag.insertRule(a,e[r])&&(this.groupSizes[t]++,a++)},t.prototype.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],n=this.indexOfGroup(t),o=n+e;this.groupSizes[t]=0;for(var i=n;i<o;i++)this.tag.deleteRule(n)}},t.prototype.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var n=this.groupSizes[t],o=this.indexOfGroup(t),i=o+n,r=o;r<i;r++)e+="".concat(this.tag.getRule(r)).concat(rr);return e},t}(),Vr=new Map,Hr=new Map,Yr=1,Jr=function(t){if(Vr.has(t))return Vr.get(t);for(;Hr.has(Yr);)Yr++;var e=Yr++;return Vr.set(t,e),Hr.set(e,t),e},Wr=function(t,e){Yr=e+1,Vr.set(t,e),Hr.set(e,t)},Xr="style[".concat(er,"][").concat(or,'="').concat(ir,'"]'),Zr=new RegExp("^".concat(er,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),$r=function(t,e,n){for(var o,i=n.split(","),r=0,a=i.length;r<a;r++)(o=i[r])&&t.registerName(e,o)},ta=function(t,e){for(var n,o=(null!==(n=e.textContent)&&void 0!==n?n:"").split(rr),i=[],r=0,a=o.length;r<a;r++){var c=o[r].trim();if(c){var s=c.match(Zr);if(s){var l=0|parseInt(s[1],10),d=s[2];0!==l&&(Wr(d,l),$r(t,d,s[3]),t.getTag().insertRules(l,i)),i.length=0}else i.push(c)}}},ea=function(t){for(var e=document.querySelectorAll(Xr),n=0,o=e.length;n<o;n++){var i=e[n];i&&i.getAttribute(er)!==nr&&(ta(t,i),i.parentNode&&i.parentNode.removeChild(i))}};function na(){return i.nc}var oa=function(t){var e=document.head,n=t||e,o=document.createElement("style"),i=function(t){var e=Array.from(t.querySelectorAll("style[".concat(er,"]")));return e[e.length-1]}(n),r=void 0!==i?i.nextSibling:null;o.setAttribute(er,nr),o.setAttribute(or,ir);var a=na();return a&&o.setAttribute("nonce",a),n.insertBefore(o,r),o},ia=function(){function t(t){this.element=oa(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,n=0,o=e.length;n<o;n++){var i=e[n];if(i.ownerNode===t)return i}throw Gr(17)}(this.element),this.length=0}return t.prototype.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch(t){return!1}},t.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},t.prototype.getRule=function(t){var e=this.sheet.cssRules[t];return e&&e.cssText?e.cssText:""},t}(),ra=function(){function t(t){this.element=oa(t),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(t,e){if(t<=this.length&&t>=0){var n=document.createTextNode(e);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},t.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),aa=function(){function t(t){this.rules=[],this.length=0}return t.prototype.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},t.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},t.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),ca=ar,sa={isServer:!ar,useCSSOMInjection:!cr},la=function(){function t(t,e,n){void 0===t&&(t=lr),void 0===e&&(e={});var o=this;this.options=ti(ti({},sa),t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&ar&&ca&&(ca=!1,ea(this)),qr(this,(function(){return function(t){for(var e=t.getTag(),n=e.length,o="",i=function(n){var i=function(t){return Hr.get(t)}(n);if(void 0===i)return"continue";var r=t.names.get(i),a=e.getGroup(n);if(void 0===r||!r.size||0===a.length)return"continue";var c="".concat(er,".g").concat(n,'[id="').concat(i,'"]'),s="";void 0!==r&&r.forEach((function(t){t.length>0&&(s+="".concat(t,","))})),o+="".concat(a).concat(c,'{content:"').concat(s,'"}').concat(rr)},r=0;r<n;r++)i(r);return o}(o)}))}return t.registerId=function(t){return Jr(t)},t.prototype.rehydrate=function(){!this.server&&ar&&ea(this)},t.prototype.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(ti(ti({},this.options),e),this.gs,n&&this.names||void 0)},t.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(t=function(t){var e=t.useCSSOMInjection,n=t.target;return t.isServer?new aa(n):e?new ia(n):new ra(n)}(this.options),new Kr(t)));var t},t.prototype.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},t.prototype.registerName=function(t,e){if(Jr(t),this.names.has(t))this.names.get(t).add(e);else{var n=new Set;n.add(e),this.names.set(t,n)}},t.prototype.insertRules=function(t,e,n){this.registerName(t,e),this.getTag().insertRules(Jr(t),n)},t.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},t.prototype.clearRules=function(t){this.getTag().clearGroup(Jr(t)),this.clearNames(t)},t.prototype.clearTag=function(){this.tag=void 0},t}(),da=/&/g,ua=/^\s*\/\/.*$/gm;function fa(t,e){return t.map((function(t){return"rule"===t.type&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map((function(t){return"".concat(e," ").concat(t)}))),Array.isArray(t.children)&&"@keyframes"!==t.type&&(t.children=fa(t.children,e)),t}))}function ga(t){var e,n,o,i=void 0===t?lr:t,r=i.options,a=void 0===r?lr:r,c=i.plugins,s=void 0===c?sr:c,l=function(t,o,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(e):t},d=s.slice();d.push((function(t){t.type===si&&t.value.includes("&")&&(t.props[0]=t.props[0].replace(da,n).replace(o,l))})),a.prefix&&d.push(Yi),d.push(Vi);var u=function(t,i,r,c){void 0===i&&(i=""),void 0===r&&(r=""),void 0===c&&(c="&"),e=c,n=i,o=new RegExp("\\".concat(n,"\\b"),"g");var s=t.replace(ua,""),l=Ji(r||i?"".concat(r," ").concat(i," { ").concat(s," }"):s);a.namespace&&(l=fa(l,a.namespace));var u,f,g,h=[];return Ki(l,(u=d.concat((g=function(t){return h.push(t)},function(t){t.root||(t=t.return)&&g(t)})),f=Ai(u),function(t,e,n,o){for(var i="",r=0;r<f;r++)i+=u[r](t,e,n,o)||"";return i})),h};return u.hash=s.length?s.reduce((function(t,e){return e.name||Gr(15),yr(t,e.name)}),5381).toString():"",u}var ha=new la,pa=ga(),_a=$o().createContext({shouldForwardProp:void 0,styleSheet:ha,stylis:pa}),ma=(_a.Consumer,$o().createContext(void 0));function ya(){return(0,Zo.useContext)(_a)}function La(t){var e=(0,Zo.useState)(t.stylisPlugins),n=e[0],o=e[1],i=ya().styleSheet,r=(0,Zo.useMemo)((function(){var e=i;return t.sheet?e=t.sheet:t.target&&(e=e.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(e=e.reconstructWithOptions({useCSSOMInjection:!1})),e}),[t.disableCSSOMInjection,t.sheet,t.target,i]),a=(0,Zo.useMemo)((function(){return ga({options:{namespace:t.namespace,prefix:t.enableVendorPrefixes},plugins:n})}),[t.enableVendorPrefixes,t.namespace,n]);(0,Zo.useEffect)((function(){oi()(n,t.stylisPlugins)||o(t.stylisPlugins)}),[t.stylisPlugins]);var c=(0,Zo.useMemo)((function(){return{shouldForwardProp:t.shouldForwardProp,styleSheet:r,stylis:a}}),[t.shouldForwardProp,r,a]);return $o().createElement(_a.Provider,{value:c},$o().createElement(ma.Provider,{value:a},t.children))}var ba=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=pa);var o=n.name+e.hash;t.hasNameForId(n.id,o)||t.insertRules(n.id,o,e(n.rules,o,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=e,qr(this,(function(){throw Gr(12,String(n.name))}))}return t.prototype.getName=function(t){return void 0===t&&(t=pa),this.name+t.hash},t}(),Aa=function(t){return t>="A"&&t<="Z"};function wa(t){for(var e="",n=0;n<t.length;n++){var o=t[n];if(1===n&&"-"===o&&"-"===t[0])return t;Aa(o)?e+="-"+o.toLowerCase():e+=o}return e.startsWith("ms-")?"-"+e:e}var Ia=function(t){return null==t||!1===t||""===t},xa=function(t){var e,n,o=[];for(var i in t){var r=t[i];t.hasOwnProperty(i)&&!Ia(r)&&(Array.isArray(r)&&r.isCss||Tr(r)?o.push("".concat(wa(i),":"),r,";"):Dr(r)?o.push.apply(o,ei(ei(["".concat(i," {")],xa(r),!1),["}"],!1)):o.push("".concat(wa(i),": ").concat((e=i,null==(n=r)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||e in tr||e.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return o};function Ca(t,e,n,o){return Ia(t)?[]:zr(t)?[".".concat(t.styledComponentId)]:Tr(t)?!Tr(i=t)||i.prototype&&i.prototype.isReactComponent||!e?[t]:Ca(t(e),e,n,o):t instanceof ba?n?(t.inject(n,o),[t.getName(o)]):[t]:Dr(t)?xa(t):Array.isArray(t)?Array.prototype.concat.apply(sr,t.map((function(t){return Ca(t,e,n,o)}))):[t.toString()];var i}function va(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(Tr(n)&&!zr(n))return!1}return!0}var Ea=Lr(ir),Ba=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&va(t),this.componentId=e,this.baseHash=yr(Ea,e),this.baseStyle=n,la.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,e,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(this.componentId,this.staticRulesId))o=Qr(o,this.staticRulesId);else{var i=Nr(Ca(this.rules,t,e,n)),r=_r(yr(this.baseHash,i)>>>0);if(!e.hasNameForId(this.componentId,r)){var a=n(i,".".concat(r),void 0,this.componentId);e.insertRules(this.componentId,r,a)}o=Qr(o,r),this.staticRulesId=r}else{for(var c=yr(this.baseHash,n.hash),s="",l=0;l<this.rules.length;l++){var d=this.rules[l];if("string"==typeof d)s+=d;else if(d){var u=Nr(Ca(d,t,e,n));c=yr(c,u+l),s+=u}}if(s){var f=_r(c>>>0);e.hasNameForId(this.componentId,f)||e.insertRules(this.componentId,f,n(s,".".concat(f),void 0,this.componentId)),o=Qr(o,f)}}return o},t}(),Fa=$o().createContext(void 0);function Oa(t){var e=$o().useContext(Fa),n=(0,Zo.useMemo)((function(){return function(t,e){if(!t)throw Gr(14);if(Tr(t))return t(e);if(Array.isArray(t)||"object"!=typeof t)throw Gr(8);return e?ti(ti({},e),t):t}(t.theme,e)}),[t.theme,e]);return t.children?$o().createElement(Fa.Provider,{value:n},t.children):null}Fa.Consumer;var Sa={};function Pa(t,e,n){var o=zr(t),i=t,r=!Ar(t),a=e.attrs,c=void 0===a?sr:a,s=e.componentId,l=void 0===s?function(t,e){var n="string"!=typeof t?"sc":gr(t);Sa[n]=(Sa[n]||0)+1;var o="".concat(n,"-").concat(br(ir+n+Sa[n]));return e?"".concat(e,"-").concat(o):o}(e.displayName,e.parentComponentId):s,d=e.displayName,u=void 0===d?function(t){return Ar(t)?"styled.".concat(t):"Styled(".concat(function(t){return t.displayName||t.name||"Component"}(t),")")}(t):d,f=e.displayName&&e.componentId?"".concat(gr(e.displayName),"-").concat(e.componentId):e.componentId||l,g=o&&i.attrs?i.attrs.concat(c).filter(Boolean):c,h=e.shouldForwardProp;if(o&&i.shouldForwardProp){var p=i.shouldForwardProp;if(e.shouldForwardProp){var _=e.shouldForwardProp;h=function(t,e){return p(t,e)&&_(t,e)}}else h=p}var m=new Ba(n,f,o?i.componentStyle:void 0);function y(t,e){return function(t,e,n){var o=t.attrs,i=t.componentStyle,r=t.defaultProps,a=t.foldedComponentIds,c=t.styledComponentId,s=t.target,l=$o().useContext(Fa),d=ya(),u=t.shouldForwardProp||d.shouldForwardProp,f=function(t,e,n){return void 0===n&&(n=lr),t.theme!==n.theme&&t.theme||e||n.theme}(e,l,r)||lr,g=function(t,e,n){for(var o,i=ti(ti({},e),{className:void 0,theme:n}),r=0;r<t.length;r+=1){var a=Tr(o=t[r])?o(i):o;for(var c in a)i[c]="className"===c?Qr(i[c],a[c]):"style"===c?ti(ti({},i[c]),a[c]):a[c]}return e.className&&(i.className=Qr(i.className,e.className)),i}(o,e,f),h=g.as||s,p={};for(var _ in g)void 0===g[_]||"$"===_[0]||"as"===_||"theme"===_&&g.theme===f||("forwardedAs"===_?p.as=g.forwardedAs:u&&!u(_,h)||(p[_]=g[_]));var m=function(t,e){var n=ya();return t.generateAndInjectStyles(e,n.styleSheet,n.stylis)}(i,g),y=Qr(a,c);return m&&(y+=" "+m),g.className&&(y+=" "+g.className),p[Ar(h)&&!dr.has(h)?"class":"className"]=y,n&&(p.ref=n),(0,Zo.createElement)(h,p)}(L,t,e)}y.displayName=u;var L=$o().forwardRef(y);return L.attrs=g,L.componentStyle=m,L.displayName=u,L.shouldForwardProp=h,L.foldedComponentIds=o?Qr(i.foldedComponentIds,i.styledComponentId):"",L.styledComponentId=f,L.target=o?i.target:t,Object.defineProperty(L,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=o?function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var o=0,i=e;o<i.length;o++)Rr(t,i[o],!0);return t}({},i.defaultProps,t):t}}),qr(L,(function(){return".".concat(L.styledComponentId)})),r&&Mr(L,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),L}function ja(t,e){for(var n=[t[0]],o=0,i=e.length;o<i;o+=1)n.push(e[o],t[o+1]);return n}new Set;var Ua=function(t){return Object.assign(t,{isCss:!0})};function ka(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Tr(t)||Dr(t))return Ua(Ca(ja(sr,ei([t],e,!0))));var o=t;return 0===e.length&&1===o.length&&"string"==typeof o[0]?Ca(o):Ua(Ca(ja(o,e)))}function Ma(t,e,n){if(void 0===n&&(n=lr),!e)throw Gr(1,e);var o=function(o){for(var i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];return t(e,n,ka.apply(void 0,ei([o],i,!1)))};return o.attrs=function(o){return Ma(t,e,ti(ti({},n),{attrs:Array.prototype.concat(n.attrs,o).filter(Boolean)}))},o.withConfig=function(o){return Ma(t,e,ti(ti({},n),o))},o}var Ta,za,Qa,Na=function(t){return Ma(Pa,t)},Da=Na;function Ra(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}dr.forEach((function(t){Da[t]=Na(t)})),function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=va(t),la.registerId(this.componentId+1)}t.prototype.createStyles=function(t,e,n,o){var i=o(Nr(Ca(this.rules,e,n,o)),""),r=this.componentId+t;n.insertRules(r,r,i)},t.prototype.removeStyles=function(t,e){e.clearRules(this.componentId+t)},t.prototype.renderStyles=function(t,e,n,o){t>2&&la.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,o)}}(),function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString();if(!e)return"";var n=na(),o=Nr([n&&'nonce="'.concat(n,'"'),"".concat(er,'="true"'),"".concat(or,'="').concat(ir,'"')].filter(Boolean)," ");return"<style ".concat(o,">").concat(e,"</style>")},this.getStyleTags=function(){if(t.sealed)throw Gr(2);return t._emitSheetCSS()},this.getStyleElement=function(){var e;if(t.sealed)throw Gr(2);var n=t.instance.toString();if(!n)return[];var o=((e={})[er]="",e[or]=ir,e.dangerouslySetInnerHTML={__html:n},e),i=na();return i&&(o.nonce=i),[$o().createElement("style",ti({},o,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new la({isServer:!0}),this.sealed=!1}t.prototype.collectStyles=function(t){if(this.sealed)throw Gr(2);return $o().createElement(La,{sheet:this.instance},t)},t.prototype.interleaveWithNodeStream=function(t){throw Gr(3)}}(),"__sc-".concat(er,"__");const qa=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=Nr(ka.apply(void 0,ei([t],e,!1))),i=br(o);return new ba(i,o)}(Ta||(Ta=Ra(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))),Ga=Da.span(za||(za=Ra(["\n width: 16px;\n height: 16px;\n\n ","\n border-radius: 50%;\n display: inline-block;\n border-top: 2px solid #fff;\n border-right: 2px solid transparent;\n box-sizing: border-box;\n animation: "," 1s linear infinite;\n"])),(t=>"large"===t.size&&ka(Qa||(Qa=Ra(["\n width: 32px;\n height: 32px;\n "])))),qa);var Ka=i(74);const Va=t=>{let{className:e,size:n}=t;return(0,Ka.jsx)(Ga,{className:e,size:n})};var Ha,Ya,Ja,Wa,Xa,Za,$a;function tc(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const ec=Da.button(Ha||(Ha=tc(["\n font-family: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n font-size: 100%;\n font-weight: inherit;\n line-height: inherit;\n letter-spacing: inherit;\n color: inherit;\n margin: 0;\n padding: 6px 12px;\n position: relative;\n font-size: 14px;\n cursor: pointer;\n height: 40px;\n line-height: 16px;\n font-weight: 500;\n border-radius: 6px;\n border: 1px solid ",";\n color: ",";\n background-color: ",";\n\n ","\n\n ","\n\n ","\n\n\n ","\n"])),(t=>t.theme&&t.theme.primaryBorderColor),(t=>t.theme&&t.theme.primaryTextColor),(t=>t.theme.backgroundColor),(t=>"action"===t.appearance&&ka(Ya||(Ya=tc(["\n background-color: ",";\n border-color: ",";\n color: ",";\n "])),(t=>t.theme.buttonActionBackgroundColor),(t=>t.theme.buttonActionBorderColor),(t=>t.theme.buttonActionTextColor))),(t=>"small"===t.size&&ka(Ja||(Ja=tc(["\n height: 32px;\n font-size: 12px;\n padding: 4px 8px;\n line-height: 12px;\n "])))),(t=>t.disabled&&ka(Wa||(Wa=tc(["\n opacity: 0.5;\n cursor: not-allowed;\n color: ",";\n background-color: ",";\n "])),(t=>t.theme.additionalTextColor),(t=>t.theme.buttonDisabledBackgroundColor))),(t=>t.loading&&ka(Xa||(Xa=tc(["\n cursor: not-allowed;\n color: transparent !important;\n\n ","\n "])),!t.disabled&&ka(Za||(Za=tc(["\n &:hover {\n background-position: right top;\n }\n &:active {\n background-position: center center;\n transform: scale(1.01);\n }\n "])))))),nc=Da(Va)($a||($a=tc(["\n position: absolute;\n top: 50%;\n left: 50%;\n translate: -50% -50%;\n"]))),oc=t=>{let{children:e,onClick:n,className:o,size:i="default",disabled:r,appearance:a="default",loading:c}=t;return(0,Ka.jsxs)(ec,{size:i,onClick:r?void 0:n,className:o,disabled:r,loading:c,appearance:a,children:[c&&(0,Ka.jsx)(nc,{}),e]})};var ic;Da.svg(ic||(rc=["\n width: 16px;\n height: 16px;\n"],ac||(ac=rc.slice(0)),ic=Object.freeze(Object.defineProperties(rc,{raw:{value:Object.freeze(ac)}}))));var rc,ac,cc;Da.svg(cc||(cc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var sc;Da.svg(sc||(sc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var lc;Da.svg(lc||(lc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var dc;Da.svg(dc||(dc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var uc;const fc=Da.svg(uc||(uc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n color: ",";\n"])),(t=>t.theme.backgroundColor));var gc;const hc=Da.svg(gc||(gc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var pc;Da.svg(pc||(pc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var _c;Da.svg(_c||(_c=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 32px;\n height: 32px;\n"])));var mc;const yc=Da.svg(mc||(mc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n color: ",";\n"])),(t=>t.theme.primaryTextColor));var Lc;const bc=Da.svg(Lc||(Lc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"]))),Ac=t=>{let{className:e}=t;return(0,Ka.jsxs)(bc,{className:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#000",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ka.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Ka.jsx)("path",{d:"M12 16v-4"}),(0,Ka.jsx)("path",{d:"M12 8h.01"})]})};var wc;const Ic=Da.svg(wc||(wc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 24px;\n height: 24px;\n"]))),xc=t=>{let{className:e}=t;return(0,Ka.jsx)(Ic,{className:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Ka.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})})};var Cc;Da.svg(Cc||(Cc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var vc;Da.svg(vc||(vc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 16px;\n height: 16px;\n"])));var Ec;Da.svg(Ec||(Ec=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n width: 12px;\n height: 12px;\n"])));const Bc=t=>{let{className:e}=t;return(0,Ka.jsx)(fc,{className:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Ka.jsx)("path",{d:"M20 6 9 17l-5-5"})})},Fc=t=>{let{className:e}=t;return(0,Ka.jsxs)(hc,{className:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ka.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Ka.jsx)("polyline",{points:"12 6 12 12 16 14"})]})},Oc=t=>{let{className:e,onClick:n}=t;return(0,Ka.jsxs)(yc,{onClick:n,className:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ka.jsx)("path",{d:"m12 19-7-7 7-7"}),(0,Ka.jsx)("path",{d:"M19 12H5"})]})},Sc=t=>{let{className:e}=t;return(0,Ka.jsx)("svg",{className:e,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Ka.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.144225 0.144225C0.336519 -0.048075 0.648289 -0.048075 0.840589 0.144225L5.00002 4.30363L9.15945 0.144225C9.35175 -0.048075 9.66348 -0.048075 9.85577 0.144225C10.0481 0.336519 10.0481 0.648289 9.85577 0.840589L5.69641 5.00002L9.85577 9.15945C10.0481 9.35175 10.0481 9.66348 9.85577 9.85577C9.66348 10.0481 9.35175 10.0481 9.15945 9.85577L5.00002 5.69641L0.840589 9.85577C0.648289 10.0481 0.336519 10.0481 0.144225 9.85577C-0.048075 9.66348 -0.048075 9.35175 0.144225 9.15945L4.30363 5.00002L0.144225 0.840589C-0.048075 0.648289 -0.048075 0.336519 0.144225 0.144225Z",fill:"#686869"})})};var Pc;const jc=Da.h1(Pc||(Pc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n font-size: 16px;\n margin: 0;\n font-weight: 700;\n color: ",";\n"])),(t=>t.theme.primaryTextColor)),Uc=t=>{let{children:e,className:n}=t;return(0,Ka.jsx)(jc,{className:n,children:e})};var kc;const Mc=Da.h2(kc||(kc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n font-size: 14px;\n color: ",";\n margin: 0;\n font-weight: 500;\n"])),(t=>t.theme.secondaryTextColor));var Tc;const zc=Da.a(Tc||(Tc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n margin: 0;\n color: ",";\n font-size: 12px;\n line-height: 16px;\n text-decoration: none;\n"])),(t=>t.theme.primaryTextColor)),Qc=t=>{let{children:e,className:n,target:o,href:i}=t;return(0,Ka.jsx)(zc,{href:i,target:o,className:n,children:e})};var Nc;const Dc=Da.p(Nc||(Nc=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n margin: 0;\n color: ",";\n font-size: 14px;\n line-height: 120%;\n"])),(t=>t.theme.secondaryTextColor)),Rc=t=>{let{children:e,className:n,onClick:o}=t;return(0,Ka.jsx)(Dc,{className:n,onClick:o,children:e})};var qc,Gc,Kc,Vc,Hc,Yc,Jc;function Wc(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Xc=Da.div(qc||(qc=Wc(["\n padding: 16px;\n border-radius: 8px;\n font-size: 14px;\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n display: flex;\n svg {\n stroke: ",";\n }\n\n ","\n\n ","\n\n ","\n"])),(t=>t.theme.messageBackgroundColor),(t=>t.theme.primaryBorderColor),(t=>t.theme.primaryTextColor),(t=>t.theme.primaryTextColor),(t=>"error"===t.status&&ka(Gc||(Gc=Wc(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n svg {\n stroke: ",";\n path {\n stroke: ",";\n }\n }\n "])),(t=>t.theme.errorStatusBackgroundColor),(t=>t.theme.errorStatusBorderColor),(t=>t.theme.errorStatusTextColor),(t=>t.theme.errorStatusTextColor),(t=>t.theme.errorStatusTextColor))),(t=>"info"===t.status&&ka(Kc||(Kc=Wc(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n "])),(t=>t.theme.infoStatusBackgroundColor),(t=>t.theme.infoStatusBorderColor),(t=>t.theme.infoStatusTextColor))),(t=>"warning"===t.status&&ka(Vc||(Vc=Wc(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n\n svg {\n stroke: ",";\n path {\n stroke: ",";\n }\n }\n "])),(t=>t.theme.warningStatusBackgroundColor),(t=>t.theme.warningStatusBorderColor),(t=>t.theme.warningStatusTextColor),(t=>t.theme.warningStatusTextColor),(t=>t.theme.warningStatusTextColor)))),Zc=Da.div(Hc||(Hc=Wc(["\n font-size: 12px;\n flex: 1;\n"]))),$c=Da.h4(Yc||(Yc=Wc(["\n font-size: 14px;\n margin: 0 0 4px;\n"]))),ts=Da(Ac)(Jc||(Jc=Wc(["\n margin-right: 6px;\n"]))),es=t=>{let{children:e,className:n,status:o="default",title:i}=t;const r="warning"===o||"error"===o?(0,Ka.jsx)(ts,{}):null;return(0,Ka.jsxs)(Xc,{className:n,status:o,children:[r,(0,Ka.jsxs)(Zc,{children:[i&&(0,Ka.jsx)($c,{children:i}),e]})]})};var ns,os,is,rs;function as(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const cs=Da.div(ns||(ns=as(["\n display: inline-block;\n padding: 2px 8px;\n border-radius: 999px;\n line-height: 16px;\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n font-size: 12px;\n font-weight: 500;\n\n ","\n\n ","\n\n ","\n"])),(t=>t.theme.defaultStatusBackgroundColor),(t=>t.theme.defaultStatusBorderColor),(t=>t.theme.primaryTextColor),(t=>"info"===t.status&&ka(os||(os=as(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n "])),(t=>t.theme.infoStatusBackgroundColor),(t=>t.theme.infoStatusBorderColor),(t=>t.theme.infoStatusTextColor))),(t=>"success"===t.status&&ka(is||(is=as(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n "])),(t=>t.theme.successStatusBackgroundColor),(t=>t.theme.successStatusBorderColor),(t=>t.theme.successStatusTextColor))),(t=>"error"===t.status&&ka(rs||(rs=as(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n "])),(t=>t.theme.errorStatusBackgroundColor),(t=>t.theme.errorStatusBorderColor),(t=>t.theme.errorStatusTextColor)))),ss=t=>{let{children:e,className:n,status:o="default"}=t;return(0,Ka.jsx)(cs,{className:n,status:o,children:e})};var ls,ds,us,fs,gs,hs,ps,_s,ms;function ys(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function Ls(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}Da.div(ls||(ls=ys(["\n height: 8px;\n border-radius: 999px;\n overflow: hidden;\n position: relative;\n background: ",";\n"])),(t=>t.theme.blankColor)),Da.div(ds||(ds=ys(["\n position: absolute;\n top: 0;\n background: ",";\n left: 0;\n border-radius: 2px;\n height: 100%;\n"])),(t=>t.theme.primaryTextColor)),Da.div(us||(us=ys([""]))),Da.div(fs||(fs=ys(["\n display: flex;\n justify-content: space-between;\n margin-bottom: 3px;\n"]))),Da.span(gs||(gs=ys(["\n color: ",";\n font-size: 12px;\n"])),(t=>t.theme.secondaryTextColor));const bs=Da.div(hs||(hs=Ls(["\n display: flex;\n align-items: center;\n text-align: left;\n cursor: pointer;\n"]))),As=Da.div(ps||(ps=Ls(["\n display: flex;\n align-items: center;\n min-width: 16px;\n justify-content: center;\n height: 16px;\n border-radius: 4px;\n background-color: ",";\n\n ","\n"])),(t=>t.theme.primaryBorderColor),(t=>t.checked&&ka(_s||(_s=Ls(["\n background-color: ",";\n "])),t.theme.buttonActionBackgroundColor))),ws=Da.h3(ms||(ms=Ls(["\n font-size: 12px;\n font-weight: 400;\n margin: 0 0 0 6px;\n"])));var Is,xs,Cs,vs,Es,Bs,Fs,Os,Ss,Ps,js,Us,ks,Ms;function Ts(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const zs=Da.div(Is||(Is=Ts(["\n padding: 12px;\n border-radius: 8px;\n\n background-color: ",";\n border: 1px solid ",";\n\n ","\n\n ","\n"])),(t=>t.theme.defaultStatusBackgroundColor),(t=>t.theme.defaultStatusBorderColor),(t=>"completed"===t.status&&ka(xs||(xs=Ts(["\n background-color: ",";\n border: 1px solid ",";\n "])),(t=>t.theme.successStatusBackgroundColor),(t=>t.theme.successStatusBorderColor))),(t=>("pending"===t.status||"scheduled"===t.status)&&ka(Cs||(Cs=Ts(["\n background-color: ",";\n border: 1px solid ",";\n "])),(t=>t.theme.pendingStatusBackgroundColor),(t=>t.theme.pendingStatusBorderColor)))),Qs=Da((t=>{let{title:e,checked:n,onClick:o,disabled:i,className:r}=t;return(0,Ka.jsxs)(bs,{className:r,children:[(0,Ka.jsx)(As,{checked:n,onClick:()=>{i||o&&o(!n)},children:n&&(0,Ka.jsx)(Bc,{})}),e&&(0,Ka.jsx)(ws,{children:e})]})}))(vs||(vs=Ts([""]))),Ns=Da.h3(Es||(Es=Ts(["\n font-size: 14px;\n font-weight: 500;\n color: ",";\n margin: 0;\n"])),(t=>t.theme.primaryTextColor)),Ds=Da.h4(Bs||(Bs=Ts(["\n font-size: 12px;\n font-weight: 400;\n color: ",";\n margin: 0;\n"])),(t=>t.theme.secondaryTextColor)),Rs=Da.img(Fs||(Fs=Ts(["\n width: 16px;\n height: 16px;\n display: block;\n object-fit: cover;\n object-position: center;\n"]))),qs=Da.div(Os||(Os=Ts(["\n width: 30px;\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n border: 1px solid ",";\n border-radius: 6px;\n"])),(t=>t.theme.backgroundColor),(t=>t.theme.primaryBorderColor)),Gs=Da.div(Ss||(Ss=Ts([""]))),Ks=Da.ul(Ps||(Ps=Ts(["\n margin: 4px 0 0;\n padding: 0 0 0 10px;\n"]))),Vs=Da.li(js||(js=Ts([""]))),Hs=Da.div(Us||(Us=Ts(["\n display: grid;\n grid-template-columns: 30px 1fr max-content;\n gap: 10px;\n align-items: center;\n\n ","\n"])),(t=>t.selectable&&ka(ks||(ks=Ts(["\n grid-template-columns: min-content 30px 1fr max-content;\n "]))))),Ys=Da.div(Ms||(Ms=Ts(["\n color: ",";\n padding-top: 10px;\n padding-left: 40px;\n"])),(t=>t.theme.secondaryTextColor)),Js=t=>{let{status:e,children:n,icon:o,title:i,description:r,selectable:a,selected:c,onSelect:s,groups:l,id:d}=t;const u=(t=>t&&1!==t.length?t.map((t=>{const e=t.checks;return e?"".concat(e[0].value,"+: ").concat(t.points," pts."):""})).filter((t=>t)):null)(l);return(0,Ka.jsxs)(zs,{status:e,children:[(0,Ka.jsxs)(Hs,{selectable:a,children:[a&&(0,Ka.jsx)(Qs,{checked:Boolean(c),onClick:s,id:d}),(0,Ka.jsx)(qs,{children:(0,Ka.jsx)(Rs,{src:o})}),(0,Ka.jsxs)(Gs,{children:[(0,Ka.jsx)(Ns,{children:i}),(0,Ka.jsx)(Ds,{children:r})]}),n]}),u&&(0,Ka.jsxs)(Ys,{children:["Tiers:",(0,Ka.jsx)(Ks,{children:u.reverse().map((t=>(0,Ka.jsx)(Vs,{children:t})))})]})]})};var Ws;const Xs=Da.div(Ws||(Ws=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n justify-self: end;\n display: flex;\n gap: 4px;\n align-items: center;\n"]))),Zs=async()=>{const t="0x0b2Ab187a6FD2d2F05fACc158611838c284E3a9c",e="84532",n="testnet";return console.log({REGISTRY:t,CHAIN_ID:e,EXTENSION_MODE:n}),{REGISTRY:t,CHAIN_ID:e,EXTENSION_MODE:n}},$s=async(t,e,n,o)=>{const i=await Zs(),r=Yo(i.CHAIN_ID),a=Ho({identity_commitment:e,semaphore_group_id:n,fetch_proofs:o});return Vo("".concat(t,"/v1/indexer/").concat(r,"/proofs?").concat(a),"GET",{Authorization:"Bearer ".concat(To)})},tl=async(t,e,n,o,i,r)=>{const a=await Zs(),c=Yo(a.CHAIN_ID);return Vo("".concat(t,"/v1/task-manager/").concat(c,"/verification/tasks"),"POST",{Authorization:"Bearer ".concat(To)},{registry:e,credential_group_id:n,id_hash:o,identity_commitment:i,verifier_signature:r})};var el=i(614),nl=i(368),ol=i(514);let il=function(t){t()};const rl=()=>il,al=Symbol.for("react-redux-context"),cl="undefined"!=typeof globalThis?globalThis:{};function sl(){var t;if(!Zo.createContext)return{};const e=null!=(t=cl[al])?t:cl[al]=new Map;let n=e.get(Zo.createContext);return n||(n=Zo.createContext(null),e.set(Zo.createContext,n)),n}const ll=sl();function dl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ll;return function(){return(0,Zo.useContext)(t)}}const ul=dl();let fl=()=>{throw new Error("uSES not initialized!")};const gl=(t,e)=>t===e;function hl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ll;const e=t===ll?ul:dl(t);return function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{equalityFn:o=gl,stabilityCheck:i,noopCheck:r}="function"==typeof n?{equalityFn:n}:n,{store:a,subscription:c,getServerState:s,stabilityCheck:l,noopCheck:d}=e(),u=((0,Zo.useRef)(!0),(0,Zo.useCallback)({[t.name]:e=>t(e)}[t.name],[t,l,i])),f=fl(c.addNestedSub,a.getState,s||a.getState,u,o);return(0,Zo.useDebugValue)(f),f}}const pl=hl();i(416),i(409);const _l={notify(){},get:()=>[]};const ml="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?Zo.useLayoutEffect:Zo.useEffect;let yl=null;const Ll=function(t){let{store:e,context:n,children:o,serverState:i,stabilityCheck:r="once",noopCheck:a="once"}=t;const c=Zo.useMemo((()=>{const t=function(t,e){let n,o=_l,i=0,r=!1;function a(){l.onStateChange&&l.onStateChange()}function c(){i++,n||(n=e?e.addNestedSub(a):t.subscribe(a),o=function(){const t=rl();let e=null,n=null;return{clear(){e=null,n=null},notify(){t((()=>{let t=e;for(;t;)t.callback(),t=t.next}))},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(t){let o=!0,i=n={callback:t,next:null,prev:n};return i.prev?i.prev.next=i:e=i,function(){o&&null!==e&&(o=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}())}function s(){i--,n&&0===i&&(n(),n=void 0,o.clear(),o=_l)}const l={addNestedSub:function(t){c();const e=o.subscribe(t);let n=!1;return()=>{n||(n=!0,e(),s())}},notifyNestedSubs:function(){o.notify()},handleChangeWrapper:a,isSubscribed:function(){return r},trySubscribe:function(){r||(r=!0,c())},tryUnsubscribe:function(){r&&(r=!1,s())},getListeners:()=>o};return l}(e);return{store:e,subscription:t,getServerState:i?()=>i:void 0,stabilityCheck:r,noopCheck:a}}),[e,i,r,a]),s=Zo.useMemo((()=>e.getState()),[e]);ml((()=>{const{subscription:t}=c;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),s!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[c,s]);const l=n||ll;return Zo.createElement(l.Provider,{value:c},o)};function bl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ll;const e=t===ll?ul:dl(t);return function(){const{store:t}=e();return t}}const Al=bl();function wl(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ll;const e=t===ll?Al:bl(t);return function(){return e().dispatch}}const Il=wl();var xl,Cl;function vl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function El(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vl(Object(n),!0).forEach((function(e){Bl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Bl(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}xl=nl.useSyncExternalStoreWithSelector,fl=xl,(t=>{yl=t})(el.useSyncExternalStore),Cl=ol.unstable_batchedUpdates,il=Cl;var Fl=function(t){return t["/verifications/addVerification"]="/verifications/addVerification",t["/verifications/addVerifications"]="/verifications/addVerifications",t["/verifications/setLoading"]="/verifications/setLoading",t}(Fl||{});const Ol={verifications:[],loading:!1},Sl=t=>({type:Fl["/verifications/addVerification"],payload:t}),Pl=t=>({type:Fl["/verifications/addVerifications"],payload:t}),jl=()=>pl((t=>t.verifications));var Ul=i(495),kl=i.n(Ul);function Ml(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Tl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ml(Object(n),!0).forEach((function(e){zl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ml(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function zl(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ql=function(t){return t["/modal/setIsOpen"]="/modal/setIsOpen",t["/modal/setLoading"]="/modal/setLoading",t}(Ql||{});const Nl={isOpen:!1,loading:!1},Dl=t=>({type:Ql["/modal/setLoading"],payload:t}),Rl=t=>{let{title:e,groups:n,icon:o,description:i,status:r,id:a,userKey:c}=t;const s=Il(),l=((t,e,n,o)=>{switch(t){case"default":const t=(t=>{if(0===t.length)return null;if(1===t.length)return"".concat(t[0].points," pts.");const e=t.reduce(((t,e)=>(t<e.points&&(t=e.points),t)),0);return"up to ".concat(e," pts.")})(e);return(0,Ka.jsxs)(Ka.Fragment,{children:[(0,Ka.jsxs)(ss,{status:"info",children:["+",t]}),(0,Ka.jsx)(oc,{appearance:"action",size:"small",onClick:async()=>{try{const t=await Zs(),e=No(!0).find((t=>t.id===n)),i=null==e?void 0:e.groups[0];if(i){const e=ko(o,null==i?void 0:i.credentialGroupId),n={registry:t.REGISTRY,credential_group_id:null==i?void 0:i.credentialGroupId,semaphore_identity_commitment:String(e.commitment),origin:window.location.origin},r=Ho({state:btoa(JSON.stringify(n))});if(Dl(!0),!window.open("".concat(Qo,"/auth/github/login?").concat(r),"oauth","width=400,height=600,popup=yes"))throw Dl(!1),new Error("Popup blocked");const a=async n=>{var o,r,c;if(console.log({event:n,AUTH_DOMAIN:Qo}),n.origin===Qo){if("AUTH_SUCCESS"===(null===(o=n.data)||void 0===o?void 0:o.type)){const{signature:o,verifier_hash:r,verifier_message:{id_hash:l}}=n.data.payload;window.removeEventListener("message",a);const{task:d,success:u}=await tl(zo,t.REGISTRY,null==i?void 0:i.credentialGroupId,l,String(e.commitment),o);u&&(Dl(!1),c={status:"scheduled",scheduledTime:d.scheduled_time,taskId:d.id,credentialGroupId:null==i?void 0:i.credentialGroupId,fetched:!1},s(Sl(c))),console.log({task:d})}if("AUTH_ERROR"===(null===(r=n.data)||void 0===r?void 0:r.type))throw Dl(!1),window.removeEventListener("message",a),new Error(n.data.error)}};window.addEventListener("message",a)}}catch(t){Dl(!1),alert(t.message)}},children:"Verify"})]});case"pending":case"scheduled":return(0,Ka.jsx)(Fc,{});default:return(0,Ka.jsx)(Bc,{})}})(r,n,a,c);return(0,Ka.jsx)(Js,{status:r,selectable:!1,title:e,description:i,icon:o,id:a,groups:n,children:(0,Ka.jsx)(Xs,{children:l})})};var ql,Gl,Kl,Vl,Hl,Yl,Jl,Wl,Xl;function Zl(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}Da.div(ql||(ql=Zl(["\n padding: 12px;\n border-radius: 8px;\n display: grid;\n grid-template-columns: 30px 1fr max-content;\n gap: 10px;\n align-items: center;\n background-color: ",";\n border: 1px solid ",";\n\n ","\n\n ","\n"])),(t=>t.theme.defaultStatusBackgroundColor),(t=>t.theme.defaultStatusBorderColor),(t=>"completed"===t.status&&ka(Gl||(Gl=Zl(["\n background-color: ",";\n border: 1px solid ",";\n "])),(t=>t.theme.successStatusBackgroundColor),(t=>t.theme.successStatusBorderColor))),(t=>("pending"===t.status||"scheduled"===t.status)&&ka(Kl||(Kl=Zl(["\n background-color: ",";\n border: 1px solid ",";\n "])),(t=>t.theme.pendingStatusBackgroundColor),(t=>t.theme.pendingStatusBorderColor)))),Da.div(Vl||(Vl=Zl(["\n width: 30px;\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: ",";\n border: 1px solid ",";\n border-radius: 6px;\n"])),(t=>t.theme.backgroundColor),(t=>t.theme.primaryBorderColor)),Da.h3(Hl||(Hl=Zl(["\n font-size: 14px;\n font-weight: 500;\n color: ",";\n margin: 0;\n"])),(t=>t.theme.primaryTextColor)),Da.h4(Yl||(Yl=Zl(["\n font-size: 12px;\n font-weight: 400;\n color: ",";\n margin: 0;\n"])),(t=>t.theme.secondaryTextColor)),Da.div(Jl||(Jl=Zl([""])));const $l=Da.div(Wl||(Wl=Zl(["\n justify-self: end;\n display: flex;\n gap: 4px;\n align-items: center;\n"]))),td=(Da.img(Xl||(Xl=Zl(["\n width: 16px;\n height: 16px;\n display: block;\n object-fit: cover;\n object-position: center;\n"]))),t=>{let{title:e,taskId:n,points:o,icon:i,description:r,scheduledTime:a,status:c,selectable:s,selected:l,onSelect:d,credentialGroupId:u,fetched:f}=t;const[g,h]=(0,Zo.useState)(null);(0,Zo.useEffect)((()=>{const t=window.setInterval((async()=>{const t=+new Date,e=a-t;h(e<=0?0:e)}),1e3);return()=>{window.clearInterval(t)}}),[]);const p=((t,e,o,i)=>{switch(t){case"default":return(0,Ka.jsxs)(ss,{status:"default",children:[e," pts"]});case"pending":return(0,Ka.jsx)(Fc,{});case"scheduled":return(0,Ka.jsxs)(Ka.Fragment,{children:[(0,Ka.jsx)(Fc,{}),Wo(o||0)," left"]});case"completed":return i?null:(0,Ka.jsxs)(Ka.Fragment,{children:[(0,Ka.jsxs)(ss,{status:"info",children:["+",e]}),(0,Ka.jsx)(oc,{onClick:async()=>{if(!n)return alert("taskId not defined")},size:"small",children:"Check TX"})]});default:return(0,Ka.jsx)(Bc,{})}})(c,o,g,f);return(0,Ka.jsx)(Js,{status:c,selectable:s,title:e,description:r,icon:i,selected:l,onSelect:d,id:u,children:(0,Ka.jsx)($l,{children:p})})});var ed,nd,od;function id(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const rd=Da.div(ed||(ed=id(["\n padding: 16px;\n border: 1px solid ",";\n border-radius: 8px;\n background-color: ",";\n width: 100%;\n font-size: 14px;\n\n ","\n\n ","\n"])),(t=>t.theme.primaryBorderColor),(t=>t.theme.messageBackgroundColor),(t=>"error"===t.status&&ka(nd||(nd=id(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n "])),(t=>t.theme.errorStatusBackgroundColor),(t=>t.theme.errorStatusBorderColor),(t=>t.theme.errorStatusTextColor))),(t=>"warning"===t.status&&ka(od||(od=id(["\n background-color: ",";\n border: 1px solid ",";\n color: ",";\n "])),(t=>t.theme.warningStatusBackgroundColor),(t=>t.theme.warningStatusBorderColor),(t=>t.theme.warningStatusTextColor))));var ad,cd,sd;function ld(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const dd=Da.div(ad||(ad=ld(["\n width: 58px;\n min-height: 58px;\n border: 1px solid ",";\n border-radius: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n\n ","\n"])),(t=>t.theme.secondaryBorderColor),(t=>"error"===t.status&&ka(cd||(cd=ld(["\n border: 1px solid ",";\n background-color: ",";\n "])),(t=>t.theme.errorStatusBorderColor),(t=>t.theme.errorStatusBackgroundColor)))),ud=Da.img(sd||(sd=ld(["\n min-width: 25px;\n max-width: 25px;\n height: 25px;\n display: block;\n object-fit: cover;\n object-position: center;\n"]))),fd=t=>t?"string"==typeof t?(0,Ka.jsx)(ud,{src:t}):t:null;var gd,hd,pd,_d,md,yd,Ld,bd,Ad;function wd(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function Id(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}Da.ul(gd||(gd=wd(["\n margin: 0;\n padding-left: 20px;\n"]))),Da.li(hd||(hd=wd(["\n margin: 0 0 8px;\n"]))),Da.div(pd||(pd=Id([""]))),Da.h4(_d||(_d=Id(["\n color: ",";\n font-size: 12px;\n margin: 0;\n font-weight: 400;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 4px;\n"])),(t=>t.theme.secondaryTextColor)),Da.div(md||(md=Id(["\n padding: 12px 0 0;\n display: none;\n\n ","\n"])),(t=>t.expanded&&ka(yd||(yd=Id(["\n display: block;\n "]))))),Da.span(Ld||(Ld=Id(["\n transition: rotate 0.3s;\n ","\n"])),(t=>t.expanded&&ka(bd||(bd=Id(["\n rotate: 90deg;\n "])))));const xd=Da.div(Ad||(Ad=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n border-radius: 8px;\n width: 32px;\n height: 32px;\n background-color: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"])),(t=>t.theme.secondaryBackgroundColor));var Cd,vd,Ed,Bd,Fd;function Od(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Sd=Da.div(Cd||(Cd=Od(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.3);\n width: 100%;\n height: 100%;\n z-index: 100;\n display: flex;\n align-items: center;\n justify-content: center;\n backdrop-filter: blur(2px);\n box-sizing: border-box;\n"]))),Pd=Da.div(vd||(vd=Od(["\n max-width: 680px;\n position: relative;\n width: 100%;\n background: ",";\n border-radius: 20px;\n border: 1px solid ",";\n padding: 16px;\n\n @media (max-width: ",") {\n padding: 40px 25px;\n }\n"])),(t=>t.theme&&t.theme.widgetBackgroundColor),(t=>t.theme&&t.theme.primaryBorderColor),(t=>t.theme.mobileBreakpoint)),jd=Da.h3(Ed||(Ed=Od(["\n margin: 0 0 20px;\n font-size: 32px;\n font-weight: 700;\n text-align: center;\n color: ",";\n"])),(t=>t.theme.primaryTextColor)),Ud=Da.div(Bd||(Bd=Od(["\n margin: 0 auto 20px;\n display: flex;\n justify-content: center;\n"]))),kd=Da((t=>{let{className:e,onClick:n}=t;return(0,Ka.jsx)(xd,{className:e,onClick:n,children:(0,Ka.jsx)(Sc,{})})}))(Fd||(Fd=Od(["\n position: absolute;\n right: 20px;\n top: 20px;\n"]))),Md=t=>{let{title:e,onClose:n,children:o,className:i,dialogClassName:r,icon:a}=t;return(0,Ka.jsx)(Sd,{onClick:t=>{t.target===t.currentTarget&&n&&n()},className:i,children:(0,Ka.jsxs)(Pd,{className:r,children:[(0,Ka.jsx)(kd,{onClick:n}),a&&(0,Ka.jsx)(Ud,{children:a}),e&&(0,Ka.jsx)(jd,{children:e}),o]})})};var Td,zd,Qd;function Nd(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Dd=Da(Md)(Td||(Td=Nd(["\n ","\n"])),(t=>!t.visible&&ka(zd||(zd=Nd(["\n opacity: 0;\n pointer-events: none;\n "]))))),Rd=Da.iframe(Qd||(Qd=Nd(["\n width: 100%;\n height: 500px;\n border: none;\n overflow: auto;\n"]))),qd={primaryTextColor:"rgb(3, 7, 18)",primaryBackgroundColor:"rgb(253, 254, 255)",secondaryBackgroundColor:"rgb(250, 250, 250)",mobileBreakpoint:"600px",primaryBorderColor:"rgb(229, 231, 235)",secondaryBorderColor:"rgb(229, 231, 235)",widgetBackgroundColor:"#FFF",backgroundColor:"rgb(255, 255, 255)",secondaryTextColor:"rgb(115, 115, 115)",blankColor:"rgb(245, 245, 245)",overlayBackgroundColor:"rgba(255, 255, 255, .9)",messageBackgroundColor:"rgba(244, 244, 245, 0.3)",additionalTextColor:"rgb(156, 163, 175)",buttonActionTextColor:"#FFF",successStatusBorderColor:"rgb(187, 247, 208)",successStatusBackgroundColor:"rgb(240, 253, 244)",successStatusTextColor:"rgb(22, 163, 74)",errorStatusBackgroundColor:"rgb(254, 242, 242)",errorStatusBorderColor:"rgb(254, 202, 202)",errorStatusTextColor:"rgb(153, 27, 27)",buttonDisabledBackgroundColor:"rgb(229, 231, 235)",warningStatusBackgroundColor:"rgb(254, 252, 232)",warningStatusBorderColor:"rgb(254, 240, 138)",warningStatusTextColor:"rgb(180, 83, 9)",infoStatusBorderColor:"rgb(191, 219, 254)",infoStatusBackgroundColor:"rgb(239, 246, 255)",infoStatusTextColor:"rgb(29, 78, 216)",defaultStatusBackgroundColor:"rgb(255, 255, 255)",defaultStatusBorderColor:"rgb(229, 231, 235)",pendingStatusBackgroundColor:"rgb(254, 252, 232)",pendingStatusBorderColor:"rgb(254, 240, 138)",buttonActionBackgroundColor:"#000",buttonActionBackgroundHoverColor:"#000",buttonActionBackgroundActiveColor:"#000",buttonActionBorderHoverColor:"transparent",buttonActionBorderActiveColor:"transparent",buttonActionBorderColor:"transparent"},Gd=t=>{let{visible:e,setVisible:n,iframeOnLoad:o,onLogin:i,onLogout:r,connectUrl:a="https://connect.bringid.org"}=t;const c=(0,Zo.useRef)(null);!function(t,e,n,o){(0,Zo.useEffect)((()=>{function i(i){const r=i.origin,a=i.data;if(console.log("useMessageProxy: ",{data:a,fromOrigin:r}),r!==window.location.origin){if(r===e)return console.log("fromOrigin === connectUrl: ",{data:a}),"LOGIN"===a.type?void(n&&n()):"LOGOUT"===a.type?void(o&&o()):void window.postMessage(a,window.location.origin)}else{var c;if(!t.current)return;null===(c=t.current.contentWindow)||void 0===c||c.postMessage(a,e)}}return window.addEventListener("message",i),()=>window.removeEventListener("message",i)}),[])}(c,a,i,r);const s="undefined"==typeof window?"":"".concat(a,"?url=").concat(encodeURIComponent(window.location.href));return(0,Ka.jsx)(Oa,{theme:qd,children:(0,Ka.jsx)(Dd,{visible:e,onClose:()=>n(!1),children:(0,Ka.jsx)(Rd,{ref:c,src:s,onLoad:o})})})},Kd=class{constructor(){this.isExtensionInstalled=()=>new Promise(((t,e)=>{setTimeout((()=>{console.log("SDK::",{window});const e=window.bringID;t(Boolean(e))}),1500)})),this.requestProofs=async t=>{let{drop:e,address:n,pointsRequired:o}=t;try{return window.postMessage({type:"PING"}),window.postMessage({type:"REQUEST_PROOFS",host:window.location.host,dropAddress:e,pointsRequired:o,address:n},"*"),new Promise(((t,e)=>{const n=e=>{switch(e.data.type){case"RECEIVE_PROOFS":t({proofs:e.data.data.proofs,points:e.data.data.points}),window.removeEventListener("message",n);break;case"PROOFS_REJECTED":t({proofs:null,points:0})}};window.addEventListener("message",n)}))}catch(t){return console.log({error:t}),{proofs:null,points:0}}}}};function Vd(t){return Vd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vd(t)}function Hd(t,e,n){return(e=function(t){var e=function(t){if("object"!=Vd(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vd(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vd(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Jd(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Yd(Object(n),!0).forEach((function(e){Hd(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yd(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Wd(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Xd="function"==typeof Symbol&&Symbol.observable||"@@observable",Zd=function(){return Math.random().toString(36).substring(7).split("").join(".")},$d={INIT:"@@redux/INIT"+Zd(),REPLACE:"@@redux/REPLACE"+Zd(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Zd()}};function tu(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function eu(t){return function(e){var n=e.dispatch,o=e.getState;return function(e){return function(i){return"function"==typeof i?i(n,o,t):e(i)}}}}var nu=eu();nu.withExtraArgument=eu;const ou=nu;function iu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function ru(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?iu(Object(n),!0).forEach((function(e){au(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):iu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function au(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}i(966);var cu=function(t){return t["/user/setKey"]="/user/setKey",t["/user/setId"]="/user/setId",t["/user/setUser"]="/user/setUser",t["/user/setLoading"]="/user/setLoading",t["/user/setAddress"]="/user/setAddress",t["/user/setApiKey"]="/user/setApiKey",t["/user/destroy"]="/user/destroy",t}(cu||{});const su={key:null,id:null,address:null,loading:!1,apiKey:null},lu=()=>pl((t=>t.user),kl());function du(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function uu(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?du(Object(n),!0).forEach((function(e){fu(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):du(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function fu(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var gu=function(t){return t["/requestProofs/registerRequest"]="/requestProofs/registerRequest",t["/requestProofs/showRequest"]="/requestProofs/showRequest",t["/requestProofs/resetRequest"]="/requestProofs/resetRequest",t}(gu||{});const hu={pointsRequired:null,dropAddress:null,isOpen:!1},pu=t=>({type:gu["/requestProofs/showRequest"],payload:t}),_u=function(t){for(var e=Object.keys(t),n={},o=0;o<e.length;o++){var i=e[o];"function"==typeof t[i]&&(n[i]=t[i])}var r,a=Object.keys(n);try{!function(t){Object.keys(t).forEach((function(e){var n=t[e];if(void 0===n(void 0,{type:$d.INIT}))throw new Error(Wd(12));if(void 0===n(void 0,{type:$d.PROBE_UNKNOWN_ACTION()}))throw new Error(Wd(13))}))}(n)}catch(t){r=t}return function(t,e){if(void 0===t&&(t={}),r)throw r;for(var o=!1,i={},c=0;c<a.length;c++){var s=a[c],l=n[s],d=t[s],u=l(d,e);if(void 0===u)throw e&&e.type,new Error(Wd(14));i[s]=u,o=o||u!==d}return(o=o||a.length!==Object.keys(t).length)?i:t}}({user:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:su,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case cu["/user/setKey"]:return console.log("KEY UPDATING"),ru(ru({},t),{},{key:e.payload});case cu["/user/setUser"]:return e.payload;case cu["/user/destroy"]:return t;case cu["/user/setId"]:return ru(ru({},t),{},{id:e.payload});case cu["/user/setLoading"]:return ru(ru({},t),{},{loading:e.payload});case cu["/user/setApiKey"]:return ru(ru({},t),{},{apiKey:e.payload});case cu["/user/setAddress"]:return ru(ru({},t),{},{address:e.payload});default:return t}},verifications:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ol,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Fl["/verifications/addVerification"]:if(t.verifications.find((t=>t.credentialGroupId))){const n=t.verifications.map((t=>t.credentialGroupId===e.payload.credentialGroupId?e.payload:t));return El(El({},t),{},{verifications:n})}return El(El({},t),{},{verifications:[e.payload,...t.verifications]});case Fl["/verifications/addVerifications"]:return El(El({},t),{},{verifications:e.payload});case Fl["/verifications/setLoading"]:return El(El({},t),{},{loading:e.payload});default:return t}},modal:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Nl,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ql["/modal/setIsOpen"]:return Tl(Tl({},t),{},{isOpen:e.payload});case Ql["/modal/setLoading"]:return Tl(Tl({},t),{},{loading:e.payload});default:return t}},requestProofs:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hu,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case gu["/requestProofs/registerRequest"]:return uu(uu({},t),{},{pointsRequired:e.payload.pointsRequired,dropAddress:e.payload.dropAddress});case gu["/requestProofs/showRequest"]:return uu(uu({},t),{},{isOpen:e.payload});case gu["/requestProofs/resetRequest"]:return uu({},t);default:return t}}}),mu=function t(e,n,o){var i;if("function"==typeof n&&"function"==typeof o||"function"==typeof o&&"function"==typeof arguments[3])throw new Error(Wd(0));if("function"==typeof n&&void 0===o&&(o=n,n=void 0),void 0!==o){if("function"!=typeof o)throw new Error(Wd(1));return o(t)(e,n)}if("function"!=typeof e)throw new Error(Wd(2));var r=e,a=n,c=[],s=c,l=!1;function d(){s===c&&(s=c.slice())}function u(){if(l)throw new Error(Wd(3));return a}function f(t){if("function"!=typeof t)throw new Error(Wd(4));if(l)throw new Error(Wd(5));var e=!0;return d(),s.push(t),function(){if(e){if(l)throw new Error(Wd(6));e=!1,d();var n=s.indexOf(t);s.splice(n,1),c=null}}}function g(t){if(!function(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t))throw new Error(Wd(7));if(void 0===t.type)throw new Error(Wd(8));if(l)throw new Error(Wd(9));try{l=!0,a=r(a,t)}finally{l=!1}for(var e=c=s,n=0;n<e.length;n++)(0,e[n])();return t}return g({type:$d.INIT}),(i={dispatch:g,subscribe:f,getState:u,replaceReducer:function(t){if("function"!=typeof t)throw new Error(Wd(10));r=t,g({type:$d.REPLACE})}})[Xd]=function(){var t,e=f;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(Wd(11));function n(){t.next&&t.next(u())}return n(),{unsubscribe:e(n)}}})[Xd]=function(){return this},t},i}(_u,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),o=function(){throw new Error(Wd(15))},i={getState:n.getState,dispatch:function(){return o.apply(void 0,arguments)}},r=e.map((function(t){return t(i)}));return o=tu.apply(void 0,r)(n.dispatch),Jd(Jd({},n),{},{dispatch:o})}}}(ou)),yu=mu;var Lu,bu,Au,wu=i(72),Iu=i.n(wu),xu=i(825),Cu=i.n(xu),vu=i(659),Eu=i.n(vu),Bu=i(56),Fu=i.n(Bu),Ou=i(540),Su=i.n(Ou),Pu=i(113),ju=i.n(Pu),Uu=i(35),ku={};function Mu(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}ku.styleTagTransform=ju(),ku.setAttributes=Fu(),ku.insert=Eu().bind(null,"head"),ku.domAPI=Cu(),ku.insertStyleElement=Su(),Iu()(Uu.A,ku),Uu.A&&Uu.A.locals&&Uu.A.locals;const Tu="DialogWindowClassName",zu=Da(Md)(Lu||(Lu=Mu(["\n\n ","\n"])),(t=>!t.visible&&ka(bu||(bu=Mu(["\n opacity: 0;\n pointer-events: none;\n "]))))),Qu=Da.div(Au||(Au=Mu(["\n ."," {\n position: relative;\n width: 400px;\n padding: 8px;\n border-radius: 8px;\n height: 600px;\n }\n"])),Tu);var Nu,Du,Ru,qu,Gu,Ku,Vu,Hu,Yu;function Ju(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Wu=Da(Uc)(Nu||(Nu=Ju([""]))),Xu=Da.header(Du||(Du=Ju(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 0 16px;\n border-bottom: 1px solid ",";\n margin-bottom: 16px;\n"])),(t=>t.theme.primaryBorderColor)),Zu=(Da.span(Ru||(Ru=Ju(["\n color: ",";\n text-transform: capitalize;\n"])),(t=>t.theme.successStatusTextColor)),Da(oc)(qu||(qu=Ju(["\n margin-left: auto;\n"])))),$u=Da.div(Gu||(Gu=Ju(["\n display: flex;\n align-items: center;\n width: 100%;\n"]))),tf=Da.div(Ku||(Ku=Ju([""]))),ef=Da.div(Vu||(Vu=Ju(["\n font-size: 14px;\n display: flex;\n align-items: center;\n gap: 8px;\n color: ",";\n"])),(t=>t.theme.secondaryTextColor)),nf=Da.span(Hu||(Hu=Ju(["\n color: ",";\n font-weight: 700;\n"])),(t=>t.theme.primaryTextColor)),of=Da(Rc)(Yu||(Yu=Ju(["\n font-size: 12px;\n"]))),rf=(t,e,n)=>{const o=Il();return t&&n?(0,Ka.jsxs)($u,{children:[(0,Ka.jsxs)(tf,{children:[(0,Ka.jsxs)(ef,{children:[(0,Ka.jsx)(xc,{})," ",(0,Ka.jsx)(nf,{children:Mo(t)})]}),(0,Ka.jsxs)(of,{children:["Total Bring Score: ",e]})]}),(0,Ka.jsx)(Zu,{onClick:async()=>{o(Pl([])),o({type:cu["/user/destroy"]})},children:"Logout"})]}):(0,Ka.jsx)(Wu,{children:"BringID"})},af=t=>{let{points:e,address:n,userKey:o}=t;return(0,Ka.jsx)(Xu,{children:rf(n,e,o)})};var cf,sf;function lf(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const df=Da.div(cf||(cf=lf(["\n padding: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n"]))),uf=Da.h3(sf||(sf=lf(["\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n margin: 0;\n color: ",";\n text-align: center;\n"])),(t=>t.theme.secondaryTextColor)),ff=t=>{let{className:e,title:n}=t;return(0,Ka.jsx)(df,{className:e,children:(0,Ka.jsx)(uf,{children:n})})};var gf;const hf=Da.div(gf||(gf=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"]))),pf=t=>{let{tasks:e,className:n,verifications:o}=t;const i=lu();return(0,Ka.jsx)(hf,{className:n,children:e.map(((t,e)=>{const n=((t,e)=>{if(null==t||!t.groups||!Array.isArray(e))return null;for(const n of t.groups){const t=e.find((t=>t.credentialGroupId===n.credentialGroupId));if(t)return t}return null})(t,o);return(0,Ka.jsx)(Rl,{status:(null==n?void 0:n.status)||"default",title:t.title,description:t.description,groups:t.groups,id:t.id,userKey:i.key},t.id)}))})};var _f,mf,yf,Lf;function bf(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Af=Da(oc)(_f||(_f=bf(["\n width: max-content;\n margin: 10px auto;\n"]))),wf=Da.div(mf||(mf=bf(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"]))),If=Da(es)(yf||(yf=bf(["\n margin-bottom: 10px;\n"]))),xf=Da(Qc)(Lf||(Lf=bf(["\n text-decoration: underline;\n"])));var Cf;const vf=Da.div(Cf||(Cf=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n"])));var Ef,Bf,Ff,Of,Sf,Pf,jf,Uf,kf,Mf,Tf,zf,Qf,Nf,Df,Rf;function qf(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Gf=Da.div(Ef||(Ef=qf(["\n padding: 12px;\n height: 100%;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n z-index: 10;\n left: 0;\n background-color: ",";\n"])),(t=>t.theme.backgroundColor)),Kf=Da(Uc)(Bf||(Bf=qf(["\n text-align: center;\n font-size: 24px;\n margin-bottom: 8px;\n"]))),Vf=(Da.header(Ff||(Ff=qf(["\n display: flex;\n align-items: center;\n flex-direction: column;\n margin-bottom: 24px;\n"]))),Da.div(Of||(Of=qf(["\n padding: 24px;\n border-radius: 8px;\n border: 1px solid ",";\n display: flex;\n flex-direction: column;\n align-items: center;\n height: 100%;\n"])),(t=>t.theme.secondaryBorderColor))),Hf=(Da.div(Sf||(Sf=qf(["\n height: 100%;\n"]))),Da((t=>{let{className:e,icon:n,status:o="default"}=t;return(0,Ka.jsx)(dd,{status:o,className:e,children:fd(n)})}))(Pf||(Pf=qf(["\n margin-bottom: 12px;\n border-radius: 58px;\n"])))),Yf=Da(Rc)(jf||(jf=qf(["\n text-align: center;\n font-size: 14px;\n margin-bottom: 40px;\n"]))),Jf=Da((t=>{let{children:e,className:n,status:o="default"}=t;return(0,Ka.jsx)(rd,{className:n,status:o,children:e})}))(Uf||(Uf=qf(["\n margin-bottom: 18px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n"]))),Wf=Da.div(kf||(kf=qf(["\n display: flex;\n justify-content: space-between;\n gap: 12px;\n width: 100%;\n"]))),Xf=Da(oc)(Mf||(Mf=qf(["\n flex: 1;\n"]))),Zf=Da.img(Tf||(Tf=qf(["\n width: 58px;\n height: 58px;\n object-fit: cover;\n object-position: center;\n"]))),$f=Da(es)(zf||(zf=qf(["\n margin-bottom: 18px;\n"]))),tg=Da.span(Qf||(Qf=qf(["\n text-decoration: underline;\n cursor: pointer;\n"]))),eg=(Da.span(Nf||(Nf=qf(["\n color: ",";\n text-transform: capitalize;\n"])),(t=>t.theme.errorStatusTextColor)),Da.span(Df||(Df=qf(["\n color: ",";\n text-transform: capitalize;\n"])),(t=>t.theme.successStatusTextColor)),Da((t=>{let{tasks:e,verifications:n,onSelect:o,selected:i,className:r,devMode:a}=t;return(0,Ka.jsx)(vf,{className:r,children:n.map((t=>{if("completed"!==t.status)return;const e=Do(t.credentialGroupId,a);if(e){const{credentialGroupId:n,points:r}=e.group,a=i.includes(n);return(0,Ka.jsx)(td,{title:e.title,description:e.description,taskId:t.taskId,points:r,scheduledTime:t.scheduledTime,status:"default",fetched:t.fetched,selectable:!0,selected:a,credentialGroupId:t.credentialGroupId,onSelect:t=>{o(n,t)}},n)}}))})}))(Rf||(Rf=qf(["\n margin-bottom: 16px;\n width: 100%;\n"])))),ng=i.p+"6d49141a78bd0420b0384a3801745c44.gif";function og(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var ig=0;function rg(t){return"__private_"+ig+++"_"+t}var ag=rg("apiUrl");const cg=new class{constructor(){Object.defineProperty(this,ag,{writable:!0,value:void 0}),this.getProof=async(t,e,n)=>{const o=await $s(og(this,ag)[ag],t,e,n),{success:i,proof:r}=o;if(i)return r},this.createIdentity=(t,e)=>ko(t,e),og(this,ag)[ag]=function(){try{return zo||""}catch(t){return""}}()}};function sg(t){return[t.pi_a[0],t.pi_a[1],t.pi_b[0][1],t.pi_b[0][0],t.pi_b[1][1],t.pi_b[1][0],t.pi_c[0],t.pi_c[1]]}var lg;!function(t){t.POSEIDON="poseidon",t.SEMAPHORE="semaphore",t.SEMAPHORE_IDENTITY="semaphore-identity"}(lg||(lg={}));const dg=Object.values(lg).sort(),ug=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];function fg(t,e){return e&&10!=e?16==e?"0x"==t.slice(0,2)?BigInt(t):BigInt("0x"+t):void 0:BigInt(t)}const gg=fg;function hg(t){const e=t.toString(16);return 4*(e.length-1)+ug[parseInt(e[0],16)]}function pg(t){return BigInt(t)<BigInt(0)}function _g(t){return!t}function mg(t,e){return BigInt(t)<<BigInt(e)}function yg(t,e){return BigInt(t)>>BigInt(e)}const Lg=mg,bg=yg;function Ag(t){return(BigInt(t)&BigInt(1))==BigInt(1)}function wg(t){let e=BigInt(t);const n=[];for(;e;)e&BigInt(1)?n.push(1):n.push(0),e>>=BigInt(1);return n}function Ig(t){if(t>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("Number too big");return Number(t)}function xg(t,e){return BigInt(t)+BigInt(e)}function Cg(t,e){return BigInt(t)-BigInt(e)}function vg(t){return-BigInt(t)}function Eg(t,e){return BigInt(t)*BigInt(e)}function Bg(t,e){return BigInt(t)**BigInt(e)}function Fg(t,e){return BigInt(t)/BigInt(e)}function Og(t,e){return BigInt(t)%BigInt(e)}function Sg(t,e){return BigInt(t)==BigInt(e)}function Pg(t,e){return BigInt(t)>BigInt(e)}function jg(t,e){return BigInt(t)>=BigInt(e)}function Ug(t,e){return BigInt(t)&BigInt(e)}function kg(t,e,n,o){const i="0000000"+n.toString(16),r=new Uint32Array(t.buffer,t.byteOffset+e,o/4),a=1+(4*(i.length-7)-1>>5);for(let t=0;t<a;t++)r[t]=parseInt(i.substring(i.length-8*t-8,i.length-8*t),16);for(let t=a;t<r.length;t++)r[t]=0;for(let e=4*r.length;e<o;e++)t[e]=Ig(Ug(yg(n,8*e),255))}function Mg(t,e,n,o){const i="0000000"+n.toString(16),r=new DataView(t.buffer,t.byteOffset+e,o),a=1+(4*(i.length-7)-1>>5);for(let t=0;t<a;t++)r.setUint32(o-4*t-4,parseInt(i.substring(i.length-8*t-8,i.length-8*t),16),!1);for(let t=0;t<o/4-a;t++)r[t]=0}function Tg(t,e,n){n=n||t.byteLength,e=e||0;const o=new Uint32Array(t.buffer,t.byteOffset+e,n/4),i=new Array(n/4);return o.forEach(((t,e)=>i[i.length-e-1]=t.toString(16).padStart(8,"0"))),fg(i.join(""),16)}function zg(t,e,n){n=n||t.byteLength,e=e||0;const o=new DataView(t.buffer,t.byteOffset+e,n),i=new Array(n/4);for(let t=0;t<n/4;t++)i[t]=o.getUint32(4*t,!1).toString(16).padStart(8,"0");return fg(i.join(""),16)}function Qg(t,e){return t.toString(e)}function Ng(t){const e=new Uint8Array(Math.floor((hg(t)-1)/8)+1);return kg(e,0,t,e.byteLength),e}const Dg=gg(0),Rg=gg(1);var qg=Object.freeze({__proto__:null,abs:function(t){return BigInt(t)>=0?BigInt(t):-BigInt(t)},add:xg,band:Ug,bitLength:hg,bits:wg,bor:function(t,e){return BigInt(t)|BigInt(e)},bxor:function(t,e){return BigInt(t)^BigInt(e)},div:Fg,e:gg,eq:Sg,exp:function(t,e){return BigInt(t)**BigInt(e)},fromArray:function(t,e){let n=BigInt(0);e=BigInt(e);for(let o=0;o<t.length;o++)n=n*e+BigInt(t[o]);return n},fromRprBE:zg,fromRprLE:Tg,fromString:fg,geq:jg,gt:Pg,isNegative:pg,isOdd:Ag,isZero:_g,land:function(t,e){return BigInt(t)&&BigInt(e)},leq:function(t,e){return BigInt(t)<=BigInt(e)},lnot:function(t){return!BigInt(t)},lor:function(t,e){return BigInt(t)||BigInt(e)},lt:function(t,e){return BigInt(t)<BigInt(e)},mod:Og,mul:Eg,naf:function(t){let e=BigInt(t);const n=[];for(;e;){if(e&BigInt(1)){const t=2-Number(e%BigInt(4));n.push(t),e-=BigInt(t)}else n.push(0);e>>=BigInt(1)}return n},neg:vg,neq:function(t,e){return BigInt(t)!=BigInt(e)},one:Rg,pow:Bg,shiftLeft:mg,shiftRight:yg,shl:Lg,shr:bg,square:function(t){return BigInt(t)*BigInt(t)},sub:Cg,toArray:function(t,e){const n=[];let o=BigInt(t);for(e=BigInt(e);o;)n.unshift(Number(o%e)),o/=e;return n},toLEBuff:Ng,toNumber:Ig,toRprBE:Mg,toRprLE:kg,toString:Qg,zero:Dg});const Gg=[];for(let t=0;t<256;t++)Gg[t]=Kg(t,8);function Kg(t,e){let n=0,o=t;for(let t=0;t<e;t++)n<<=1,n|=1&o,o>>=1;return n}function Vg(t,e,n){if(_g(n))return t.one;const o=wg(n);if(0==o.length)return t.one;let i=e;for(let n=o.length-2;n>=0;n--)i=t.square(i),o[n]&&(i=t.mul(i,e));return i}function Hg(t,e,n,o,i){t[e]=t[e]+t[n]>>>0,t[i]=(t[i]^t[e])>>>0,t[i]=(t[i]<<16|t[i]>>>16&65535)>>>0,t[o]=t[o]+t[i]>>>0,t[n]=(t[n]^t[o])>>>0,t[n]=(t[n]<<12|t[n]>>>20&4095)>>>0,t[e]=t[e]+t[n]>>>0,t[i]=(t[i]^t[e])>>>0,t[i]=(t[i]<<8|t[i]>>>24&255)>>>0,t[o]=t[o]+t[i]>>>0,t[n]=(t[n]^t[o])>>>0,t[n]=(t[n]<<7|t[n]>>>25&127)>>>0}class Yg{constructor(t){t=t||[0,0,0,0,0,0,0,0],this.state=[1634760805,857760878,2036477234,1797285236,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],0,0,0,0],this.idx=16,this.buff=new Array(16)}nextU32(){return 16==this.idx&&this.update(),this.buff[this.idx++]}nextU64(){return xg(Eg(this.nextU32(),4294967296),this.nextU32())}nextBool(){return!(1&~this.nextU32())}update(){for(let t=0;t<16;t++)this.buff[t]=this.state[t];for(let e=0;e<10;e++)Hg(t=this.buff,0,4,8,12),Hg(t,1,5,9,13),Hg(t,2,6,10,14),Hg(t,3,7,11,15),Hg(t,0,5,10,15),Hg(t,1,6,11,12),Hg(t,2,7,8,13),Hg(t,3,4,9,14);var t;for(let t=0;t<16;t++)this.buff[t]=this.buff[t]+this.state[t]>>>0;this.idx=0,this.state[12]=this.state[12]+1>>>0,0==this.state[12]&&(this.state[13]=this.state[13]+1>>>0,0==this.state[13]&&(this.state[14]=this.state[14]+1>>>0,0==this.state[14]&&(this.state[15]=this.state[15]+1>>>0)))}}function Jg(t){let e=new Uint8Array(t);if(void 0!==globalThis.crypto)globalThis.crypto.getRandomValues(e);else for(let n=0;n<t;n++)e[n]=4294967296*Math.random()>>>0;return e}let Wg=null;function Xg(){return Wg||(Wg=new Yg(function(){const t=Jg(32),e=new Uint32Array(t.buffer),n=[];for(let t=0;t<8;t++)n.push(e[t]);return n}()),Wg)}class Zg{constructor(t,e,n){this.F=e,this.G=t,this.opMulGF=n;let o=e.sqrt_t||e.t,i=e.sqrt_s||e.s,r=e.one;for(;e.eq(e.pow(r,e.half),e.one);)r=e.add(r,e.one);this.w=new Array(i+1),this.wi=new Array(i+1),this.w[i]=this.F.pow(r,o),this.wi[i]=this.F.inv(this.w[i]);let a=i-1;for(;a>=0;)this.w[a]=this.F.square(this.w[a+1]),this.wi[a]=this.F.square(this.wi[a+1]),a--;this.roots=[],this._setRoots(Math.min(i,15))}_setRoots(t){for(let e=t;e>=0&&!this.roots[e];e--){let t=this.F.one;const n=1<<e,o=new Array(n);for(let i=0;i<n;i++)o[i]=t,t=this.F.mul(t,this.w[e]);this.roots[e]=o}}fft(t){if(t.length<=1)return t;const e=$g(t.length-1)+1;this._setRoots(e);const n=1<<e;if(t.length!=n)throw new Error("Size must be multiple of 2");return th(this,t,e,0,1)}ifft(t){if(t.length<=1)return t;const e=$g(t.length-1)+1;this._setRoots(e);const n=1<<e;if(t.length!=n)throw new Error("Size must be multiple of 2");const o=th(this,t,e,0,1),i=this.F.inv(this.F.mulScalar(this.F.one,n)),r=new Array(n);for(let t=0;t<n;t++)r[t]=this.opMulGF(o[(n-t)%n],i);return r}}function $g(t){return(4294901760&t?(t&=4294901760,16):0)|(4278255360&t?(t&=4278255360,8):0)|(4042322160&t?(t&=4042322160,4):0)|(3435973836&t?(t&=3435973836,2):0)|!!(2863311530&t)}function th(t,e,n,o,i){const r=1<<n;if(1==r)return[e[o]];if(2==r)return[t.G.add(e[o],e[o+i]),t.G.sub(e[o],e[o+i])];const a=r>>1,c=th(t,e,n-1,o,2*i),s=th(t,e,n-1,o+i,2*i),l=new Array(r);for(let e=0;e<a;e++)l[e]=t.G.add(c[e],t.opMulGF(s[e],t.roots[n][e])),l[e+a]=t.G.sub(c[e],t.opMulGF(s[e],t.roots[n][e]));return l}class eh{constructor(t){this.type="F1",this.one=BigInt(1),this.zero=BigInt(0),this.p=BigInt(t),this.m=1,this.negone=this.p-this.one,this.two=BigInt(2),this.half=this.p>>this.one,this.bitLength=hg(this.p),this.mask=(this.one<<BigInt(this.bitLength))-this.one,this.n64=Math.floor((this.bitLength-1)/64)+1,this.n32=2*this.n64,this.n8=8*this.n64,this.R=this.e(this.one<<BigInt(64*this.n64)),this.Ri=this.inv(this.R);const e=this.negone>>this.one;this.nqr=this.two;let n=this.pow(this.nqr,e);for(;!this.eq(n,this.negone);)this.nqr=this.nqr+this.one,n=this.pow(this.nqr,e);for(this.s=0,this.t=this.negone;(this.t&this.one)==this.zero;)this.s=this.s+1,this.t=this.t>>this.one;this.nqr_to_t=this.pow(this.nqr,this.t),function(t){if(t.m%2==1)if(Sg(Og(t.p,4),1))if(Sg(Og(t.p,8),1))if(Sg(Og(t.p,16),1))!function(t){for(t.sqrt_q=Bg(t.p,t.m),t.sqrt_s=0,t.sqrt_t=Cg(t.sqrt_q,1);!Ag(t.sqrt_t);)t.sqrt_s=t.sqrt_s+1,t.sqrt_t=Fg(t.sqrt_t,2);let e=t.one;for(;t.eq(e,t.one);){const n=t.random();t.sqrt_z=t.pow(n,t.sqrt_t),e=t.pow(t.sqrt_z,2**(t.sqrt_s-1))}t.sqrt_tm1d2=Fg(Cg(t.sqrt_t,1),2),t.sqrt=function(t){const e=this;if(e.isZero(t))return e.zero;let n=e.pow(t,e.sqrt_tm1d2);const o=e.pow(e.mul(e.square(n),t),2**(e.sqrt_s-1));if(e.eq(o,e.negone))return null;let i=e.sqrt_s,r=e.mul(t,n),a=e.mul(r,n),c=e.sqrt_z;for(;!e.eq(a,e.one);){let t=e.square(a),o=1;for(;!e.eq(t,e.one);)t=e.square(t),o++;n=c;for(let t=0;t<i-o-1;t++)n=e.square(n);c=e.square(n),a=e.mul(a,c),r=e.mul(r,n),i=o}return e.geq(r,e.zero)?r:e.neg(r)}}(t);else{if(!Sg(Og(t.p,16),9))throw new Error("Field withot sqrt");!function(t){t.sqrt=function(){throw new Error("Sqrt alg 4 not implemented")}}(t)}else{if(!Sg(Og(t.p,8),5))throw new Error("Field withot sqrt");!function(t){t.sqrt=function(){throw new Error("Sqrt alg 3 not implemented")}}(t)}else Sg(Og(t.p,4),3)&&function(t){t.sqrt_q=Bg(t.p,t.m),t.sqrt_e1=Fg(Cg(t.sqrt_q,3),4),t.sqrt=function(e){if(this.isZero(e))return this.zero;const n=this.pow(e,this.sqrt_e1),o=this.mul(this.square(n),e);if(this.eq(o,this.negone))return null;const i=this.mul(n,e);return t.geq(i,t.zero)?i:t.neg(i)}}(t);else{const e=Og(Bg(t.p,t.m/2),4);1==e?function(t){t.sqrt=function(){throw new Error("Sqrt alg 10 not implemented")}}(t):3==e?function(t){t.sqrt_q=Bg(t.p,t.m/2),t.sqrt_e34=Fg(Cg(t.sqrt_q,3),4),t.sqrt_e12=Fg(Cg(t.sqrt_q,1),2),t.frobenius=function(e,n){return e%2==1?t.conjugate(n):n},t.sqrt=function(t){const e=this,n=e.pow(t,e.sqrt_e34),o=e.mul(e.square(n),t),i=e.mul(e.frobenius(1,o),o);if(e.eq(i,e.negone))return null;const r=e.mul(n,t);let a;if(e.eq(o,e.negone))a=e.mul(r,[e.F.zero,e.F.one]);else{const t=e.pow(e.add(e.one,o),e.sqrt_e12);a=e.mul(t,r)}return e.geq(a,e.zero)?a:e.neg(a)}}(t):function(t){t.sqrt=function(){throw new Error("Sqrt alg 8 not implemented")}}(t)}}(this),this.FFT=new Zg(this,this,this.mul.bind(this)),this.fft=this.FFT.fft.bind(this.FFT),this.ifft=this.FFT.ifft.bind(this.FFT),this.w=this.FFT.w,this.wi=this.FFT.wi,this.shift=this.square(this.nqr),this.k=this.exp(this.nqr,2**this.s)}e(t,e){let n;if(e?16==e&&(n=BigInt("0x"+t)):n=BigInt(t),n<0){let t=-n;return t>=this.p&&(t%=this.p),this.p-t}return n>=this.p?n%this.p:n}add(t,e){const n=t+e;return n>=this.p?n-this.p:n}sub(t,e){return t>=e?t-e:this.p-e+t}neg(t){return t?this.p-t:t}mul(t,e){return t*e%this.p}mulScalar(t,e){return t*this.e(e)%this.p}square(t){return t*t%this.p}eq(t,e){return t==e}neq(t,e){return t!=e}lt(t,e){return(t>this.half?t-this.p:t)<(e>this.half?e-this.p:e)}gt(t,e){return(t>this.half?t-this.p:t)>(e>this.half?e-this.p:e)}leq(t,e){return(t>this.half?t-this.p:t)<=(e>this.half?e-this.p:e)}geq(t,e){return(t>this.half?t-this.p:t)>=(e>this.half?e-this.p:e)}div(t,e){return this.mul(t,this.inv(e))}idiv(t,e){if(!e)throw new Error("Division by zero");return t/e}inv(t){if(!t)throw new Error("Division by zero");let e=this.zero,n=this.p,o=this.one,i=t%this.p;for(;i;){let t=n/i;[e,o]=[o,e-t*o],[n,i]=[i,n-t*i]}return e<this.zero&&(e+=this.p),e}mod(t,e){return t%e}pow(t,e){return Vg(this,t,e)}exp(t,e){return Vg(this,t,e)}band(t,e){const n=t&e&this.mask;return n>=this.p?n-this.p:n}bor(t,e){const n=(t|e)&this.mask;return n>=this.p?n-this.p:n}bxor(t,e){const n=(t^e)&this.mask;return n>=this.p?n-this.p:n}bnot(t){const e=t^this.mask;return e>=this.p?e-this.p:e}shl(t,e){if(Number(e)<this.bitLength){const n=t<<e&this.mask;return n>=this.p?n-this.p:n}{const n=this.p-e;return Number(n)<this.bitLength?t>>n:this.zero}}shr(t,e){if(Number(e)<this.bitLength)return t>>e;{const n=this.p-e;if(Number(n)<this.bitLength){const e=t<<n&this.mask;return e>=this.p?e-this.p:e}return 0}}land(t,e){return t&&e?this.one:this.zero}lor(t,e){return t||e?this.one:this.zero}lnot(t){return t?this.zero:this.one}sqrt_old(t){if(t==this.zero)return this.zero;if(this.pow(t,this.negone>>this.one)!=this.one)return null;let e=this.s,n=this.nqr_to_t,o=this.pow(t,this.t),i=this.pow(t,this.add(this.t,this.one)>>this.one);for(;o!=this.one;){let t=this.square(o),r=1;for(;t!=this.one;)r++,t=this.square(t);let a=n;for(let t=0;t<e-r-1;t++)a=this.square(a);e=r,n=this.square(a),o=this.mul(o,n),i=this.mul(i,a)}return i>this.p>>this.one&&(i=this.neg(i)),i}normalize(t,e){if((t=BigInt(t,e))<0){let e=-t;return e>=this.p&&(e%=this.p),this.p-e}return t>=this.p?t%this.p:t}random(){const t=2*this.bitLength/8;let e=this.zero;for(let n=0;n<t;n++)e=(e<<BigInt(8))+BigInt(Jg(1)[0]);return e%this.p}toString(t,e){let n;return e=e||10,n=t>this.half&&10==e?"-"+(this.p-t).toString(e):t.toString(e),n}isZero(t){return t==this.zero}fromRng(t){let e;do{e=this.zero;for(let n=0;n<this.n64;n++)e+=t.nextU64()<<BigInt(64*n);e&=this.mask}while(e>=this.p);return e=e*this.Ri%this.p,e}fft(t){return this.FFT.fft(t)}ifft(t){return this.FFT.ifft(t)}toRprLE(t,e,n){kg(t,e,n,8*this.n64)}toRprBE(t,e,n){Mg(t,e,n,8*this.n64)}toRprBEM(t,e,n){return this.toRprBE(t,e,this.mul(this.R,n))}toRprLEM(t,e,n){return this.toRprLE(t,e,this.mul(this.R,n))}fromRprLE(t,e){return Tg(t,e,this.n8)}fromRprBE(t,e){return zg(t,e,this.n8)}fromRprLEM(t,e){return this.mul(this.fromRprLE(t,e),this.Ri)}fromRprBEM(t,e){return this.mul(this.fromRprBE(t,e),this.Ri)}toObject(t){return t}}var nh={bigInt2BytesLE:function(t,e){const n=Array(e);let o=BigInt(t);for(let t=0;t<e;t++)n[t]=Number(0xFFn&o),o>>=8n;return n},bigInt2U32LE:function(t,e){const n=Array(e);let o=BigInt(t);for(let t=0;t<e;t++)n[t]=Number(0xFFFFFFFFn&o),o>>=32n;return n},isOcamNum:function(t){return!!Array.isArray(t)&&3==t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&!!Array.isArray(t[2])}},oh=function(t,e,n,o,i,r,a){const c=t.addFunction(e);c.addParam("base","i32"),c.addParam("scalar","i32"),c.addParam("scalarLength","i32"),c.addParam("r","i32"),c.addLocal("i","i32"),c.addLocal("b","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(n));c.addCode(s.if(s.i32_eqz(s.getLocal("scalarLength")),[...s.call(a,s.getLocal("r")),...s.ret([])])),c.addCode(s.call(r,s.getLocal("base"),l)),c.addCode(s.call(a,s.getLocal("r"))),c.addCode(s.setLocal("i",s.getLocal("scalarLength"))),c.addCode(s.block(s.loop(s.setLocal("i",s.i32_sub(s.getLocal("i"),s.i32_const(1))),s.setLocal("b",s.i32_load8_u(s.i32_add(s.getLocal("scalar"),s.getLocal("i")))),...function(){const t=[];for(let e=0;e<8;e++)t.push(...s.call(i,s.getLocal("r"),s.getLocal("r")),...s.if(s.i32_ge_u(s.getLocal("b"),s.i32_const(128>>e)),[...s.setLocal("b",s.i32_sub(s.getLocal("b"),s.i32_const(128>>e))),...s.call(o,s.getLocal("r"),l,s.getLocal("r"))]));return t}(),s.br_if(1,s.i32_eqz(s.getLocal("i"))),s.br(0))))},ih=function(t,e){const n=8*t.modules[e].n64,o=t.addFunction(e+"_batchInverse");o.addParam("pIn","i32"),o.addParam("inStep","i32"),o.addParam("n","i32"),o.addParam("pOut","i32"),o.addParam("outStep","i32"),o.addLocal("itAux","i32"),o.addLocal("itIn","i32"),o.addLocal("itOut","i32"),o.addLocal("i","i32");const i=o.getCodeBuilder(),r=i.i32_const(t.alloc(n));o.addCode(i.setLocal("itAux",i.i32_load(i.i32_const(0))),i.i32_store(i.i32_const(0),i.i32_add(i.getLocal("itAux"),i.i32_mul(i.i32_add(i.getLocal("n"),i.i32_const(1)),i.i32_const(n))))),o.addCode(i.call(e+"_one",i.getLocal("itAux")),i.setLocal("itIn",i.getLocal("pIn")),i.setLocal("itAux",i.i32_add(i.getLocal("itAux"),i.i32_const(n))),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.if(i.call(e+"_isZero",i.getLocal("itIn")),i.call(e+"_copy",i.i32_sub(i.getLocal("itAux"),i.i32_const(n)),i.getLocal("itAux")),i.call(e+"_mul",i.getLocal("itIn"),i.i32_sub(i.getLocal("itAux"),i.i32_const(n)),i.getLocal("itAux"))),i.setLocal("itIn",i.i32_add(i.getLocal("itIn"),i.getLocal("inStep"))),i.setLocal("itAux",i.i32_add(i.getLocal("itAux"),i.i32_const(n))),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))),i.setLocal("itIn",i.i32_sub(i.getLocal("itIn"),i.getLocal("inStep"))),i.setLocal("itAux",i.i32_sub(i.getLocal("itAux"),i.i32_const(n))),i.setLocal("itOut",i.i32_add(i.getLocal("pOut"),i.i32_mul(i.i32_sub(i.getLocal("n"),i.i32_const(1)),i.getLocal("outStep")))),i.call(e+"_inverse",i.getLocal("itAux"),i.getLocal("itAux")),i.block(i.loop(i.br_if(1,i.i32_eqz(i.getLocal("i"))),i.if(i.call(e+"_isZero",i.getLocal("itIn")),[...i.call(e+"_copy",i.getLocal("itAux"),i.i32_sub(i.getLocal("itAux"),i.i32_const(n))),...i.call(e+"_zero",i.getLocal("itOut"))],[...i.call(e+"_copy",i.i32_sub(i.getLocal("itAux"),i.i32_const(n)),r),...i.call(e+"_mul",i.getLocal("itAux"),i.getLocal("itIn"),i.i32_sub(i.getLocal("itAux"),i.i32_const(n))),...i.call(e+"_mul",i.getLocal("itAux"),r,i.getLocal("itOut"))]),i.setLocal("itIn",i.i32_sub(i.getLocal("itIn"),i.getLocal("inStep"))),i.setLocal("itOut",i.i32_sub(i.getLocal("itOut"),i.getLocal("outStep"))),i.setLocal("itAux",i.i32_sub(i.getLocal("itAux"),i.i32_const(n))),i.setLocal("i",i.i32_sub(i.getLocal("i"),i.i32_const(1))),i.br(0)))),o.addCode(i.i32_store(i.i32_const(0),i.getLocal("itAux")))},rh=function(t,e,n,o,i,r){void 0===r&&(r=o<i);const a=t.addFunction(e);a.addParam("pIn","i32"),a.addParam("n","i32"),a.addParam("pOut","i32"),a.addLocal("i","i32"),a.addLocal("itIn","i32"),a.addLocal("itOut","i32");const c=a.getCodeBuilder();r?a.addCode(c.setLocal("itIn",c.i32_add(c.getLocal("pIn"),c.i32_mul(c.i32_sub(c.getLocal("n"),c.i32_const(1)),c.i32_const(o)))),c.setLocal("itOut",c.i32_add(c.getLocal("pOut"),c.i32_mul(c.i32_sub(c.getLocal("n"),c.i32_const(1)),c.i32_const(i)))),c.setLocal("i",c.i32_const(0)),c.block(c.loop(c.br_if(1,c.i32_eq(c.getLocal("i"),c.getLocal("n"))),c.call(n,c.getLocal("itIn"),c.getLocal("itOut")),c.setLocal("itIn",c.i32_sub(c.getLocal("itIn"),c.i32_const(o))),c.setLocal("itOut",c.i32_sub(c.getLocal("itOut"),c.i32_const(i))),c.setLocal("i",c.i32_add(c.getLocal("i"),c.i32_const(1))),c.br(0)))):a.addCode(c.setLocal("itIn",c.getLocal("pIn")),c.setLocal("itOut",c.getLocal("pOut")),c.setLocal("i",c.i32_const(0)),c.block(c.loop(c.br_if(1,c.i32_eq(c.getLocal("i"),c.getLocal("n"))),c.call(n,c.getLocal("itIn"),c.getLocal("itOut")),c.setLocal("itIn",c.i32_add(c.getLocal("itIn"),c.i32_const(o))),c.setLocal("itOut",c.i32_add(c.getLocal("itOut"),c.i32_const(i))),c.setLocal("i",c.i32_add(c.getLocal("i"),c.i32_const(1))),c.br(0))))},ah={};function ch(t,e){return t===e?0:t>e?1:-1}function sh(t){return t*t}function lh(t){return t%2n!==0n}function dh(t){return t%2n===0n}function uh(t){return t<0n}function fh(t){return t>0n}function gh(t){return uh(t)?t.toString(2).length-1:t.toString(2).length}function hh(t){return t<0n?-t:t}function ph(t){return 1n===hh(t)}function _h(t,e){for(var n,o,i,r=0n,a=1n,c=e,s=hh(t);0n!==s;)n=c/s,o=r,i=c,r=a,c=s,a=o-n*a,s=i-n*s;if(!ph(c))throw new Error(t.toString()+" and "+e.toString()+" are not co-prime");return-1===ch(r,0n)&&(r+=e),uh(t)?-r:r}function mh(t,e,n){if(0n===n)throw new Error("Cannot take modPow with modulus 0");var o=1n,i=t%n;for(uh(e)&&(e*=-1n,i=_h(i,n));fh(e);){if(0n===i)return 0n;lh(e)&&(o=o*i%n),e/=2n,i=sh(i)%n}return o}function yh(t,e){return 0n!==e&&(!!ph(e)||(0===function(t,e){return(t=t>=0n?t:-t)===(e=e>=0n?e:-e)?0:t>e?1:-1}(e,2n)?dh(t):t%e===0n))}function Lh(t,e){for(var n,o,i,r=function(t){return t-1n}(t),a=r,c=0;dh(a);)a/=2n,c++;t:for(o=0;o<e.length;o++)if(!(t<e[o]||ph(i=mh(BigInt(e[o]),a,t))||i===r)){for(n=c-1;0!=n;n--){if(ph(i=sh(i)%t))return!1;if(i===r)continue t}return!1}return!0}ah.bitLength=gh,ah.isOdd=lh,ah.isNegative=uh,ah.abs=hh,ah.isUnit=ph,ah.compare=ch,ah.modInv=_h,ah.modPow=mh,ah.isPrime=function(t){var e=function(t){var e=hh(t);return!ph(e)&&(2n===e||3n===e||5n===e||!(dh(e)||yh(e,3n)||yh(e,5n))&&(e<49n||void 0))}(t);if(void 0!==e)return e;var n=hh(t),o=gh(n);if(o<=64)return Lh(n,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var i=Math.log(2)*Number(o),r=Math.ceil(i),a=[],c=0;c<r;c++)a.push(BigInt(c+2));return Lh(n,a)},ah.square=sh;const bh=nh,Ah=oh,wh=ih,Ih=rh,xh=function(t,e,n,o,i,r){void 0===r&&(r=o<i);const a=t.addFunction(e);a.addParam("pIn1","i32"),a.addParam("pIn2","i32"),a.addParam("n","i32"),a.addParam("pOut","i32"),a.addLocal("i","i32"),a.addLocal("itIn1","i32"),a.addLocal("itIn2","i32"),a.addLocal("itOut","i32");const c=a.getCodeBuilder();r?a.addCode(c.setLocal("itIn1",c.i32_add(c.getLocal("pIn1"),c.i32_mul(c.i32_sub(c.getLocal("n"),c.i32_const(1)),c.i32_const(o)))),c.setLocal("itIn2",c.i32_add(c.getLocal("pIn2"),c.i32_mul(c.i32_sub(c.getLocal("n"),c.i32_const(1)),c.i32_const(o)))),c.setLocal("itOut",c.i32_add(c.getLocal("pOut"),c.i32_mul(c.i32_sub(c.getLocal("n"),c.i32_const(1)),c.i32_const(i)))),c.setLocal("i",c.i32_const(0)),c.block(c.loop(c.br_if(1,c.i32_eq(c.getLocal("i"),c.getLocal("n"))),c.call(n,c.getLocal("itIn1"),c.getLocal("itIn2"),c.getLocal("itOut")),c.setLocal("itIn1",c.i32_sub(c.getLocal("itIn1"),c.i32_const(o))),c.setLocal("itIn2",c.i32_sub(c.getLocal("itIn2"),c.i32_const(o))),c.setLocal("itOut",c.i32_sub(c.getLocal("itOut"),c.i32_const(i))),c.setLocal("i",c.i32_add(c.getLocal("i"),c.i32_const(1))),c.br(0)))):a.addCode(c.setLocal("itIn1",c.getLocal("pIn1")),c.setLocal("itIn2",c.getLocal("pIn2")),c.setLocal("itOut",c.getLocal("pOut")),c.setLocal("i",c.i32_const(0)),c.block(c.loop(c.br_if(1,c.i32_eq(c.getLocal("i"),c.getLocal("n"))),c.call(n,c.getLocal("itIn1"),c.getLocal("itIn2"),c.getLocal("itOut")),c.setLocal("itIn1",c.i32_add(c.getLocal("itIn1"),c.i32_const(o))),c.setLocal("itIn2",c.i32_add(c.getLocal("itIn2"),c.i32_const(o))),c.setLocal("itOut",c.i32_add(c.getLocal("itOut"),c.i32_const(i))),c.setLocal("i",c.i32_add(c.getLocal("i"),c.i32_const(1))),c.br(0))))},{bitLength:Ch,modInv:vh,modPow:Eh,isPrime:Bh,isOdd:Fh,square:Oh}=ah;var Sh=function(t,e,n,o){const i=BigInt(e),r=Math.floor((Ch(i-1n)-1)/64)+1,a=2*r,c=8*r,s=n||"f1m";if(t.modules[s])return s;const l=function(t,e,n){const o=n||"int";if(t.modules[o])return o;t.modules[o]={};const i=2*e,r=8*e;return function(){const n=t.addFunction(o+"_copy");n.addParam("px","i32"),n.addParam("pr","i32");const i=n.getCodeBuilder();for(let t=0;t<e;t++)n.addCode(i.i64_store(i.getLocal("pr"),8*t,i.i64_load(i.getLocal("px"),8*t)))}(),function(){const n=t.addFunction(o+"_zero");n.addParam("pr","i32");const i=n.getCodeBuilder();for(let t=0;t<e;t++)n.addCode(i.i64_store(i.getLocal("pr"),8*t,i.i64_const(0)))}(),function(){const n=t.addFunction(o+"_isZero");n.addParam("px","i32"),n.setReturnType("i32");const i=n.getCodeBuilder();n.addCode(function t(e){return 0==e?i.ret(i.i64_eqz(i.i64_load(i.getLocal("px")))):i.if(i.i64_eqz(i.i64_load(i.getLocal("px"),8*e)),t(e-1),i.ret(i.i32_const(0)))}(e-1)),n.addCode(i.ret(i.i32_const(0)))}(),function(){const n=t.addFunction(o+"_one");n.addParam("pr","i32");const i=n.getCodeBuilder();n.addCode(i.i64_store(i.getLocal("pr"),0,i.i64_const(1)));for(let t=1;t<e;t++)n.addCode(i.i64_store(i.getLocal("pr"),8*t,i.i64_const(0)))}(),function(){const n=t.addFunction(o+"_eq");n.addParam("px","i32"),n.addParam("py","i32"),n.setReturnType("i32");const i=n.getCodeBuilder();n.addCode(function t(e){return 0==e?i.ret(i.i64_eq(i.i64_load(i.getLocal("px")),i.i64_load(i.getLocal("py")))):i.if(i.i64_eq(i.i64_load(i.getLocal("px"),8*e),i.i64_load(i.getLocal("py"),8*e)),t(e-1),i.ret(i.i32_const(0)))}(e-1)),n.addCode(i.ret(i.i32_const(0)))}(),function(){const n=t.addFunction(o+"_gte");n.addParam("px","i32"),n.addParam("py","i32"),n.setReturnType("i32");const i=n.getCodeBuilder();n.addCode(function t(e){return 0==e?i.ret(i.i64_ge_u(i.i64_load(i.getLocal("px")),i.i64_load(i.getLocal("py")))):i.if(i.i64_lt_u(i.i64_load(i.getLocal("px"),8*e),i.i64_load(i.getLocal("py"),8*e)),i.ret(i.i32_const(0)),i.if(i.i64_gt_u(i.i64_load(i.getLocal("px"),8*e),i.i64_load(i.getLocal("py"),8*e)),i.ret(i.i32_const(1)),t(e-1)))}(e-1)),n.addCode(i.ret(i.i32_const(0)))}(),function(){const e=t.addFunction(o+"_add");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32"),e.setReturnType("i32"),e.addLocal("c","i64");const n=e.getCodeBuilder();e.addCode(n.setLocal("c",n.i64_add(n.i64_load32_u(n.getLocal("x")),n.i64_load32_u(n.getLocal("y"))))),e.addCode(n.i64_store32(n.getLocal("r"),n.getLocal("c")));for(let t=1;t<i;t++)e.addCode(n.setLocal("c",n.i64_add(n.i64_add(n.i64_load32_u(n.getLocal("x"),4*t),n.i64_load32_u(n.getLocal("y"),4*t)),n.i64_shr_u(n.getLocal("c"),n.i64_const(32))))),e.addCode(n.i64_store32(n.getLocal("r"),4*t,n.getLocal("c")));e.addCode(n.i32_wrap_i64(n.i64_shr_u(n.getLocal("c"),n.i64_const(32))))}(),function(){const e=t.addFunction(o+"_sub");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32"),e.setReturnType("i32"),e.addLocal("c","i64");const n=e.getCodeBuilder();e.addCode(n.setLocal("c",n.i64_sub(n.i64_load32_u(n.getLocal("x")),n.i64_load32_u(n.getLocal("y"))))),e.addCode(n.i64_store32(n.getLocal("r"),n.i64_and(n.getLocal("c"),n.i64_const("0xFFFFFFFF"))));for(let t=1;t<i;t++)e.addCode(n.setLocal("c",n.i64_add(n.i64_sub(n.i64_load32_u(n.getLocal("x"),4*t),n.i64_load32_u(n.getLocal("y"),4*t)),n.i64_shr_s(n.getLocal("c"),n.i64_const(32))))),e.addCode(n.i64_store32(n.getLocal("r"),4*t,n.i64_and(n.getLocal("c"),n.i64_const("0xFFFFFFFF"))));e.addCode(n.i32_wrap_i64(n.i64_shr_s(n.getLocal("c"),n.i64_const(32))))}(),function(){const e=t.addFunction(o+"_mul");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32"),e.addLocal("c0","i64"),e.addLocal("c1","i64");for(let t=0;t<i;t++)e.addLocal("x"+t,"i64"),e.addLocal("y"+t,"i64");const n=e.getCodeBuilder(),r=[],a=[];function c(t,e){let o,i;return r[t]?o=n.getLocal("x"+t):(o=n.teeLocal("x"+t,n.i64_load32_u(n.getLocal("x"),4*t)),r[t]=!0),a[e]?i=n.getLocal("y"+e):(i=n.teeLocal("y"+e,n.i64_load32_u(n.getLocal("y"),4*e)),a[e]=!0),n.i64_mul(o,i)}let s="c0",l="c1";for(let t=0;t<2*i-1;t++){for(let o=Math.max(0,t-i+1);o<=t&&o<i;o++){const i=t-o;e.addCode(n.setLocal(s,n.i64_add(n.i64_and(n.getLocal(s),n.i64_const(4294967295)),c(o,i)))),e.addCode(n.setLocal(l,n.i64_add(n.getLocal(l),n.i64_shr_u(n.getLocal(s),n.i64_const(32)))))}e.addCode(n.i64_store32(n.getLocal("r"),4*t,n.getLocal(s))),[s,l]=[l,s],e.addCode(n.setLocal(l,n.i64_shr_u(n.getLocal(s),n.i64_const(32))))}e.addCode(n.i64_store32(n.getLocal("r"),4*i*2-4,n.getLocal(s)))}(),function(){const e=t.addFunction(o+"_square");e.addParam("x","i32"),e.addParam("r","i32"),e.addLocal("c0","i64"),e.addLocal("c1","i64"),e.addLocal("c0_old","i64"),e.addLocal("c1_old","i64");for(let t=0;t<i;t++)e.addLocal("x"+t,"i64");const n=e.getCodeBuilder(),r=[];function a(t,e){let o,i;return r[t]?o=n.getLocal("x"+t):(o=n.teeLocal("x"+t,n.i64_load32_u(n.getLocal("x"),4*t)),r[t]=!0),r[e]?i=n.getLocal("x"+e):(i=n.teeLocal("x"+e,n.i64_load32_u(n.getLocal("x"),4*e)),r[e]=!0),n.i64_mul(o,i)}let c="c0",s="c1",l="c0_old",d="c1_old";for(let t=0;t<2*i-1;t++){e.addCode(n.setLocal(c,n.i64_const(0)),n.setLocal(s,n.i64_const(0)));for(let o=Math.max(0,t-i+1);o<t+1>>1&&o<i;o++){const i=t-o;e.addCode(n.setLocal(c,n.i64_add(n.i64_and(n.getLocal(c),n.i64_const(4294967295)),a(o,i)))),e.addCode(n.setLocal(s,n.i64_add(n.getLocal(s),n.i64_shr_u(n.getLocal(c),n.i64_const(32)))))}e.addCode(n.setLocal(c,n.i64_shl(n.i64_and(n.getLocal(c),n.i64_const(4294967295)),n.i64_const(1)))),e.addCode(n.setLocal(s,n.i64_add(n.i64_shl(n.getLocal(s),n.i64_const(1)),n.i64_shr_u(n.getLocal(c),n.i64_const(32))))),t%2==0&&(e.addCode(n.setLocal(c,n.i64_add(n.i64_and(n.getLocal(c),n.i64_const(4294967295)),a(t>>1,t>>1)))),e.addCode(n.setLocal(s,n.i64_add(n.getLocal(s),n.i64_shr_u(n.getLocal(c),n.i64_const(32)))))),t>0&&(e.addCode(n.setLocal(c,n.i64_add(n.i64_and(n.getLocal(c),n.i64_const(4294967295)),n.i64_and(n.getLocal(l),n.i64_const(4294967295))))),e.addCode(n.setLocal(s,n.i64_add(n.i64_add(n.getLocal(s),n.i64_shr_u(n.getLocal(c),n.i64_const(32))),n.getLocal(d))))),e.addCode(n.i64_store32(n.getLocal("r"),4*t,n.getLocal(c))),e.addCode(n.setLocal(l,n.getLocal(s)),n.setLocal(d,n.i64_shr_u(n.getLocal(l),n.i64_const(32))))}e.addCode(n.i64_store32(n.getLocal("r"),4*i*2-4,n.getLocal(l)))}(),function(){const e=t.addFunction(o+"_squareOld");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(o+"_mul",n.getLocal("x"),n.getLocal("x"),n.getLocal("r")))}(),function(){!function(){const e=t.addFunction(o+"__mul1");e.addParam("px","i32"),e.addParam("y","i64"),e.addParam("pr","i32"),e.addLocal("c","i64");const n=e.getCodeBuilder();e.addCode(n.setLocal("c",n.i64_mul(n.i64_load32_u(n.getLocal("px"),0,0),n.getLocal("y")))),e.addCode(n.i64_store32(n.getLocal("pr"),0,0,n.getLocal("c")));for(let t=1;t<i;t++)e.addCode(n.setLocal("c",n.i64_add(n.i64_mul(n.i64_load32_u(n.getLocal("px"),4*t,0),n.getLocal("y")),n.i64_shr_u(n.getLocal("c"),n.i64_const(32))))),e.addCode(n.i64_store32(n.getLocal("pr"),4*t,0,n.getLocal("c")))}(),function(){const e=t.addFunction(o+"__add1");e.addParam("x","i32"),e.addParam("y","i64"),e.addLocal("c","i64"),e.addLocal("px","i32");const n=e.getCodeBuilder();e.addCode(n.setLocal("px",n.getLocal("x"))),e.addCode(n.setLocal("c",n.i64_add(n.i64_load32_u(n.getLocal("px"),0,0),n.getLocal("y")))),e.addCode(n.i64_store32(n.getLocal("px"),0,0,n.getLocal("c"))),e.addCode(n.setLocal("c",n.i64_shr_u(n.getLocal("c"),n.i64_const(32)))),e.addCode(n.block(n.loop(n.br_if(1,n.i64_eqz(n.getLocal("c"))),n.setLocal("px",n.i32_add(n.getLocal("px"),n.i32_const(4))),n.setLocal("c",n.i64_add(n.i64_load32_u(n.getLocal("px"),0,0),n.getLocal("c"))),n.i64_store32(n.getLocal("px"),0,0,n.getLocal("c")),n.setLocal("c",n.i64_shr_u(n.getLocal("c"),n.i64_const(32))),n.br(0))))}();const e=t.addFunction(o+"_div");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("c","i32"),e.addParam("r","i32"),e.addLocal("rr","i32"),e.addLocal("cc","i32"),e.addLocal("eX","i32"),e.addLocal("eY","i32"),e.addLocal("sy","i64"),e.addLocal("sx","i64"),e.addLocal("ec","i32");const n=e.getCodeBuilder(),a=n.i32_const(t.alloc(r)),c=n.i32_const(t.alloc(r)),s=n.i32_const(t.alloc(r)),l=n.getLocal("cc"),d=n.getLocal("rr"),u=t.alloc(2*r),f=n.i32_const(u),g=n.i32_const(u+r);e.addCode(n.if(n.getLocal("c"),n.setLocal("cc",n.getLocal("c")),n.setLocal("cc",c))),e.addCode(n.if(n.getLocal("r"),n.setLocal("rr",n.getLocal("r")),n.setLocal("rr",s))),e.addCode(n.call(o+"_copy",n.getLocal("x"),d)),e.addCode(n.call(o+"_copy",n.getLocal("y"),a)),e.addCode(n.call(o+"_zero",l)),e.addCode(n.call(o+"_zero",f)),e.addCode(n.setLocal("eX",n.i32_const(r-1))),e.addCode(n.setLocal("eY",n.i32_const(r-1))),e.addCode(n.block(n.loop(n.br_if(1,n.i32_or(n.i32_load8_u(n.i32_add(a,n.getLocal("eY")),0,0),n.i32_eq(n.getLocal("eY"),n.i32_const(3)))),n.setLocal("eY",n.i32_sub(n.getLocal("eY"),n.i32_const(1))),n.br(0)))),e.addCode(n.setLocal("sy",n.i64_add(n.i64_load32_u(n.i32_sub(n.i32_add(a,n.getLocal("eY")),n.i32_const(3)),0,0),n.i64_const(1)))),e.addCode(n.if(n.i64_eq(n.getLocal("sy"),n.i64_const(1)),n.drop(n.i64_div_u(n.i64_const(0),n.i64_const(0))))),e.addCode(n.block(n.loop(n.block(n.loop(n.br_if(1,n.i32_or(n.i32_load8_u(n.i32_add(d,n.getLocal("eX")),0,0),n.i32_eq(n.getLocal("eX"),n.i32_const(7)))),n.setLocal("eX",n.i32_sub(n.getLocal("eX"),n.i32_const(1))),n.br(0))),n.setLocal("sx",n.i64_load(n.i32_sub(n.i32_add(d,n.getLocal("eX")),n.i32_const(7)),0,0)),n.setLocal("sx",n.i64_div_u(n.getLocal("sx"),n.getLocal("sy"))),n.setLocal("ec",n.i32_sub(n.i32_sub(n.getLocal("eX"),n.getLocal("eY")),n.i32_const(4))),n.block(n.loop(n.br_if(1,n.i32_and(n.i64_eqz(n.i64_and(n.getLocal("sx"),n.i64_const("0xFFFFFFFF00000000"))),n.i32_ge_s(n.getLocal("ec"),n.i32_const(0)))),n.setLocal("sx",n.i64_shr_u(n.getLocal("sx"),n.i64_const(8))),n.setLocal("ec",n.i32_add(n.getLocal("ec"),n.i32_const(1))),n.br(0))),n.if(n.i64_eqz(n.getLocal("sx")),[...n.br_if(2,n.i32_eqz(n.call(o+"_gte",d,a))),...n.setLocal("sx",n.i64_const(1)),...n.setLocal("ec",n.i32_const(0))]),n.call(o+"__mul1",a,n.getLocal("sx"),g),n.drop(n.call(o+"_sub",d,n.i32_sub(g,n.getLocal("ec")),d)),n.call(o+"__add1",n.i32_add(l,n.getLocal("ec")),n.getLocal("sx")),n.br(0))))}(),function(){const e=t.addFunction(o+"_inverseMod");e.addParam("px","i32"),e.addParam("pm","i32"),e.addParam("pr","i32"),e.addLocal("t","i32"),e.addLocal("newt","i32"),e.addLocal("r","i32"),e.addLocal("qq","i32"),e.addLocal("qr","i32"),e.addLocal("newr","i32"),e.addLocal("swp","i32"),e.addLocal("x","i32"),e.addLocal("signt","i32"),e.addLocal("signnewt","i32"),e.addLocal("signx","i32");const n=e.getCodeBuilder(),i=n.i32_const(t.alloc(r)),a=n.i32_const(t.alloc(r)),c=n.i32_const(t.alloc(r)),s=n.i32_const(t.alloc(r)),l=n.i32_const(t.alloc(r)),d=n.i32_const(t.alloc(r)),u=n.i32_const(t.alloc(2*r)),f=n.i32_const(t.alloc(r));e.addCode(n.setLocal("t",i),n.call(o+"_zero",i),n.setLocal("signt",n.i32_const(0))),e.addCode(n.setLocal("r",a),n.call(o+"_copy",n.getLocal("pm"),a)),e.addCode(n.setLocal("newt",c),n.call(o+"_one",c),n.setLocal("signnewt",n.i32_const(0))),e.addCode(n.setLocal("newr",s),n.call(o+"_copy",n.getLocal("px"),s)),e.addCode(n.setLocal("qq",l)),e.addCode(n.setLocal("qr",d)),e.addCode(n.setLocal("x",f)),e.addCode(n.block(n.loop(n.br_if(1,n.call(o+"_isZero",n.getLocal("newr"))),n.call(o+"_div",n.getLocal("r"),n.getLocal("newr"),n.getLocal("qq"),n.getLocal("qr")),n.call(o+"_mul",n.getLocal("qq"),n.getLocal("newt"),u),n.if(n.getLocal("signt"),n.if(n.getLocal("signnewt"),n.if(n.call(o+"_gte",u,n.getLocal("t")),[...n.drop(n.call(o+"_sub",u,n.getLocal("t"),n.getLocal("x"))),...n.setLocal("signx",n.i32_const(0))],[...n.drop(n.call(o+"_sub",n.getLocal("t"),u,n.getLocal("x"))),...n.setLocal("signx",n.i32_const(1))]),[...n.drop(n.call(o+"_add",u,n.getLocal("t"),n.getLocal("x"))),...n.setLocal("signx",n.i32_const(1))]),n.if(n.getLocal("signnewt"),[...n.drop(n.call(o+"_add",u,n.getLocal("t"),n.getLocal("x"))),...n.setLocal("signx",n.i32_const(0))],n.if(n.call(o+"_gte",n.getLocal("t"),u),[...n.drop(n.call(o+"_sub",n.getLocal("t"),u,n.getLocal("x"))),...n.setLocal("signx",n.i32_const(0))],[...n.drop(n.call(o+"_sub",u,n.getLocal("t"),n.getLocal("x"))),...n.setLocal("signx",n.i32_const(1))]))),n.setLocal("swp",n.getLocal("t")),n.setLocal("t",n.getLocal("newt")),n.setLocal("newt",n.getLocal("x")),n.setLocal("x",n.getLocal("swp")),n.setLocal("signt",n.getLocal("signnewt")),n.setLocal("signnewt",n.getLocal("signx")),n.setLocal("swp",n.getLocal("r")),n.setLocal("r",n.getLocal("newr")),n.setLocal("newr",n.getLocal("qr")),n.setLocal("qr",n.getLocal("swp")),n.br(0)))),e.addCode(n.if(n.getLocal("signt"),n.drop(n.call(o+"_sub",n.getLocal("pm"),n.getLocal("t"),n.getLocal("pr"))),n.call(o+"_copy",n.getLocal("t"),n.getLocal("pr"))))}(),t.exportFunction(o+"_copy"),t.exportFunction(o+"_zero"),t.exportFunction(o+"_one"),t.exportFunction(o+"_isZero"),t.exportFunction(o+"_eq"),t.exportFunction(o+"_gte"),t.exportFunction(o+"_add"),t.exportFunction(o+"_sub"),t.exportFunction(o+"_mul"),t.exportFunction(o+"_square"),t.exportFunction(o+"_squareOld"),t.exportFunction(o+"_div"),t.exportFunction(o+"_inverseMod"),o}(t,r,o),d=t.alloc(c,bh.bigInt2BytesLE(i,c)),u=t.alloc(bh.bigInt2BytesLE(Oh(1n<<BigInt(64*r))%i,c)),f=t.alloc(bh.bigInt2BytesLE((1n<<BigInt(64*r))%i,c)),g=t.alloc(bh.bigInt2BytesLE(0n,c)),h=i-1n,p=h>>1n,_=t.alloc(c,bh.bigInt2BytesLE(p,c)),m=p+1n,y=t.alloc(c,bh.bigInt2BytesLE(m,c));t.modules[s]={pq:d,pR2:u,n64:r,q:i,pOne:f,pZero:g,pePlusOne:y};let L=2n;if(Bh(i))for(;Eh(L,p,i)!==h;)L+=1n;let b=0,A=h;for(;!Fh(A)&&0n!==A;)b++,A>>=1n;const w=t.alloc(c,bh.bigInt2BytesLE(A,c)),I=Eh(L,A,i),x=t.alloc(bh.bigInt2BytesLE((I<<BigInt(64*r))%i,c)),C=A+1n>>1n,v=t.alloc(c,bh.bigInt2BytesLE(C,c));return t.exportFunction(l+"_copy",s+"_copy"),t.exportFunction(l+"_zero",s+"_zero"),t.exportFunction(l+"_isZero",s+"_isZero"),t.exportFunction(l+"_eq",s+"_eq"),function(){const e=t.addFunction(s+"_isOne");e.addParam("x","i32"),e.setReturnType("i32");const n=e.getCodeBuilder();e.addCode(n.ret(n.call(l+"_eq",n.getLocal("x"),n.i32_const(f))))}(),function(){const e=t.addFunction(s+"_add");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.if(n.call(l+"_add",n.getLocal("x"),n.getLocal("y"),n.getLocal("r")),n.drop(n.call(l+"_sub",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))),n.if(n.call(l+"_gte",n.getLocal("r"),n.i32_const(d)),n.drop(n.call(l+"_sub",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))))))}(),function(){const e=t.addFunction(s+"_sub");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.if(n.call(l+"_sub",n.getLocal("x"),n.getLocal("y"),n.getLocal("r")),n.drop(n.call(l+"_add",n.getLocal("r"),n.i32_const(d),n.getLocal("r")))))}(),function(){const e=t.addFunction(s+"_neg");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(s+"_sub",n.i32_const(g),n.getLocal("x"),n.getLocal("r")))}(),function(){const e=t.alloc(a*a*8),n=t.addFunction(s+"_mReduct");n.addParam("t","i32"),n.addParam("r","i32"),n.addLocal("np32","i64"),n.addLocal("c","i64"),n.addLocal("m","i64");const o=n.getCodeBuilder(),r=Number(0x100000000n-vh(i,0x100000000n));n.addCode(o.setLocal("np32",o.i64_const(r)));for(let t=0;t<a;t++){n.addCode(o.setLocal("c",o.i64_const(0))),n.addCode(o.setLocal("m",o.i64_and(o.i64_mul(o.i64_load32_u(o.getLocal("t"),4*t),o.getLocal("np32")),o.i64_const("0xFFFFFFFF"))));for(let e=0;e<a;e++)n.addCode(o.setLocal("c",o.i64_add(o.i64_add(o.i64_load32_u(o.getLocal("t"),4*(t+e)),o.i64_shr_u(o.getLocal("c"),o.i64_const(32))),o.i64_mul(o.i64_load32_u(o.i32_const(d),4*e),o.getLocal("m"))))),n.addCode(o.i64_store32(o.getLocal("t"),4*(t+e),o.getLocal("c")));n.addCode(o.i64_store32(o.i32_const(e),4*t,o.i64_shr_u(o.getLocal("c"),o.i64_const(32))))}n.addCode(o.call(s+"_add",o.i32_const(e),o.i32_add(o.getLocal("t"),o.i32_const(4*a)),o.getLocal("r")))}(),function(){const e=t.addFunction(s+"_mul");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32"),e.addLocal("c0","i64"),e.addLocal("c1","i64"),e.addLocal("np32","i64");for(let t=0;t<a;t++)e.addLocal("x"+t,"i64"),e.addLocal("y"+t,"i64"),e.addLocal("m"+t,"i64"),e.addLocal("q"+t,"i64");const n=e.getCodeBuilder(),o=Number(0x100000000n-vh(i,0x100000000n));e.addCode(n.setLocal("np32",n.i64_const(o)));const r=[],c=[],u=[];function f(t,e){let o,i;return r[t]?o=n.getLocal("x"+t):(o=n.teeLocal("x"+t,n.i64_load32_u(n.getLocal("x"),4*t)),r[t]=!0),c[e]?i=n.getLocal("y"+e):(i=n.teeLocal("y"+e,n.i64_load32_u(n.getLocal("y"),4*e)),c[e]=!0),n.i64_mul(o,i)}function g(t,e){let o,i;return u[t]?o=n.getLocal("q"+t):(o=n.teeLocal("q"+t,n.i64_load32_u(n.i32_const(0),d+4*t)),u[t]=!0),i=n.getLocal("m"+e),n.i64_mul(o,i)}let h="c0",p="c1";for(let t=0;t<2*a-1;t++){for(let o=Math.max(0,t-a+1);o<=t&&o<a;o++){const i=t-o;e.addCode(n.setLocal(h,n.i64_add(n.i64_and(n.getLocal(h),n.i64_const(4294967295)),f(o,i)))),e.addCode(n.setLocal(p,n.i64_add(n.getLocal(p),n.i64_shr_u(n.getLocal(h),n.i64_const(32)))))}for(let o=Math.max(1,t-a+1);o<=t&&o<a;o++){const i=t-o;e.addCode(n.setLocal(h,n.i64_add(n.i64_and(n.getLocal(h),n.i64_const(4294967295)),g(o,i)))),e.addCode(n.setLocal(p,n.i64_add(n.getLocal(p),n.i64_shr_u(n.getLocal(h),n.i64_const(32)))))}t<a&&(e.addCode(n.setLocal("m"+t,n.i64_and(n.i64_mul(n.i64_and(n.getLocal(h),n.i64_const(4294967295)),n.getLocal("np32")),n.i64_const("0xFFFFFFFF")))),e.addCode(n.setLocal(h,n.i64_add(n.i64_and(n.getLocal(h),n.i64_const(4294967295)),g(0,t)))),e.addCode(n.setLocal(p,n.i64_add(n.getLocal(p),n.i64_shr_u(n.getLocal(h),n.i64_const(32)))))),t>=a&&e.addCode(n.i64_store32(n.getLocal("r"),4*(t-a),n.getLocal(h))),[h,p]=[p,h],e.addCode(n.setLocal(p,n.i64_shr_u(n.getLocal(h),n.i64_const(32))))}e.addCode(n.i64_store32(n.getLocal("r"),4*a-4,n.getLocal(h))),e.addCode(n.if(n.i32_wrap_i64(n.getLocal(p)),n.drop(n.call(l+"_sub",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))),n.if(n.call(l+"_gte",n.getLocal("r"),n.i32_const(d)),n.drop(n.call(l+"_sub",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))))))}(),function(){const e=t.addFunction(s+"_square");e.addParam("x","i32"),e.addParam("r","i32"),e.addLocal("c0","i64"),e.addLocal("c1","i64"),e.addLocal("c0_old","i64"),e.addLocal("c1_old","i64"),e.addLocal("np32","i64");for(let t=0;t<a;t++)e.addLocal("x"+t,"i64"),e.addLocal("m"+t,"i64"),e.addLocal("q"+t,"i64");const n=e.getCodeBuilder(),o=Number(0x100000000n-vh(i,0x100000000n));e.addCode(n.setLocal("np32",n.i64_const(o)));const r=[],c=[];function u(t,e){let o,i;return r[t]?o=n.getLocal("x"+t):(o=n.teeLocal("x"+t,n.i64_load32_u(n.getLocal("x"),4*t)),r[t]=!0),r[e]?i=n.getLocal("x"+e):(i=n.teeLocal("x"+e,n.i64_load32_u(n.getLocal("x"),4*e)),r[e]=!0),n.i64_mul(o,i)}function f(t,e){let o,i;return c[t]?o=n.getLocal("q"+t):(o=n.teeLocal("q"+t,n.i64_load32_u(n.i32_const(0),d+4*t)),c[t]=!0),i=n.getLocal("m"+e),n.i64_mul(o,i)}let g="c0",h="c1",p="c0_old",_="c1_old";for(let t=0;t<2*a-1;t++){e.addCode(n.setLocal(g,n.i64_const(0)),n.setLocal(h,n.i64_const(0)));for(let o=Math.max(0,t-a+1);o<t+1>>1&&o<a;o++){const i=t-o;e.addCode(n.setLocal(g,n.i64_add(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),u(o,i)))),e.addCode(n.setLocal(h,n.i64_add(n.getLocal(h),n.i64_shr_u(n.getLocal(g),n.i64_const(32)))))}e.addCode(n.setLocal(g,n.i64_shl(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),n.i64_const(1)))),e.addCode(n.setLocal(h,n.i64_add(n.i64_shl(n.getLocal(h),n.i64_const(1)),n.i64_shr_u(n.getLocal(g),n.i64_const(32))))),t%2==0&&(e.addCode(n.setLocal(g,n.i64_add(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),u(t>>1,t>>1)))),e.addCode(n.setLocal(h,n.i64_add(n.getLocal(h),n.i64_shr_u(n.getLocal(g),n.i64_const(32)))))),t>0&&(e.addCode(n.setLocal(g,n.i64_add(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),n.i64_and(n.getLocal(p),n.i64_const(4294967295))))),e.addCode(n.setLocal(h,n.i64_add(n.i64_add(n.getLocal(h),n.i64_shr_u(n.getLocal(g),n.i64_const(32))),n.getLocal(_)))));for(let o=Math.max(1,t-a+1);o<=t&&o<a;o++){const i=t-o;e.addCode(n.setLocal(g,n.i64_add(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),f(o,i)))),e.addCode(n.setLocal(h,n.i64_add(n.getLocal(h),n.i64_shr_u(n.getLocal(g),n.i64_const(32)))))}t<a&&(e.addCode(n.setLocal("m"+t,n.i64_and(n.i64_mul(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),n.getLocal("np32")),n.i64_const("0xFFFFFFFF")))),e.addCode(n.setLocal(g,n.i64_add(n.i64_and(n.getLocal(g),n.i64_const(4294967295)),f(0,t)))),e.addCode(n.setLocal(h,n.i64_add(n.getLocal(h),n.i64_shr_u(n.getLocal(g),n.i64_const(32)))))),t>=a&&e.addCode(n.i64_store32(n.getLocal("r"),4*(t-a),n.getLocal(g))),e.addCode(n.setLocal(p,n.getLocal(h)),n.setLocal(_,n.i64_shr_u(n.getLocal(p),n.i64_const(32))))}e.addCode(n.i64_store32(n.getLocal("r"),4*a-4,n.getLocal(p))),e.addCode(n.if(n.i32_wrap_i64(n.getLocal(_)),n.drop(n.call(l+"_sub",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))),n.if(n.call(l+"_gte",n.getLocal("r"),n.i32_const(d)),n.drop(n.call(l+"_sub",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))))))}(),function(){const e=t.addFunction(s+"_squareOld");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(s+"_mul",n.getLocal("x"),n.getLocal("x"),n.getLocal("r")))}(),function(){const e=t.addFunction(s+"_toMontgomery");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(s+"_mul",n.getLocal("x"),n.i32_const(u),n.getLocal("r")))}(),function(){const e=t.alloc(2*c),n=t.addFunction(s+"_fromMontgomery");n.addParam("x","i32"),n.addParam("r","i32");const o=n.getCodeBuilder();n.addCode(o.call(l+"_copy",o.getLocal("x"),o.i32_const(e))),n.addCode(o.call(l+"_zero",o.i32_const(e+c))),n.addCode(o.call(s+"_mReduct",o.i32_const(e),o.getLocal("r")))}(),function(){const e=t.addFunction(s+"_isNegative");e.addParam("x","i32"),e.setReturnType("i32");const n=e.getCodeBuilder(),o=n.i32_const(t.alloc(c));e.addCode(n.call(s+"_fromMontgomery",n.getLocal("x"),o),n.call(l+"_gte",o,n.i32_const(y)))}(),function(){const e=t.addFunction(s+"_sign");e.addParam("x","i32"),e.setReturnType("i32");const n=e.getCodeBuilder(),o=n.i32_const(t.alloc(c));e.addCode(n.if(n.call(l+"_isZero",n.getLocal("x")),n.ret(n.i32_const(0))),n.call(s+"_fromMontgomery",n.getLocal("x"),o),n.if(n.call(l+"_gte",o,n.i32_const(y)),n.ret(n.i32_const(-1))),n.ret(n.i32_const(1)))}(),function(){const e=t.addFunction(s+"_inverse");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(s+"_fromMontgomery",n.getLocal("x"),n.getLocal("r"))),e.addCode(n.call(l+"_inverseMod",n.getLocal("r"),n.i32_const(d),n.getLocal("r"))),e.addCode(n.call(s+"_toMontgomery",n.getLocal("r"),n.getLocal("r")))}(),function(){const e=t.addFunction(s+"_one");e.addParam("pr","i32");const n=e.getCodeBuilder();e.addCode(n.call(l+"_copy",n.i32_const(f),n.getLocal("pr")))}(),function(){const e=t.addFunction(s+"_load");e.addParam("scalar","i32"),e.addParam("scalarLen","i32"),e.addParam("r","i32"),e.addLocal("p","i32"),e.addLocal("l","i32"),e.addLocal("i","i32"),e.addLocal("j","i32");const n=e.getCodeBuilder(),o=n.i32_const(t.alloc(c)),i=t.alloc(c),r=n.i32_const(i);e.addCode(n.call(l+"_zero",n.getLocal("r")),n.setLocal("i",n.i32_const(c)),n.setLocal("p",n.getLocal("scalar")),n.block(n.loop(n.br_if(1,n.i32_gt_u(n.getLocal("i"),n.getLocal("scalarLen"))),n.if(n.i32_eq(n.getLocal("i"),n.i32_const(c)),n.call(s+"_one",o),n.call(s+"_mul",o,n.i32_const(u),o)),n.call(s+"_mul",n.getLocal("p"),o,r),n.call(s+"_add",n.getLocal("r"),r,n.getLocal("r")),n.setLocal("p",n.i32_add(n.getLocal("p"),n.i32_const(c))),n.setLocal("i",n.i32_add(n.getLocal("i"),n.i32_const(c))),n.br(0))),n.setLocal("l",n.i32_rem_u(n.getLocal("scalarLen"),n.i32_const(c))),n.if(n.i32_eqz(n.getLocal("l")),n.ret([])),n.call(l+"_zero",r),n.setLocal("j",n.i32_const(0)),n.block(n.loop(n.br_if(1,n.i32_eq(n.getLocal("j"),n.getLocal("l"))),n.i32_store8(n.getLocal("j"),i,n.i32_load8_u(n.getLocal("p"))),n.setLocal("p",n.i32_add(n.getLocal("p"),n.i32_const(1))),n.setLocal("j",n.i32_add(n.getLocal("j"),n.i32_const(1))),n.br(0))),n.if(n.i32_eq(n.getLocal("i"),n.i32_const(c)),n.call(s+"_one",o),n.call(s+"_mul",o,n.i32_const(u),o)),n.call(s+"_mul",r,o,r),n.call(s+"_add",n.getLocal("r"),r,n.getLocal("r")))}(),function(){const e=t.addFunction(s+"_timesScalar");e.addParam("x","i32"),e.addParam("scalar","i32"),e.addParam("scalarLen","i32"),e.addParam("r","i32");const n=e.getCodeBuilder(),o=n.i32_const(t.alloc(c));e.addCode(n.call(s+"_load",n.getLocal("scalar"),n.getLocal("scalarLen"),o),n.call(s+"_toMontgomery",o,o),n.call(s+"_mul",n.getLocal("x"),o,n.getLocal("r")))}(),wh(t,s),Ih(t,s+"_batchToMontgomery",s+"_toMontgomery",c,c),Ih(t,s+"_batchFromMontgomery",s+"_fromMontgomery",c,c),Ih(t,s+"_batchNeg",s+"_neg",c,c),xh(t,s+"_batchAdd",s+"_add",c,c),xh(t,s+"_batchSub",s+"_sub",c,c),xh(t,s+"_batchMul",s+"_mul",c,c),t.exportFunction(s+"_add"),t.exportFunction(s+"_sub"),t.exportFunction(s+"_neg"),t.exportFunction(s+"_isNegative"),t.exportFunction(s+"_isOne"),t.exportFunction(s+"_sign"),t.exportFunction(s+"_mReduct"),t.exportFunction(s+"_mul"),t.exportFunction(s+"_square"),t.exportFunction(s+"_squareOld"),t.exportFunction(s+"_fromMontgomery"),t.exportFunction(s+"_toMontgomery"),t.exportFunction(s+"_inverse"),t.exportFunction(s+"_one"),t.exportFunction(s+"_load"),t.exportFunction(s+"_timesScalar"),Ah(t,s+"_exp",c,s+"_mul",s+"_square",l+"_copy",s+"_one"),t.exportFunction(s+"_exp"),t.exportFunction(s+"_batchInverse"),Bh(i)&&(function(){const e=t.addFunction(s+"_sqrt");e.addParam("n","i32"),e.addParam("r","i32"),e.addLocal("m","i32"),e.addLocal("i","i32"),e.addLocal("j","i32");const n=e.getCodeBuilder(),o=n.i32_const(f),i=n.i32_const(t.alloc(c)),r=n.i32_const(t.alloc(c)),a=n.i32_const(t.alloc(c)),l=n.i32_const(t.alloc(c)),d=n.i32_const(t.alloc(c));e.addCode(n.if(n.call(s+"_isZero",n.getLocal("n")),n.ret(n.call(s+"_zero",n.getLocal("r")))),n.setLocal("m",n.i32_const(b)),n.call(s+"_copy",n.i32_const(x),i),n.call(s+"_exp",n.getLocal("n"),n.i32_const(w),n.i32_const(c),r),n.call(s+"_exp",n.getLocal("n"),n.i32_const(v),n.i32_const(c),a),n.block(n.loop(n.br_if(1,n.call(s+"_eq",r,o)),n.call(s+"_square",r,l),n.setLocal("i",n.i32_const(1)),n.block(n.loop(n.br_if(1,n.call(s+"_eq",l,o)),n.call(s+"_square",l,l),n.setLocal("i",n.i32_add(n.getLocal("i"),n.i32_const(1))),n.br(0))),n.call(s+"_copy",i,d),n.setLocal("j",n.i32_sub(n.i32_sub(n.getLocal("m"),n.getLocal("i")),n.i32_const(1))),n.block(n.loop(n.br_if(1,n.i32_eqz(n.getLocal("j"))),n.call(s+"_square",d,d),n.setLocal("j",n.i32_sub(n.getLocal("j"),n.i32_const(1))),n.br(0))),n.setLocal("m",n.getLocal("i")),n.call(s+"_square",d,i),n.call(s+"_mul",r,i,r),n.call(s+"_mul",a,d,a),n.br(0))),n.if(n.call(s+"_isNegative",a),n.call(s+"_neg",a,n.getLocal("r")),n.call(s+"_copy",a,n.getLocal("r"))))}(),function(){const e=t.addFunction(s+"_isSquare");e.addParam("n","i32"),e.setReturnType("i32");const n=e.getCodeBuilder(),o=n.i32_const(f),i=n.i32_const(t.alloc(c));e.addCode(n.if(n.call(s+"_isZero",n.getLocal("n")),n.ret(n.i32_const(1))),n.call(s+"_exp",n.getLocal("n"),n.i32_const(_),n.i32_const(c),i),n.call(s+"_eq",i,o))}(),t.exportFunction(s+"_sqrt"),t.exportFunction(s+"_isSquare")),t.exportFunction(s+"_batchToMontgomery"),t.exportFunction(s+"_batchFromMontgomery"),s};const Ph=Sh,{bitLength:jh}=ah;var Uh=function(t,e,n,o,i){const r=BigInt(e),a=Math.floor((jh(r-1n)-1)/64)+1,c=8*a,s=n||"f1";if(t.modules[s])return s;t.modules[s]={n64:a};const l=i||"int",d=Ph(t,r,o,l),u=t.modules[d].pR2,f=t.modules[d].pq,g=t.modules[d].pePlusOne;return function(){const e=t.alloc(c),n=t.addFunction(s+"_mul");n.addParam("x","i32"),n.addParam("y","i32"),n.addParam("r","i32");const o=n.getCodeBuilder();n.addCode(o.call(d+"_mul",o.getLocal("x"),o.getLocal("y"),o.i32_const(e))),n.addCode(o.call(d+"_mul",o.i32_const(e),o.i32_const(u),o.getLocal("r")))}(),function(){const e=t.addFunction(s+"_square");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(s+"_mul",n.getLocal("x"),n.getLocal("x"),n.getLocal("r")))}(),function(){const e=t.addFunction(s+"_inverse");e.addParam("x","i32"),e.addParam("r","i32");const n=e.getCodeBuilder();e.addCode(n.call(l+"_inverseMod",n.getLocal("x"),n.i32_const(f),n.getLocal("r")))}(),function(){const e=t.addFunction(s+"_isNegative");e.addParam("x","i32"),e.setReturnType("i32");const n=e.getCodeBuilder();e.addCode(n.call(l+"_gte",n.getLocal("x"),n.i32_const(g)))}(),t.exportFunction(d+"_add",s+"_add"),t.exportFunction(d+"_sub",s+"_sub"),t.exportFunction(d+"_neg",s+"_neg"),t.exportFunction(s+"_mul"),t.exportFunction(s+"_square"),t.exportFunction(s+"_inverse"),t.exportFunction(s+"_isNegative"),t.exportFunction(d+"_copy",s+"_copy"),t.exportFunction(d+"_zero",s+"_zero"),t.exportFunction(d+"_one",s+"_one"),t.exportFunction(d+"_isZero",s+"_isZero"),t.exportFunction(d+"_eq",s+"_eq"),s};const kh=oh,Mh=ih,Th=nh;var zh=function(t,e,n,o){if(t.modules[n])return n;const i=8*t.modules[o].n64,r=t.modules[o].q;return t.modules[n]={n64:2*t.modules[o].n64},function(){const e=t.addFunction(n+"_isZero");e.addParam("x","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i));e.addCode(r.i32_and(r.call(o+"_isZero",a),r.call(o+"_isZero",c)))}(),function(){const e=t.addFunction(n+"_isOne");e.addParam("x","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i));e.addCode(r.ret(r.i32_and(r.call(o+"_isOne",a),r.call(o+"_isZero",c))))}(),function(){const e=t.addFunction(n+"_zero");e.addParam("x","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i));e.addCode(r.call(o+"_zero",a),r.call(o+"_zero",c))}(),function(){const e=t.addFunction(n+"_one");e.addParam("x","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i));e.addCode(r.call(o+"_one",a),r.call(o+"_zero",c))}(),function(){const e=t.addFunction(n+"_copy");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_copy",a,s),r.call(o+"_copy",c,l))}(),function(){const r=t.addFunction(n+"_mul");r.addParam("x","i32"),r.addParam("y","i32"),r.addParam("r","i32");const a=r.getCodeBuilder(),c=a.getLocal("x"),s=a.i32_add(a.getLocal("x"),a.i32_const(i)),l=a.getLocal("y"),d=a.i32_add(a.getLocal("y"),a.i32_const(i)),u=a.getLocal("r"),f=a.i32_add(a.getLocal("r"),a.i32_const(i)),g=a.i32_const(t.alloc(i)),h=a.i32_const(t.alloc(i)),p=a.i32_const(t.alloc(i)),_=a.i32_const(t.alloc(i));r.addCode(a.call(o+"_mul",c,l,g),a.call(o+"_mul",s,d,h),a.call(o+"_add",c,s,p),a.call(o+"_add",l,d,_),a.call(o+"_mul",p,_,p),a.call(e,h,u),a.call(o+"_add",g,u,u),a.call(o+"_add",g,h,f),a.call(o+"_sub",p,f,f))}(),function(){const e=t.addFunction(n+"_mul1");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("y"),l=r.getLocal("r"),d=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_mul",a,s,l),r.call(o+"_mul",c,s,d))}(),function(){const r=t.addFunction(n+"_square");r.addParam("x","i32"),r.addParam("r","i32");const a=r.getCodeBuilder(),c=a.getLocal("x"),s=a.i32_add(a.getLocal("x"),a.i32_const(i)),l=a.getLocal("r"),d=a.i32_add(a.getLocal("r"),a.i32_const(i)),u=a.i32_const(t.alloc(i)),f=a.i32_const(t.alloc(i)),g=a.i32_const(t.alloc(i)),h=a.i32_const(t.alloc(i));r.addCode(a.call(o+"_mul",c,s,u),a.call(o+"_add",c,s,f),a.call(e,s,g),a.call(o+"_add",c,g,g),a.call(e,u,h),a.call(o+"_add",h,u,h),a.call(o+"_mul",f,g,l),a.call(o+"_sub",l,h,l),a.call(o+"_add",u,u,d))}(),function(){const e=t.addFunction(n+"_add");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("y"),l=r.i32_add(r.getLocal("y"),r.i32_const(i)),d=r.getLocal("r"),u=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_add",a,s,d),r.call(o+"_add",c,l,u))}(),function(){const e=t.addFunction(n+"_sub");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("y"),l=r.i32_add(r.getLocal("y"),r.i32_const(i)),d=r.getLocal("r"),u=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_sub",a,s,d),r.call(o+"_sub",c,l,u))}(),function(){const e=t.addFunction(n+"_neg");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_neg",a,s),r.call(o+"_neg",c,l))}(),function(){const e=t.addFunction(n+"_conjugate");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_copy",a,s),r.call(o+"_neg",c,l))}(),function(){const e=t.addFunction(n+"_toMontgomery");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_toMontgomery",a,s),r.call(o+"_toMontgomery",c,l))}(),function(){const e=t.addFunction(n+"_fromMontgomery");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_fromMontgomery",a,s),r.call(o+"_fromMontgomery",c,l))}(),function(){const e=t.addFunction(n+"_eq");e.addParam("x","i32"),e.addParam("y","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("y"),l=r.i32_add(r.getLocal("y"),r.i32_const(i));e.addCode(r.i32_and(r.call(o+"_eq",a,s),r.call(o+"_eq",c,l)))}(),function(){const r=t.addFunction(n+"_inverse");r.addParam("x","i32"),r.addParam("r","i32");const a=r.getCodeBuilder(),c=a.getLocal("x"),s=a.i32_add(a.getLocal("x"),a.i32_const(i)),l=a.getLocal("r"),d=a.i32_add(a.getLocal("r"),a.i32_const(i)),u=a.i32_const(t.alloc(i)),f=a.i32_const(t.alloc(i)),g=a.i32_const(t.alloc(i)),h=a.i32_const(t.alloc(i));r.addCode(a.call(o+"_square",c,u),a.call(o+"_square",s,f),a.call(e,f,g),a.call(o+"_sub",u,g,g),a.call(o+"_inverse",g,h),a.call(o+"_mul",c,h,l),a.call(o+"_mul",s,h,d),a.call(o+"_neg",d,d))}(),function(){const e=t.addFunction(n+"_timesScalar");e.addParam("x","i32"),e.addParam("scalar","i32"),e.addParam("scalarLen","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.getLocal("r"),l=r.i32_add(r.getLocal("r"),r.i32_const(i));e.addCode(r.call(o+"_timesScalar",a,r.getLocal("scalar"),r.getLocal("scalarLen"),s),r.call(o+"_timesScalar",c,r.getLocal("scalar"),r.getLocal("scalarLen"),l))}(),function(){const e=t.addFunction(n+"_sign");e.addParam("x","i32"),e.addLocal("s","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i));e.addCode(r.setLocal("s",r.call(o+"_sign",c)),r.if(r.getLocal("s"),r.ret(r.getLocal("s"))),r.ret(r.call(o+"_sign",a)))}(),function(){const e=t.addFunction(n+"_isNegative");e.addParam("x","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i));e.addCode(r.if(r.call(o+"_isZero",c),r.ret(r.call(o+"_isNegative",a))),r.ret(r.call(o+"_isNegative",c)))}(),t.exportFunction(n+"_isZero"),t.exportFunction(n+"_isOne"),t.exportFunction(n+"_zero"),t.exportFunction(n+"_one"),t.exportFunction(n+"_copy"),t.exportFunction(n+"_mul"),t.exportFunction(n+"_mul1"),t.exportFunction(n+"_square"),t.exportFunction(n+"_add"),t.exportFunction(n+"_sub"),t.exportFunction(n+"_neg"),t.exportFunction(n+"_sign"),t.exportFunction(n+"_conjugate"),t.exportFunction(n+"_fromMontgomery"),t.exportFunction(n+"_toMontgomery"),t.exportFunction(n+"_eq"),t.exportFunction(n+"_inverse"),Mh(t,n),kh(t,n+"_exp",2*i,n+"_mul",n+"_square",n+"_copy",n+"_one"),function(){const e=t.addFunction(n+"_sqrt");e.addParam("a","i32"),e.addParam("pr","i32");const a=e.getCodeBuilder(),c=a.i32_const(t.alloc(Th.bigInt2BytesLE((BigInt(r||0)-3n)/4n,i))),s=a.i32_const(t.alloc(Th.bigInt2BytesLE((BigInt(r||0)-1n)/2n,i))),l=a.getLocal("a"),d=a.i32_const(t.alloc(2*i)),u=a.i32_const(t.alloc(2*i)),f=a.i32_const(t.alloc(2*i)),g=t.alloc(2*i),h=a.i32_const(g),p=a.i32_const(g),_=a.i32_const(g+i),m=a.i32_const(t.alloc(2*i)),y=a.i32_const(t.alloc(2*i));e.addCode(a.call(n+"_one",h),a.call(n+"_neg",h,h),a.call(n+"_exp",l,c,a.i32_const(i),d),a.call(n+"_square",d,u),a.call(n+"_mul",l,u,u),a.call(n+"_conjugate",u,f),a.call(n+"_mul",f,u,f),a.if(a.call(n+"_eq",f,h),a.unreachable()),a.call(n+"_mul",d,l,m),a.if(a.call(n+"_eq",u,h),[...a.call(o+"_zero",p),...a.call(o+"_one",_),...a.call(n+"_mul",h,m,a.getLocal("pr"))],[...a.call(n+"_one",y),...a.call(n+"_add",y,u,y),...a.call(n+"_exp",y,s,a.i32_const(i),y),...a.call(n+"_mul",y,m,a.getLocal("pr"))]))}(),function(){const e=t.addFunction(n+"_isSquare");e.addParam("a","i32"),e.setReturnType("i32");const o=e.getCodeBuilder(),a=o.i32_const(t.alloc(Th.bigInt2BytesLE((BigInt(r||0)-3n)/4n,i))),c=o.getLocal("a"),s=o.i32_const(t.alloc(2*i)),l=o.i32_const(t.alloc(2*i)),d=o.i32_const(t.alloc(2*i)),u=t.alloc(2*i),f=o.i32_const(u);e.addCode(o.call(n+"_one",f),o.call(n+"_neg",f,f),o.call(n+"_exp",c,a,o.i32_const(i),s),o.call(n+"_square",s,l),o.call(n+"_mul",c,l,l),o.call(n+"_conjugate",l,d),o.call(n+"_mul",d,l,d),o.if(o.call(n+"_eq",d,f),o.ret(o.i32_const(0))),o.ret(o.i32_const(1)))}(),t.exportFunction(n+"_exp"),t.exportFunction(n+"_timesScalar"),t.exportFunction(n+"_batchInverse"),t.exportFunction(n+"_sqrt"),t.exportFunction(n+"_isSquare"),t.exportFunction(n+"_isNegative"),n};const Qh=oh,Nh=ih;var Dh=function(t,e,n,o){if(t.modules[n])return n;const i=8*t.modules[o].n64;return t.modules[n]={n64:3*t.modules[o].n64},function(){const e=t.addFunction(n+"_isZero");e.addParam("x","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i));e.addCode(r.i32_and(r.i32_and(r.call(o+"_isZero",a),r.call(o+"_isZero",c)),r.call(o+"_isZero",s)))}(),function(){const e=t.addFunction(n+"_isOne");e.addParam("x","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i));e.addCode(r.ret(r.i32_and(r.i32_and(r.call(o+"_isOne",a),r.call(o+"_isZero",c)),r.call(o+"_isZero",s))))}(),function(){const e=t.addFunction(n+"_zero");e.addParam("x","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i));e.addCode(r.call(o+"_zero",a),r.call(o+"_zero",c),r.call(o+"_zero",s))}(),function(){const e=t.addFunction(n+"_one");e.addParam("x","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i));e.addCode(r.call(o+"_one",a),r.call(o+"_zero",c),r.call(o+"_zero",s))}(),function(){const e=t.addFunction(n+"_copy");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("r"),d=r.i32_add(r.getLocal("r"),r.i32_const(i)),u=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_copy",a,l),r.call(o+"_copy",c,d),r.call(o+"_copy",s,u))}(),function(){const r=t.addFunction(n+"_mul");r.addParam("x","i32"),r.addParam("y","i32"),r.addParam("r","i32");const a=r.getCodeBuilder(),c=a.getLocal("x"),s=a.i32_add(a.getLocal("x"),a.i32_const(i)),l=a.i32_add(a.getLocal("x"),a.i32_const(2*i)),d=a.getLocal("y"),u=a.i32_add(a.getLocal("y"),a.i32_const(i)),f=a.i32_add(a.getLocal("y"),a.i32_const(2*i)),g=a.getLocal("r"),h=a.i32_add(a.getLocal("r"),a.i32_const(i)),p=a.i32_add(a.getLocal("r"),a.i32_const(2*i)),_=a.i32_const(t.alloc(i)),m=a.i32_const(t.alloc(i)),y=a.i32_const(t.alloc(i)),L=a.i32_const(t.alloc(i)),b=a.i32_const(t.alloc(i)),A=a.i32_const(t.alloc(i)),w=a.i32_const(t.alloc(i)),I=a.i32_const(t.alloc(i)),x=a.i32_const(t.alloc(i)),C=a.i32_const(t.alloc(i)),v=a.i32_const(t.alloc(i)),E=a.i32_const(t.alloc(i)),B=a.i32_const(t.alloc(i));r.addCode(a.call(o+"_mul",c,d,_),a.call(o+"_mul",s,u,m),a.call(o+"_mul",l,f,y),a.call(o+"_add",c,s,L),a.call(o+"_add",d,u,b),a.call(o+"_add",c,l,A),a.call(o+"_add",d,f,w),a.call(o+"_add",s,l,I),a.call(o+"_add",u,f,x),a.call(o+"_add",_,m,C),a.call(o+"_add",_,y,v),a.call(o+"_add",m,y,E),a.call(o+"_mul",I,x,g),a.call(o+"_sub",g,E,g),a.call(e,g,g),a.call(o+"_add",_,g,g),a.call(o+"_mul",L,b,h),a.call(o+"_sub",h,C,h),a.call(e,y,B),a.call(o+"_add",h,B,h),a.call(o+"_mul",A,w,p),a.call(o+"_sub",p,v,p),a.call(o+"_add",p,m,p))}(),function(){const r=t.addFunction(n+"_square");r.addParam("x","i32"),r.addParam("r","i32");const a=r.getCodeBuilder(),c=a.getLocal("x"),s=a.i32_add(a.getLocal("x"),a.i32_const(i)),l=a.i32_add(a.getLocal("x"),a.i32_const(2*i)),d=a.getLocal("r"),u=a.i32_add(a.getLocal("r"),a.i32_const(i)),f=a.i32_add(a.getLocal("r"),a.i32_const(2*i)),g=a.i32_const(t.alloc(i)),h=a.i32_const(t.alloc(i)),p=a.i32_const(t.alloc(i)),_=a.i32_const(t.alloc(i)),m=a.i32_const(t.alloc(i)),y=a.i32_const(t.alloc(i)),L=a.i32_const(t.alloc(i));r.addCode(a.call(o+"_square",c,g),a.call(o+"_mul",c,s,h),a.call(o+"_add",h,h,p),a.call(o+"_sub",c,s,_),a.call(o+"_add",_,l,_),a.call(o+"_square",_,_),a.call(o+"_mul",s,l,m),a.call(o+"_add",m,m,y),a.call(o+"_square",l,L),a.call(e,y,d),a.call(o+"_add",g,d,d),a.call(e,L,u),a.call(o+"_add",p,u,u),a.call(o+"_add",g,L,f),a.call(o+"_sub",y,f,f),a.call(o+"_add",_,f,f),a.call(o+"_add",p,f,f))}(),function(){const e=t.addFunction(n+"_add");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("y"),d=r.i32_add(r.getLocal("y"),r.i32_const(i)),u=r.i32_add(r.getLocal("y"),r.i32_const(2*i)),f=r.getLocal("r"),g=r.i32_add(r.getLocal("r"),r.i32_const(i)),h=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_add",a,l,f),r.call(o+"_add",c,d,g),r.call(o+"_add",s,u,h))}(),function(){const e=t.addFunction(n+"_sub");e.addParam("x","i32"),e.addParam("y","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("y"),d=r.i32_add(r.getLocal("y"),r.i32_const(i)),u=r.i32_add(r.getLocal("y"),r.i32_const(2*i)),f=r.getLocal("r"),g=r.i32_add(r.getLocal("r"),r.i32_const(i)),h=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_sub",a,l,f),r.call(o+"_sub",c,d,g),r.call(o+"_sub",s,u,h))}(),function(){const e=t.addFunction(n+"_neg");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("r"),d=r.i32_add(r.getLocal("r"),r.i32_const(i)),u=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_neg",a,l),r.call(o+"_neg",c,d),r.call(o+"_neg",s,u))}(),function(){const e=t.addFunction(n+"_sign");e.addParam("x","i32"),e.addLocal("s","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i));e.addCode(r.setLocal("s",r.call(o+"_sign",s)),r.if(r.getLocal("s"),r.ret(r.getLocal("s"))),r.setLocal("s",r.call(o+"_sign",c)),r.if(r.getLocal("s"),r.ret(r.getLocal("s"))),r.ret(r.call(o+"_sign",a)))}(),function(){const e=t.addFunction(n+"_toMontgomery");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("r"),d=r.i32_add(r.getLocal("r"),r.i32_const(i)),u=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_toMontgomery",a,l),r.call(o+"_toMontgomery",c,d),r.call(o+"_toMontgomery",s,u))}(),function(){const e=t.addFunction(n+"_fromMontgomery");e.addParam("x","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("r"),d=r.i32_add(r.getLocal("r"),r.i32_const(i)),u=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_fromMontgomery",a,l),r.call(o+"_fromMontgomery",c,d),r.call(o+"_fromMontgomery",s,u))}(),function(){const e=t.addFunction(n+"_eq");e.addParam("x","i32"),e.addParam("y","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("y"),d=r.i32_add(r.getLocal("y"),r.i32_const(i)),u=r.i32_add(r.getLocal("y"),r.i32_const(2*i));e.addCode(r.i32_and(r.i32_and(r.call(o+"_eq",a,l),r.call(o+"_eq",c,d)),r.call(o+"_eq",s,u)))}(),function(){const r=t.addFunction(n+"_inverse");r.addParam("x","i32"),r.addParam("r","i32");const a=r.getCodeBuilder(),c=a.getLocal("x"),s=a.i32_add(a.getLocal("x"),a.i32_const(i)),l=a.i32_add(a.getLocal("x"),a.i32_const(2*i)),d=a.getLocal("r"),u=a.i32_add(a.getLocal("r"),a.i32_const(i)),f=a.i32_add(a.getLocal("r"),a.i32_const(2*i)),g=a.i32_const(t.alloc(i)),h=a.i32_const(t.alloc(i)),p=a.i32_const(t.alloc(i)),_=a.i32_const(t.alloc(i)),m=a.i32_const(t.alloc(i)),y=a.i32_const(t.alloc(i)),L=a.i32_const(t.alloc(i)),b=a.i32_const(t.alloc(i)),A=a.i32_const(t.alloc(i)),w=a.i32_const(t.alloc(i)),I=a.i32_const(t.alloc(i));r.addCode(a.call(o+"_square",c,g),a.call(o+"_square",s,h),a.call(o+"_square",l,p),a.call(o+"_mul",c,s,_),a.call(o+"_mul",c,l,m),a.call(o+"_mul",s,l,y),a.call(e,y,L),a.call(o+"_sub",g,L,L),a.call(e,p,b),a.call(o+"_sub",b,_,b),a.call(o+"_sub",h,m,A),a.call(o+"_mul",l,b,w),a.call(o+"_mul",s,A,I),a.call(o+"_add",w,I,w),a.call(e,w,w),a.call(o+"_mul",c,L,I),a.call(o+"_add",I,w,w),a.call(o+"_inverse",w,w),a.call(o+"_mul",w,L,d),a.call(o+"_mul",w,b,u),a.call(o+"_mul",w,A,f))}(),function(){const e=t.addFunction(n+"_timesScalar");e.addParam("x","i32"),e.addParam("scalar","i32"),e.addParam("scalarLen","i32"),e.addParam("r","i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i)),l=r.getLocal("r"),d=r.i32_add(r.getLocal("r"),r.i32_const(i)),u=r.i32_add(r.getLocal("r"),r.i32_const(2*i));e.addCode(r.call(o+"_timesScalar",a,r.getLocal("scalar"),r.getLocal("scalarLen"),l),r.call(o+"_timesScalar",c,r.getLocal("scalar"),r.getLocal("scalarLen"),d),r.call(o+"_timesScalar",s,r.getLocal("scalar"),r.getLocal("scalarLen"),u))}(),function(){const e=t.addFunction(n+"_isNegative");e.addParam("x","i32"),e.setReturnType("i32");const r=e.getCodeBuilder(),a=r.getLocal("x"),c=r.i32_add(r.getLocal("x"),r.i32_const(i)),s=r.i32_add(r.getLocal("x"),r.i32_const(2*i));e.addCode(r.if(r.call(o+"_isZero",s),r.if(r.call(o+"_isZero",c),r.ret(r.call(o+"_isNegative",a)),r.ret(r.call(o+"_isNegative",c)))),r.ret(r.call(o+"_isNegative",s)))}(),t.exportFunction(n+"_isZero"),t.exportFunction(n+"_isOne"),t.exportFunction(n+"_zero"),t.exportFunction(n+"_one"),t.exportFunction(n+"_copy"),t.exportFunction(n+"_mul"),t.exportFunction(n+"_square"),t.exportFunction(n+"_add"),t.exportFunction(n+"_sub"),t.exportFunction(n+"_neg"),t.exportFunction(n+"_sign"),t.exportFunction(n+"_fromMontgomery"),t.exportFunction(n+"_toMontgomery"),t.exportFunction(n+"_eq"),t.exportFunction(n+"_inverse"),Nh(t,n),Qh(t,n+"_exp",3*i,n+"_mul",n+"_square",n+"_copy",n+"_one"),t.exportFunction(n+"_exp"),t.exportFunction(n+"_timesScalar"),t.exportFunction(n+"_batchInverse"),t.exportFunction(n+"_isNegative"),n};const Rh=function(t,e,n,o,i,r,a,c){const s=t.addFunction(e);s.addParam("base","i32"),s.addParam("scalar","i32"),s.addParam("scalarLength","i32"),s.addParam("r","i32"),s.addLocal("old0","i32"),s.addLocal("nbits","i32"),s.addLocal("i","i32"),s.addLocal("last","i32"),s.addLocal("cur","i32"),s.addLocal("carry","i32"),s.addLocal("p","i32");const l=s.getCodeBuilder(),d=l.i32_const(t.alloc(n));function u(t){return l.i32_and(l.i32_shr_u(l.i32_load(l.i32_add(l.getLocal("scalar"),l.i32_and(l.i32_shr_u(t,l.i32_const(3)),l.i32_const(4294967292)))),l.i32_and(t,l.i32_const(31))),l.i32_const(1))}function f(t){return[...l.i32_store8(l.getLocal("p"),l.i32_const(t)),...l.setLocal("p",l.i32_add(l.getLocal("p"),l.i32_const(1)))]}s.addCode(l.if(l.i32_eqz(l.getLocal("scalarLength")),[...l.call(c,l.getLocal("r")),...l.ret([])]),l.setLocal("nbits",l.i32_shl(l.getLocal("scalarLength"),l.i32_const(3))),l.setLocal("old0",l.i32_load(l.i32_const(0))),l.setLocal("p",l.getLocal("old0")),l.i32_store(l.i32_const(0),l.i32_and(l.i32_add(l.i32_add(l.getLocal("old0"),l.i32_const(32)),l.getLocal("nbits")),l.i32_const(4294967288))),l.setLocal("i",l.i32_const(1)),l.setLocal("last",u(l.i32_const(0))),l.setLocal("carry",l.i32_const(0)),l.block(l.loop(l.br_if(1,l.i32_eq(l.getLocal("i"),l.getLocal("nbits"))),l.setLocal("cur",u(l.getLocal("i"))),l.if(l.getLocal("last"),l.if(l.getLocal("cur"),l.if(l.getLocal("carry"),[...l.setLocal("last",l.i32_const(0)),...l.setLocal("carry",l.i32_const(1)),...f(1)],[...l.setLocal("last",l.i32_const(0)),...l.setLocal("carry",l.i32_const(1)),...f(255)]),l.if(l.getLocal("carry"),[...l.setLocal("last",l.i32_const(0)),...l.setLocal("carry",l.i32_const(1)),...f(255)],[...l.setLocal("last",l.i32_const(0)),...l.setLocal("carry",l.i32_const(0)),...f(1)])),l.if(l.getLocal("cur"),l.if(l.getLocal("carry"),[...l.setLocal("last",l.i32_const(0)),...l.setLocal("carry",l.i32_const(1)),...f(0)],[...l.setLocal("last",l.i32_const(1)),...l.setLocal("carry",l.i32_const(0)),...f(0)]),l.if(l.getLocal("carry"),[...l.setLocal("last",l.i32_const(1)),...l.setLocal("carry",l.i32_const(0)),...f(0)],[...l.setLocal("last",l.i32_const(0)),...l.setLocal("carry",l.i32_const(0)),...f(0)]))),l.setLocal("i",l.i32_add(l.getLocal("i"),l.i32_const(1))),l.br(0))),l.if(l.getLocal("last"),l.if(l.getLocal("carry"),[...f(255),...f(0),...f(1)],[...f(1)]),l.if(l.getLocal("carry"),[...f(0),...f(1)])),l.setLocal("p",l.i32_sub(l.getLocal("p"),l.i32_const(1))),l.call(a,l.getLocal("base"),d),l.call(c,l.getLocal("r")),l.block(l.loop(l.call(i,l.getLocal("r"),l.getLocal("r")),l.setLocal("cur",l.i32_load8_u(l.getLocal("p"))),l.if(l.getLocal("cur"),l.if(l.i32_eq(l.getLocal("cur"),l.i32_const(1)),l.call(o,l.getLocal("r"),d,l.getLocal("r")),l.call(r,l.getLocal("r"),d,l.getLocal("r")))),l.br_if(1,l.i32_eq(l.getLocal("old0"),l.getLocal("p"))),l.setLocal("p",l.i32_sub(l.getLocal("p"),l.i32_const(1))),l.br(0))),l.i32_store(l.i32_const(0),l.getLocal("old0")))},qh=rh,Gh=function(t,e,n,o,i){const r=8*t.modules[e].n64;!function(){const e=t.addFunction(n+"_getChunk");e.addParam("pScalar","i32"),e.addParam("scalarSize","i32"),e.addParam("startBit","i32"),e.addParam("chunkSize","i32"),e.addLocal("bitsToEnd","i32"),e.addLocal("mask","i32"),e.setReturnType("i32");const o=e.getCodeBuilder();e.addCode(o.setLocal("bitsToEnd",o.i32_sub(o.i32_mul(o.getLocal("scalarSize"),o.i32_const(8)),o.getLocal("startBit"))),o.if(o.i32_gt_s(o.getLocal("chunkSize"),o.getLocal("bitsToEnd")),o.setLocal("mask",o.i32_sub(o.i32_shl(o.i32_const(1),o.getLocal("bitsToEnd")),o.i32_const(1))),o.setLocal("mask",o.i32_sub(o.i32_shl(o.i32_const(1),o.getLocal("chunkSize")),o.i32_const(1)))),o.i32_and(o.i32_shr_u(o.i32_load(o.i32_add(o.getLocal("pScalar"),o.i32_shr_u(o.getLocal("startBit"),o.i32_const(3))),0,0),o.i32_and(o.getLocal("startBit"),o.i32_const(7))),o.getLocal("mask")))}(),function(){const o=t.addFunction(n+"_reduceTable");o.addParam("pTable","i32"),o.addParam("p","i32"),o.addLocal("half","i32"),o.addLocal("it1","i32"),o.addLocal("it2","i32"),o.addLocal("pAcc","i32");const i=o.getCodeBuilder();o.addCode(i.if(i.i32_eq(i.getLocal("p"),i.i32_const(1)),i.ret([])),i.setLocal("half",i.i32_shl(i.i32_const(1),i.i32_sub(i.getLocal("p"),i.i32_const(1)))),i.setLocal("it1",i.getLocal("pTable")),i.setLocal("it2",i.i32_add(i.getLocal("pTable"),i.i32_mul(i.getLocal("half"),i.i32_const(r)))),i.setLocal("pAcc",i.i32_sub(i.getLocal("it2"),i.i32_const(r))),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("it1"),i.getLocal("pAcc"))),i.call(e+"_add",i.getLocal("it1"),i.getLocal("it2"),i.getLocal("it1")),i.call(e+"_add",i.getLocal("pAcc"),i.getLocal("it2"),i.getLocal("pAcc")),i.setLocal("it1",i.i32_add(i.getLocal("it1"),i.i32_const(r))),i.setLocal("it2",i.i32_add(i.getLocal("it2"),i.i32_const(r))),i.br(0))),i.call(n+"_reduceTable",i.getLocal("pTable"),i.i32_sub(i.getLocal("p"),i.i32_const(1))),i.setLocal("p",i.i32_sub(i.getLocal("p"),i.i32_const(1))),i.block(i.loop(i.br_if(1,i.i32_eqz(i.getLocal("p"))),i.call(e+"_double",i.getLocal("pAcc"),i.getLocal("pAcc")),i.setLocal("p",i.i32_sub(i.getLocal("p"),i.i32_const(1))),i.br(0))),i.call(e+"_add",i.getLocal("pTable"),i.getLocal("pAcc"),i.getLocal("pTable")))}(),function(){const a=t.addFunction(n+"_chunk");a.addParam("pBases","i32"),a.addParam("pScalars","i32"),a.addParam("scalarSize","i32"),a.addParam("n","i32"),a.addParam("startBit","i32"),a.addParam("chunkSize","i32"),a.addParam("pr","i32"),a.addLocal("nChunks","i32"),a.addLocal("itScalar","i32"),a.addLocal("endScalar","i32"),a.addLocal("itBase","i32"),a.addLocal("i","i32"),a.addLocal("j","i32"),a.addLocal("nTable","i32"),a.addLocal("pTable","i32"),a.addLocal("idx","i32"),a.addLocal("pIdxTable","i32");const c=a.getCodeBuilder();a.addCode(c.if(c.i32_eqz(c.getLocal("n")),[...c.call(e+"_zero",c.getLocal("pr")),...c.ret([])]),c.setLocal("nTable",c.i32_shl(c.i32_const(1),c.getLocal("chunkSize"))),c.setLocal("pTable",c.i32_load(c.i32_const(0))),c.i32_store(c.i32_const(0),c.i32_add(c.getLocal("pTable"),c.i32_mul(c.getLocal("nTable"),c.i32_const(r)))),c.setLocal("j",c.i32_const(0)),c.block(c.loop(c.br_if(1,c.i32_eq(c.getLocal("j"),c.getLocal("nTable"))),c.call(e+"_zero",c.i32_add(c.getLocal("pTable"),c.i32_mul(c.getLocal("j"),c.i32_const(r)))),c.setLocal("j",c.i32_add(c.getLocal("j"),c.i32_const(1))),c.br(0))),c.setLocal("itBase",c.getLocal("pBases")),c.setLocal("itScalar",c.getLocal("pScalars")),c.setLocal("endScalar",c.i32_add(c.getLocal("pScalars"),c.i32_mul(c.getLocal("n"),c.getLocal("scalarSize")))),c.block(c.loop(c.br_if(1,c.i32_eq(c.getLocal("itScalar"),c.getLocal("endScalar"))),c.setLocal("idx",c.call(n+"_getChunk",c.getLocal("itScalar"),c.getLocal("scalarSize"),c.getLocal("startBit"),c.getLocal("chunkSize"))),c.if(c.getLocal("idx"),[...c.setLocal("pIdxTable",c.i32_add(c.getLocal("pTable"),c.i32_mul(c.i32_sub(c.getLocal("idx"),c.i32_const(1)),c.i32_const(r)))),...c.call(o,c.getLocal("pIdxTable"),c.getLocal("itBase"),c.getLocal("pIdxTable"))]),c.setLocal("itScalar",c.i32_add(c.getLocal("itScalar"),c.getLocal("scalarSize"))),c.setLocal("itBase",c.i32_add(c.getLocal("itBase"),c.i32_const(i))),c.br(0))),c.call(n+"_reduceTable",c.getLocal("pTable"),c.getLocal("chunkSize")),c.call(e+"_copy",c.getLocal("pTable"),c.getLocal("pr")),c.i32_store(c.i32_const(0),c.getLocal("pTable")))}(),function(){const o=t.addFunction(n);o.addParam("pBases","i32"),o.addParam("pScalars","i32"),o.addParam("scalarSize","i32"),o.addParam("n","i32"),o.addParam("pr","i32"),o.addLocal("chunkSize","i32"),o.addLocal("nChunks","i32"),o.addLocal("itScalar","i32"),o.addLocal("endScalar","i32"),o.addLocal("itBase","i32"),o.addLocal("itBit","i32"),o.addLocal("i","i32"),o.addLocal("j","i32"),o.addLocal("nTable","i32"),o.addLocal("pTable","i32"),o.addLocal("idx","i32"),o.addLocal("pIdxTable","i32");const i=o.getCodeBuilder(),a=i.i32_const(t.alloc(r)),c=t.alloc([17,17,17,17,17,17,17,17,17,17,16,16,15,14,13,13,12,11,10,9,8,7,7,6,5,4,3,2,1,1,1,1]);o.addCode(i.call(e+"_zero",i.getLocal("pr")),i.if(i.i32_eqz(i.getLocal("n")),i.ret([])),i.setLocal("chunkSize",i.i32_load8_u(i.i32_clz(i.getLocal("n")),c)),i.setLocal("nChunks",i.i32_add(i.i32_div_u(i.i32_sub(i.i32_shl(i.getLocal("scalarSize"),i.i32_const(3)),i.i32_const(1)),i.getLocal("chunkSize")),i.i32_const(1))),i.setLocal("itBit",i.i32_mul(i.i32_sub(i.getLocal("nChunks"),i.i32_const(1)),i.getLocal("chunkSize"))),i.block(i.loop(i.br_if(1,i.i32_lt_s(i.getLocal("itBit"),i.i32_const(0))),i.if(i.i32_eqz(i.call(e+"_isZero",i.getLocal("pr"))),[...i.setLocal("j",i.i32_const(0)),...i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("j"),i.getLocal("chunkSize"))),i.call(e+"_double",i.getLocal("pr"),i.getLocal("pr")),i.setLocal("j",i.i32_add(i.getLocal("j"),i.i32_const(1))),i.br(0)))]),i.call(n+"_chunk",i.getLocal("pBases"),i.getLocal("pScalars"),i.getLocal("scalarSize"),i.getLocal("n"),i.getLocal("itBit"),i.getLocal("chunkSize"),a),i.call(e+"_add",i.getLocal("pr"),a,i.getLocal("pr")),i.setLocal("itBit",i.i32_sub(i.getLocal("itBit"),i.getLocal("chunkSize"))),i.br(0))))}(),t.exportFunction(n),t.exportFunction(n+"_chunk")};var Kh=function(t,e,n,o){const i=t.modules[n].n64,r=8*i;return t.modules[e]||(t.modules[e]={n64:3*i},function(){const o=t.addFunction(e+"_isZeroAffine");o.addParam("p1","i32"),o.setReturnType("i32");const i=o.getCodeBuilder();o.addCode(i.i32_and(i.call(n+"_isZero",i.getLocal("p1")),i.call(n+"_isZero",i.i32_add(i.getLocal("p1"),i.i32_const(r)))))}(),function(){const o=t.addFunction(e+"_isZero");o.addParam("p1","i32"),o.setReturnType("i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_isZero",i.i32_add(i.getLocal("p1"),i.i32_const(2*r))))}(),function(){const o=t.addFunction(e+"_zeroAffine");o.addParam("pr","i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_zero",i.getLocal("pr"))),o.addCode(i.call(n+"_zero",i.i32_add(i.getLocal("pr"),i.i32_const(r))))}(),function(){const o=t.addFunction(e+"_zero");o.addParam("pr","i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_zero",i.getLocal("pr"))),o.addCode(i.call(n+"_one",i.i32_add(i.getLocal("pr"),i.i32_const(r)))),o.addCode(i.call(n+"_zero",i.i32_add(i.getLocal("pr"),i.i32_const(2*r))))}(),function(){const n=t.addFunction(e+"_copyAffine");n.addParam("ps","i32"),n.addParam("pd","i32");const o=n.getCodeBuilder();for(let t=0;t<2*i;t++)n.addCode(o.i64_store(o.getLocal("pd"),8*t,o.i64_load(o.getLocal("ps"),8*t)))}(),function(){const n=t.addFunction(e+"_copy");n.addParam("ps","i32"),n.addParam("pd","i32");const o=n.getCodeBuilder();for(let t=0;t<3*i;t++)n.addCode(o.i64_store(o.getLocal("pd"),8*t,o.i64_load(o.getLocal("ps"),8*t)))}(),function(){const o=t.addFunction(e+"_toJacobian");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.getLocal("pr"),l=i.i32_add(i.getLocal("pr"),i.i32_const(r)),d=i.i32_add(i.getLocal("pr"),i.i32_const(2*r));o.addCode(i.if(i.call(e+"_isZeroAffine",i.getLocal("p1")),i.call(e+"_zero",i.getLocal("pr")),[...i.call(n+"_one",d),...i.call(n+"_copy",c,l),...i.call(n+"_copy",a,s)]))}(),function(){const o=t.addFunction(e+"_eqAffine");o.addParam("p1","i32"),o.addParam("p2","i32"),o.setReturnType("i32"),o.addLocal("z1","i32");const i=o.getCodeBuilder();o.addCode(i.ret(i.i32_and(i.call(n+"_eq",i.getLocal("p1"),i.getLocal("p2")),i.call(n+"_eq",i.i32_add(i.getLocal("p1"),i.i32_const(r)),i.i32_add(i.getLocal("p2"),i.i32_const(r))))))}(),function(){const o=t.addFunction(e+"_eqMixed");o.addParam("p1","i32"),o.addParam("p2","i32"),o.setReturnType("i32"),o.addLocal("z1","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r));o.addCode(i.setLocal("z1",i.i32_add(i.getLocal("p1"),i.i32_const(2*r))));const s=i.getLocal("z1"),l=i.getLocal("p2"),d=i.i32_add(i.getLocal("p2"),i.i32_const(r)),u=i.i32_const(t.alloc(r)),f=i.i32_const(t.alloc(r)),g=i.i32_const(t.alloc(r)),h=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),i.ret(i.call(e+"_isZeroAffine",i.getLocal("p2")))),i.if(i.call(e+"_isZeroAffine",i.getLocal("p2")),i.ret(i.i32_const(0))),i.if(i.call(n+"_isOne",s),i.ret(i.call(e+"_eqAffine",i.getLocal("p1"),i.getLocal("p2")))),i.call(n+"_square",s,u),i.call(n+"_mul",l,u,f),i.call(n+"_mul",s,u,g),i.call(n+"_mul",d,g,h),i.if(i.call(n+"_eq",a,f),i.if(i.call(n+"_eq",c,h),i.ret(i.i32_const(1)))),i.ret(i.i32_const(0)))}(),function(){const o=t.addFunction(e+"_eq");o.addParam("p1","i32"),o.addParam("p2","i32"),o.setReturnType("i32"),o.addLocal("z1","i32"),o.addLocal("z2","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r));o.addCode(i.setLocal("z1",i.i32_add(i.getLocal("p1"),i.i32_const(2*r))));const s=i.getLocal("z1"),l=i.getLocal("p2"),d=i.i32_add(i.getLocal("p2"),i.i32_const(r));o.addCode(i.setLocal("z2",i.i32_add(i.getLocal("p2"),i.i32_const(2*r))));const u=i.getLocal("z2"),f=i.i32_const(t.alloc(r)),g=i.i32_const(t.alloc(r)),h=i.i32_const(t.alloc(r)),p=i.i32_const(t.alloc(r)),_=i.i32_const(t.alloc(r)),m=i.i32_const(t.alloc(r)),y=i.i32_const(t.alloc(r)),L=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),i.ret(i.call(e+"_isZero",i.getLocal("p2")))),i.if(i.call(e+"_isZero",i.getLocal("p2")),i.ret(i.i32_const(0))),i.if(i.call(n+"_isOne",s),i.ret(i.call(e+"_eqMixed",i.getLocal("p2"),i.getLocal("p1")))),i.if(i.call(n+"_isOne",u),i.ret(i.call(e+"_eqMixed",i.getLocal("p1"),i.getLocal("p2")))),i.call(n+"_square",s,f),i.call(n+"_square",u,g),i.call(n+"_mul",a,g,h),i.call(n+"_mul",l,f,p),i.call(n+"_mul",s,f,_),i.call(n+"_mul",u,g,m),i.call(n+"_mul",c,m,y),i.call(n+"_mul",d,_,L),i.if(i.call(n+"_eq",h,p),i.if(i.call(n+"_eq",y,L),i.ret(i.i32_const(1)))),i.ret(i.i32_const(0)))}(),function(){const o=t.addFunction(e+"_doubleAffine");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.getLocal("pr"),l=i.i32_add(i.getLocal("pr"),i.i32_const(r)),d=i.i32_add(i.getLocal("pr"),i.i32_const(2*r)),u=i.i32_const(t.alloc(r)),f=i.i32_const(t.alloc(r)),g=i.i32_const(t.alloc(r)),h=i.i32_const(t.alloc(r)),p=i.i32_const(t.alloc(r)),_=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZeroAffine",i.getLocal("p1")),[...i.call(e+"_toJacobian",i.getLocal("p1"),i.getLocal("pr")),...i.ret([])]),i.call(n+"_square",a,u),i.call(n+"_square",c,f),i.call(n+"_square",f,g),i.call(n+"_add",a,f,h),i.call(n+"_square",h,h),i.call(n+"_sub",h,u,h),i.call(n+"_sub",h,g,h),i.call(n+"_add",h,h,h),i.call(n+"_add",u,u,p),i.call(n+"_add",p,u,p),i.call(n+"_add",c,c,d),i.call(n+"_square",p,s),i.call(n+"_sub",s,h,s),i.call(n+"_sub",s,h,s),i.call(n+"_add",g,g,_),i.call(n+"_add",_,_,_),i.call(n+"_add",_,_,_),i.call(n+"_sub",h,s,l),i.call(n+"_mul",l,p,l),i.call(n+"_sub",l,_,l))}(),function(){const o=t.addFunction(e+"_double");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.i32_add(i.getLocal("p1"),i.i32_const(2*r)),l=i.getLocal("pr"),d=i.i32_add(i.getLocal("pr"),i.i32_const(r)),u=i.i32_add(i.getLocal("pr"),i.i32_const(2*r)),f=i.i32_const(t.alloc(r)),g=i.i32_const(t.alloc(r)),h=i.i32_const(t.alloc(r)),p=i.i32_const(t.alloc(r)),_=i.i32_const(t.alloc(r)),m=i.i32_const(t.alloc(r)),y=i.i32_const(t.alloc(r)),L=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),[...i.call(e+"_copy",i.getLocal("p1"),i.getLocal("pr")),...i.ret([])]),i.if(i.call(n+"_isOne",s),[...i.ret(i.call(e+"_doubleAffine",i.getLocal("p1"),i.getLocal("pr"))),...i.ret([])]),i.call(n+"_square",a,f),i.call(n+"_square",c,g),i.call(n+"_square",g,h),i.call(n+"_add",a,g,p),i.call(n+"_square",p,p),i.call(n+"_sub",p,f,p),i.call(n+"_sub",p,h,p),i.call(n+"_add",p,p,p),i.call(n+"_add",f,f,_),i.call(n+"_add",_,f,_),i.call(n+"_square",_,m),i.call(n+"_mul",c,s,y),i.call(n+"_add",p,p,l),i.call(n+"_sub",m,l,l),i.call(n+"_add",h,h,L),i.call(n+"_add",L,L,L),i.call(n+"_add",L,L,L),i.call(n+"_sub",p,l,d),i.call(n+"_mul",d,_,d),i.call(n+"_sub",d,L,d),i.call(n+"_add",y,y,u))}(),function(){const o=t.addFunction(e+"_addAffine");o.addParam("p1","i32"),o.addParam("p2","i32"),o.addParam("pr","i32"),o.addLocal("z1","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r));o.addCode(i.setLocal("z1",i.i32_add(i.getLocal("p1"),i.i32_const(2*r))));const s=i.getLocal("p2"),l=i.i32_add(i.getLocal("p2"),i.i32_const(r)),d=i.getLocal("pr"),u=i.i32_add(i.getLocal("pr"),i.i32_const(r)),f=i.i32_add(i.getLocal("pr"),i.i32_const(2*r)),g=i.i32_const(t.alloc(r)),h=i.i32_const(t.alloc(r)),p=i.i32_const(t.alloc(r)),_=i.i32_const(t.alloc(r)),m=i.i32_const(t.alloc(r)),y=i.i32_const(t.alloc(r)),L=i.i32_const(t.alloc(r)),b=i.i32_const(t.alloc(r)),A=i.i32_const(t.alloc(r)),w=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZeroAffine",i.getLocal("p1")),[...i.call(e+"_copyAffine",i.getLocal("p2"),i.getLocal("pr")),...i.call(n+"_one",i.i32_add(i.getLocal("pr"),i.i32_const(2*r))),...i.ret([])]),i.if(i.call(e+"_isZeroAffine",i.getLocal("p2")),[...i.call(e+"_copyAffine",i.getLocal("p1"),i.getLocal("pr")),...i.call(n+"_one",i.i32_add(i.getLocal("pr"),i.i32_const(2*r))),...i.ret([])]),i.if(i.call(n+"_eq",a,s),i.if(i.call(n+"_eq",c,l),[...i.call(e+"_doubleAffine",i.getLocal("p2"),i.getLocal("pr")),...i.ret([])])),i.call(n+"_sub",s,a,g),i.call(n+"_sub",l,c,p),i.call(n+"_square",g,h),i.call(n+"_add",h,h,_),i.call(n+"_add",_,_,_),i.call(n+"_mul",g,_,m),i.call(n+"_add",p,p,y),i.call(n+"_mul",a,_,b),i.call(n+"_square",y,L),i.call(n+"_add",b,b,A),i.call(n+"_sub",L,m,d),i.call(n+"_sub",d,A,d),i.call(n+"_mul",c,m,w),i.call(n+"_add",w,w,w),i.call(n+"_sub",b,d,u),i.call(n+"_mul",u,y,u),i.call(n+"_sub",u,w,u),i.call(n+"_add",g,g,f))}(),function(){const o=t.addFunction(e+"_addMixed");o.addParam("p1","i32"),o.addParam("p2","i32"),o.addParam("pr","i32"),o.addLocal("z1","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r));o.addCode(i.setLocal("z1",i.i32_add(i.getLocal("p1"),i.i32_const(2*r))));const s=i.getLocal("z1"),l=i.getLocal("p2"),d=i.i32_add(i.getLocal("p2"),i.i32_const(r)),u=i.getLocal("pr"),f=i.i32_add(i.getLocal("pr"),i.i32_const(r)),g=i.i32_add(i.getLocal("pr"),i.i32_const(2*r)),h=i.i32_const(t.alloc(r)),p=i.i32_const(t.alloc(r)),_=i.i32_const(t.alloc(r)),m=i.i32_const(t.alloc(r)),y=i.i32_const(t.alloc(r)),L=i.i32_const(t.alloc(r)),b=i.i32_const(t.alloc(r)),A=i.i32_const(t.alloc(r)),w=i.i32_const(t.alloc(r)),I=i.i32_const(t.alloc(r)),x=i.i32_const(t.alloc(r)),C=i.i32_const(t.alloc(r)),v=i.i32_const(t.alloc(r)),E=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),[...i.call(e+"_copyAffine",i.getLocal("p2"),i.getLocal("pr")),...i.call(n+"_one",i.i32_add(i.getLocal("pr"),i.i32_const(2*r))),...i.ret([])]),i.if(i.call(e+"_isZeroAffine",i.getLocal("p2")),[...i.call(e+"_copy",i.getLocal("p1"),i.getLocal("pr")),...i.ret([])]),i.if(i.call(n+"_isOne",s),[...i.call(e+"_addAffine",a,l,u),...i.ret([])]),i.call(n+"_square",s,h),i.call(n+"_mul",l,h,p),i.call(n+"_mul",s,h,_),i.call(n+"_mul",d,_,m),i.if(i.call(n+"_eq",a,p),i.if(i.call(n+"_eq",c,m),[...i.call(e+"_doubleAffine",i.getLocal("p2"),i.getLocal("pr")),...i.ret([])])),i.call(n+"_sub",p,a,y),i.call(n+"_sub",m,c,b),i.call(n+"_square",y,L),i.call(n+"_add",L,L,A),i.call(n+"_add",A,A,A),i.call(n+"_mul",y,A,w),i.call(n+"_add",b,b,I),i.call(n+"_mul",a,A,C),i.call(n+"_square",I,x),i.call(n+"_add",C,C,v),i.call(n+"_sub",x,w,u),i.call(n+"_sub",u,v,u),i.call(n+"_mul",c,w,E),i.call(n+"_add",E,E,E),i.call(n+"_sub",C,u,f),i.call(n+"_mul",f,I,f),i.call(n+"_sub",f,E,f),i.call(n+"_add",s,y,g),i.call(n+"_square",g,g),i.call(n+"_sub",g,h,g),i.call(n+"_sub",g,L,g))}(),function(){const o=t.addFunction(e+"_add");o.addParam("p1","i32"),o.addParam("p2","i32"),o.addParam("pr","i32"),o.addLocal("z1","i32"),o.addLocal("z2","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r));o.addCode(i.setLocal("z1",i.i32_add(i.getLocal("p1"),i.i32_const(2*r))));const s=i.getLocal("z1"),l=i.getLocal("p2"),d=i.i32_add(i.getLocal("p2"),i.i32_const(r));o.addCode(i.setLocal("z2",i.i32_add(i.getLocal("p2"),i.i32_const(2*r))));const u=i.getLocal("z2"),f=i.getLocal("pr"),g=i.i32_add(i.getLocal("pr"),i.i32_const(r)),h=i.i32_add(i.getLocal("pr"),i.i32_const(2*r)),p=i.i32_const(t.alloc(r)),_=i.i32_const(t.alloc(r)),m=i.i32_const(t.alloc(r)),y=i.i32_const(t.alloc(r)),L=i.i32_const(t.alloc(r)),b=i.i32_const(t.alloc(r)),A=i.i32_const(t.alloc(r)),w=i.i32_const(t.alloc(r)),I=i.i32_const(t.alloc(r)),x=i.i32_const(t.alloc(r)),C=i.i32_const(t.alloc(r)),v=i.i32_const(t.alloc(r)),E=i.i32_const(t.alloc(r)),B=i.i32_const(t.alloc(r)),F=i.i32_const(t.alloc(r)),O=i.i32_const(t.alloc(r)),S=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),[...i.call(e+"_copy",i.getLocal("p2"),i.getLocal("pr")),...i.ret([])]),i.if(i.call(e+"_isZero",i.getLocal("p2")),[...i.call(e+"_copy",i.getLocal("p1"),i.getLocal("pr")),...i.ret([])]),i.if(i.call(n+"_isOne",s),[...i.call(e+"_addMixed",l,a,f),...i.ret([])]),i.if(i.call(n+"_isOne",u),[...i.call(e+"_addMixed",a,l,f),...i.ret([])]),i.call(n+"_square",s,p),i.call(n+"_square",u,_),i.call(n+"_mul",a,_,m),i.call(n+"_mul",l,p,y),i.call(n+"_mul",s,p,L),i.call(n+"_mul",u,_,b),i.call(n+"_mul",c,b,A),i.call(n+"_mul",d,L,w),i.if(i.call(n+"_eq",m,y),i.if(i.call(n+"_eq",A,w),[...i.call(e+"_double",i.getLocal("p1"),i.getLocal("pr")),...i.ret([])])),i.call(n+"_sub",y,m,I),i.call(n+"_sub",w,A,x),i.call(n+"_add",I,I,C),i.call(n+"_square",C,C),i.call(n+"_mul",I,C,v),i.call(n+"_add",x,x,E),i.call(n+"_mul",m,C,F),i.call(n+"_square",E,B),i.call(n+"_add",F,F,O),i.call(n+"_sub",B,v,f),i.call(n+"_sub",f,O,f),i.call(n+"_mul",A,v,S),i.call(n+"_add",S,S,S),i.call(n+"_sub",F,f,g),i.call(n+"_mul",g,E,g),i.call(n+"_sub",g,S,g),i.call(n+"_add",s,u,h),i.call(n+"_square",h,h),i.call(n+"_sub",h,p,h),i.call(n+"_sub",h,_,h),i.call(n+"_mul",h,I,h))}(),function(){const o=t.addFunction(e+"_negAffine");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.getLocal("pr"),l=i.i32_add(i.getLocal("pr"),i.i32_const(r));o.addCode(i.call(n+"_copy",a,s),i.call(n+"_neg",c,l))}(),function(){const o=t.addFunction(e+"_neg");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.i32_add(i.getLocal("p1"),i.i32_const(2*r)),l=i.getLocal("pr"),d=i.i32_add(i.getLocal("pr"),i.i32_const(r)),u=i.i32_add(i.getLocal("pr"),i.i32_const(2*r));o.addCode(i.call(n+"_copy",a,l),i.call(n+"_neg",c,d),i.call(n+"_copy",s,u))}(),function(){const n=t.addFunction(e+"_subAffine");n.addParam("p1","i32"),n.addParam("p2","i32"),n.addParam("pr","i32");const o=n.getCodeBuilder(),i=o.i32_const(t.alloc(3*r));n.addCode(o.call(e+"_negAffine",o.getLocal("p2"),i),o.call(e+"_addAffine",o.getLocal("p1"),i,o.getLocal("pr")))}(),function(){const n=t.addFunction(e+"_subMixed");n.addParam("p1","i32"),n.addParam("p2","i32"),n.addParam("pr","i32");const o=n.getCodeBuilder(),i=o.i32_const(t.alloc(3*r));n.addCode(o.call(e+"_negAffine",o.getLocal("p2"),i),o.call(e+"_addMixed",o.getLocal("p1"),i,o.getLocal("pr")))}(),function(){const n=t.addFunction(e+"_sub");n.addParam("p1","i32"),n.addParam("p2","i32"),n.addParam("pr","i32");const o=n.getCodeBuilder(),i=o.i32_const(t.alloc(3*r));n.addCode(o.call(e+"_neg",o.getLocal("p2"),i),o.call(e+"_add",o.getLocal("p1"),i,o.getLocal("pr")))}(),function(){const o=t.addFunction(e+"_fromMontgomeryAffine");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_fromMontgomery",i.getLocal("p1"),i.getLocal("pr")));for(let t=1;t<2;t++)o.addCode(i.call(n+"_fromMontgomery",i.i32_add(i.getLocal("p1"),i.i32_const(t*r)),i.i32_add(i.getLocal("pr"),i.i32_const(t*r))))}(),function(){const o=t.addFunction(e+"_fromMontgomery");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_fromMontgomery",i.getLocal("p1"),i.getLocal("pr")));for(let t=1;t<3;t++)o.addCode(i.call(n+"_fromMontgomery",i.i32_add(i.getLocal("p1"),i.i32_const(t*r)),i.i32_add(i.getLocal("pr"),i.i32_const(t*r))))}(),function(){const o=t.addFunction(e+"_toMontgomeryAffine");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_toMontgomery",i.getLocal("p1"),i.getLocal("pr")));for(let t=1;t<2;t++)o.addCode(i.call(n+"_toMontgomery",i.i32_add(i.getLocal("p1"),i.i32_const(t*r)),i.i32_add(i.getLocal("pr"),i.i32_const(t*r))))}(),function(){const o=t.addFunction(e+"_toMontgomery");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder();o.addCode(i.call(n+"_toMontgomery",i.getLocal("p1"),i.getLocal("pr")));for(let t=1;t<3;t++)o.addCode(i.call(n+"_toMontgomery",i.i32_add(i.getLocal("p1"),i.i32_const(t*r)),i.i32_add(i.getLocal("pr"),i.i32_const(t*r))))}(),function(){const o=t.addFunction(e+"_toAffine");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.i32_add(i.getLocal("p1"),i.i32_const(2*r)),l=i.getLocal("pr"),d=i.i32_add(i.getLocal("pr"),i.i32_const(r)),u=i.i32_const(t.alloc(r)),f=i.i32_const(t.alloc(r)),g=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),[...i.call(n+"_zero",l),...i.call(n+"_zero",d)],[...i.call(n+"_inverse",s,u),...i.call(n+"_square",u,f),...i.call(n+"_mul",u,f,g),...i.call(n+"_mul",a,f,l),...i.call(n+"_mul",c,g,d)]))}(),function(){const i=t.addFunction(e+"_inCurveAffine");i.addParam("pIn","i32"),i.setReturnType("i32");const a=i.getCodeBuilder(),c=a.getLocal("pIn"),s=a.i32_add(a.getLocal("pIn"),a.i32_const(r)),l=a.i32_const(t.alloc(r)),d=a.i32_const(t.alloc(r));i.addCode(a.call(n+"_square",s,l),a.call(n+"_square",c,d),a.call(n+"_mul",c,d,d),a.call(n+"_add",d,a.i32_const(o),d),a.ret(a.call(n+"_eq",l,d)))}(),function(){const n=t.addFunction(e+"_inCurve");n.addParam("pIn","i32"),n.setReturnType("i32");const o=n.getCodeBuilder(),i=o.i32_const(t.alloc(2*r));n.addCode(o.call(e+"_toAffine",o.getLocal("pIn"),i),o.ret(o.call(e+"_inCurveAffine",i)))}(),function(){const o=t.addFunction(e+"_batchToAffine");o.addParam("pIn","i32"),o.addParam("n","i32"),o.addParam("pOut","i32"),o.addLocal("pAux","i32"),o.addLocal("itIn","i32"),o.addLocal("itAux","i32"),o.addLocal("itOut","i32"),o.addLocal("i","i32");const i=o.getCodeBuilder(),a=i.i32_const(t.alloc(r));o.addCode(i.setLocal("pAux",i.i32_load(i.i32_const(0))),i.i32_store(i.i32_const(0),i.i32_add(i.getLocal("pAux"),i.i32_mul(i.getLocal("n"),i.i32_const(r)))),i.call(n+"_batchInverse",i.i32_add(i.getLocal("pIn"),i.i32_const(2*r)),i.i32_const(3*r),i.getLocal("n"),i.getLocal("pAux"),i.i32_const(r)),i.setLocal("itIn",i.getLocal("pIn")),i.setLocal("itAux",i.getLocal("pAux")),i.setLocal("itOut",i.getLocal("pOut")),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.if(i.call(n+"_isZero",i.getLocal("itAux")),[...i.call(n+"_zero",i.getLocal("itOut")),...i.call(n+"_zero",i.i32_add(i.getLocal("itOut"),i.i32_const(r)))],[...i.call(n+"_mul",i.getLocal("itAux"),i.i32_add(i.getLocal("itIn"),i.i32_const(r)),a),...i.call(n+"_square",i.getLocal("itAux"),i.getLocal("itAux")),...i.call(n+"_mul",i.getLocal("itAux"),i.getLocal("itIn"),i.getLocal("itOut")),...i.call(n+"_mul",i.getLocal("itAux"),a,i.i32_add(i.getLocal("itOut"),i.i32_const(r)))]),i.setLocal("itIn",i.i32_add(i.getLocal("itIn"),i.i32_const(3*r))),i.setLocal("itOut",i.i32_add(i.getLocal("itOut"),i.i32_const(2*r))),i.setLocal("itAux",i.i32_add(i.getLocal("itAux"),i.i32_const(r))),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))),i.i32_store(i.i32_const(0),i.getLocal("pAux")))}(),function(){const o=t.addFunction(e+"_normalize");o.addParam("p1","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),a=i.getLocal("p1"),c=i.i32_add(i.getLocal("p1"),i.i32_const(r)),s=i.i32_add(i.getLocal("p1"),i.i32_const(2*r)),l=i.getLocal("pr"),d=i.i32_add(i.getLocal("pr"),i.i32_const(r)),u=i.i32_add(i.getLocal("pr"),i.i32_const(2*r)),f=i.i32_const(t.alloc(r)),g=i.i32_const(t.alloc(r)),h=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZero",i.getLocal("p1")),i.call(e+"_zero",i.getLocal("pr")),[...i.call(n+"_inverse",s,f),...i.call(n+"_square",f,g),...i.call(n+"_mul",f,g,h),...i.call(n+"_mul",a,g,l),...i.call(n+"_mul",c,h,d),...i.call(n+"_one",u)]))}(),function(){const n=t.addFunction(e+"__reverseBytes");n.addParam("pIn","i32"),n.addParam("n","i32"),n.addParam("pOut","i32"),n.addLocal("itOut","i32"),n.addLocal("itIn","i32");const o=n.getCodeBuilder();n.addCode(o.setLocal("itOut",o.i32_sub(o.i32_add(o.getLocal("pOut"),o.getLocal("n")),o.i32_const(1))),o.setLocal("itIn",o.getLocal("pIn")),o.block(o.loop(o.br_if(1,o.i32_lt_s(o.getLocal("itOut"),o.getLocal("pOut"))),o.i32_store8(o.getLocal("itOut"),o.i32_load8_u(o.getLocal("itIn"))),o.setLocal("itOut",o.i32_sub(o.getLocal("itOut"),o.i32_const(1))),o.setLocal("itIn",o.i32_add(o.getLocal("itIn"),o.i32_const(1))),o.br(0))))}(),function(){const n=t.addFunction(e+"_LEMtoU");n.addParam("pIn","i32"),n.addParam("pOut","i32");const o=n.getCodeBuilder(),i=t.alloc(2*r),a=o.i32_const(i),c=o.i32_const(i),s=o.i32_const(i+r);n.addCode(o.if(o.call(e+"_isZeroAffine",o.getLocal("pIn")),[...o.call(e+"_zeroAffine",o.getLocal("pOut")),...o.ret([])]),o.call(e+"_fromMontgomeryAffine",o.getLocal("pIn"),a),o.call(e+"__reverseBytes",c,o.i32_const(r),o.getLocal("pOut")),o.call(e+"__reverseBytes",s,o.i32_const(r),o.i32_add(o.getLocal("pOut"),o.i32_const(r))))}(),function(){const o=t.addFunction(e+"_LEMtoC");o.addParam("pIn","i32"),o.addParam("pOut","i32");const i=o.getCodeBuilder(),a=i.i32_const(t.alloc(r));o.addCode(i.if(i.call(e+"_isZeroAffine",i.getLocal("pIn")),[...i.call(n+"_zero",i.getLocal("pOut")),...i.i32_store8(i.getLocal("pOut"),i.i32_const(64)),...i.ret([])]),i.call(n+"_fromMontgomery",i.getLocal("pIn"),a),i.call(e+"__reverseBytes",a,i.i32_const(r),i.getLocal("pOut")),i.if(i.i32_eq(i.call(n+"_sign",i.i32_add(i.getLocal("pIn"),i.i32_const(r))),i.i32_const(-1)),i.i32_store8(i.getLocal("pOut"),i.i32_or(i.i32_load8_u(i.getLocal("pOut")),i.i32_const(128)))))}(),function(){const n=t.addFunction(e+"_UtoLEM");n.addParam("pIn","i32"),n.addParam("pOut","i32");const o=n.getCodeBuilder(),i=t.alloc(2*r),a=o.i32_const(i),c=o.i32_const(i),s=o.i32_const(i+r);n.addCode(o.if(o.i32_and(o.i32_load8_u(o.getLocal("pIn")),o.i32_const(64)),[...o.call(e+"_zeroAffine",o.getLocal("pOut")),...o.ret([])]),o.call(e+"__reverseBytes",o.getLocal("pIn"),o.i32_const(r),c),o.call(e+"__reverseBytes",o.i32_add(o.getLocal("pIn"),o.i32_const(r)),o.i32_const(r),s),o.call(e+"_toMontgomeryAffine",a,o.getLocal("pOut")))}(),function(){const i=t.addFunction(e+"_CtoLEM");i.addParam("pIn","i32"),i.addParam("pOut","i32"),i.addLocal("firstByte","i32"),i.addLocal("greatest","i32");const a=i.getCodeBuilder(),c=t.alloc(2*r),s=a.i32_const(c),l=a.i32_const(c+r);i.addCode(a.setLocal("firstByte",a.i32_load8_u(a.getLocal("pIn"))),a.if(a.i32_and(a.getLocal("firstByte"),a.i32_const(64)),[...a.call(e+"_zeroAffine",a.getLocal("pOut")),...a.ret([])]),a.setLocal("greatest",a.i32_and(a.getLocal("firstByte"),a.i32_const(128))),a.call(n+"_copy",a.getLocal("pIn"),l),a.i32_store8(l,a.i32_and(a.getLocal("firstByte"),a.i32_const(63))),a.call(e+"__reverseBytes",l,a.i32_const(r),s),a.call(n+"_toMontgomery",s,a.getLocal("pOut")),a.call(n+"_square",a.getLocal("pOut"),l),a.call(n+"_mul",a.getLocal("pOut"),l,l),a.call(n+"_add",l,a.i32_const(o),l),a.call(n+"_sqrt",l,l),a.call(n+"_neg",l,s),a.if(a.i32_eq(a.call(n+"_sign",l),a.i32_const(-1)),a.if(a.getLocal("greatest"),a.call(n+"_copy",l,a.i32_add(a.getLocal("pOut"),a.i32_const(r))),a.call(n+"_neg",l,a.i32_add(a.getLocal("pOut"),a.i32_const(r)))),a.if(a.getLocal("greatest"),a.call(n+"_neg",l,a.i32_add(a.getLocal("pOut"),a.i32_const(r))),a.call(n+"_copy",l,a.i32_add(a.getLocal("pOut"),a.i32_const(r))))))}(),qh(t,e+"_batchLEMtoU",e+"_LEMtoU",2*r,2*r),qh(t,e+"_batchLEMtoC",e+"_LEMtoC",2*r,r),qh(t,e+"_batchUtoLEM",e+"_UtoLEM",2*r,2*r),qh(t,e+"_batchCtoLEM",e+"_CtoLEM",r,2*r,!0),qh(t,e+"_batchToJacobian",e+"_toJacobian",2*r,3*r,!0),Gh(t,e,e+"_multiexp",e+"_add",3*r),Gh(t,e,e+"_multiexpAffine",e+"_addMixed",2*r),Rh(t,e+"_timesScalar",3*r,e+"_add",e+"_double",e+"_sub",e+"_copy",e+"_zero"),Rh(t,e+"_timesScalarAffine",2*r,e+"_addMixed",e+"_double",e+"_subMixed",e+"_copyAffine",e+"_zero"),t.exportFunction(e+"_isZero"),t.exportFunction(e+"_isZeroAffine"),t.exportFunction(e+"_eq"),t.exportFunction(e+"_eqMixed"),t.exportFunction(e+"_eqAffine"),t.exportFunction(e+"_copy"),t.exportFunction(e+"_copyAffine"),t.exportFunction(e+"_zero"),t.exportFunction(e+"_zeroAffine"),t.exportFunction(e+"_double"),t.exportFunction(e+"_doubleAffine"),t.exportFunction(e+"_add"),t.exportFunction(e+"_addMixed"),t.exportFunction(e+"_addAffine"),t.exportFunction(e+"_neg"),t.exportFunction(e+"_negAffine"),t.exportFunction(e+"_sub"),t.exportFunction(e+"_subMixed"),t.exportFunction(e+"_subAffine"),t.exportFunction(e+"_fromMontgomery"),t.exportFunction(e+"_fromMontgomeryAffine"),t.exportFunction(e+"_toMontgomery"),t.exportFunction(e+"_toMontgomeryAffine"),t.exportFunction(e+"_timesScalar"),t.exportFunction(e+"_timesScalarAffine"),t.exportFunction(e+"_normalize"),t.exportFunction(e+"_LEMtoU"),t.exportFunction(e+"_LEMtoC"),t.exportFunction(e+"_UtoLEM"),t.exportFunction(e+"_CtoLEM"),t.exportFunction(e+"_batchLEMtoU"),t.exportFunction(e+"_batchLEMtoC"),t.exportFunction(e+"_batchUtoLEM"),t.exportFunction(e+"_batchCtoLEM"),t.exportFunction(e+"_toAffine"),t.exportFunction(e+"_toJacobian"),t.exportFunction(e+"_batchToAffine"),t.exportFunction(e+"_batchToJacobian"),t.exportFunction(e+"_inCurve"),t.exportFunction(e+"_inCurveAffine")),e};const{isOdd:Vh,modInv:Hh,modPow:Yh}=ah,Jh=nh;var Wh=function(t,e,n,o,i){const r=8*t.modules[o].n64,a=8*t.modules[n].n64,c=t.modules[o].q;let s=c-1n,l=0;for(;!Vh(s);)l++,s>>=1n;let d=2n;for(;1n===Yh(d,c>>1n,c);)d+=1n;const u=new Array(l+1);u[l]=Yh(d,s,c);let f=l-1;for(;f>=0;)u[f]=Yh(u[f+1],2n,c),f--;const g=[],h=(1n<<BigInt(8*r))%c;for(let t=0;t<u.length;t++){const e=u[t]*h%c;g.push(...Jh.bigInt2BytesLE(e,r))}const p=t.alloc(g),_=new Array(l+1);_[0]=1n;for(let t=1;t<=l;t++)_[t]=2n*_[t-1];const m=[];for(let t=0;t<=l;t++){const e=Hh(_[t],c)*h%c;m.push(...Jh.bigInt2BytesLE(e,r))}const y=t.alloc(m),L=Yh(d,2n,c),b=[],A=[];for(let t=0;t<=l;t++){const e=Yh(L,2n**BigInt(t),c),n=Hh(c+1n-e,c);b.push(...Jh.bigInt2BytesLE(e*h%c,r)),A.push(...Jh.bigInt2BytesLE(n*h%c,r))}const w=t.alloc(b),I=t.alloc(A);function x(t){let e=0;for(let n=0;n<8;n++)t&1<<n&&(e|=128>>n);return e}const C=Array(256);for(let t=0;t<256;t++)C[t]=x(t);const v=t.alloc(C);!function(){const n=t.addFunction(e+"__rev");n.addParam("x","i32"),n.addParam("bits","i32"),n.setReturnType("i32");const o=n.getCodeBuilder();n.addCode(o.i32_rotl(o.i32_add(o.i32_add(o.i32_shl(o.i32_load8_u(o.i32_and(o.getLocal("x"),o.i32_const(255)),v,0),o.i32_const(24)),o.i32_shl(o.i32_load8_u(o.i32_and(o.i32_shr_u(o.getLocal("x"),o.i32_const(8)),o.i32_const(255)),v,0),o.i32_const(16))),o.i32_add(o.i32_shl(o.i32_load8_u(o.i32_and(o.i32_shr_u(o.getLocal("x"),o.i32_const(16)),o.i32_const(255)),v,0),o.i32_const(8)),o.i32_load8_u(o.i32_and(o.i32_shr_u(o.getLocal("x"),o.i32_const(24)),o.i32_const(255)),v,0))),o.getLocal("bits")))}(),function(){const o=t.addFunction(e+"__reversePermutation");o.addParam("px","i32"),o.addParam("bits","i32"),o.addLocal("n","i32"),o.addLocal("i","i32"),o.addLocal("ri","i32"),o.addLocal("idx1","i32"),o.addLocal("idx2","i32");const i=o.getCodeBuilder(),r=i.i32_const(t.alloc(a));o.addCode(i.setLocal("n",i.i32_shl(i.i32_const(1),i.getLocal("bits"))),i.setLocal("i",i.i32_const(0)),i.block(i.loop(i.br_if(1,i.i32_eq(i.getLocal("i"),i.getLocal("n"))),i.setLocal("idx1",i.i32_add(i.getLocal("px"),i.i32_mul(i.getLocal("i"),i.i32_const(a)))),i.setLocal("ri",i.call(e+"__rev",i.getLocal("i"),i.getLocal("bits"))),i.setLocal("idx2",i.i32_add(i.getLocal("px"),i.i32_mul(i.getLocal("ri"),i.i32_const(a)))),i.if(i.i32_lt_u(i.getLocal("i"),i.getLocal("ri")),[...i.call(n+"_copy",i.getLocal("idx1"),r),...i.call(n+"_copy",i.getLocal("idx2"),i.getLocal("idx1")),...i.call(n+"_copy",r,i.getLocal("idx2"))]),i.setLocal("i",i.i32_add(i.getLocal("i"),i.i32_const(1))),i.br(0))))}(),function(){const r=t.addFunction(e+"__fftFinal");r.addParam("px","i32"),r.addParam("bits","i32"),r.addParam("reverse","i32"),r.addParam("mulFactor","i32"),r.addLocal("n","i32"),r.addLocal("ndiv2","i32"),r.addLocal("pInv2","i32"),r.addLocal("i","i32"),r.addLocal("mask","i32"),r.addLocal("idx1","i32"),r.addLocal("idx2","i32");const c=r.getCodeBuilder(),s=c.i32_const(t.alloc(a));r.addCode(c.if(c.i32_and(c.i32_eqz(c.getLocal("reverse")),c.call(o+"_isOne",c.getLocal("mulFactor"))),c.ret([])),c.setLocal("n",c.i32_shl(c.i32_const(1),c.getLocal("bits"))),c.setLocal("mask",c.i32_sub(c.getLocal("n"),c.i32_const(1))),c.setLocal("i",c.i32_const(1)),c.setLocal("ndiv2",c.i32_shr_u(c.getLocal("n"),c.i32_const(1))),c.block(c.loop(c.br_if(1,c.i32_ge_u(c.getLocal("i"),c.getLocal("ndiv2"))),c.setLocal("idx1",c.i32_add(c.getLocal("px"),c.i32_mul(c.getLocal("i"),c.i32_const(a)))),c.setLocal("idx2",c.i32_add(c.getLocal("px"),c.i32_mul(c.i32_sub(c.getLocal("n"),c.getLocal("i")),c.i32_const(a)))),c.if(c.getLocal("reverse"),c.if(c.call(o+"_isOne",c.getLocal("mulFactor")),[...c.call(n+"_copy",c.getLocal("idx1"),s),...c.call(n+"_copy",c.getLocal("idx2"),c.getLocal("idx1")),...c.call(n+"_copy",s,c.getLocal("idx2"))],[...c.call(n+"_copy",c.getLocal("idx1"),s),...c.call(i,c.getLocal("idx2"),c.getLocal("mulFactor"),c.getLocal("idx1")),...c.call(i,s,c.getLocal("mulFactor"),c.getLocal("idx2"))]),c.if(c.call(o+"_isOne",c.getLocal("mulFactor")),[],[...c.call(i,c.getLocal("idx1"),c.getLocal("mulFactor"),c.getLocal("idx1")),...c.call(i,c.getLocal("idx2"),c.getLocal("mulFactor"),c.getLocal("idx2"))])),c.setLocal("i",c.i32_add(c.getLocal("i"),c.i32_const(1))),c.br(0))),c.if(c.call(o+"_isOne",c.getLocal("mulFactor")),[],[...c.call(i,c.getLocal("px"),c.getLocal("mulFactor"),c.getLocal("px")),...c.setLocal("idx2",c.i32_add(c.getLocal("px"),c.i32_mul(c.getLocal("ndiv2"),c.i32_const(a)))),...c.call(i,c.getLocal("idx2"),c.getLocal("mulFactor"),c.getLocal("idx2"))]))}(),function(){const c=t.addFunction(e+"_rawfft");c.addParam("px","i32"),c.addParam("bits","i32"),c.addParam("reverse","i32"),c.addParam("mulFactor","i32"),c.addLocal("s","i32"),c.addLocal("k","i32"),c.addLocal("j","i32"),c.addLocal("m","i32"),c.addLocal("mdiv2","i32"),c.addLocal("n","i32"),c.addLocal("pwm","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(r)),d=s.i32_const(t.alloc(a)),u=s.i32_const(t.alloc(a));c.addCode(s.call(e+"__reversePermutation",s.getLocal("px"),s.getLocal("bits")),s.setLocal("n",s.i32_shl(s.i32_const(1),s.getLocal("bits"))),s.setLocal("s",s.i32_const(1)),s.block(s.loop(s.br_if(1,s.i32_gt_u(s.getLocal("s"),s.getLocal("bits"))),s.setLocal("m",s.i32_shl(s.i32_const(1),s.getLocal("s"))),s.setLocal("pwm",s.i32_add(s.i32_const(p),s.i32_mul(s.getLocal("s"),s.i32_const(r)))),s.setLocal("k",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_ge_u(s.getLocal("k"),s.getLocal("n"))),s.call(o+"_one",l),s.setLocal("mdiv2",s.i32_shr_u(s.getLocal("m"),s.i32_const(1))),s.setLocal("j",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_ge_u(s.getLocal("j"),s.getLocal("mdiv2"))),s.setLocal("idx1",s.i32_add(s.getLocal("px"),s.i32_mul(s.i32_add(s.getLocal("k"),s.getLocal("j")),s.i32_const(a)))),s.setLocal("idx2",s.i32_add(s.getLocal("idx1"),s.i32_mul(s.getLocal("mdiv2"),s.i32_const(a)))),s.call(i,s.getLocal("idx2"),l,d),s.call(n+"_copy",s.getLocal("idx1"),u),s.call(n+"_add",u,d,s.getLocal("idx1")),s.call(n+"_sub",u,d,s.getLocal("idx2")),s.call(o+"_mul",l,s.getLocal("pwm"),l),s.setLocal("j",s.i32_add(s.getLocal("j"),s.i32_const(1))),s.br(0))),s.setLocal("k",s.i32_add(s.getLocal("k"),s.getLocal("m"))),s.br(0))),s.setLocal("s",s.i32_add(s.getLocal("s"),s.i32_const(1))),s.br(0))),s.call(e+"__fftFinal",s.getLocal("px"),s.getLocal("bits"),s.getLocal("reverse"),s.getLocal("mulFactor")))}(),function(){const n=t.addFunction(e+"__log2");n.addParam("n","i32"),n.setReturnType("i32"),n.addLocal("bits","i32"),n.addLocal("aux","i32");const o=n.getCodeBuilder();n.addCode(o.setLocal("aux",o.i32_shr_u(o.getLocal("n"),o.i32_const(1)))),n.addCode(o.setLocal("bits",o.i32_const(0))),n.addCode(o.block(o.loop(o.br_if(1,o.i32_eqz(o.getLocal("aux"))),o.setLocal("aux",o.i32_shr_u(o.getLocal("aux"),o.i32_const(1))),o.setLocal("bits",o.i32_add(o.getLocal("bits"),o.i32_const(1))),o.br(0)))),n.addCode(o.if(o.i32_ne(o.getLocal("n"),o.i32_shl(o.i32_const(1),o.getLocal("bits"))),o.unreachable())),n.addCode(o.if(o.i32_gt_u(o.getLocal("bits"),o.i32_const(l)),o.unreachable())),n.addCode(o.getLocal("bits"))}(),function(){const n=t.addFunction(e+"_fft");n.addParam("px","i32"),n.addParam("n","i32"),n.addLocal("bits","i32");const i=n.getCodeBuilder(),a=i.i32_const(t.alloc(r));n.addCode(i.setLocal("bits",i.call(e+"__log2",i.getLocal("n"))),i.call(o+"_one",a),i.call(e+"_rawfft",i.getLocal("px"),i.getLocal("bits"),i.i32_const(0),a))}(),function(){const n=t.addFunction(e+"_ifft");n.addParam("px","i32"),n.addParam("n","i32"),n.addLocal("bits","i32"),n.addLocal("pInv2","i32");const o=n.getCodeBuilder();n.addCode(o.setLocal("bits",o.call(e+"__log2",o.getLocal("n"))),o.setLocal("pInv2",o.i32_add(o.i32_const(y),o.i32_mul(o.getLocal("bits"),o.i32_const(r)))),o.call(e+"_rawfft",o.getLocal("px"),o.getLocal("bits"),o.i32_const(1),o.getLocal("pInv2")))}(),function(){const c=t.addFunction(e+"_fftJoin");c.addParam("pBuff1","i32"),c.addParam("pBuff2","i32"),c.addParam("n","i32"),c.addParam("first","i32"),c.addParam("inc","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(r)),d=s.i32_const(t.alloc(a)),u=s.i32_const(t.alloc(a));c.addCode(s.call(o+"_copy",s.getLocal("first"),l),s.setLocal("i",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_eq(s.getLocal("i"),s.getLocal("n"))),s.setLocal("idx1",s.i32_add(s.getLocal("pBuff1"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.setLocal("idx2",s.i32_add(s.getLocal("pBuff2"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.call(i,s.getLocal("idx2"),l,d),s.call(n+"_copy",s.getLocal("idx1"),u),s.call(n+"_add",u,d,s.getLocal("idx1")),s.call(n+"_sub",u,d,s.getLocal("idx2")),s.call(o+"_mul",l,s.getLocal("inc"),l),s.setLocal("i",s.i32_add(s.getLocal("i"),s.i32_const(1))),s.br(0))))}(),function(){const c=t.addFunction(e+"_fftJoinExt");c.addParam("pBuff1","i32"),c.addParam("pBuff2","i32"),c.addParam("n","i32"),c.addParam("first","i32"),c.addParam("inc","i32"),c.addParam("totalBits","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32"),c.addLocal("pShiftToM","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(r)),d=s.i32_const(t.alloc(a));c.addCode(s.setLocal("pShiftToM",s.i32_add(s.i32_const(w),s.i32_mul(s.getLocal("totalBits"),s.i32_const(r)))),s.call(o+"_copy",s.getLocal("first"),l),s.setLocal("i",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_eq(s.getLocal("i"),s.getLocal("n"))),s.setLocal("idx1",s.i32_add(s.getLocal("pBuff1"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.setLocal("idx2",s.i32_add(s.getLocal("pBuff2"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.call(n+"_add",s.getLocal("idx1"),s.getLocal("idx2"),d),s.call(i,s.getLocal("idx2"),s.getLocal("pShiftToM"),s.getLocal("idx2")),s.call(n+"_add",s.getLocal("idx1"),s.getLocal("idx2"),s.getLocal("idx2")),s.call(i,s.getLocal("idx2"),l,s.getLocal("idx2")),s.call(n+"_copy",d,s.getLocal("idx1")),s.call(o+"_mul",l,s.getLocal("inc"),l),s.setLocal("i",s.i32_add(s.getLocal("i"),s.i32_const(1))),s.br(0))))}(),function(){const c=t.addFunction(e+"_fftJoinExtInv");c.addParam("pBuff1","i32"),c.addParam("pBuff2","i32"),c.addParam("n","i32"),c.addParam("first","i32"),c.addParam("inc","i32"),c.addParam("totalBits","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32"),c.addLocal("pShiftToM","i32"),c.addLocal("pSConst","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(r)),d=s.i32_const(t.alloc(a));c.addCode(s.setLocal("pShiftToM",s.i32_add(s.i32_const(w),s.i32_mul(s.getLocal("totalBits"),s.i32_const(r)))),s.setLocal("pSConst",s.i32_add(s.i32_const(I),s.i32_mul(s.getLocal("totalBits"),s.i32_const(r)))),s.call(o+"_copy",s.getLocal("first"),l),s.setLocal("i",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_eq(s.getLocal("i"),s.getLocal("n"))),s.setLocal("idx1",s.i32_add(s.getLocal("pBuff1"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.setLocal("idx2",s.i32_add(s.getLocal("pBuff2"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.call(i,s.getLocal("idx2"),l,d),s.call(n+"_sub",s.getLocal("idx1"),d,s.getLocal("idx2")),s.call(i,s.getLocal("idx2"),s.getLocal("pSConst"),s.getLocal("idx2")),s.call(i,s.getLocal("idx1"),s.getLocal("pShiftToM"),s.getLocal("idx1")),s.call(n+"_sub",d,s.getLocal("idx1"),s.getLocal("idx1")),s.call(i,s.getLocal("idx1"),s.getLocal("pSConst"),s.getLocal("idx1")),s.call(o+"_mul",l,s.getLocal("inc"),l),s.setLocal("i",s.i32_add(s.getLocal("i"),s.i32_const(1))),s.br(0))))}(),function(){const c=t.addFunction(e+"_fftMix");c.addParam("pBuff","i32"),c.addParam("n","i32"),c.addParam("exp","i32"),c.addLocal("nGroups","i32"),c.addLocal("nPerGroup","i32"),c.addLocal("nPerGroupDiv2","i32"),c.addLocal("pairOffset","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32"),c.addLocal("j","i32"),c.addLocal("pwm","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(r)),d=s.i32_const(t.alloc(a)),u=s.i32_const(t.alloc(a));c.addCode(s.setLocal("nPerGroup",s.i32_shl(s.i32_const(1),s.getLocal("exp"))),s.setLocal("nPerGroupDiv2",s.i32_shr_u(s.getLocal("nPerGroup"),s.i32_const(1))),s.setLocal("nGroups",s.i32_shr_u(s.getLocal("n"),s.getLocal("exp"))),s.setLocal("pairOffset",s.i32_mul(s.getLocal("nPerGroupDiv2"),s.i32_const(a))),s.setLocal("pwm",s.i32_add(s.i32_const(p),s.i32_mul(s.getLocal("exp"),s.i32_const(r)))),s.setLocal("i",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_eq(s.getLocal("i"),s.getLocal("nGroups"))),s.call(o+"_one",l),s.setLocal("j",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_eq(s.getLocal("j"),s.getLocal("nPerGroupDiv2"))),s.setLocal("idx1",s.i32_add(s.getLocal("pBuff"),s.i32_mul(s.i32_add(s.i32_mul(s.getLocal("i"),s.getLocal("nPerGroup")),s.getLocal("j")),s.i32_const(a)))),s.setLocal("idx2",s.i32_add(s.getLocal("idx1"),s.getLocal("pairOffset"))),s.call(i,s.getLocal("idx2"),l,d),s.call(n+"_copy",s.getLocal("idx1"),u),s.call(n+"_add",u,d,s.getLocal("idx1")),s.call(n+"_sub",u,d,s.getLocal("idx2")),s.call(o+"_mul",l,s.getLocal("pwm"),l),s.setLocal("j",s.i32_add(s.getLocal("j"),s.i32_const(1))),s.br(0))),s.setLocal("i",s.i32_add(s.getLocal("i"),s.i32_const(1))),s.br(0))))}(),function(){const o=t.addFunction(e+"_fftFinal");o.addParam("pBuff","i32"),o.addParam("n","i32"),o.addParam("factor","i32"),o.addLocal("idx1","i32"),o.addLocal("idx2","i32"),o.addLocal("i","i32"),o.addLocal("ndiv2","i32");const r=o.getCodeBuilder(),c=r.i32_const(t.alloc(a));o.addCode(r.setLocal("ndiv2",r.i32_shr_u(r.getLocal("n"),r.i32_const(1))),r.if(r.i32_and(r.getLocal("n"),r.i32_const(1)),r.call(i,r.i32_add(r.getLocal("pBuff"),r.i32_mul(r.getLocal("ndiv2"),r.i32_const(a))),r.getLocal("factor"),r.i32_add(r.getLocal("pBuff"),r.i32_mul(r.getLocal("ndiv2"),r.i32_const(a))))),r.setLocal("i",r.i32_const(0)),r.block(r.loop(r.br_if(1,r.i32_ge_u(r.getLocal("i"),r.getLocal("ndiv2"))),r.setLocal("idx1",r.i32_add(r.getLocal("pBuff"),r.i32_mul(r.getLocal("i"),r.i32_const(a)))),r.setLocal("idx2",r.i32_add(r.getLocal("pBuff"),r.i32_mul(r.i32_sub(r.i32_sub(r.getLocal("n"),r.i32_const(1)),r.getLocal("i")),r.i32_const(a)))),r.call(i,r.getLocal("idx2"),r.getLocal("factor"),c),r.call(i,r.getLocal("idx1"),r.getLocal("factor"),r.getLocal("idx2")),r.call(n+"_copy",c,r.getLocal("idx1")),r.setLocal("i",r.i32_add(r.getLocal("i"),r.i32_const(1))),r.br(0))))}(),function(){const c=t.addFunction(e+"_prepareLagrangeEvaluation");c.addParam("pBuff1","i32"),c.addParam("pBuff2","i32"),c.addParam("n","i32"),c.addParam("first","i32"),c.addParam("inc","i32"),c.addParam("totalBits","i32"),c.addLocal("idx1","i32"),c.addLocal("idx2","i32"),c.addLocal("i","i32"),c.addLocal("pShiftToM","i32"),c.addLocal("pSConst","i32");const s=c.getCodeBuilder(),l=s.i32_const(t.alloc(r)),d=s.i32_const(t.alloc(a));c.addCode(s.setLocal("pShiftToM",s.i32_add(s.i32_const(w),s.i32_mul(s.getLocal("totalBits"),s.i32_const(r)))),s.setLocal("pSConst",s.i32_add(s.i32_const(I),s.i32_mul(s.getLocal("totalBits"),s.i32_const(r)))),s.call(o+"_copy",s.getLocal("first"),l),s.setLocal("i",s.i32_const(0)),s.block(s.loop(s.br_if(1,s.i32_eq(s.getLocal("i"),s.getLocal("n"))),s.setLocal("idx1",s.i32_add(s.getLocal("pBuff1"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.setLocal("idx2",s.i32_add(s.getLocal("pBuff2"),s.i32_mul(s.getLocal("i"),s.i32_const(a)))),s.call(i,s.getLocal("idx1"),s.getLocal("pShiftToM"),d),s.call(n+"_sub",s.getLocal("idx2"),d,d),s.call(n+"_sub",s.getLocal("idx1"),s.getLocal("idx2"),s.getLocal("idx2")),s.call(i,d,s.getLocal("pSConst"),s.getLocal("idx1")),s.call(i,s.getLocal("idx2"),l,s.getLocal("idx2")),s.call(o+"_mul",l,s.getLocal("inc"),l),s.setLocal("i",s.i32_add(s.getLocal("i"),s.i32_const(1))),s.br(0))))}(),t.exportFunction(e+"_fft"),t.exportFunction(e+"_ifft"),t.exportFunction(e+"_rawfft"),t.exportFunction(e+"_fftJoin"),t.exportFunction(e+"_fftJoinExt"),t.exportFunction(e+"_fftJoinExtInv"),t.exportFunction(e+"_fftMix"),t.exportFunction(e+"_fftFinal"),t.exportFunction(e+"_prepareLagrangeEvaluation")},Xh=function(t,e,n){const o=8*t.modules[n].n64;return function(){const i=t.addFunction(e+"_zero");i.addParam("px","i32"),i.addParam("n","i32"),i.addLocal("lastp","i32"),i.addLocal("p","i32");const r=i.getCodeBuilder();i.addCode(r.setLocal("p",r.getLocal("px")),r.setLocal("lastp",r.i32_add(r.getLocal("px"),r.i32_mul(r.getLocal("n"),r.i32_const(o)))),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("p"),r.getLocal("lastp"))),r.call(n+"_zero",r.getLocal("p")),r.setLocal("p",r.i32_add(r.getLocal("p"),r.i32_const(o))),r.br(0))))}(),function(){const i=t.addFunction(e+"_constructLC");i.addParam("ppolynomials","i32"),i.addParam("psignals","i32"),i.addParam("nSignals","i32"),i.addParam("pres","i32"),i.addLocal("i","i32"),i.addLocal("j","i32"),i.addLocal("pp","i32"),i.addLocal("ps","i32"),i.addLocal("pd","i32"),i.addLocal("ncoefs","i32");const r=i.getCodeBuilder(),a=r.i32_const(t.alloc(o));i.addCode(r.setLocal("i",r.i32_const(0)),r.setLocal("pp",r.getLocal("ppolynomials")),r.setLocal("ps",r.getLocal("psignals")),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("i"),r.getLocal("nSignals"))),r.setLocal("ncoefs",r.i32_load(r.getLocal("pp"))),r.setLocal("pp",r.i32_add(r.getLocal("pp"),r.i32_const(4))),r.setLocal("j",r.i32_const(0)),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("j"),r.getLocal("ncoefs"))),r.setLocal("pd",r.i32_add(r.getLocal("pres"),r.i32_mul(r.i32_load(r.getLocal("pp")),r.i32_const(o)))),r.setLocal("pp",r.i32_add(r.getLocal("pp"),r.i32_const(4))),r.call(n+"_mul",r.getLocal("ps"),r.getLocal("pp"),a),r.call(n+"_add",a,r.getLocal("pd"),r.getLocal("pd")),r.setLocal("pp",r.i32_add(r.getLocal("pp"),r.i32_const(o))),r.setLocal("j",r.i32_add(r.getLocal("j"),r.i32_const(1))),r.br(0))),r.setLocal("ps",r.i32_add(r.getLocal("ps"),r.i32_const(o))),r.setLocal("i",r.i32_add(r.getLocal("i"),r.i32_const(1))),r.br(0))))}(),t.exportFunction(e+"_zero"),t.exportFunction(e+"_constructLC"),e},Zh=function(t,e,n){const o=8*t.modules[n].n64;return function(){const i=t.addFunction(e+"_buildABC");i.addParam("pCoefs","i32"),i.addParam("nCoefs","i32"),i.addParam("pWitness","i32"),i.addParam("pA","i32"),i.addParam("pB","i32"),i.addParam("pC","i32"),i.addParam("offsetOut","i32"),i.addParam("nOut","i32"),i.addParam("offsetWitness","i32"),i.addParam("nWitness","i32"),i.addLocal("it","i32"),i.addLocal("ita","i32"),i.addLocal("itb","i32"),i.addLocal("last","i32"),i.addLocal("m","i32"),i.addLocal("c","i32"),i.addLocal("s","i32"),i.addLocal("pOut","i32");const r=i.getCodeBuilder(),a=r.i32_const(t.alloc(o));i.addCode(r.setLocal("ita",r.getLocal("pA")),r.setLocal("itb",r.getLocal("pB")),r.setLocal("last",r.i32_add(r.getLocal("pA"),r.i32_mul(r.getLocal("nOut"),r.i32_const(o)))),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("ita"),r.getLocal("last"))),r.call(n+"_zero",r.getLocal("ita")),r.call(n+"_zero",r.getLocal("itb")),r.setLocal("ita",r.i32_add(r.getLocal("ita"),r.i32_const(o))),r.setLocal("itb",r.i32_add(r.getLocal("itb"),r.i32_const(o))),r.br(0))),r.setLocal("it",r.getLocal("pCoefs")),r.setLocal("last",r.i32_add(r.getLocal("pCoefs"),r.i32_mul(r.getLocal("nCoefs"),r.i32_const(o+12)))),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("it"),r.getLocal("last"))),r.setLocal("s",r.i32_load(r.getLocal("it"),8)),r.if(r.i32_or(r.i32_lt_u(r.getLocal("s"),r.getLocal("offsetWitness")),r.i32_ge_u(r.getLocal("s"),r.i32_add(r.getLocal("offsetWitness"),r.getLocal("nWitness")))),[...r.setLocal("it",r.i32_add(r.getLocal("it"),r.i32_const(o+12))),...r.br(1)]),r.setLocal("m",r.i32_load(r.getLocal("it"))),r.if(r.i32_eq(r.getLocal("m"),r.i32_const(0)),r.setLocal("pOut",r.getLocal("pA")),r.if(r.i32_eq(r.getLocal("m"),r.i32_const(1)),r.setLocal("pOut",r.getLocal("pB")),[...r.setLocal("it",r.i32_add(r.getLocal("it"),r.i32_const(o+12))),...r.br(1)])),r.setLocal("c",r.i32_load(r.getLocal("it"),4)),r.if(r.i32_or(r.i32_lt_u(r.getLocal("c"),r.getLocal("offsetOut")),r.i32_ge_u(r.getLocal("c"),r.i32_add(r.getLocal("offsetOut"),r.getLocal("nOut")))),[...r.setLocal("it",r.i32_add(r.getLocal("it"),r.i32_const(o+12))),...r.br(1)]),r.setLocal("pOut",r.i32_add(r.getLocal("pOut"),r.i32_mul(r.i32_sub(r.getLocal("c"),r.getLocal("offsetOut")),r.i32_const(o)))),r.call(n+"_mul",r.i32_add(r.getLocal("pWitness"),r.i32_mul(r.i32_sub(r.getLocal("s"),r.getLocal("offsetWitness")),r.i32_const(o))),r.i32_add(r.getLocal("it"),r.i32_const(12)),a),r.call(n+"_add",r.getLocal("pOut"),a,r.getLocal("pOut")),r.setLocal("it",r.i32_add(r.getLocal("it"),r.i32_const(o+12))),r.br(0))),r.setLocal("ita",r.getLocal("pA")),r.setLocal("itb",r.getLocal("pB")),r.setLocal("it",r.getLocal("pC")),r.setLocal("last",r.i32_add(r.getLocal("pA"),r.i32_mul(r.getLocal("nOut"),r.i32_const(o)))),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("ita"),r.getLocal("last"))),r.call(n+"_mul",r.getLocal("ita"),r.getLocal("itb"),r.getLocal("it")),r.setLocal("ita",r.i32_add(r.getLocal("ita"),r.i32_const(o))),r.setLocal("itb",r.i32_add(r.getLocal("itb"),r.i32_const(o))),r.setLocal("it",r.i32_add(r.getLocal("it"),r.i32_const(o))),r.br(0))))}(),function(){const i=t.addFunction(e+"_joinABC");i.addParam("pA","i32"),i.addParam("pB","i32"),i.addParam("pC","i32"),i.addParam("n","i32"),i.addParam("pP","i32"),i.addLocal("ita","i32"),i.addLocal("itb","i32"),i.addLocal("itc","i32"),i.addLocal("itp","i32"),i.addLocal("last","i32");const r=i.getCodeBuilder(),a=r.i32_const(t.alloc(o));i.addCode(r.setLocal("ita",r.getLocal("pA")),r.setLocal("itb",r.getLocal("pB")),r.setLocal("itc",r.getLocal("pC")),r.setLocal("itp",r.getLocal("pP")),r.setLocal("last",r.i32_add(r.getLocal("pA"),r.i32_mul(r.getLocal("n"),r.i32_const(o)))),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("ita"),r.getLocal("last"))),r.call(n+"_mul",r.getLocal("ita"),r.getLocal("itb"),a),r.call(n+"_sub",a,r.getLocal("itc"),r.getLocal("itp")),r.setLocal("ita",r.i32_add(r.getLocal("ita"),r.i32_const(o))),r.setLocal("itb",r.i32_add(r.getLocal("itb"),r.i32_const(o))),r.setLocal("itc",r.i32_add(r.getLocal("itc"),r.i32_const(o))),r.setLocal("itp",r.i32_add(r.getLocal("itp"),r.i32_const(o))),r.br(0))))}(),function(){const i=t.addFunction(e+"_batchAdd");i.addParam("pa","i32"),i.addParam("pb","i32"),i.addParam("n","i32"),i.addParam("pr","i32"),i.addLocal("ita","i32"),i.addLocal("itb","i32"),i.addLocal("itr","i32"),i.addLocal("last","i32");const r=i.getCodeBuilder();i.addCode(r.setLocal("ita",r.getLocal("pa")),r.setLocal("itb",r.getLocal("pb")),r.setLocal("itr",r.getLocal("pr")),r.setLocal("last",r.i32_add(r.getLocal("pa"),r.i32_mul(r.getLocal("n"),r.i32_const(o)))),r.block(r.loop(r.br_if(1,r.i32_eq(r.getLocal("ita"),r.getLocal("last"))),r.call(n+"_add",r.getLocal("ita"),r.getLocal("itb"),r.getLocal("itr")),r.setLocal("ita",r.i32_add(r.getLocal("ita"),r.i32_const(o))),r.setLocal("itb",r.i32_add(r.getLocal("itb"),r.i32_const(o))),r.setLocal("itr",r.i32_add(r.getLocal("itr"),r.i32_const(o))),r.br(0))))}(),t.exportFunction(e+"_buildABC"),t.exportFunction(e+"_joinABC"),t.exportFunction(e+"_batchAdd"),e},$h=function(t,e,n,o,i,r,a,c){const s=t.addFunction(e);s.addParam("pIn","i32"),s.addParam("n","i32"),s.addParam("pFirst","i32"),s.addParam("pInc","i32"),s.addParam("pOut","i32"),s.addLocal("pOldFree","i32"),s.addLocal("i","i32"),s.addLocal("pFrom","i32"),s.addLocal("pTo","i32");const l=s.getCodeBuilder(),d=l.i32_const(t.alloc(a));s.addCode(l.setLocal("pFrom",l.getLocal("pIn")),l.setLocal("pTo",l.getLocal("pOut"))),s.addCode(l.call(o+"_copy",l.getLocal("pFirst"),d)),s.addCode(l.setLocal("i",l.i32_const(0)),l.block(l.loop(l.br_if(1,l.i32_eq(l.getLocal("i"),l.getLocal("n"))),l.call(c,l.getLocal("pFrom"),d,l.getLocal("pTo")),l.setLocal("pFrom",l.i32_add(l.getLocal("pFrom"),l.i32_const(i))),l.setLocal("pTo",l.i32_add(l.getLocal("pTo"),l.i32_const(r))),l.call(o+"_mul",d,l.getLocal("pInc"),d),l.setLocal("i",l.i32_add(l.getLocal("i"),l.i32_const(1))),l.br(0)))),t.exportFunction(e)};const tp=nh,ep=Sh,np=Uh,op=zh,ip=Dh,rp=Kh,ap=Wh,cp=Xh,sp=Zh,lp=$h,{bitLength:dp,modInv:up,isOdd:fp,isNegative:gp}=ah,hp=nh,pp=Sh,_p=Uh,mp=zh,yp=Dh,Lp=Kh,bp=Wh,Ap=Xh,wp=Zh,Ip=$h,{bitLength:xp,isOdd:Cp,isNegative:vp}=ah;var Ep=function(t,e){const n=e||"bn128";if(t.modules[n])return n;const o=21888242871839275222246405745257275088696311157297823662689037894645226208583n,i=21888242871839275222246405745257275088548364400416034343698204186575808495617n,r=Math.floor((dp(o-1n)-1)/64)+1,a=8*r,c=a,s=a,l=2*s,d=12*s,u=t.alloc(tp.bigInt2BytesLE(i,c)),f=ep(t,o,"f1m");np(t,i,"fr","frm");const g=t.alloc(tp.bigInt2BytesLE(L(3n),s)),h=rp(t,"g1m","f1m",g);ap(t,"frm","frm","frm","frm_mul"),cp(t,"pol","frm"),sp(t,"qap","frm");const p=op(t,"f1m_neg","f2m","f1m"),_=t.alloc([...tp.bigInt2BytesLE(L(19485874751759354771024239261021720505790618469301721065564631296452457478373n),s),...tp.bigInt2BytesLE(L(266929791119991161246907387137283842545076965332900288569378510910307636690n),s)]),m=rp(t,"g2m","f2m",_);function y(e,n){const o=t.addFunction(e);o.addParam("pG","i32"),o.addParam("pFr","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),r=i.i32_const(t.alloc(a));o.addCode(i.call("frm_fromMontgomery",i.getLocal("pFr"),r),i.call(n,i.getLocal("pG"),r,i.i32_const(a),i.getLocal("pr"))),t.exportFunction(e)}function L(t){return BigInt(t)*(1n<<BigInt(8*s))%o}y("g1m_timesFr","g1m_timesScalar"),ap(t,"g1m","g1m","frm","g1m_timesFr"),y("g2m_timesFr","g2m_timesScalar"),ap(t,"g2m","g2m","frm","g2m_timesFr"),y("g1m_timesFrAffine","g1m_timesScalarAffine"),y("g2m_timesFrAffine","g2m_timesScalarAffine"),lp(t,"frm_batchApplyKey","fmr","frm",a,a,a,"frm_mul"),lp(t,"g1m_batchApplyKey","g1m","frm",3*a,3*a,a,"g1m_timesFr"),lp(t,"g1m_batchApplyKeyMixed","g1m","frm",2*a,3*a,a,"g1m_timesFrAffine"),lp(t,"g2m_batchApplyKey","g2m","frm",2*a*3,3*a*2,a,"g2m_timesFr"),lp(t,"g2m_batchApplyKeyMixed","g2m","frm",2*a*2,3*a*2,a,"g2m_timesFrAffine");const b=[1n,2n,1n],A=t.alloc([...tp.bigInt2BytesLE(L(b[0]),s),...tp.bigInt2BytesLE(L(b[1]),s),...tp.bigInt2BytesLE(L(b[2]),s)]),w=[0n,1n,0n],I=t.alloc([...tp.bigInt2BytesLE(L(w[0]),s),...tp.bigInt2BytesLE(L(w[1]),s),...tp.bigInt2BytesLE(L(w[2]),s)]),x=[[10857046999023057135944570762232829481370756359578518086990519993285655852781n,11559732032986387107991004021392285783925812861821192530917403151452391805634n],[8495653923123431417604973247489272438418190587263600148770280649306958101930n,4082367875863433681332203403145435568316851327593401208105741076214120093531n],[1n,0n]],C=t.alloc([...tp.bigInt2BytesLE(L(x[0][0]),s),...tp.bigInt2BytesLE(L(x[0][1]),s),...tp.bigInt2BytesLE(L(x[1][0]),s),...tp.bigInt2BytesLE(L(x[1][1]),s),...tp.bigInt2BytesLE(L(x[2][0]),s),...tp.bigInt2BytesLE(L(x[2][1]),s)]),v=[[0n,0n],[1n,0n],[0n,0n]],E=t.alloc([...tp.bigInt2BytesLE(L(v[0][0]),s),...tp.bigInt2BytesLE(L(v[0][1]),s),...tp.bigInt2BytesLE(L(v[1][0]),s),...tp.bigInt2BytesLE(L(v[1][1]),s),...tp.bigInt2BytesLE(L(v[2][0]),s),...tp.bigInt2BytesLE(L(v[2][1]),s)]),B=t.alloc([...tp.bigInt2BytesLE(L(1),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s),...tp.bigInt2BytesLE(L(0),s)]),F=t.alloc([...tp.bigInt2BytesLE(L(9),s),...tp.bigInt2BytesLE(L(1),s)]),O=t.alloc([...tp.bigInt2BytesLE(L(up(2n,o)),s),...tp.bigInt2BytesLE(0n,s)]),S=F,P=t.alloc([...tp.bigInt2BytesLE(L(19485874751759354771024239261021720505790618469301721065564631296452457478373n),s),...tp.bigInt2BytesLE(L(266929791119991161246907387137283842545076965332900288569378510910307636690n),s)]);!function(){const e=t.addFunction(n+"_mulNR6");e.addParam("x","i32"),e.addParam("pr","i32");const o=e.getCodeBuilder();e.addCode(o.call(p+"_mul",o.i32_const(F),o.getLocal("x"),o.getLocal("pr")))}();const j=ip(t,n+"_mulNR6","f6m","f2m");!function(){const e=t.addFunction(n+"_mulNR12");e.addParam("x","i32"),e.addParam("pr","i32");const o=e.getCodeBuilder();e.addCode(o.call(p+"_mul",o.i32_const(F),o.i32_add(o.getLocal("x"),o.i32_const(4*a)),o.getLocal("pr")),o.call(p+"_copy",o.getLocal("x"),o.i32_add(o.getLocal("pr"),o.i32_const(2*a))),o.call(p+"_copy",o.i32_add(o.getLocal("x"),o.i32_const(2*a)),o.i32_add(o.getLocal("pr"),o.i32_const(4*a))))}();const U=op(t,n+"_mulNR12","ftm",j),k=function(){let t=29793968203157093288n;const e=[];for(;t>0n;)fp(t)?e.push(1):e.push(0),t>>=1n;return e}(),M=t.alloc(k),T=3*l,z=k.length-1,Q=k.reduce(((t,e)=>t+(0!=e?1:0)),0),N=6*a,D=3*a*2+(Q+z+1)*T;function R(e){const i=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[8376118865763821496583973867626364092589906065868298776909617916018768340080n,16469823323077808223889137241176536799009286646108169935659301613961712198316n],[21888242871839275220042445260109153167277707414472061641714758635765020556617n,0n],[11697423496358154304825782922584725312912383441159505038794027105778954184319n,303847389135065887422783454877609941456349188919719272345083954437860409601n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3321304630594332808241809054958361220322477375291206261884409189760185844239n,5722266937896532885780051958958348231143373700109372999374820235121374419868n],[21888242871839275222246405745257275088696311157297823662689037894645226208582n,0n],[13512124006075453725662431877630910996106405091429524885779419978626457868503n,5418419548761466998357268504080738289687024511189653727029736280683514010267n],[2203960485148121921418603742825762020974279258880205651966n,0n],[10190819375481120917420622822672549775783927716138318623895010788866272024264n,21584395482704209334823622290379665147239961968378104390343953940207365798982n],[2203960485148121921418603742825762020974279258880205651967n,0n],[18566938241244942414004596690298913868373833782006617400804628704885040364344n,16165975933942742336466353786298926857552937457188450663314217659523851788715n]]],r=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[21575463638280843010398324269430826099269044274347216827212613867836435027261n,10307601595873709700152284273816112264069230130616436755625194854815875713954n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[3772000881919853776433695186713858239009073593817195771773381919316419345261n,2236595495967245188281701248203181795121068902605861227855261137820944008926n],[2203960485148121921418603742825762020974279258880205651966n,0n],[18429021223477853657660792034369865839114504446431234726392080002137598044644n,9344045779998320333812420223237981029506012124075525679208581902008406485703n]],[[1n,0n],[2581911344467009335267311115468803099551665605076196740867805258568234346338n,19937756971775647987995932169929341994314640652964949448313374472400716661030n],[2203960485148121921418603742825762020974279258880205651966n,0n],[5324479202449903542726783395506214481928257762400643279780343368557297135718n,16208900380737693084919495127334387981393726419856888799917914180988844123039n],[21888242871839275220042445260109153167277707414472061641714758635765020556616n,0n],[13981852324922362344252311234282257507216387789820983642040889267519694726527n,7629828391165209371577384193250820201684255241773809077146787135900891633097n]]],a=t.addFunction(n+"__frobeniusMap"+e);a.addParam("x","i32"),a.addParam("r","i32");const c=a.getCodeBuilder();for(let n=0;n<6;n++){const o=0==n?c.getLocal("x"):c.i32_add(c.getLocal("x"),c.i32_const(n*l)),u=o,g=c.i32_add(c.getLocal("x"),c.i32_const(n*l+s)),h=0==n?c.getLocal("r"):c.i32_add(c.getLocal("r"),c.i32_const(n*l)),_=h,m=c.i32_add(c.getLocal("r"),c.i32_const(n*l+s)),y=d(i[Math.floor(n/3)][e%12],r[n%3][e%6]),b=t.alloc([...tp.bigInt2BytesLE(L(y[0]),32),...tp.bigInt2BytesLE(L(y[1]),32)]);e%2==1?a.addCode(c.call(f+"_copy",u,_),c.call(f+"_neg",g,m),c.call(p+"_mul",h,c.i32_const(b),h)):a.addCode(c.call(p+"_mul",o,c.i32_const(b),h))}function d(t,e){const n=BigInt(t[0]),i=BigInt(t[1]),r=BigInt(e[0]),a=BigInt(e[1]),c=[(n*r-i*a)%o,(n*a+i*r)%o];return gp(c[0])&&(c[0]=c[0]+o),c}}function q(){!function(){const e=t.addFunction(n+"__cyclotomicSquare");e.addParam("x","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("x"),r=o.i32_add(o.getLocal("x"),o.i32_const(l)),a=o.i32_add(o.getLocal("x"),o.i32_const(2*l)),c=o.i32_add(o.getLocal("x"),o.i32_const(3*l)),s=o.i32_add(o.getLocal("x"),o.i32_const(4*l)),d=o.i32_add(o.getLocal("x"),o.i32_const(5*l)),u=o.getLocal("r"),f=o.i32_add(o.getLocal("r"),o.i32_const(l)),g=o.i32_add(o.getLocal("r"),o.i32_const(2*l)),h=o.i32_add(o.getLocal("r"),o.i32_const(3*l)),_=o.i32_add(o.getLocal("r"),o.i32_const(4*l)),m=o.i32_add(o.getLocal("r"),o.i32_const(5*l)),y=o.i32_const(t.alloc(l)),L=o.i32_const(t.alloc(l)),b=o.i32_const(t.alloc(l)),A=o.i32_const(t.alloc(l)),w=o.i32_const(t.alloc(l)),I=o.i32_const(t.alloc(l)),x=o.i32_const(t.alloc(l)),C=o.i32_const(t.alloc(l));e.addCode(o.call(p+"_mul",i,s,x),o.call(p+"_mul",s,o.i32_const(F),y),o.call(p+"_add",i,y,y),o.call(p+"_add",i,s,C),o.call(p+"_mul",C,y,y),o.call(p+"_mul",o.i32_const(F),x,C),o.call(p+"_add",x,C,C),o.call(p+"_sub",y,C,y),o.call(p+"_add",x,x,L),o.call(p+"_mul",c,a,x),o.call(p+"_mul",a,o.i32_const(F),b),o.call(p+"_add",c,b,b),o.call(p+"_add",c,a,C),o.call(p+"_mul",C,b,b),o.call(p+"_mul",o.i32_const(F),x,C),o.call(p+"_add",x,C,C),o.call(p+"_sub",b,C,b),o.call(p+"_add",x,x,A),o.call(p+"_mul",r,d,x),o.call(p+"_mul",d,o.i32_const(F),w),o.call(p+"_add",r,w,w),o.call(p+"_add",r,d,C),o.call(p+"_mul",C,w,w),o.call(p+"_mul",o.i32_const(F),x,C),o.call(p+"_add",x,C,C),o.call(p+"_sub",w,C,w),o.call(p+"_add",x,x,I),o.call(p+"_sub",y,i,u),o.call(p+"_add",u,u,u),o.call(p+"_add",y,u,u),o.call(p+"_add",L,s,_),o.call(p+"_add",_,_,_),o.call(p+"_add",L,_,_),o.call(p+"_mul",I,o.i32_const(S),C),o.call(p+"_add",C,c,h),o.call(p+"_add",h,h,h),o.call(p+"_add",C,h,h),o.call(p+"_sub",w,a,g),o.call(p+"_add",g,g,g),o.call(p+"_add",w,g,g),o.call(p+"_sub",b,r,f),o.call(p+"_add",f,f,f),o.call(p+"_add",b,f,f),o.call(p+"_add",A,d,m),o.call(p+"_add",m,m,m),o.call(p+"_add",A,m,m))}(),function(e,o){const i=function(t){let e=t;const n=[];for(;e>0n;){if(fp(e)){const t=2-Number(e%4n);n.push(t),e-=BigInt(t)}else n.push(0);e>>=1n}return n}(e).map((t=>-1==t?255:t)),r=t.alloc(i),a=t.addFunction(n+"__cyclotomicExp_"+o);a.addParam("x","i32"),a.addParam("r","i32"),a.addLocal("bit","i32"),a.addLocal("i","i32");const c=a.getCodeBuilder(),s=c.getLocal("x"),l=c.getLocal("r"),u=c.i32_const(t.alloc(d));a.addCode(c.call(U+"_conjugate",s,u),c.call(U+"_one",l),c.if(c.teeLocal("bit",c.i32_load8_s(c.i32_const(i.length-1),r)),c.if(c.i32_eq(c.getLocal("bit"),c.i32_const(1)),c.call(U+"_mul",l,s,l),c.call(U+"_mul",l,u,l))),c.setLocal("i",c.i32_const(i.length-2)),c.block(c.loop(c.call(n+"__cyclotomicSquare",l,l),c.if(c.teeLocal("bit",c.i32_load8_s(c.getLocal("i"),r)),c.if(c.i32_eq(c.getLocal("bit"),c.i32_const(1)),c.call(U+"_mul",l,s,l),c.call(U+"_mul",l,u,l))),c.br_if(1,c.i32_eqz(c.getLocal("i"))),c.setLocal("i",c.i32_sub(c.getLocal("i"),c.i32_const(1))),c.br(0))))}(4965661367192848881n,"w0");const e=t.addFunction(n+"__finalExponentiationLastChunk");e.addParam("x","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("x"),r=o.getLocal("r"),a=o.i32_const(t.alloc(d)),c=o.i32_const(t.alloc(d)),s=o.i32_const(t.alloc(d)),u=o.i32_const(t.alloc(d)),f=o.i32_const(t.alloc(d)),g=o.i32_const(t.alloc(d)),h=o.i32_const(t.alloc(d)),_=o.i32_const(t.alloc(d)),m=o.i32_const(t.alloc(d)),y=o.i32_const(t.alloc(d)),L=o.i32_const(t.alloc(d)),b=o.i32_const(t.alloc(d)),A=o.i32_const(t.alloc(d)),w=o.i32_const(t.alloc(d)),I=o.i32_const(t.alloc(d)),x=o.i32_const(t.alloc(d)),C=o.i32_const(t.alloc(d)),v=o.i32_const(t.alloc(d)),E=o.i32_const(t.alloc(d)),B=o.i32_const(t.alloc(d)),O=o.i32_const(t.alloc(d));e.addCode(o.call(n+"__cyclotomicExp_w0",i,a),o.call(U+"_conjugate",a,a),o.call(n+"__cyclotomicSquare",a,c),o.call(n+"__cyclotomicSquare",c,s),o.call(U+"_mul",s,c,u),o.call(n+"__cyclotomicExp_w0",u,f),o.call(U+"_conjugate",f,f),o.call(n+"__cyclotomicSquare",f,g),o.call(n+"__cyclotomicExp_w0",g,h),o.call(U+"_conjugate",h,h),o.call(U+"_conjugate",u,_),o.call(U+"_conjugate",h,m),o.call(U+"_mul",m,f,y),o.call(U+"_mul",y,_,L),o.call(U+"_mul",L,c,b),o.call(U+"_mul",L,f,A),o.call(U+"_mul",A,i,w),o.call(n+"__frobeniusMap1",b,I),o.call(U+"_mul",I,w,x),o.call(n+"__frobeniusMap2",L,C),o.call(U+"_mul",C,x,v),o.call(U+"_conjugate",i,E),o.call(U+"_mul",E,b,B),o.call(n+"__frobeniusMap3",B,O),o.call(U+"_mul",O,v,r))}t.modules[n]={n64:r,pG1gen:A,pG1zero:I,pG1b:g,pG2gen:C,pG2zero:E,pG2b:_,pq:t.modules.f1m.pq,pr:u,pOneT:B,prePSize:N,preQSize:D,r:i.toString(),q:o.toString()};const G=t.alloc(N),K=t.alloc(D);function V(e){const o=t.addFunction(n+"_pairingEq"+e);for(let t=0;t<e;t++)o.addParam("p_"+t,"i32"),o.addParam("q_"+t,"i32");o.addParam("c","i32"),o.setReturnType("i32");const i=o.getCodeBuilder(),r=i.i32_const(t.alloc(d)),a=i.i32_const(t.alloc(d));o.addCode(i.call(U+"_one",r));for(let t=0;t<e;t++)o.addCode(i.call(n+"_prepareG1",i.getLocal("p_"+t),i.i32_const(G))),o.addCode(i.call(n+"_prepareG2",i.getLocal("q_"+t),i.i32_const(K))),o.addCode(i.call(n+"_millerLoop",i.i32_const(G),i.i32_const(K),a)),o.addCode(i.call(U+"_mul",r,a,r));o.addCode(i.call(n+"_finalExponentiation",r,r)),o.addCode(i.call(U+"_eq",r,i.getLocal("c")))}!function(){const e=t.addFunction(n+"_prepAddStep");e.addParam("pQ","i32"),e.addParam("pR","i32"),e.addParam("pCoef","i32");const o=e.getCodeBuilder(),i=o.getLocal("pQ"),r=o.i32_add(o.getLocal("pQ"),o.i32_const(l)),a=o.getLocal("pR"),c=o.i32_add(o.getLocal("pR"),o.i32_const(l)),s=o.i32_add(o.getLocal("pR"),o.i32_const(2*l)),d=o.getLocal("pCoef"),u=o.i32_add(o.getLocal("pCoef"),o.i32_const(l)),f=o.i32_add(o.getLocal("pCoef"),o.i32_const(2*l)),g=u,h=o.i32_const(t.alloc(l)),_=o.i32_const(t.alloc(l)),m=o.i32_const(t.alloc(l)),y=o.i32_const(t.alloc(l)),L=o.i32_const(t.alloc(l)),b=o.i32_const(t.alloc(l)),A=o.i32_const(t.alloc(l));e.addCode(o.call(p+"_mul",i,s,g),o.call(p+"_sub",a,g,g),o.call(p+"_mul",r,s,h),o.call(p+"_sub",c,h,h),o.call(p+"_square",g,_),o.call(p+"_square",h,m),o.call(p+"_mul",g,_,y),o.call(p+"_mul",a,_,L),o.call(p+"_add",L,L,A),o.call(p+"_mul",s,m,b),o.call(p+"_add",y,b,b),o.call(p+"_sub",b,A,b),o.call(p+"_mul",g,b,a),o.call(p+"_mul",y,c,c),o.call(p+"_sub",L,b,A),o.call(p+"_mul",h,A,A),o.call(p+"_sub",A,c,c),o.call(p+"_mul",s,y,s),o.call(p+"_mul",g,r,A),o.call(p+"_mul",h,i,d),o.call(p+"_sub",d,A,d),o.call(p+"_mul",d,o.i32_const(S),d),o.call(p+"_neg",h,f))}(),function(){const e=t.addFunction(n+"_prepDblStep");e.addParam("pR","i32"),e.addParam("pCoef","i32");const o=e.getCodeBuilder(),i=o.getLocal("pR"),r=o.i32_add(o.getLocal("pR"),o.i32_const(l)),a=o.i32_add(o.getLocal("pR"),o.i32_const(2*l)),c=o.getLocal("pCoef"),s=o.i32_add(o.getLocal("pCoef"),o.i32_const(l)),d=o.i32_add(o.getLocal("pCoef"),o.i32_const(2*l)),u=o.i32_const(t.alloc(l)),f=o.i32_const(t.alloc(l)),g=o.i32_const(t.alloc(l)),h=o.i32_const(t.alloc(l)),_=o.i32_const(t.alloc(l)),m=o.i32_const(t.alloc(l)),y=o.i32_const(t.alloc(l)),L=o.i32_const(t.alloc(l)),b=o.i32_const(t.alloc(l)),A=o.i32_const(t.alloc(l)),w=o.i32_const(t.alloc(l)),I=o.i32_const(t.alloc(l));e.addCode(o.call(p+"_mul",r,o.i32_const(O),u),o.call(p+"_mul",i,u,u),o.call(p+"_square",r,f),o.call(p+"_square",a,g),o.call(p+"_add",g,g,h),o.call(p+"_add",h,g,h),o.call(p+"_mul",o.i32_const(P),h,_),o.call(p+"_add",_,_,m),o.call(p+"_add",_,m,m),o.call(p+"_add",f,m,y),o.call(p+"_mul",y,o.i32_const(O),y),o.call(p+"_add",f,g,I),o.call(p+"_add",r,a,L),o.call(p+"_square",L,L),o.call(p+"_sub",L,I,L),o.call(p+"_sub",_,f,b),o.call(p+"_square",i,A),o.call(p+"_square",_,w),o.call(p+"_sub",f,m,I),o.call(p+"_mul",u,I,i),o.call(p+"_add",w,w,I),o.call(p+"_add",w,I,I),o.call(p+"_square",y,r),o.call(p+"_sub",r,I,r),o.call(p+"_mul",f,L,a),o.call(p+"_mul",o.i32_const(S),b,c),o.call(p+"_neg",L,s),o.call(p+"_add",A,A,d),o.call(p+"_add",A,d,d))}(),function(){const e=t.addFunction(n+"_prepareG1");e.addParam("pP","i32"),e.addParam("ppreP","i32");const o=e.getCodeBuilder();e.addCode(o.call(h+"_normalize",o.getLocal("pP"),o.getLocal("ppreP")))}(),function(){!function(){const e=t.addFunction(n+"_mulByQ");e.addParam("p1","i32"),e.addParam("pr","i32");const o=e.getCodeBuilder(),i=o.getLocal("p1"),r=o.i32_add(o.getLocal("p1"),o.i32_const(l)),a=o.i32_add(o.getLocal("p1"),o.i32_const(2*l)),c=o.getLocal("pr"),d=o.i32_add(o.getLocal("pr"),o.i32_const(l)),u=o.i32_add(o.getLocal("pr"),o.i32_const(2*l)),f=o.i32_const(t.alloc([...tp.bigInt2BytesLE(L("21575463638280843010398324269430826099269044274347216827212613867836435027261"),s),...tp.bigInt2BytesLE(L("10307601595873709700152284273816112264069230130616436755625194854815875713954"),s)])),g=o.i32_const(t.alloc([...tp.bigInt2BytesLE(L("2821565182194536844548159561693502659359617185244120367078079554186484126554"),s),...tp.bigInt2BytesLE(L("3505843767911556378687030309984248845540243509899259641013678093033130930403"),s)]));e.addCode(o.call(p+"_conjugate",i,c),o.call(p+"_mul",f,c,c),o.call(p+"_conjugate",r,d),o.call(p+"_mul",g,d,d),o.call(p+"_conjugate",a,u))}();const e=t.addFunction(n+"_prepareG2");e.addParam("pQ","i32"),e.addParam("ppreQ","i32"),e.addLocal("pCoef","i32"),e.addLocal("i","i32");const o=e.getCodeBuilder(),i=o.getLocal("pQ"),r=t.alloc(3*l),a=o.i32_const(r),c=o.i32_const(r),d=o.i32_const(r+l),u=o.i32_const(r+2*l),f=o.i32_add(o.getLocal("ppreQ"),o.i32_const(0)),g=o.i32_add(o.getLocal("ppreQ"),o.i32_const(l)),h=t.alloc(3*l),_=o.i32_const(h),y=t.alloc(3*l),b=o.i32_const(y),A=o.i32_const(y+l);e.addCode(o.call(m+"_normalize",i,f),o.call(p+"_copy",f,c),o.call(p+"_copy",g,d),o.call(p+"_one",u)),e.addCode(o.setLocal("pCoef",o.i32_add(o.getLocal("ppreQ"),o.i32_const(3*l))),o.setLocal("i",o.i32_const(k.length-2)),o.block(o.loop(o.call(n+"_prepDblStep",a,o.getLocal("pCoef")),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T))),o.if(o.i32_load8_s(o.getLocal("i"),M),[...o.call(n+"_prepAddStep",f,a,o.getLocal("pCoef")),...o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T)))]),o.br_if(1,o.i32_eqz(o.getLocal("i"))),o.setLocal("i",o.i32_sub(o.getLocal("i"),o.i32_const(1))),o.br(0)))),e.addCode(o.call(n+"_mulByQ",f,_),o.call(n+"_mulByQ",_,b)),e.addCode(o.call(p+"_neg",A,A),o.call(n+"_prepAddStep",_,a,o.getLocal("pCoef")),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T))),o.call(n+"_prepAddStep",b,a,o.getLocal("pCoef")),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T))))}(),function(){const e=t.addFunction(n+"__mulBy024");e.addParam("pEll0","i32"),e.addParam("pEllVW","i32"),e.addParam("pEllVV","i32"),e.addParam("pR","i32");const o=e.getCodeBuilder(),i=o.getLocal("pEll0"),r=o.getLocal("pEllVV"),c=o.getLocal("pEllVW"),s=o.getLocal("pR"),d=o.i32_add(o.getLocal("pR"),o.i32_const(2*a)),u=o.i32_add(o.getLocal("pR"),o.i32_const(4*a)),f=o.i32_add(o.getLocal("pR"),o.i32_const(6*a)),g=o.i32_add(o.getLocal("pR"),o.i32_const(8*a)),h=o.i32_add(o.getLocal("pR"),o.i32_const(10*a)),_=o.i32_const(t.alloc(l)),m=o.i32_const(t.alloc(l)),y=o.i32_const(t.alloc(l)),L=o.i32_const(t.alloc(l)),b=o.i32_const(t.alloc(l)),A=o.i32_const(t.alloc(l)),w=o.i32_const(t.alloc(l)),I=o.i32_const(t.alloc(l)),x=o.i32_const(t.alloc(l)),C=o.i32_const(t.alloc(l)),v=o.i32_const(t.alloc(l));e.addCode(o.call(p+"_mul",s,i,w),o.call(p+"_mul",u,r,I),o.call(p+"_mul",g,c,x),o.call(p+"_add",s,g,y),o.call(p+"_add",s,u,m),o.call(p+"_add",d,f,L),o.call(p+"_add",L,h,L),o.call(p+"_mul",d,r,C),o.call(p+"_add",C,x,b),o.call(p+"_mul",o.i32_const(F),b,A),o.call(p+"_add",A,w,s),o.call(p+"_mul",h,c,b),o.call(p+"_add",C,b,C),o.call(p+"_add",b,I,b),o.call(p+"_mul",o.i32_const(F),b,A),o.call(p+"_mul",d,i,b),o.call(p+"_add",C,b,C),o.call(p+"_add",A,b,d),o.call(p+"_add",i,r,_),o.call(p+"_mul",m,_,b),o.call(p+"_add",w,I,v),o.call(p+"_sub",b,v,b),o.call(p+"_mul",f,c,A),o.call(p+"_add",C,A,C),o.call(p+"_add",u,g,_),o.call(p+"_add",b,A,u),o.call(p+"_add",r,c,m),o.call(p+"_mul",m,_,b),o.call(p+"_add",I,x,v),o.call(p+"_sub",b,v,b),o.call(p+"_mul",o.i32_const(F),b,A),o.call(p+"_mul",f,i,b),o.call(p+"_add",C,b,C),o.call(p+"_add",A,b,f),o.call(p+"_mul",h,r,b),o.call(p+"_add",C,b,C),o.call(p+"_mul",o.i32_const(F),b,A),o.call(p+"_add",i,c,_),o.call(p+"_mul",y,_,b),o.call(p+"_add",w,x,v),o.call(p+"_sub",b,v,b),o.call(p+"_add",A,b,g),o.call(p+"_add",i,r,_),o.call(p+"_add",_,c,_),o.call(p+"_mul",L,_,b),o.call(p+"_sub",b,C,h))}(),function(){const e=t.addFunction(n+"__mulBy024Old");e.addParam("pEll0","i32"),e.addParam("pEllVW","i32"),e.addParam("pEllVV","i32"),e.addParam("pR","i32");const o=e.getCodeBuilder(),i=o.getLocal("pEll0"),r=o.getLocal("pEllVV"),a=o.getLocal("pEllVW"),c=o.getLocal("pR"),s=t.alloc(d),u=o.i32_const(s),f=o.i32_const(s),g=o.i32_const(s+l),h=o.i32_const(s+2*l),_=o.i32_const(s+3*l),m=o.i32_const(s+4*l),y=o.i32_const(s+5*l);e.addCode(o.call(p+"_copy",i,f),o.call(p+"_zero",g),o.call(p+"_copy",r,h),o.call(p+"_zero",_),o.call(p+"_copy",a,m),o.call(p+"_zero",y),o.call(U+"_mul",u,c,c))}(),function(){const e=t.addFunction(n+"_millerLoop");e.addParam("ppreP","i32"),e.addParam("ppreQ","i32"),e.addParam("r","i32"),e.addLocal("pCoef","i32"),e.addLocal("i","i32");const o=e.getCodeBuilder(),i=o.getLocal("ppreP"),r=o.i32_add(o.getLocal("ppreP"),o.i32_const(s)),a=o.getLocal("pCoef"),c=o.i32_add(o.getLocal("pCoef"),o.i32_const(l)),d=o.i32_add(o.getLocal("pCoef"),o.i32_const(2*l)),u=t.alloc(l),f=o.i32_const(u),g=t.alloc(l),h=o.i32_const(g),_=o.getLocal("r");e.addCode(o.call(U+"_one",_),o.setLocal("pCoef",o.i32_add(o.getLocal("ppreQ"),o.i32_const(3*l))),o.setLocal("i",o.i32_const(k.length-2)),o.block(o.loop(o.call(U+"_square",_,_),o.call(p+"_mul1",c,r,f),o.call(p+"_mul1",d,i,h),o.call(n+"__mulBy024",a,f,h,_),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T))),o.if(o.i32_load8_s(o.getLocal("i"),M),[...o.call(p+"_mul1",c,r,f),...o.call(p+"_mul1",d,i,h),...o.call(n+"__mulBy024",a,f,h,_),...o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T)))]),o.br_if(1,o.i32_eqz(o.getLocal("i"))),o.setLocal("i",o.i32_sub(o.getLocal("i"),o.i32_const(1))),o.br(0)))),e.addCode(o.call(p+"_mul1",c,r,f),o.call(p+"_mul1",d,i,h),o.call(n+"__mulBy024",a,f,h,_),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T))),o.call(p+"_mul1",c,r,f),o.call(p+"_mul1",d,i,h),o.call(n+"__mulBy024",a,f,h,_),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(T))))}();for(let e=0;e<10;e++)R(e),t.exportFunction(n+"__frobeniusMap"+e);!function(){const e=t.addFunction(n+"_finalExponentiationOld");e.addParam("x","i32"),e.addParam("r","i32");const o=t.alloc(tp.bigInt2BytesLE(552484233613224096312617126783173147097382103762957654188882734314196910839907541213974502761540629817009608548654680343627701153829446747810907373256841551006201639677726139946029199968412598804882391702273019083653272047566316584365559776493027495458238373902875937659943504873220554161550525926302303331747463515644711876653177129578303191095900909191624817826566688241804408081892785725967931714097716709526092261278071952560171111444072049229123565057483750161460024353346284167282452756217662335528813519139808291170539072125381230815729071544861602750936964829313608137325426383735122175229541155376346436093930287402089517426973178917569713384748081827255472576937471496195752727188261435633271238710131736096299798168852925540549342330775279877006784354801422249722573783561685179618816480037695005515426162362431072245638324744480n,352)),i=e.getCodeBuilder();e.addCode(i.call(U+"_exp",i.getLocal("x"),i.i32_const(o),i.i32_const(352),i.getLocal("r")))}(),function(){!function(){const e=t.addFunction(n+"__finalExponentiationFirstChunk");e.addParam("x","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("x"),r=i,c=o.i32_add(i,o.i32_const(6*a)),s=o.getLocal("r"),l=t.alloc(d),u=o.i32_const(l),f=u,g=o.i32_const(l+6*a),h=o.i32_const(t.alloc(d)),p=o.i32_const(t.alloc(d)),_=o.i32_const(t.alloc(d));e.addCode(o.call(j+"_copy",r,f),o.call(j+"_neg",c,g),o.call(U+"_inverse",i,h),o.call(U+"_mul",u,h,p),o.call(n+"__frobeniusMap2",p,_),o.call(U+"_mul",p,_,s))}(),q();const e=t.addFunction(n+"_finalExponentiation");e.addParam("x","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("x"),r=o.getLocal("r"),c=o.i32_const(t.alloc(d));e.addCode(o.call(n+"__finalExponentiationFirstChunk",i,c),o.call(n+"__finalExponentiationLastChunk",c,r))}();for(let e=1;e<=5;e++)V(e),t.exportFunction(n+"_pairingEq"+e);!function(){const e=t.addFunction(n+"_pairing");e.addParam("p","i32"),e.addParam("q","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.i32_const(t.alloc(d));e.addCode(o.call(n+"_prepareG1",o.getLocal("p"),o.i32_const(G))),e.addCode(o.call(n+"_prepareG2",o.getLocal("q"),o.i32_const(K))),e.addCode(o.call(n+"_millerLoop",o.i32_const(G),o.i32_const(K),i)),e.addCode(o.call(n+"_finalExponentiation",i,o.getLocal("r")))}(),t.exportFunction(n+"_pairing"),t.exportFunction(n+"_prepareG1"),t.exportFunction(n+"_prepareG2"),t.exportFunction(n+"_millerLoop"),t.exportFunction(n+"_finalExponentiation"),t.exportFunction(n+"_finalExponentiationOld"),t.exportFunction(n+"__mulBy024"),t.exportFunction(n+"__mulBy024Old"),t.exportFunction(n+"__cyclotomicSquare"),t.exportFunction(n+"__cyclotomicExp_w0")},Bp=function(t,e){const n=e||"bls12381";if(t.modules[n])return n;const o=0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn,i=0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001n,r=Math.floor((xp(o-1n)-1)/64)+1,a=8*r,c=a,s=2*c,l=12*c,d=Math.floor((xp(i-1n)-1)/64)+1,u=8*d,f=u,g=t.alloc(hp.bigInt2BytesLE(i,f)),h=pp(t,o,"f1m","intq");_p(t,i,"fr","frm","intr");const p=t.alloc(hp.bigInt2BytesLE(A(4n),c)),_=Lp(t,"g1m","f1m",p);bp(t,"frm","frm","frm","frm_mul"),Ap(t,"pol","frm"),wp(t,"qap","frm");const m=mp(t,"f1m_neg","f2m","f1m"),y=t.alloc([...hp.bigInt2BytesLE(A(4n),c),...hp.bigInt2BytesLE(A(4n),c)]),L=Lp(t,"g2m","f2m",y);function b(e,n){const o=t.addFunction(e);o.addParam("pG","i32"),o.addParam("pFr","i32"),o.addParam("pr","i32");const i=o.getCodeBuilder(),r=i.i32_const(t.alloc(u));o.addCode(i.call("frm_fromMontgomery",i.getLocal("pFr"),r),i.call(n,i.getLocal("pG"),r,i.i32_const(u),i.getLocal("pr"))),t.exportFunction(e)}function A(t){return BigInt(t)*(1n<<BigInt(8*c))%o}b("g1m_timesFr","g1m_timesScalar"),bp(t,"g1m","g1m","frm","g1m_timesFr"),b("g2m_timesFr","g2m_timesScalar"),bp(t,"g2m","g2m","frm","g2m_timesFr"),b("g1m_timesFrAffine","g1m_timesScalarAffine"),b("g2m_timesFrAffine","g2m_timesScalarAffine"),Ip(t,"frm_batchApplyKey","fmr","frm",u,u,u,"frm_mul"),Ip(t,"g1m_batchApplyKey","g1m","frm",3*a,3*a,u,"g1m_timesFr"),Ip(t,"g1m_batchApplyKeyMixed","g1m","frm",2*a,3*a,u,"g1m_timesFrAffine"),Ip(t,"g2m_batchApplyKey","g2m","frm",2*a*3,3*a*2,u,"g2m_timesFr"),Ip(t,"g2m_batchApplyKeyMixed","g2m","frm",2*a*2,3*a*2,u,"g2m_timesFrAffine");const w=[3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507n,1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569n,1n],I=t.alloc([...hp.bigInt2BytesLE(A(w[0]),c),...hp.bigInt2BytesLE(A(w[1]),c),...hp.bigInt2BytesLE(A(w[2]),c)]),x=[0n,1n,0n],C=t.alloc([...hp.bigInt2BytesLE(A(x[0]),c),...hp.bigInt2BytesLE(A(x[1]),c),...hp.bigInt2BytesLE(A(x[2]),c)]),v=[[352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160n,3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758n],[1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905n,927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582n],[1n,0n]],E=t.alloc([...hp.bigInt2BytesLE(A(v[0][0]),c),...hp.bigInt2BytesLE(A(v[0][1]),c),...hp.bigInt2BytesLE(A(v[1][0]),c),...hp.bigInt2BytesLE(A(v[1][1]),c),...hp.bigInt2BytesLE(A(v[2][0]),c),...hp.bigInt2BytesLE(A(v[2][1]),c)]),B=[[0n,0n],[1n,0n],[0n,0n]],F=t.alloc([...hp.bigInt2BytesLE(A(B[0][0]),c),...hp.bigInt2BytesLE(A(B[0][1]),c),...hp.bigInt2BytesLE(A(B[1][0]),c),...hp.bigInt2BytesLE(A(B[1][1]),c),...hp.bigInt2BytesLE(A(B[2][0]),c),...hp.bigInt2BytesLE(A(B[2][1]),c)]),O=t.alloc([...hp.bigInt2BytesLE(A(1n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c),...hp.bigInt2BytesLE(A(0n),c)]),S=t.alloc([...hp.bigInt2BytesLE(A(1n),c),...hp.bigInt2BytesLE(A(1n),c)]);!function(){const e=t.addFunction(m+"_mulNR");e.addParam("x","i32"),e.addParam("pr","i32");const n=e.getCodeBuilder(),o=n.i32_const(t.alloc(c)),i=n.getLocal("x"),r=n.i32_add(n.getLocal("x"),n.i32_const(c)),a=n.getLocal("pr"),s=n.i32_add(n.getLocal("pr"),n.i32_const(c));e.addCode(n.call(h+"_copy",i,o),n.call(h+"_sub",i,r,a),n.call(h+"_add",o,r,s))}();const P=yp(t,m+"_mulNR","f6m","f2m");!function(){const e=t.addFunction(P+"_mulNR");e.addParam("x","i32"),e.addParam("pr","i32");const n=e.getCodeBuilder(),o=n.i32_const(t.alloc(2*c));e.addCode(n.call(m+"_copy",n.getLocal("x"),o),n.call(m+"_mulNR",n.i32_add(n.getLocal("x"),n.i32_const(4*a)),n.getLocal("pr")),n.call(m+"_copy",n.i32_add(n.getLocal("x"),n.i32_const(2*a)),n.i32_add(n.getLocal("pr"),n.i32_const(4*a))),n.call(m+"_copy",o,n.i32_add(n.getLocal("pr"),n.i32_const(2*a))))}();const j=mp(t,P+"_mulNR","ftm",P),U=function(){let t=0xd201000000010000n;const e=[];for(;t>0n;)Cp(t)?e.push(1):e.push(0),t>>=1n;return e}(),k=t.alloc(U),M=3*s,T=U.length-1,z=U.reduce(((t,e)=>t+(0!=e?1:0)),0),Q=6*a,N=3*a*2+(z+T+1)*M,D=15132376222941642752n;function R(e){const n=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n,151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n],[2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n,1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n,877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027n,3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257n,2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230n,3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557n]]],i=[[[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n],[1n,0n]],[[1n,0n],[0n,4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[0n,1n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[0n,793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n]],[[1n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437n,0n],[4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n,0n],[4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559786n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n,0n],[793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351n,0n]]],r=t.addFunction(j+"_frobeniusMap"+e);r.addParam("x","i32"),r.addParam("r","i32");const l=r.getCodeBuilder();for(let o=0;o<6;o++){const u=0==o?l.getLocal("x"):l.i32_add(l.getLocal("x"),l.i32_const(o*s)),f=u,g=l.i32_add(l.getLocal("x"),l.i32_const(o*s+c)),p=0==o?l.getLocal("r"):l.i32_add(l.getLocal("r"),l.i32_const(o*s)),_=p,y=l.i32_add(l.getLocal("r"),l.i32_const(o*s+c)),L=d(n[Math.floor(o/3)][e%12],i[o%3][e%6]),b=t.alloc([...hp.bigInt2BytesLE(A(L[0]),a),...hp.bigInt2BytesLE(A(L[1]),a)]);e%2==1?r.addCode(l.call(h+"_copy",f,_),l.call(h+"_neg",g,y),l.call(m+"_mul",p,l.i32_const(b),p)):r.addCode(l.call(m+"_mul",u,l.i32_const(b),p))}function d(t,e){const n=t[0],i=t[1],r=e[0],a=e[1],c=[(n*r-i*a)%o,(n*a+i*r)%o];return vp(c[0])&&(c[0]=c[0]+o),c}}t.modules[n]={n64q:r,n64r:d,n8q:a,n8r:u,pG1gen:I,pG1zero:C,pG1b:p,pG2gen:E,pG2zero:F,pG2b:y,pq:t.modules.f1m.pq,pr:g,pOneT:O,r:i,q:o,prePSize:Q,preQSize:N},function(){const e=t.addFunction(P+"_mul1");e.addParam("pA","i32"),e.addParam("pC1","i32"),e.addParam("pR","i32");const n=e.getCodeBuilder(),o=n.getLocal("pA"),i=n.i32_add(n.getLocal("pA"),n.i32_const(2*c)),r=n.i32_add(n.getLocal("pA"),n.i32_const(4*c)),a=n.getLocal("pC1"),s=n.getLocal("pR"),l=n.i32_add(n.getLocal("pR"),n.i32_const(2*c)),d=n.i32_add(n.getLocal("pR"),n.i32_const(4*c)),u=n.i32_const(t.alloc(2*c)),f=n.i32_const(t.alloc(2*c));e.addCode(n.call(m+"_add",o,i,u),n.call(m+"_add",i,r,f),n.call(m+"_mul",i,a,d),n.call(m+"_mul",f,a,s),n.call(m+"_sub",s,d,s),n.call(m+"_mulNR",s,s),n.call(m+"_mul",u,a,l),n.call(m+"_sub",l,d,l))}(),function(){const e=t.addFunction(P+"_mul01");e.addParam("pA","i32"),e.addParam("pC0","i32"),e.addParam("pC1","i32"),e.addParam("pR","i32");const n=e.getCodeBuilder(),o=n.getLocal("pA"),i=n.i32_add(n.getLocal("pA"),n.i32_const(2*c)),r=n.i32_add(n.getLocal("pA"),n.i32_const(4*c)),a=n.getLocal("pC0"),s=n.getLocal("pC1"),l=n.getLocal("pR"),d=n.i32_add(n.getLocal("pR"),n.i32_const(2*c)),u=n.i32_add(n.getLocal("pR"),n.i32_const(4*c)),f=n.i32_const(t.alloc(2*c)),g=n.i32_const(t.alloc(2*c)),h=n.i32_const(t.alloc(2*c)),p=n.i32_const(t.alloc(2*c));e.addCode(n.call(m+"_mul",o,a,f),n.call(m+"_mul",i,s,g),n.call(m+"_add",o,i,h),n.call(m+"_add",o,r,p),n.call(m+"_add",i,r,l),n.call(m+"_mul",l,s,l),n.call(m+"_sub",l,g,l),n.call(m+"_mulNR",l,l),n.call(m+"_add",l,f,l),n.call(m+"_add",a,s,d),n.call(m+"_mul",d,h,d),n.call(m+"_sub",d,f,d),n.call(m+"_sub",d,g,d),n.call(m+"_mul",p,a,u),n.call(m+"_sub",u,f,u),n.call(m+"_add",u,g,u))}(),function(){const e=t.addFunction(j+"_mul014");e.addParam("pA","i32"),e.addParam("pC0","i32"),e.addParam("pC1","i32"),e.addParam("pC4","i32"),e.addParam("pR","i32");const n=e.getCodeBuilder(),o=n.getLocal("pA"),i=n.i32_add(n.getLocal("pA"),n.i32_const(6*c)),r=n.getLocal("pC0"),a=n.getLocal("pC1"),s=n.getLocal("pC4"),l=n.i32_const(t.alloc(6*c)),d=n.i32_const(t.alloc(6*c)),u=n.i32_const(t.alloc(2*c)),f=n.getLocal("pR"),g=n.i32_add(n.getLocal("pR"),n.i32_const(6*c));e.addCode(n.call(P+"_mul01",o,r,a,l),n.call(P+"_mul1",i,s,d),n.call(m+"_add",a,s,u),n.call(P+"_add",i,o,g),n.call(P+"_mul01",g,r,u,g),n.call(P+"_sub",g,l,g),n.call(P+"_sub",g,d,g),n.call(P+"_copy",d,f),n.call(P+"_mulNR",f,f),n.call(P+"_add",f,l,f))}(),function(){const e=t.addFunction(n+"_ell");e.addParam("pP","i32"),e.addParam("pCoefs","i32"),e.addParam("pF","i32");const o=e.getCodeBuilder(),i=o.getLocal("pP"),r=o.i32_add(o.getLocal("pP"),o.i32_const(a)),s=o.getLocal("pF"),l=o.getLocal("pCoefs"),d=o.i32_add(o.getLocal("pCoefs"),o.i32_const(c)),u=o.i32_add(o.getLocal("pCoefs"),o.i32_const(2*c)),f=o.i32_add(o.getLocal("pCoefs"),o.i32_const(3*c)),g=o.i32_add(o.getLocal("pCoefs"),o.i32_const(4*c)),p=t.alloc(2*c),_=o.i32_const(p),m=o.i32_const(p),y=o.i32_const(p+c),L=t.alloc(2*c),b=o.i32_const(L),A=o.i32_const(L),w=o.i32_const(L+c);e.addCode(o.call(h+"_mul",l,r,m),o.call(h+"_mul",d,r,y),o.call(h+"_mul",u,i,A),o.call(h+"_mul",f,i,w),o.call(j+"_mul014",s,g,b,_,s))}();const q=t.alloc(Q),G=t.alloc(N);function K(e){const o=t.addFunction(n+"_pairingEq"+e);for(let t=0;t<e;t++)o.addParam("p_"+t,"i32"),o.addParam("q_"+t,"i32");o.addParam("c","i32"),o.setReturnType("i32");const i=o.getCodeBuilder(),r=i.i32_const(t.alloc(l)),a=i.i32_const(t.alloc(l));o.addCode(i.call(j+"_one",r));for(let t=0;t<e;t++)o.addCode(i.call(n+"_prepareG1",i.getLocal("p_"+t),i.i32_const(q))),o.addCode(i.call(n+"_prepareG2",i.getLocal("q_"+t),i.i32_const(G))),o.addCode(i.if(i.i32_eqz(i.call(_+"_inGroupAffine",i.i32_const(q))),i.ret(i.i32_const(0))),i.if(i.i32_eqz(i.call(L+"_inGroupAffine",i.i32_const(G))),i.ret(i.i32_const(0)))),o.addCode(i.call(n+"_millerLoop",i.i32_const(q),i.i32_const(G),a)),o.addCode(i.call(j+"_mul",r,a,r));o.addCode(i.call(n+"_finalExponentiation",r,r)),o.addCode(i.call(j+"_eq",r,i.getLocal("c")))}for(let e=0;e<10;e++)R(e),t.exportFunction(j+"_frobeniusMap"+e);!function(){const e=t.addFunction(_+"_inGroupAffine");e.addParam("p","i32"),e.setReturnType("i32");const n=e.getCodeBuilder(),o=(D*D-1n)/3n,i=n.i32_const(t.alloc(hp.bigInt2BytesLE(A(4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n),a))),r=n.i32_const(t.alloc(hp.bigInt2BytesLE(A(793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350n),a))),s=n.i32_const(t.alloc(hp.bigInt2BytesLE(o,16))),l=n.getLocal("p"),d=n.i32_add(n.getLocal("p"),n.i32_const(c)),u=t.alloc(3*c),f=n.i32_const(u),g=n.i32_const(u),p=n.i32_const(u+c),m=t.alloc(2*c),y=n.i32_const(m),L=n.i32_const(m),b=n.i32_const(m+c);e.addCode(n.if(n.call(_+"_isZeroAffine",n.getLocal("p")),n.ret(n.i32_const(1))),n.if(n.i32_eqz(n.call(_+"_inCurveAffine",n.getLocal("p"))),n.ret(n.i32_const(0))),n.call(h+"_mul",l,i,g),n.call(h+"_copy",d,p),n.call(h+"_mul",l,r,L),n.call(h+"_copy",d,b),n.call(_+"_doubleAffine",f,f),n.call(_+"_subMixed",f,n.getLocal("p"),f),n.call(_+"_subMixed",f,y,f),n.call(_+"_timesScalar",f,s,n.i32_const(16),f),n.ret(n.call(_+"_eqMixed",f,y)));const w=t.addFunction(_+"_inGroup");w.addParam("pIn","i32"),w.setReturnType("i32");const I=w.getCodeBuilder(),x=I.i32_const(t.alloc(2*c));w.addCode(I.call(_+"_toAffine",I.getLocal("pIn"),x),I.ret(I.call(_+"_inGroupAffine",x)))}(),function(){const e=t.addFunction(L+"_inGroupAffine");e.addParam("p","i32"),e.setReturnType("i32");const n=e.getCodeBuilder(),o=[2001204777610833696708894912867952078278441409969503942666029068062015825245418932221343814564507832018947136279894n,2001204777610833696708894912867952078278441409969503942666029068062015825245418932221343814564507832018947136279893n],i=[2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n,2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530n],r=n.i32_const(t.alloc([...hp.bigInt2BytesLE(A(o[0]),a),...hp.bigInt2BytesLE(A(o[1]),a)])),l=n.i32_const(t.alloc(hp.bigInt2BytesLE(A(4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436n),a))),d=n.i32_const(t.alloc([...hp.bigInt2BytesLE(A(i[0]),a),...hp.bigInt2BytesLE(A(i[1]),a)])),u=n.i32_const(t.alloc(hp.bigInt2BytesLE(D,8))),f=n.getLocal("p"),g=n.i32_add(n.getLocal("p"),n.i32_const(s)),p=n.i32_const(t.alloc(c)),_=n.i32_const(t.alloc(s)),y=n.i32_const(t.alloc(s)),b=t.alloc(2*s),w=n.i32_const(b),I=n.i32_const(b),x=n.i32_const(b),C=n.i32_const(b+c),v=n.i32_const(b+s),E=n.i32_const(b+s),B=n.i32_const(b+s+c),F=t.alloc(3*s),O=n.i32_const(F),S=n.i32_const(F),P=n.i32_const(F),j=n.i32_const(F+c),U=n.i32_const(F+s),k=n.i32_const(F+s),M=n.i32_const(F+s+c),T=n.i32_const(F+2*s);e.addCode(n.if(n.call(L+"_isZeroAffine",n.getLocal("p")),n.ret(n.i32_const(1))),n.if(n.i32_eqz(n.call(L+"_inCurveAffine",n.getLocal("p"))),n.ret(n.i32_const(0))),n.call(m+"_mul",f,r,_),n.call(m+"_mul",g,r,y),n.call(m+"_mul1",_,l,I),n.call(m+"_neg",y,v),n.call(m+"_neg",_,S),n.call(m+"_mul",y,d,U),n.call(h+"_sub",x,C,p),n.call(h+"_add",x,C,C),n.call(h+"_copy",p,x),n.call(h+"_sub",E,B,p),n.call(h+"_add",E,B,B),n.call(h+"_copy",p,E),n.call(h+"_add",P,j,p),n.call(h+"_sub",P,j,j),n.call(h+"_copy",p,P),n.call(h+"_sub",M,k,p),n.call(h+"_add",k,M,M),n.call(h+"_copy",p,k),n.call(m+"_one",T),n.call(L+"_timesScalar",O,u,n.i32_const(8),O),n.call(L+"_addMixed",O,w,O),n.ret(n.call(L+"_eqMixed",O,n.getLocal("p"))));const z=t.addFunction(L+"_inGroup");z.addParam("pIn","i32"),z.setReturnType("i32");const Q=z.getCodeBuilder(),N=Q.i32_const(t.alloc(2*s));z.addCode(Q.call(L+"_toAffine",Q.getLocal("pIn"),N),Q.ret(Q.call(L+"_inGroupAffine",N)))}(),function(){const e=t.addFunction(n+"_prepAddStep");e.addParam("R","i32"),e.addParam("Q","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("R"),r=o.i32_add(o.getLocal("R"),o.i32_const(2*a)),c=o.i32_add(o.getLocal("R"),o.i32_const(4*a)),l=o.getLocal("Q"),d=o.i32_add(o.getLocal("Q"),o.i32_const(2*a)),u=o.getLocal("r"),f=o.i32_add(o.getLocal("r"),o.i32_const(2*a)),g=o.i32_add(o.getLocal("r"),o.i32_const(4*a)),h=o.i32_const(t.alloc(s)),p=o.i32_const(t.alloc(s)),_=o.i32_const(t.alloc(s)),y=o.i32_const(t.alloc(s)),L=o.i32_const(t.alloc(s)),b=o.i32_const(t.alloc(s)),A=o.i32_const(t.alloc(s)),w=o.i32_const(t.alloc(s)),I=o.i32_const(t.alloc(s)),x=o.i32_const(t.alloc(s)),C=o.i32_const(t.alloc(s));e.addCode(o.call(m+"_square",c,h),o.call(m+"_square",d,p),o.call(m+"_mul",h,l,y),o.call(m+"_add",d,c,f),o.call(m+"_square",f,f),o.call(m+"_sub",f,p,f),o.call(m+"_sub",f,h,f),o.call(m+"_mul",f,h,f),o.call(m+"_sub",y,i,L),o.call(m+"_square",L,b),o.call(m+"_add",b,b,A),o.call(m+"_add",A,A,A),o.call(m+"_mul",A,L,w),o.call(m+"_sub",f,r,I),o.call(m+"_sub",I,r,I),o.call(m+"_mul",I,l,g),o.call(m+"_mul",A,i,x),o.call(m+"_square",I,i),o.call(m+"_sub",i,w,i),o.call(m+"_sub",i,x,i),o.call(m+"_sub",i,x,i),o.call(m+"_add",c,L,c),o.call(m+"_square",c,c),o.call(m+"_sub",c,h,c),o.call(m+"_sub",c,b,c),o.call(m+"_add",d,c,u),o.call(m+"_sub",x,i,C),o.call(m+"_mul",C,I,C),o.call(m+"_mul",r,w,y),o.call(m+"_add",y,y,y),o.call(m+"_sub",C,y,r),o.call(m+"_square",u,u),o.call(m+"_sub",u,p,u),o.call(m+"_square",c,_),o.call(m+"_sub",u,_,u),o.call(m+"_add",g,g,g),o.call(m+"_sub",g,u,g),o.call(m+"_add",c,c,u),o.call(m+"_neg",I,I),o.call(m+"_add",I,I,f))}(),function(){const e=t.addFunction(n+"_prepDblStep");e.addParam("R","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("R"),r=o.i32_add(o.getLocal("R"),o.i32_const(2*a)),c=o.i32_add(o.getLocal("R"),o.i32_const(4*a)),l=o.getLocal("r"),d=o.i32_add(o.getLocal("r"),o.i32_const(2*a)),u=o.i32_add(o.getLocal("r"),o.i32_const(4*a)),f=o.i32_const(t.alloc(s)),g=o.i32_const(t.alloc(s)),h=o.i32_const(t.alloc(s)),p=o.i32_const(t.alloc(s)),_=o.i32_const(t.alloc(s));e.addCode(o.call(m+"_square",i,l),o.call(m+"_square",r,g),o.call(m+"_square",g,h),o.call(m+"_add",g,i,d),o.call(m+"_square",d,d),o.call(m+"_sub",d,l,d),o.call(m+"_sub",d,h,d),o.call(m+"_add",d,d,d),o.call(m+"_add",l,l,p),o.call(m+"_add",p,l,p),o.call(m+"_add",i,p,u),o.call(m+"_square",p,_),o.call(m+"_square",c,f),o.call(m+"_sub",_,d,i),o.call(m+"_sub",i,d,i),o.call(m+"_add",c,r,c),o.call(m+"_square",c,c),o.call(m+"_sub",c,g,c),o.call(m+"_sub",c,f,c),o.call(m+"_sub",d,i,r),o.call(m+"_mul",r,p,r),o.call(m+"_add",h,h,h),o.call(m+"_add",h,h,h),o.call(m+"_add",h,h,h),o.call(m+"_sub",r,h,r),o.call(m+"_mul",p,f,d),o.call(m+"_add",d,d,d),o.call(m+"_neg",d,d),o.call(m+"_square",u,u),o.call(m+"_sub",u,l,u),o.call(m+"_sub",u,_,u),o.call(m+"_add",g,g,g),o.call(m+"_add",g,g,g),o.call(m+"_sub",u,g,u),o.call(m+"_mul",c,f,l),o.call(m+"_add",l,l,l))}(),function(){const e=t.addFunction(n+"_prepareG1");e.addParam("pP","i32"),e.addParam("ppreP","i32");const o=e.getCodeBuilder();e.addCode(o.call(_+"_normalize",o.getLocal("pP"),o.getLocal("ppreP")))}(),function(){const e=t.addFunction(n+"_prepareG2");e.addParam("pQ","i32"),e.addParam("ppreQ","i32"),e.addLocal("pCoef","i32"),e.addLocal("i","i32");const o=e.getCodeBuilder(),i=o.getLocal("pQ"),r=t.alloc(3*s),a=o.i32_const(r),c=o.getLocal("ppreQ");e.addCode(o.call(L+"_normalize",i,c),o.if(o.call(L+"_isZero",c),o.ret([])),o.call(L+"_copy",c,a),o.setLocal("pCoef",o.i32_add(o.getLocal("ppreQ"),o.i32_const(3*s)))),e.addCode(o.setLocal("i",o.i32_const(U.length-2)),o.block(o.loop(o.call(n+"_prepDblStep",a,o.getLocal("pCoef")),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(M))),o.if(o.i32_load8_s(o.getLocal("i"),k),[...o.call(n+"_prepAddStep",a,c,o.getLocal("pCoef")),...o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(M)))]),o.br_if(1,o.i32_eqz(o.getLocal("i"))),o.setLocal("i",o.i32_sub(o.getLocal("i"),o.i32_const(1))),o.br(0))))}(),function(){const e=t.addFunction(n+"_millerLoop");e.addParam("ppreP","i32"),e.addParam("ppreQ","i32"),e.addParam("r","i32"),e.addLocal("pCoef","i32"),e.addLocal("i","i32");const o=e.getCodeBuilder(),i=o.getLocal("ppreP"),r=o.getLocal("pCoef"),a=o.getLocal("r");e.addCode(o.call(j+"_one",a),o.if(o.call(_+"_isZero",i),o.ret([])),o.if(o.call(_+"_isZero",o.getLocal("ppreQ")),o.ret([])),o.setLocal("pCoef",o.i32_add(o.getLocal("ppreQ"),o.i32_const(3*s))),o.setLocal("i",o.i32_const(U.length-2)),o.block(o.loop(o.call(n+"_ell",i,r,a),o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(M))),o.if(o.i32_load8_s(o.getLocal("i"),k),[...o.call(n+"_ell",i,r,a),...o.setLocal("pCoef",o.i32_add(o.getLocal("pCoef"),o.i32_const(M)))]),o.call(j+"_square",a,a),o.br_if(1,o.i32_eq(o.getLocal("i"),o.i32_const(1))),o.setLocal("i",o.i32_sub(o.getLocal("i"),o.i32_const(1))),o.br(0))),o.call(n+"_ell",i,r,a)),e.addCode(o.call(j+"_conjugate",a,a))}(),function(){const e=t.addFunction(n+"_finalExponentiationOld");e.addParam("x","i32"),e.addParam("r","i32");const o=t.alloc(hp.bigInt2BytesLE(322277361516934140462891564586510139908379969514828494218366688025288661041104682794998680497580008899973249814104447692778988208376779573819485263026159588510513834876303014016798809919343532899164848730280942609956670917565618115867287399623286813270357901731510188149934363360381614501334086825442271920079363289954510565375378443704372994881406797882676971082200626541916413184642520269678897559532260949334760604962086348898118982248842634379637598665468817769075878555493752214492790122785850202957575200176084204422751485957336465472324810982833638490904279282696134323072515220044451592646885410572234451732790590013479358343841220074174848221722017083597872017638514103174122784843925578370430843522959600095676285723737049438346544753168912974976791528535276317256904336520179281145394686565050419250614107803233314658825463117900250701199181529205942363159325765991819433914303908860460720581408201373164047773794825411011922305820065611121544561808414055302212057471395719432072209245600258134364584636810093520285711072578721435517884103526483832733289802426157301542744476740008494780363354305116978805620671467071400711358839553375340724899735460480144599782014906586543813292157922220645089192130209334926661588737007768565838519456601560804957985667880395221049249803753582637708560n,544)),i=e.getCodeBuilder();e.addCode(i.call(j+"_exp",i.getLocal("x"),i.i32_const(o),i.i32_const(544),i.getLocal("r")))}(),function(){!function(){const e=t.addFunction(n+"__cyclotomicSquare");e.addParam("x","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("x"),r=o.i32_add(o.getLocal("x"),o.i32_const(s)),a=o.i32_add(o.getLocal("x"),o.i32_const(2*s)),c=o.i32_add(o.getLocal("x"),o.i32_const(3*s)),l=o.i32_add(o.getLocal("x"),o.i32_const(4*s)),d=o.i32_add(o.getLocal("x"),o.i32_const(5*s)),u=o.getLocal("r"),f=o.i32_add(o.getLocal("r"),o.i32_const(s)),g=o.i32_add(o.getLocal("r"),o.i32_const(2*s)),h=o.i32_add(o.getLocal("r"),o.i32_const(3*s)),p=o.i32_add(o.getLocal("r"),o.i32_const(4*s)),_=o.i32_add(o.getLocal("r"),o.i32_const(5*s)),y=o.i32_const(t.alloc(s)),L=o.i32_const(t.alloc(s)),b=o.i32_const(t.alloc(s)),A=o.i32_const(t.alloc(s)),w=o.i32_const(t.alloc(s)),I=o.i32_const(t.alloc(s)),x=o.i32_const(t.alloc(s)),C=o.i32_const(t.alloc(s));e.addCode(o.call(m+"_mul",i,l,x),o.call(m+"_mulNR",l,y),o.call(m+"_add",i,y,y),o.call(m+"_add",i,l,C),o.call(m+"_mul",C,y,y),o.call(m+"_mulNR",x,C),o.call(m+"_add",x,C,C),o.call(m+"_sub",y,C,y),o.call(m+"_add",x,x,L),o.call(m+"_mul",c,a,x),o.call(m+"_mulNR",a,b),o.call(m+"_add",c,b,b),o.call(m+"_add",c,a,C),o.call(m+"_mul",C,b,b),o.call(m+"_mulNR",x,C),o.call(m+"_add",x,C,C),o.call(m+"_sub",b,C,b),o.call(m+"_add",x,x,A),o.call(m+"_mul",r,d,x),o.call(m+"_mulNR",d,w),o.call(m+"_add",r,w,w),o.call(m+"_add",r,d,C),o.call(m+"_mul",C,w,w),o.call(m+"_mulNR",x,C),o.call(m+"_add",x,C,C),o.call(m+"_sub",w,C,w),o.call(m+"_add",x,x,I),o.call(m+"_sub",y,i,u),o.call(m+"_add",u,u,u),o.call(m+"_add",y,u,u),o.call(m+"_add",L,l,p),o.call(m+"_add",p,p,p),o.call(m+"_add",L,p,p),o.call(m+"_mul",I,o.i32_const(S),C),o.call(m+"_add",C,c,h),o.call(m+"_add",h,h,h),o.call(m+"_add",C,h,h),o.call(m+"_sub",w,a,g),o.call(m+"_add",g,g,g),o.call(m+"_add",w,g,g),o.call(m+"_sub",b,r,f),o.call(m+"_add",f,f,f),o.call(m+"_add",b,f,f),o.call(m+"_add",A,d,_),o.call(m+"_add",_,_,_),o.call(m+"_add",A,_,_))}(),function(e,o,i){const r=function(t){let e=t;const n=[];for(;e>0n;){if(Cp(e)){const t=2-Number(e%4n);n.push(t),e-=BigInt(t)}else n.push(0);e>>=1n}return n}(e).map((t=>-1==t?255:t)),a=t.alloc(r),c=t.addFunction(n+"__cyclotomicExp_"+i);c.addParam("x","i32"),c.addParam("r","i32"),c.addLocal("bit","i32"),c.addLocal("i","i32");const s=c.getCodeBuilder(),d=s.getLocal("x"),u=s.getLocal("r"),f=s.i32_const(t.alloc(l));c.addCode(s.call(j+"_conjugate",d,f),s.call(j+"_one",u),s.if(s.teeLocal("bit",s.i32_load8_s(s.i32_const(r.length-1),a)),s.if(s.i32_eq(s.getLocal("bit"),s.i32_const(1)),s.call(j+"_mul",u,d,u),s.call(j+"_mul",u,f,u))),s.setLocal("i",s.i32_const(r.length-2)),s.block(s.loop(s.call(n+"__cyclotomicSquare",u,u),s.if(s.teeLocal("bit",s.i32_load8_s(s.getLocal("i"),a)),s.if(s.i32_eq(s.getLocal("bit"),s.i32_const(1)),s.call(j+"_mul",u,d,u),s.call(j+"_mul",u,f,u))),s.br_if(1,s.i32_eqz(s.getLocal("i"))),s.setLocal("i",s.i32_sub(s.getLocal("i"),s.i32_const(1))),s.br(0)))),o&&c.addCode(s.call(j+"_conjugate",u,u))}(D,!0,"w0");const e=t.addFunction(n+"_finalExponentiation");e.addParam("x","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.getLocal("x"),r=o.getLocal("r"),a=o.i32_const(t.alloc(l)),c=o.i32_const(t.alloc(l)),d=o.i32_const(t.alloc(l)),u=o.i32_const(t.alloc(l)),f=o.i32_const(t.alloc(l)),g=o.i32_const(t.alloc(l)),h=o.i32_const(t.alloc(l));e.addCode(o.call(j+"_frobeniusMap6",i,a),o.call(j+"_inverse",i,c),o.call(j+"_mul",a,c,d),o.call(j+"_copy",d,c),o.call(j+"_frobeniusMap2",d,d),o.call(j+"_mul",d,c,d),o.call(n+"__cyclotomicSquare",d,c),o.call(j+"_conjugate",c,c),o.call(n+"__cyclotomicExp_w0",d,u),o.call(n+"__cyclotomicSquare",u,f),o.call(j+"_mul",c,u,g),o.call(n+"__cyclotomicExp_w0",g,c),o.call(n+"__cyclotomicExp_w0",c,a),o.call(n+"__cyclotomicExp_w0",a,h),o.call(j+"_mul",h,f,h),o.call(n+"__cyclotomicExp_w0",h,f),o.call(j+"_conjugate",g,g),o.call(j+"_mul",f,g,f),o.call(j+"_mul",f,d,f),o.call(j+"_conjugate",d,g),o.call(j+"_mul",c,d,c),o.call(j+"_frobeniusMap3",c,c),o.call(j+"_mul",h,g,h),o.call(j+"_frobeniusMap1",h,h),o.call(j+"_mul",u,a,u),o.call(j+"_frobeniusMap2",u,u),o.call(j+"_mul",u,c,u),o.call(j+"_mul",u,h,u),o.call(j+"_mul",u,f,r))}();for(let e=1;e<=5;e++)K(e),t.exportFunction(n+"_pairingEq"+e);!function(){const e=t.addFunction(n+"_pairing");e.addParam("p","i32"),e.addParam("q","i32"),e.addParam("r","i32");const o=e.getCodeBuilder(),i=o.i32_const(t.alloc(l));e.addCode(o.call(n+"_prepareG1",o.getLocal("p"),o.i32_const(q))),e.addCode(o.call(n+"_prepareG2",o.getLocal("q"),o.i32_const(G))),e.addCode(o.call(n+"_millerLoop",o.i32_const(q),o.i32_const(G),i)),e.addCode(o.call(n+"_finalExponentiation",i,o.getLocal("r")))}(),t.exportFunction(n+"_pairing"),t.exportFunction(n+"_prepareG1"),t.exportFunction(n+"_prepareG2"),t.exportFunction(n+"_millerLoop"),t.exportFunction(n+"_finalExponentiation"),t.exportFunction(n+"_finalExponentiationOld"),t.exportFunction(n+"__cyclotomicSquare"),t.exportFunction(n+"__cyclotomicExp_w0"),t.exportFunction(P+"_mul1"),t.exportFunction(P+"_mul01"),t.exportFunction(j+"_mul014"),t.exportFunction(_+"_inGroupAffine"),t.exportFunction(_+"_inGroup"),t.exportFunction(L+"_inGroupAffine"),t.exportFunction(L+"_inGroup")};function Fp(t,e){let n=t;void 0===e&&0==(e=Math.floor((hg(t)-1)/8)+1)&&(e=1);const o=new Uint8Array(e),i=new DataView(o.buffer);let r=0;for(;r<e;)r+4<=e?(i.setUint32(r,Number(n&BigInt(4294967295)),!0),r+=4,n>>=BigInt(32)):r+2<=e?(i.setUint16(r,Number(n&BigInt(65535)),!0),r+=2,n>>=BigInt(16)):(i.setUint8(r,Number(n&BigInt(255)),!0),r+=1,n>>=BigInt(8));if(n)throw new Error("Number does not fit in this length");return o}const Op=[];for(let t=0;t<256;t++)Op[t]=Sp(t,8);function Sp(t,e){let n=0,o=t;for(let t=0;t<e;t++)n<<=1,n|=1&o,o>>=1;return n}function Pp(t,e){return(Op[t>>>24]|Op[t>>>16&255]<<8|Op[t>>>8&255]<<16|Op[255&t]<<24)>>>32-e}function jp(t){return(4294901760&t?(t&=4294901760,16):0)|(4278255360&t?(t&=4278255360,8):0)|(4042322160&t?(t&=4042322160,4):0)|(3435973836&t?(t&=3435973836,2):0)|!!(2863311530&t)}function Up(t,e){const n=t.byteLength/e,o=jp(n);if(n!=1<<o)throw new Error("Invalid number of pointers");for(let i=0;i<n;i++){const n=Pp(i,o);if(i>n){const o=t.slice(i*e,(i+1)*e);t.set(t.slice(n*e,(n+1)*e),i*e),t.set(o,n*e)}}}function kp(t,e){const n=new Uint8Array(e*t.length);for(let o=0;o<t.length;o++)n.set(t[o],o*e);return n}function Mp(t,e){const n=t.byteLength/e,o=new Array(n);for(let i=0;i<n;i++)o[i]=t.slice(i*e,i*e+e);return o}var Tp=Object.freeze({__proto__:null,array2buffer:kp,beBuff2int:function(t){let e=BigInt(0),n=t.length,o=0;const i=new DataView(t.buffer,t.byteOffset,t.byteLength);for(;n>0;)n>=4?(n-=4,e+=BigInt(i.getUint32(n))<<BigInt(8*o),o+=4):n>=2?(n-=2,e+=BigInt(i.getUint16(n))<<BigInt(8*o),o+=2):(n-=1,e+=BigInt(i.getUint8(n))<<BigInt(8*o),o+=1);return e},beInt2Buff:function(t,e){let n=t;const o=new Uint8Array(e),i=new DataView(o.buffer);let r=e;for(;r>0;)r-4>=0?(r-=4,i.setUint32(r,Number(n&BigInt(4294967295))),n>>=BigInt(32)):r-2>=0?(r-=2,i.setUint16(r,Number(n&BigInt(65535))),n>>=BigInt(16)):(r-=1,i.setUint8(r,Number(n&BigInt(255))),n>>=BigInt(8));if(n)throw new Error("Number does not fit in this length");return o},bitReverse:Pp,buffReverseBits:Up,buffer2array:Mp,leBuff2int:function(t){let e=BigInt(0),n=0;const o=new DataView(t.buffer,t.byteOffset,t.byteLength);for(;n<t.length;)n+4<=t.length?(e+=BigInt(o.getUint32(n,!0))<<BigInt(8*n),n+=4):n+2<=t.length?(e+=BigInt(o.getUint16(n,!0))<<BigInt(8*n),n+=2):(e+=BigInt(o.getUint8(n,!0))<<BigInt(8*n),n+=1);return e},leInt2Buff:Fp,log2:jp,stringifyBigInts:function t(e){if("bigint"==typeof e||void 0!==e.eq)return e.toString(10);if(e instanceof Uint8Array)return Tg(e,0);if(Array.isArray(e))return e.map(t);if("object"==typeof e){const n={};return Object.keys(e).forEach((o=>{n[o]=t(e[o])})),n}return e},stringifyFElements:function t(e,n){if("bigint"==typeof n||void 0!==n.eq)return n.toString(10);if(n instanceof Uint8Array)return e.toString(e.e(n));if(Array.isArray(n))return n.map(t.bind(this,e));if("object"==typeof n){const o={};return Object.keys(n).forEach((i=>{o[i]=t(e,n[i])})),o}return n},unstringifyBigInts:function t(e){if("string"==typeof e&&/^[0-9]+$/.test(e))return BigInt(e);if("string"==typeof e&&/^0x[0-9a-fA-F]+$/.test(e))return BigInt(e);if(Array.isArray(e))return e.map(t);if("object"==typeof e){if(null===e)return null;const n={};return Object.keys(e).forEach((o=>{n[o]=t(e[o])})),n}return e},unstringifyFElements:function t(e,n){if("string"==typeof n&&/^[0-9]+$/.test(n))return e.e(n);if("string"==typeof n&&/^0x[0-9a-fA-F]+$/.test(n))return e.e(n);if(Array.isArray(n))return n.map(t.bind(this,e));if("object"==typeof n){if(null===n)return null;const o={};return Object.keys(n).forEach((i=>{o[i]=t(e,n[i])})),o}return n}});const zp=1<<30;class Qp{constructor(t){this.buffers=[],this.byteLength=t;for(let e=0;e<t;e+=zp){const n=Math.min(t-e,zp);this.buffers.push(new Uint8Array(n))}}slice(t,e){void 0===e&&(e=this.byteLength),void 0===t&&(t=0);const n=e-t,o=Math.floor(t/zp);if(o==Math.floor((t+n-1)/zp)||0==n)return this.buffers[o].slice(t%zp,t%zp+n);let i,r=o,a=t%zp,c=n;for(;c>0;){const t=a+c>zp?zp-a:c,e=new Uint8Array(this.buffers[r].buffer,this.buffers[r].byteOffset+a,t);if(t==n)return e.slice();i||(i=n<=zp?new Uint8Array(n):new Qp(n)),i.set(e,n-c),c-=t,r++,a=0}return i}set(t,e){void 0===e&&(e=0);const n=t.byteLength;if(0==n)return;const o=Math.floor(e/zp);if(o==Math.floor((e+n-1)/zp))return t instanceof Qp&&1==t.buffers.length?this.buffers[o].set(t.buffers[0],e%zp):this.buffers[o].set(t,e%zp);let i=o,r=e%zp,a=n;for(;a>0;){const e=r+a>zp?zp-r:a,o=t.slice(n-a,n-a+e);new Uint8Array(this.buffers[i].buffer,this.buffers[i].byteOffset+r,e).set(o),a-=e,i++,r=0}}}function Np(t,e,n,o){return async function(i){const r=Math.floor(i.byteLength/n);if(r*n!==i.byteLength)throw new Error("Invalid buffer size");const a=Math.floor(r/t.concurrency),c=[];for(let s=0;s<t.concurrency;s++){let l;if(l=s<t.concurrency-1?a:r-s*a,0==l)continue;const d=[{cmd:"ALLOCSET",var:0,buff:i.slice(s*a*n,s*a*n+l*n)},{cmd:"ALLOC",var:1,len:o*l},{cmd:"CALL",fnName:e,params:[{var:0},{val:l},{var:1}]},{cmd:"GET",out:0,var:1,len:o*l}];c.push(t.queueAction(d))}const s=await Promise.all(c);let l;l=i instanceof Qp?new Qp(r*o):new Uint8Array(r*o);let d=0;for(let t=0;t<s.length;t++)l.set(s[t][0],d),d+=s[t][0].byteLength;return l}}class Dp{constructor(t,e,n,o){if(this.tm=t,this.prefix=e,this.p=o,this.n8=n,this.type="F1",this.m=1,this.half=yg(o,Rg),this.bitLength=hg(o),this.mask=Cg(mg(Rg,this.bitLength),Rg),this.pOp1=t.alloc(n),this.pOp2=t.alloc(n),this.pOp3=t.alloc(n),this.tm.instance.exports[e+"_zero"](this.pOp1),this.zero=this.tm.getBuff(this.pOp1,this.n8),this.tm.instance.exports[e+"_one"](this.pOp1),this.one=this.tm.getBuff(this.pOp1,this.n8),this.negone=this.neg(this.one),this.two=this.add(this.one,this.one),this.n64=Math.floor(n/8),this.n32=Math.floor(n/4),8*this.n64!=this.n8)throw new Error("n8 must be a multiple of 8");this.half=yg(this.p,Rg),this.nqr=this.two;let i=this.exp(this.nqr,this.half);for(;!this.eq(i,this.negone);)this.nqr=this.add(this.nqr,this.one),i=this.exp(this.nqr,this.half);this.shift=this.mul(this.nqr,this.nqr),this.shiftInv=this.inv(this.shift),this.s=0;let r=Cg(this.p,Rg);for(;!Ag(r);)this.s=this.s+1,r=yg(r,Rg);this.w=[],this.w[this.s]=this.exp(this.nqr,r);for(let t=this.s-1;t>=0;t--)this.w[t]=this.square(this.w[t+1]);if(!this.eq(this.w[0],this.one))throw new Error("Error calculating roots of unity");this.batchToMontgomery=Np(t,e+"_batchToMontgomery",this.n8,this.n8),this.batchFromMontgomery=Np(t,e+"_batchFromMontgomery",this.n8,this.n8)}op2(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op2Bool(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2)}op1(t,e){return this.tm.setBuff(this.pOp1,e),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op1Bool(t,e){return this.tm.setBuff(this.pOp1,e),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3)}add(t,e){return this.op2("_add",t,e)}eq(t,e){return this.op2Bool("_eq",t,e)}isZero(t){return this.op1Bool("_isZero",t)}sub(t,e){return this.op2("_sub",t,e)}neg(t){return this.op1("_neg",t)}inv(t){return this.op1("_inverse",t)}toMontgomery(t){return this.op1("_toMontgomery",t)}fromMontgomery(t){return this.op1("_fromMontgomery",t)}mul(t,e){return this.op2("_mul",t,e)}div(t,e){return this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[this.prefix+"_inverse"](this.pOp2,this.pOp2),this.tm.instance.exports[this.prefix+"_mul"](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}square(t){return this.op1("_square",t)}isSquare(t){return this.op1Bool("_isSquare",t)}sqrt(t){return this.op1("_sqrt",t)}exp(t,e){return e instanceof Uint8Array||(e=Ng(gg(e))),this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[this.prefix+"_exp"](this.pOp1,this.pOp2,e.byteLength,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}isNegative(t){return this.op1Bool("_isNegative",t)}e(t,e){if(t instanceof Uint8Array)return t;let n=gg(t,e);pg(n)?(n=vg(n),Pg(n,this.p)&&(n=Og(n,this.p)),n=Cg(this.p,n)):Pg(n,this.p)&&(n=Og(n,this.p));const o=Fp(n,this.n8);return this.toMontgomery(o)}toString(t,e){return Qg(Tg(this.fromMontgomery(t),0),e)}fromRng(t){let e;const n=new Uint8Array(this.n8);do{e=Dg;for(let n=0;n<this.n64;n++)e=xg(e,mg(t.nextU64(),64*n));e=Ug(e,this.mask)}while(jg(e,this.p));return kg(n,0,e,this.n8),n}random(){return this.fromRng(Xg())}toObject(t){return Tg(this.fromMontgomery(t),0)}fromObject(t){const e=new Uint8Array(this.n8);return kg(e,0,t,this.n8),this.toMontgomery(e)}toRprLE(t,e,n){t.set(this.fromMontgomery(n),e)}toRprBE(t,e,n){const o=this.fromMontgomery(n);for(let t=0;t<this.n8/2;t++){const e=o[t];o[t]=o[this.n8-1-t],o[this.n8-1-t]=e}t.set(o,e)}fromRprLE(t,e){e=e||0;const n=t.slice(e,e+this.n8);return this.toMontgomery(n)}async batchInverse(t){let e=!1;const n=this.n8,o=this.n8;Array.isArray(t)?(t=kp(t,n),e=!0):t=t.slice(0,t.byteLength);const i=Math.floor(t.byteLength/n);if(i*n!==t.byteLength)throw new Error("Invalid buffer size");const r=Math.floor(i/this.tm.concurrency),a=[];for(let e=0;e<this.tm.concurrency;e++){let c;if(c=e<this.tm.concurrency-1?r:i-e*r,0==c)continue;const s=[{cmd:"ALLOCSET",var:0,buff:t.slice(e*r*n,e*r*n+c*n)},{cmd:"ALLOC",var:1,len:o*c},{cmd:"CALL",fnName:this.prefix+"_batchInverse",params:[{var:0},{val:n},{val:c},{var:1},{val:o}]},{cmd:"GET",out:0,var:1,len:o*c}];a.push(this.tm.queueAction(s))}const c=await Promise.all(a);let s;s=t instanceof Qp?new Qp(i*o):new Uint8Array(i*o);let l=0;for(let t=0;t<c.length;t++)s.set(c[t][0],l),l+=c[t][0].byteLength;return e?Mp(s,o):s}}class Rp{constructor(t,e,n){this.tm=t,this.prefix=e,this.F=n,this.type="F2",this.m=2*n.m,this.n8=2*this.F.n8,this.n32=2*this.F.n32,this.n64=2*this.F.n64,this.pOp1=t.alloc(2*n.n8),this.pOp2=t.alloc(2*n.n8),this.pOp3=t.alloc(2*n.n8),this.tm.instance.exports[e+"_zero"](this.pOp1),this.zero=t.getBuff(this.pOp1,this.n8),this.tm.instance.exports[e+"_one"](this.pOp1),this.one=t.getBuff(this.pOp1,this.n8),this.negone=this.neg(this.one),this.two=this.add(this.one,this.one)}op2(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op2Bool(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2)}op1(t,e){return this.tm.setBuff(this.pOp1,e),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op1Bool(t,e){return this.tm.setBuff(this.pOp1,e),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3)}add(t,e){return this.op2("_add",t,e)}eq(t,e){return this.op2Bool("_eq",t,e)}isZero(t){return this.op1Bool("_isZero",t)}sub(t,e){return this.op2("_sub",t,e)}neg(t){return this.op1("_neg",t)}inv(t){return this.op1("_inverse",t)}isNegative(t){return this.op1Bool("_isNegative",t)}toMontgomery(t){return this.op1("_toMontgomery",t)}fromMontgomery(t){return this.op1("_fromMontgomery",t)}mul(t,e){return this.op2("_mul",t,e)}mul1(t,e){return this.op2("_mul1",t,e)}div(t,e){return this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[this.prefix+"_inverse"](this.pOp2,this.pOp2),this.tm.instance.exports[this.prefix+"_mul"](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}square(t){return this.op1("_square",t)}isSquare(t){return this.op1Bool("_isSquare",t)}sqrt(t){return this.op1("_sqrt",t)}exp(t,e){return e instanceof Uint8Array||(e=Ng(gg(e))),this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[this.prefix+"_exp"](this.pOp1,this.pOp2,e.byteLength,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}e(t,e){if(t instanceof Uint8Array)return t;if(Array.isArray(t)&&2==t.length){const n=this.F.e(t[0],e),o=this.F.e(t[1],e),i=new Uint8Array(2*this.F.n8);return i.set(n),i.set(o,2*this.F.n8),i}throw new Error("invalid F2")}toString(t,e){const n=this.F.toString(t.slice(0,this.F.n8),e),o=this.F.toString(t.slice(this.F.n8),e);return"[".concat(n,", ").concat(o,"]")}fromRng(t){const e=this.F.fromRng(t),n=this.F.fromRng(t),o=new Uint8Array(2*this.F.n8);return o.set(e),o.set(n,this.F.n8),o}random(){return this.fromRng(Xg())}toObject(t){return[this.F.toObject(t.slice(0,this.F.n8)),this.F.toObject(t.slice(this.F.n8,2*this.F.n8))]}fromObject(t){const e=new Uint8Array(2*this.F.n8),n=this.F.fromObject(t[0]),o=this.F.fromObject(t[1]);return e.set(n),e.set(o,this.F.n8),e}c1(t){return t.slice(0,this.F.n8)}c2(t){return t.slice(this.F.n8)}}class qp{constructor(t,e,n){this.tm=t,this.prefix=e,this.F=n,this.type="F3",this.m=3*n.m,this.n8=3*this.F.n8,this.n32=3*this.F.n32,this.n64=3*this.F.n64,this.pOp1=t.alloc(3*n.n8),this.pOp2=t.alloc(3*n.n8),this.pOp3=t.alloc(3*n.n8),this.tm.instance.exports[e+"_zero"](this.pOp1),this.zero=t.getBuff(this.pOp1,this.n8),this.tm.instance.exports[e+"_one"](this.pOp1),this.one=t.getBuff(this.pOp1,this.n8),this.negone=this.neg(this.one),this.two=this.add(this.one,this.one)}op2(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op2Bool(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2)}op1(t,e){return this.tm.setBuff(this.pOp1,e),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}op1Bool(t,e){return this.tm.setBuff(this.pOp1,e),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3)}eq(t,e){return this.op2Bool("_eq",t,e)}isZero(t){return this.op1Bool("_isZero",t)}add(t,e){return this.op2("_add",t,e)}sub(t,e){return this.op2("_sub",t,e)}neg(t){return this.op1("_neg",t)}inv(t){return this.op1("_inverse",t)}isNegative(t){return this.op1Bool("_isNegative",t)}toMontgomery(t){return this.op1("_toMontgomery",t)}fromMontgomery(t){return this.op1("_fromMontgomery",t)}mul(t,e){return this.op2("_mul",t,e)}div(t,e){return this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[this.prefix+"_inverse"](this.pOp2,this.pOp2),this.tm.instance.exports[this.prefix+"_mul"](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,this.n8)}square(t){return this.op1("_square",t)}isSquare(t){return this.op1Bool("_isSquare",t)}sqrt(t){return this.op1("_sqrt",t)}exp(t,e){return e instanceof Uint8Array||(e=Ng(gg(e))),this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[this.prefix+"_exp"](this.pOp1,this.pOp2,e.byteLength,this.pOp3),this.getBuff(this.pOp3,this.n8)}e(t,e){if(t instanceof Uint8Array)return t;if(Array.isArray(t)&&3==t.length){const n=this.F.e(t[0],e),o=this.F.e(t[1],e),i=this.F.e(t[2],e),r=new Uint8Array(3*this.F.n8);return r.set(n),r.set(o,this.F.n8),r.set(i,2*this.F.n8),r}throw new Error("invalid F3")}toString(t,e){const n=this.F.toString(t.slice(0,this.F.n8),e),o=this.F.toString(t.slice(this.F.n8,2*this.F.n8),e),i=this.F.toString(t.slice(2*this.F.n8),e);return"[".concat(n,", ").concat(o,", ").concat(i,"]")}fromRng(t){const e=this.F.fromRng(t),n=this.F.fromRng(t),o=this.F.fromRng(t),i=new Uint8Array(3*this.F.n8);return i.set(e),i.set(n,this.F.n8),i.set(o,2*this.F.n8),i}random(){return this.fromRng(Xg())}toObject(t){return[this.F.toObject(t.slice(0,this.F.n8)),this.F.toObject(t.slice(this.F.n8,2*this.F.n8)),this.F.toObject(t.slice(2*this.F.n8,3*this.F.n8))]}fromObject(t){const e=new Uint8Array(3*this.F.n8),n=this.F.fromObject(t[0]),o=this.F.fromObject(t[1]),i=this.F.fromObject(t[2]);return e.set(n),e.set(o,this.F.n8),e.set(i,2*this.F.n8),e}c1(t){return t.slice(0,this.F.n8)}c2(t){return t.slice(this.F.n8,2*this.F.n8)}c3(t){return t.slice(2*this.F.n8)}}class Gp{constructor(t,e,n,o,i,r){this.tm=t,this.prefix=e,this.F=n,this.pOp1=t.alloc(3*n.n8),this.pOp2=t.alloc(3*n.n8),this.pOp3=t.alloc(3*n.n8),this.tm.instance.exports[e+"_zero"](this.pOp1),this.zero=this.tm.getBuff(this.pOp1,3*n.n8),this.tm.instance.exports[e+"_zeroAffine"](this.pOp1),this.zeroAffine=this.tm.getBuff(this.pOp1,2*n.n8),this.one=this.tm.getBuff(o,3*n.n8),this.g=this.one,this.oneAffine=this.tm.getBuff(o,2*n.n8),this.gAffine=this.oneAffine,this.b=this.tm.getBuff(i,n.n8),r&&(this.cofactor=Ng(r)),this.negone=this.neg(this.one),this.two=this.add(this.one,this.one),this.batchLEMtoC=Np(t,e+"_batchLEMtoC",2*n.n8,n.n8),this.batchLEMtoU=Np(t,e+"_batchLEMtoU",2*n.n8,2*n.n8),this.batchCtoLEM=Np(t,e+"_batchCtoLEM",n.n8,2*n.n8),this.batchUtoLEM=Np(t,e+"_batchUtoLEM",2*n.n8,2*n.n8),this.batchToJacobian=Np(t,e+"_batchToJacobian",2*n.n8,3*n.n8),this.batchToAffine=Np(t,e+"_batchToAffine",3*n.n8,2*n.n8)}op2(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,3*this.F.n8)}op2bool(t,e,n){return this.tm.setBuff(this.pOp1,e),this.tm.setBuff(this.pOp2,n),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp2,this.pOp3)}op1(t,e){return this.tm.setBuff(this.pOp1,e),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,3*this.F.n8)}op1Affine(t,e){return this.tm.setBuff(this.pOp1,e),this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3),this.tm.getBuff(this.pOp3,2*this.F.n8)}op1Bool(t,e){return this.tm.setBuff(this.pOp1,e),!!this.tm.instance.exports[this.prefix+t](this.pOp1,this.pOp3)}add(t,e){if(t.byteLength==3*this.F.n8){if(e.byteLength==3*this.F.n8)return this.op2("_add",t,e);if(e.byteLength==2*this.F.n8)return this.op2("_addMixed",t,e);throw new Error("invalid point size")}if(t.byteLength==2*this.F.n8){if(e.byteLength==3*this.F.n8)return this.op2("_addMixed",e,t);if(e.byteLength==2*this.F.n8)return this.op2("_addAffine",t,e);throw new Error("invalid point size")}throw new Error("invalid point size")}sub(t,e){if(t.byteLength==3*this.F.n8){if(e.byteLength==3*this.F.n8)return this.op2("_sub",t,e);if(e.byteLength==2*this.F.n8)return this.op2("_subMixed",t,e);throw new Error("invalid point size")}if(t.byteLength==2*this.F.n8){if(e.byteLength==3*this.F.n8)return this.op2("_subMixed",e,t);if(e.byteLength==2*this.F.n8)return this.op2("_subAffine",t,e);throw new Error("invalid point size")}throw new Error("invalid point size")}neg(t){if(t.byteLength==3*this.F.n8)return this.op1("_neg",t);if(t.byteLength==2*this.F.n8)return this.op1Affine("_negAffine",t);throw new Error("invalid point size")}double(t){if(t.byteLength==3*this.F.n8)return this.op1("_double",t);if(t.byteLength==2*this.F.n8)return this.op1("_doubleAffine",t);throw new Error("invalid point size")}isZero(t){if(t.byteLength==3*this.F.n8)return this.op1Bool("_isZero",t);if(t.byteLength==2*this.F.n8)return this.op1Bool("_isZeroAffine",t);throw new Error("invalid point size")}timesScalar(t,e){let n;if(e instanceof Uint8Array||(e=Ng(gg(e))),t.byteLength==3*this.F.n8)n=this.prefix+"_timesScalar";else{if(t.byteLength!=2*this.F.n8)throw new Error("invalid point size");n=this.prefix+"_timesScalarAffine"}return this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[n](this.pOp1,this.pOp2,e.byteLength,this.pOp3),this.tm.getBuff(this.pOp3,3*this.F.n8)}timesFr(t,e){let n;if(t.byteLength==3*this.F.n8)n=this.prefix+"_timesFr";else{if(t.byteLength!=2*this.F.n8)throw new Error("invalid point size");n=this.prefix+"_timesFrAffine"}return this.tm.setBuff(this.pOp1,t),this.tm.setBuff(this.pOp2,e),this.tm.instance.exports[n](this.pOp1,this.pOp2,this.pOp3),this.tm.getBuff(this.pOp3,3*this.F.n8)}eq(t,e){if(t.byteLength==3*this.F.n8){if(e.byteLength==3*this.F.n8)return this.op2bool("_eq",t,e);if(e.byteLength==2*this.F.n8)return this.op2bool("_eqMixed",t,e);throw new Error("invalid point size")}if(t.byteLength==2*this.F.n8){if(e.byteLength==3*this.F.n8)return this.op2bool("_eqMixed",e,t);if(e.byteLength==2*this.F.n8)return this.op2bool("_eqAffine",t,e);throw new Error("invalid point size")}throw new Error("invalid point size")}toAffine(t){if(t.byteLength==3*this.F.n8)return this.op1Affine("_toAffine",t);if(t.byteLength==2*this.F.n8)return t;throw new Error("invalid point size")}toJacobian(t){if(t.byteLength==3*this.F.n8)return t;if(t.byteLength==2*this.F.n8)return this.op1("_toJacobian",t);throw new Error("invalid point size")}toRprUncompressed(t,e,n){if(this.tm.setBuff(this.pOp1,n),n.byteLength==3*this.F.n8)this.tm.instance.exports[this.prefix+"_toAffine"](this.pOp1,this.pOp1);else if(n.byteLength!=2*this.F.n8)throw new Error("invalid point size");this.tm.instance.exports[this.prefix+"_LEMtoU"](this.pOp1,this.pOp1);const o=this.tm.getBuff(this.pOp1,2*this.F.n8);t.set(o,e)}fromRprUncompressed(t,e){const n=t.slice(e,e+2*this.F.n8);return this.tm.setBuff(this.pOp1,n),this.tm.instance.exports[this.prefix+"_UtoLEM"](this.pOp1,this.pOp1),this.tm.getBuff(this.pOp1,2*this.F.n8)}toRprCompressed(t,e,n){if(this.tm.setBuff(this.pOp1,n),n.byteLength==3*this.F.n8)this.tm.instance.exports[this.prefix+"_toAffine"](this.pOp1,this.pOp1);else if(n.byteLength!=2*this.F.n8)throw new Error("invalid point size");this.tm.instance.exports[this.prefix+"_LEMtoC"](this.pOp1,this.pOp1);const o=this.tm.getBuff(this.pOp1,this.F.n8);t.set(o,e)}fromRprCompressed(t,e){const n=t.slice(e,e+this.F.n8);return this.tm.setBuff(this.pOp1,n),this.tm.instance.exports[this.prefix+"_CtoLEM"](this.pOp1,this.pOp2),this.tm.getBuff(this.pOp2,2*this.F.n8)}toUncompressed(t){const e=new Uint8Array(2*this.F.n8);return this.toRprUncompressed(e,0,t),e}toRprLEM(t,e,n){if(n.byteLength!=2*this.F.n8){if(n.byteLength!=3*this.F.n8)throw new Error("invalid point size");{this.tm.setBuff(this.pOp1,n),this.tm.instance.exports[this.prefix+"_toAffine"](this.pOp1,this.pOp1);const o=this.tm.getBuff(this.pOp1,2*this.F.n8);t.set(o,e)}}else t.set(n,e)}fromRprLEM(t,e){return e=e||0,t.slice(e,e+2*this.F.n8)}toString(t,e){if(t.byteLength==3*this.F.n8){const n=this.F.toString(t.slice(0,this.F.n8),e),o=this.F.toString(t.slice(this.F.n8,2*this.F.n8),e),i=this.F.toString(t.slice(2*this.F.n8),e);return"[ ".concat(n,", ").concat(o,", ").concat(i," ]")}if(t.byteLength==2*this.F.n8){const n=this.F.toString(t.slice(0,this.F.n8),e),o=this.F.toString(t.slice(this.F.n8),e);return"[ ".concat(n,", ").concat(o," ]")}throw new Error("invalid point size")}isValid(t){if(this.isZero(t))return!0;const e=this.F,n=this.toAffine(t),o=n.slice(0,this.F.n8),i=n.slice(this.F.n8,2*this.F.n8),r=e.add(e.mul(e.square(o),o),this.b),a=e.square(i);return e.eq(r,a)}fromRng(t){const e=this.F;let n,o,i=[];do{i[0]=e.fromRng(t),n=t.nextBool(),o=e.add(e.mul(e.square(i[0]),i[0]),this.b)}while(!e.isSquare(o));i[1]=e.sqrt(o),n^e.isNegative(i[1])&&(i[1]=e.neg(i[1]));let r=new Uint8Array(2*this.F.n8);return r.set(i[0]),r.set(i[1],this.F.n8),this.cofactor&&(r=this.timesScalar(r,this.cofactor)),r}toObject(t){if(this.isZero(t))return[this.F.toObject(this.F.zero),this.F.toObject(this.F.one),this.F.toObject(this.F.zero)];const e=this.F.toObject(t.slice(0,this.F.n8)),n=this.F.toObject(t.slice(this.F.n8,2*this.F.n8));let o;return o=t.byteLength==3*this.F.n8?this.F.toObject(t.slice(2*this.F.n8,3*this.F.n8)):this.F.toObject(this.F.one),[e,n,o]}fromObject(t){const e=this.F.fromObject(t[0]),n=this.F.fromObject(t[1]);let o;if(o=3==t.length?this.F.fromObject(t[2]):this.F.one,this.F.isZero(o,this.F.one))return this.zeroAffine;if(this.F.eq(o,this.F.one)){const t=new Uint8Array(2*this.F.n8);return t.set(e),t.set(n,this.F.n8),t}{const t=new Uint8Array(3*this.F.n8);return t.set(e),t.set(n,this.F.n8),t.set(o,2*this.F.n8),t}}e(t){return t instanceof Uint8Array?t:this.fromObject(t)}x(t){return this.toAffine(t).slice(0,this.F.n8)}y(t){return this.toAffine(t).slice(this.F.n8)}}class Kp{constructor(){this.promise=new Promise(((t,e)=>{this.reject=e,this.resolve=t}))}}let Vp;const Hp="(".concat('function thread(self) {\n const MAXMEM = 32767;\n let instance;\n let memory;\n\n if (self) {\n self.onmessage = function(e) {\n let data;\n if (e.data) {\n data = e.data;\n } else {\n data = e;\n }\n\n if (data[0].cmd == "INIT") {\n init(data[0]).then(function() {\n self.postMessage(data.result);\n });\n } else if (data[0].cmd == "TERMINATE") {\n self.close();\n } else {\n const res = runTask(data);\n self.postMessage(res);\n }\n };\n }\n\n async function init(data) {\n const code = new Uint8Array(data.code);\n const wasmModule = await WebAssembly.compile(code);\n memory = new WebAssembly.Memory({initial:data.init, maximum: MAXMEM});\n\n instance = await WebAssembly.instantiate(wasmModule, {\n env: {\n "memory": memory\n }\n });\n }\n\n\n\n function alloc(length) {\n const u32 = new Uint32Array(memory.buffer, 0, 1);\n while (u32[0] & 3) u32[0]++; // Return always aligned pointers\n const res = u32[0];\n u32[0] += length;\n if (u32[0] + length > memory.buffer.byteLength) {\n const currentPages = memory.buffer.byteLength / 0x10000;\n let requiredPages = Math.floor((u32[0] + length) / 0x10000)+1;\n if (requiredPages>MAXMEM) requiredPages=MAXMEM;\n memory.grow(requiredPages-currentPages);\n }\n return res;\n }\n\n function allocBuffer(buffer) {\n const p = alloc(buffer.byteLength);\n setBuffer(p, buffer);\n return p;\n }\n\n function getBuffer(pointer, length) {\n const u8 = new Uint8Array(memory.buffer);\n return new Uint8Array(u8.buffer, u8.byteOffset + pointer, length);\n }\n\n function setBuffer(pointer, buffer) {\n const u8 = new Uint8Array(memory.buffer);\n u8.set(new Uint8Array(buffer), pointer);\n }\n\n function runTask(task) {\n if (task[0].cmd == "INIT") {\n return init(task[0]);\n }\n const ctx = {\n vars: [],\n out: []\n };\n const u32a = new Uint32Array(memory.buffer, 0, 1);\n const oldAlloc = u32a[0];\n for (let i=0; i<task.length; i++) {\n switch (task[i].cmd) {\n case "ALLOCSET":\n ctx.vars[task[i].var] = allocBuffer(task[i].buff);\n break;\n case "ALLOC":\n ctx.vars[task[i].var] = alloc(task[i].len);\n break;\n case "SET":\n setBuffer(ctx.vars[task[i].var], task[i].buff);\n break;\n case "CALL": {\n const params = [];\n for (let j=0; j<task[i].params.length; j++) {\n const p = task[i].params[j];\n if (typeof p.var !== "undefined") {\n params.push(ctx.vars[p.var] + (p.offset || 0));\n } else if (typeof p.val != "undefined") {\n params.push(p.val);\n }\n }\n instance.exports[task[i].fnName](...params);\n break;\n }\n case "GET":\n ctx.out[task[i].out] = getBuffer(ctx.vars[task[i].var], task[i].len).slice();\n break;\n default:\n throw new Error("Invalid cmd");\n }\n }\n const u32b = new Uint32Array(memory.buffer, 0, 1);\n u32b[0] = oldAlloc;\n return ctx.out;\n }\n\n\n return runTask;\n}',")(self)");if(null!==globalThis&&void 0!==globalThis&&globalThis.Blob){const t=(new TextEncoder).encode(Hp),e=new Blob([t],{type:"application/javascript"});Vp=URL.createObjectURL(e)}else Vp="data:application/javascript;base64,"+globalThis.btoa(Hp);class Yp{constructor(){this.actionQueue=[],this.oldPFree=0}startSyncOp(){if(0!=this.oldPFree)throw new Error("Sync operation in progress");this.oldPFree=this.u32[0]}endSyncOp(){if(0==this.oldPFree)throw new Error("No sync operation in progress");this.u32[0]=this.oldPFree,this.oldPFree=0}postAction(t,e,n,o){if(this.working[t])throw new Error("Posting a job t a working worker");return this.working[t]=!0,this.pendingDeferreds[t]=o||new Kp,this.workers[t].postMessage(e,n),this.pendingDeferreds[t].promise}processWorks(){for(let t=0;t<this.workers.length&&this.actionQueue.length>0;t++)if(0==this.working[t]){const e=this.actionQueue.shift();this.postAction(t,e.data,e.transfers,e.deferred)}}queueAction(t,e){const n=new Kp;if(this.singleThread){const e=this.taskManager(t);n.resolve(e)}else this.actionQueue.push({data:t,transfers:e,deferred:n}),this.processWorks();return n.promise}resetMemory(){this.u32[0]=this.initalPFree}allocBuff(t){const e=this.alloc(t.byteLength);return this.setBuff(e,t),e}getBuff(t,e){return this.u8.slice(t,t+e)}setBuff(t,e){this.u8.set(new Uint8Array(e),t)}alloc(t){for(;3&this.u32[0];)this.u32[0]++;const e=this.u32[0];return this.u32[0]+=t,e}async terminate(){for(let t=0;t<this.workers.length;t++)this.workers[t].postMessage([{cmd:"TERMINATE"}]);await new Promise((t=>setTimeout(t,200)))}}function Jp(t,e){const n=t[e],o=t.Fr,i=t.tm;t[e].batchApplyKey=async function(t,r,a,c,s){let l,d,u,f,g;if(c=c||"affine",s=s||"affine","G1"==e)"jacobian"==c?(u=3*n.F.n8,l="g1m_batchApplyKey"):(u=2*n.F.n8,l="g1m_batchApplyKeyMixed"),f=3*n.F.n8,"jacobian"==s?g=3*n.F.n8:(d="g1m_batchToAffine",g=2*n.F.n8);else if("G2"==e)"jacobian"==c?(u=3*n.F.n8,l="g2m_batchApplyKey"):(u=2*n.F.n8,l="g2m_batchApplyKeyMixed"),f=3*n.F.n8,"jacobian"==s?g=3*n.F.n8:(d="g2m_batchToAffine",g=2*n.F.n8);else{if("Fr"!=e)throw new Error("Invalid group: "+e);l="frm_batchApplyKey",u=n.n8,f=n.n8,g=n.n8}const h=Math.floor(t.byteLength/u),p=Math.floor(h/i.concurrency),_=[];a=o.e(a);let m=o.e(r);for(let e=0;e<i.concurrency;e++){let n;if(n=e<i.concurrency-1?p:h-e*p,0==n)continue;const r=[];r.push({cmd:"ALLOCSET",var:0,buff:t.slice(e*p*u,e*p*u+n*u)}),r.push({cmd:"ALLOCSET",var:1,buff:m}),r.push({cmd:"ALLOCSET",var:2,buff:a}),r.push({cmd:"ALLOC",var:3,len:n*Math.max(f,g)}),r.push({cmd:"CALL",fnName:l,params:[{var:0},{val:n},{var:1},{var:2},{var:3}]}),d&&r.push({cmd:"CALL",fnName:d,params:[{var:3},{val:n},{var:3}]}),r.push({cmd:"GET",out:0,var:3,len:n*g}),_.push(i.queueAction(r)),m=o.mul(m,o.exp(a,n))}const y=await Promise.all(_);let L;L=t instanceof Qp?new Qp(h*g):new Uint8Array(h*g);let b=0;for(let t=0;t<y.length;t++)L.set(y[t][0],b),b+=y[t][0].byteLength;return L}}const Wp=[1,1,1,1,2,3,4,5,6,7,7,8,9,10,11,12,13,13,14,15,16,16,17,17,17,17,17,17,17,17,17,17];function Xp(t,e){const n=t[e],o=n.tm;async function i(t,o,i,r,a){if(!(t instanceof Uint8Array))throw r&&r.error("".concat(a," _multiExpChunk buffBases is not Uint8Array")),new Error("".concat(a," _multiExpChunk buffBases is not Uint8Array"));if(!(o instanceof Uint8Array))throw r&&r.error("".concat(a," _multiExpChunk buffScalars is not Uint8Array")),new Error("".concat(a," _multiExpChunk buffScalars is not Uint8Array"));let c,s;if(i=i||"affine","G1"==e)"affine"==i?(s="g1m_multiexpAffine_chunk",c=2*n.F.n8):(s="g1m_multiexp_chunk",c=3*n.F.n8);else{if("G2"!=e)throw new Error("Invalid group");"affine"==i?(s="g2m_multiexpAffine_chunk",c=2*n.F.n8):(s="g2m_multiexp_chunk",c=3*n.F.n8)}const l=Math.floor(t.byteLength/c);if(0==l)return n.zero;const d=Math.floor(o.byteLength/l);if(d*l!=o.byteLength)throw new Error("Scalar size does not match");const u=Wp[jp(l)],f=Math.floor((8*d-1)/u)+1,g=[];for(let e=0;e<f;e++){const i=[{cmd:"ALLOCSET",var:0,buff:t},{cmd:"ALLOCSET",var:1,buff:o},{cmd:"ALLOC",var:2,len:3*n.F.n8},{cmd:"CALL",fnName:s,params:[{var:0},{var:1},{val:d},{val:l},{val:e*u},{val:Math.min(8*d-e*u,u)},{var:2}]},{cmd:"GET",out:0,var:2,len:3*n.F.n8}];g.push(n.tm.queueAction(i))}const h=await Promise.all(g);let p=n.zero;for(let t=h.length-1;t>=0;t--){if(!n.isZero(p))for(let t=0;t<u;t++)p=n.double(p);p=n.add(p,h[t][0])}return p}async function r(t,r,a,c,s){const l=1<<22;let d;if("G1"==e)d="affine"==a?2*n.F.n8:3*n.F.n8;else{if("G2"!=e)throw new Error("Invalid group");d="affine"==a?2*n.F.n8:3*n.F.n8}const u=Math.floor(t.byteLength/d);if(0==u)return n.zero;const f=Math.floor(r.byteLength/u);if(f*u!=r.byteLength)throw new Error("Scalar size does not match");const g=Wp[jp(u)],h=Math.floor((8*f-1)/g)+1;let p;p=Math.floor(u/(o.concurrency/h)),p>l&&(p=l),p<1024&&(p=1024);const _=[];for(let e=0;e<u;e+=p){c&&c.debug("Multiexp start: ".concat(s,": ").concat(e,"/").concat(u));const n=Math.min(u-e,p),o=t.slice(e*d,(e+n)*d),l=r.slice(e*f,(e+n)*f);_.push(i(o,l,a,c,s).then((t=>(c&&c.debug("Multiexp end: ".concat(s,": ").concat(e,"/").concat(u)),t))))}const m=await Promise.all(_);let y=n.zero;for(let t=m.length-1;t>=0;t--)y=n.add(y,m[t]);return y}n.multiExp=async function(t,e,n,o){return await r(t,e,"jacobian",n,o)},n.multiExpAffine=async function(t,e,n,o){return await r(t,e,"affine",n,o)}}function Zp(t,e){const n=t[e],o=t.Fr,i=n.tm;async function r(t,c,s,l,d,u){let f,g,h,p,_,m,y,L;s=s||"affine",l=l||"affine","G1"==e?("affine"==s?(f=2*n.F.n8,p="g1m_batchToJacobian"):f=3*n.F.n8,g=3*n.F.n8,c&&(L="g1m_fftFinal"),y="g1m_fftJoin",m="g1m_fftMix","affine"==l?(h=2*n.F.n8,_="g1m_batchToAffine"):h=3*n.F.n8):"G2"==e?("affine"==s?(f=2*n.F.n8,p="g2m_batchToJacobian"):f=3*n.F.n8,g=3*n.F.n8,c&&(L="g2m_fftFinal"),y="g2m_fftJoin",m="g2m_fftMix","affine"==l?(h=2*n.F.n8,_="g2m_batchToAffine"):h=3*n.F.n8):"Fr"==e&&(f=n.n8,g=n.n8,h=n.n8,c&&(L="frm_fftFinal"),m="frm_fftMix",y="frm_fftJoin");let b=!1;Array.isArray(t)?(t=kp(t,f),b=!0):t=t.slice(0,t.byteLength);const A=t.byteLength/f,w=jp(A);if(1<<w!=A)throw new Error("fft must be multiple of 2");if(w==o.s+1){let e;return e=c?await async function(t,e,n,i,c){let s,l;s=t.slice(0,t.byteLength/2),l=t.slice(t.byteLength/2,t.byteLength);const d=[];d.push(r(s,!0,e,"jacobian",i,c)),d.push(r(l,!0,e,"jacobian",i,c)),[s,l]=await Promise.all(d);const u=await a(s,l,"fftJoinExtInv",o.one,o.shiftInv,"jacobian",n,i,c);let f;return f=u[0].byteLength>1<<28?new Qp(2*u[0].byteLength):new Uint8Array(2*u[0].byteLength),f.set(u[0]),f.set(u[1],u[0].byteLength),f}(t,s,l,d,u):await async function(t,e,n,i,c){let s,l;s=t.slice(0,t.byteLength/2),l=t.slice(t.byteLength/2,t.byteLength);const d=[];[s,l]=await a(s,l,"fftJoinExt",o.one,o.shift,e,"jacobian",i,c),d.push(r(s,!1,"jacobian",n,i,c)),d.push(r(l,!1,"jacobian",n,i,c));const u=await Promise.all(d);let f;return f=u[0].byteLength>1<<28?new Qp(2*u[0].byteLength):new Uint8Array(2*u[0].byteLength),f.set(u[0]),f.set(u[1],u[0].byteLength),f}(t,s,l,d,u),b?Mp(e,h):e}let I,x,C;c&&(I=o.inv(o.e(A))),Up(t,f);let v=Math.min(16384,A),E=A/v;for(;E<i.concurrency&&v>=16;)E*=2,v/=2;const B=jp(v),F=[];for(let e=0;e<E;e++){d&&d.debug("".concat(u,": fft ").concat(w," mix start: ").concat(e,"/").concat(E));const n=[];n.push({cmd:"ALLOC",var:0,len:g*v});const o=t.slice(v*e*f,v*(e+1)*f);n.push({cmd:"SET",var:0,buff:o}),p&&n.push({cmd:"CALL",fnName:p,params:[{var:0},{val:v},{var:0}]});for(let t=1;t<=B;t++)n.push({cmd:"CALL",fnName:m,params:[{var:0},{val:v},{val:t}]});B==w?(L&&(n.push({cmd:"ALLOCSET",var:1,buff:I}),n.push({cmd:"CALL",fnName:L,params:[{var:0},{val:v},{var:1}]})),_&&n.push({cmd:"CALL",fnName:_,params:[{var:0},{val:v},{var:0}]}),n.push({cmd:"GET",out:0,var:0,len:v*h})):n.push({cmd:"GET",out:0,var:0,len:g*v}),F.push(i.queueAction(n).then((t=>(d&&d.debug("".concat(u,": fft ").concat(w," mix end: ").concat(e,"/").concat(E)),t))))}C=await Promise.all(F);for(let t=0;t<E;t++)C[t]=C[t][0];for(let t=B+1;t<=w;t++){d&&d.debug("".concat(u,": fft ").concat(w," join: ").concat(t,"/").concat(w));const e=1<<w-t,n=E/e,r=[];for(let a=0;a<e;a++)for(let c=0;c<n/2;c++){const s=o.exp(o.w[t],c*v),l=o.w[t],f=a*n+c,p=a*n+c+n/2,m=[];m.push({cmd:"ALLOCSET",var:0,buff:C[f]}),m.push({cmd:"ALLOCSET",var:1,buff:C[p]}),m.push({cmd:"ALLOCSET",var:2,buff:s}),m.push({cmd:"ALLOCSET",var:3,buff:l}),m.push({cmd:"CALL",fnName:y,params:[{var:0},{var:1},{val:v},{var:2},{var:3}]}),t==w?(L&&(m.push({cmd:"ALLOCSET",var:4,buff:I}),m.push({cmd:"CALL",fnName:L,params:[{var:0},{val:v},{var:4}]}),m.push({cmd:"CALL",fnName:L,params:[{var:1},{val:v},{var:4}]})),_&&(m.push({cmd:"CALL",fnName:_,params:[{var:0},{val:v},{var:0}]}),m.push({cmd:"CALL",fnName:_,params:[{var:1},{val:v},{var:1}]})),m.push({cmd:"GET",out:0,var:0,len:v*h}),m.push({cmd:"GET",out:1,var:1,len:v*h})):(m.push({cmd:"GET",out:0,var:0,len:v*g}),m.push({cmd:"GET",out:1,var:1,len:v*g})),r.push(i.queueAction(m).then((o=>(d&&d.debug("".concat(u,": fft ").concat(w," join ").concat(t,"/").concat(w," ").concat(a+1,"/").concat(e," ").concat(c,"/").concat(n/2)),o))))}const a=await Promise.all(r);for(let t=0;t<e;t++)for(let e=0;e<n/2;e++){const o=t*n+e,i=t*n+e+n/2,r=a.shift();C[o]=r[0],C[i]=r[1]}}if(x=t instanceof Qp?new Qp(A*h):new Uint8Array(A*h),c){x.set(C[0].slice((v-1)*h));let t=h;for(let e=E-1;e>0;e--)x.set(C[e],t),t+=v*h,delete C[e];x.set(C[0].slice(0,(v-1)*h),t),delete C[0]}else for(let t=0;t<E;t++)x.set(C[t],v*h*t),delete C[t];return b?Mp(x,h):x}async function a(t,r,a,c,s,l,d,u,f){let g,h,p,_,m,y;if("G1"==e)"affine"==l?(m=2*n.F.n8,h="g1m_batchToJacobian"):m=3*n.F.n8,y=3*n.F.n8,g="g1m_"+a,"affine"==d?(p="g1m_batchToAffine",_=2*n.F.n8):_=3*n.F.n8;else if("G2"==e)"affine"==l?(m=2*n.F.n8,h="g2m_batchToJacobian"):m=3*n.F.n8,g="g2m_"+a,y=3*n.F.n8,"affine"==d?(p="g2m_batchToAffine",_=2*n.F.n8):_=3*n.F.n8;else{if("Fr"!=e)throw new Error("Invalid group");m=o.n8,_=o.n8,y=o.n8,g="frm_"+a}if(t.byteLength!=r.byteLength)throw new Error("Invalid buffer size");const L=Math.floor(t.byteLength/m);if(L!=1<<jp(L))throw new Error("Invalid number of points");let b=Math.floor(L/i.concurrency);b<16&&(b=16),b>65536&&(b=65536);const A=[];for(let e=0;e<L;e+=b){u&&u.debug("".concat(f,": fftJoinExt Start: ").concat(e,"/").concat(L));const n=Math.min(L-e,b),a=o.mul(c,o.exp(s,e)),l=[],d=t.slice(e*m,(e+n)*m),w=r.slice(e*m,(e+n)*m);l.push({cmd:"ALLOC",var:0,len:y*n}),l.push({cmd:"SET",var:0,buff:d}),l.push({cmd:"ALLOC",var:1,len:y*n}),l.push({cmd:"SET",var:1,buff:w}),l.push({cmd:"ALLOCSET",var:2,buff:a}),l.push({cmd:"ALLOCSET",var:3,buff:s}),h&&(l.push({cmd:"CALL",fnName:h,params:[{var:0},{val:n},{var:0}]}),l.push({cmd:"CALL",fnName:h,params:[{var:1},{val:n},{var:1}]})),l.push({cmd:"CALL",fnName:g,params:[{var:0},{var:1},{val:n},{var:2},{var:3},{val:o.s}]}),p&&(l.push({cmd:"CALL",fnName:p,params:[{var:0},{val:n},{var:0}]}),l.push({cmd:"CALL",fnName:p,params:[{var:1},{val:n},{var:1}]})),l.push({cmd:"GET",out:0,var:0,len:n*_}),l.push({cmd:"GET",out:1,var:1,len:n*_}),A.push(i.queueAction(l).then((t=>(u&&u.debug("".concat(f,": fftJoinExt End: ").concat(e,"/").concat(L)),t))))}const w=await Promise.all(A);let I,x;L*_>1<<28?(I=new Qp(L*_),x=new Qp(L*_)):(I=new Uint8Array(L*_),x=new Uint8Array(L*_));let C=0;for(let t=0;t<w.length;t++)I.set(w[t][0],C),x.set(w[t][1],C),C+=w[t][0].byteLength;return[I,x]}n.fft=async function(t,e,n,o,i){return await r(t,!1,e,n,o,i)},n.ifft=async function(t,e,n,o,i){return await r(t,!0,e,n,o,i)},n.lagrangeEvaluations=async function(t,i,c,s,l){let d;if(i=i||"affine",c=c||"affine","G1"==e)d="affine"==i?2*n.F.n8:3*n.F.n8;else if("G2"==e)d="affine"==i?2*n.F.n8:3*n.F.n8;else{if("Fr"!=e)throw new Error("Invalid group");d=o.n8}const u=t.byteLength/d,f=jp(u);if(2**f*d!=t.byteLength)throw s&&s.error("lagrangeEvaluations iinvalid input size"),new Error("lagrangeEvaluations invalid Input size");if(f<=o.s)return await n.ifft(t,i,c,s,l);if(f>o.s+1)throw s&&s.error("lagrangeEvaluations input too big"),new Error("lagrangeEvaluations input too big");let g=t.slice(0,t.byteLength/2),h=t.slice(t.byteLength/2,t.byteLength);const p=o.exp(o.shift,u/2),_=o.inv(o.sub(o.one,p));[g,h]=await a(g,h,"prepareLagrangeEvaluation",_,o.shiftInv,i,"jacobian",s,l+" prep");const m=[];let y;return m.push(r(g,!0,"jacobian",c,s,l+" t0")),m.push(r(h,!0,"jacobian",c,s,l+" t1")),[g,h]=await Promise.all(m),y=g.byteLength>1<<28?new Qp(2*g.byteLength):new Uint8Array(2*g.byteLength),y.set(g),y.set(h,g.byteLength),y},n.fftMix=async function(t){const r=3*n.F.n8;let a,c;if("G1"==e)a="g1m_fftMix",c="g1m_fftJoin";else if("G2"==e)a="g2m_fftMix",c="g2m_fftJoin";else{if("Fr"!=e)throw new Error("Invalid group");a="frm_fftMix",c="frm_fftJoin"}const s=Math.floor(t.byteLength/r),l=jp(s);let d=1<<jp(i.concurrency);s<=2*d&&(d=1);const u=s/d,f=jp(u),g=[];for(let e=0;e<d;e++){const n=[],o=t.slice(e*u*r,(e+1)*u*r);n.push({cmd:"ALLOCSET",var:0,buff:o});for(let t=1;t<=f;t++)n.push({cmd:"CALL",fnName:a,params:[{var:0},{val:u},{val:t}]});n.push({cmd:"GET",out:0,var:0,len:u*r}),g.push(i.queueAction(n))}const h=await Promise.all(g),p=[];for(let t=0;t<h.length;t++)p[t]=h[t][0];for(let t=f+1;t<=l;t++){const e=1<<l-t,n=d/e,a=[];for(let s=0;s<e;s++)for(let e=0;e<n/2;e++){const l=o.exp(o.w[t],e*u),d=o.w[t],f=s*n+e,g=s*n+e+n/2,h=[];h.push({cmd:"ALLOCSET",var:0,buff:p[f]}),h.push({cmd:"ALLOCSET",var:1,buff:p[g]}),h.push({cmd:"ALLOCSET",var:2,buff:l}),h.push({cmd:"ALLOCSET",var:3,buff:d}),h.push({cmd:"CALL",fnName:c,params:[{var:0},{var:1},{val:u},{var:2},{var:3}]}),h.push({cmd:"GET",out:0,var:0,len:u*r}),h.push({cmd:"GET",out:1,var:1,len:u*r}),a.push(i.queueAction(h))}const s=await Promise.all(a);for(let t=0;t<e;t++)for(let e=0;e<n/2;e++){const o=t*n+e,i=t*n+e+n/2,r=s.shift();p[o]=r[0],p[i]=r[1]}}let _;_=t instanceof Qp?new Qp(s*r):new Uint8Array(s*r);let m=0;for(let t=0;t<d;t++)_.set(p[t],m),m+=p[t].byteLength;return _},n.fftJoin=async function(t,r,a,c){const s=3*n.F.n8;let l;if("G1"==e)l="g1m_fftJoin";else if("G2"==e)l="g2m_fftJoin";else{if("Fr"!=e)throw new Error("Invalid group");l="frm_fftJoin"}if(t.byteLength!=r.byteLength)throw new Error("Invalid buffer size");const d=Math.floor(t.byteLength/s);if(d!=1<<jp(d))throw new Error("Invalid number of points");let u=1<<jp(i.concurrency);d<=2*u&&(u=1);const f=d/u,g=[];for(let e=0;e<u;e++){const n=[],d=o.mul(a,o.exp(c,e*f)),u=t.slice(e*f*s,(e+1)*f*s),h=r.slice(e*f*s,(e+1)*f*s);n.push({cmd:"ALLOCSET",var:0,buff:u}),n.push({cmd:"ALLOCSET",var:1,buff:h}),n.push({cmd:"ALLOCSET",var:2,buff:d}),n.push({cmd:"ALLOCSET",var:3,buff:c}),n.push({cmd:"CALL",fnName:l,params:[{var:0},{var:1},{val:f},{var:2},{var:3}]}),n.push({cmd:"GET",out:0,var:0,len:f*s}),n.push({cmd:"GET",out:1,var:1,len:f*s}),g.push(i.queueAction(n))}const h=await Promise.all(g);let p,_;t instanceof Qp?(p=new Qp(d*s),_=new Qp(d*s)):(p=new Uint8Array(d*s),_=new Uint8Array(d*s));let m=0;for(let t=0;t<h.length;t++)p.set(h[t][0],m),_.set(h[t][1],m),m+=h[t][0].byteLength;return[p,_]},n.fftFinal=async function(t,o){const r=3*n.F.n8,a=2*n.F.n8;let c,s;if("G1"==e)c="g1m_fftFinal",s="g1m_batchToAffine";else{if("G2"!=e)throw new Error("Invalid group");c="g2m_fftFinal",s="g2m_batchToAffine"}const l=Math.floor(t.byteLength/r);if(l!=1<<jp(l))throw new Error("Invalid number of points");const d=Math.floor(l/i.concurrency),u=[];for(let e=0;e<i.concurrency;e++){let n;if(n=e<i.concurrency-1?d:l-e*d,0==n)continue;const f=[],g=t.slice(e*d*r,(e*d+n)*r);f.push({cmd:"ALLOCSET",var:0,buff:g}),f.push({cmd:"ALLOCSET",var:1,buff:o}),f.push({cmd:"CALL",fnName:c,params:[{var:0},{val:n},{var:1}]}),f.push({cmd:"CALL",fnName:s,params:[{var:0},{val:n},{var:0}]}),f.push({cmd:"GET",out:0,var:0,len:n*a}),u.push(i.queueAction(f))}const f=await Promise.all(u);let g;g=t instanceof Qp?new Qp(l*a):new Uint8Array(l*a);let h=0;for(let t=f.length-1;t>=0;t--)g.set(f[t][0],h),h+=f[t][0].byteLength;return g}}async function $p(t){const e=await async function(t,e){const n=new Yp;n.memory=new WebAssembly.Memory({initial:25}),n.u8=new Uint8Array(n.memory.buffer),n.u32=new Uint32Array(n.memory.buffer);const o=await WebAssembly.compile(t.code);if(n.instance=await WebAssembly.instantiate(o,{env:{memory:n.memory}}),null!==globalThis&&void 0!==globalThis&&globalThis.Worker||(e=!0),n.singleThread=e,n.initalPFree=n.u32[0],n.pq=t.pq,n.pr=t.pr,n.pG1gen=t.pG1gen,n.pG1zero=t.pG1zero,n.pG2gen=t.pG2gen,n.pG2zero=t.pG2zero,n.pOneT=t.pOneT,e)n.code=t.code,n.taskManager=function(){const t=32767;let e,n;async function o(o){const i=new Uint8Array(o.code),r=await WebAssembly.compile(i);n=new WebAssembly.Memory({initial:o.init,maximum:t}),e=await WebAssembly.instantiate(r,{env:{memory:n}})}function i(e){const o=new Uint32Array(n.buffer,0,1);for(;3&o[0];)o[0]++;const i=o[0];if(o[0]+=e,o[0]+e>n.buffer.byteLength){const i=n.buffer.byteLength/65536;let r=Math.floor((o[0]+e)/65536)+1;r>t&&(r=t),n.grow(r-i)}return i}function r(t){const e=i(t.byteLength);return c(e,t),e}function a(t,e){const o=new Uint8Array(n.buffer);return new Uint8Array(o.buffer,o.byteOffset+t,e)}function c(t,e){new Uint8Array(n.buffer).set(new Uint8Array(e),t)}function s(t){if("INIT"==t[0].cmd)return o(t[0]);const s={vars:[],out:[]},l=new Uint32Array(n.buffer,0,1)[0];for(let n=0;n<t.length;n++)switch(t[n].cmd){case"ALLOCSET":s.vars[t[n].var]=r(t[n].buff);break;case"ALLOC":s.vars[t[n].var]=i(t[n].len);break;case"SET":c(s.vars[t[n].var],t[n].buff);break;case"CALL":{const o=[];for(let e=0;e<t[n].params.length;e++){const i=t[n].params[e];void 0!==i.var?o.push(s.vars[i.var]+(i.offset||0)):void 0!==i.val&&o.push(i.val)}e.exports[t[n].fnName](...o);break}case"GET":s.out[t[n].out]=a(s.vars[t[n].var],t[n].len).slice();break;default:throw new Error("Invalid cmd")}return new Uint32Array(n.buffer,0,1)[0]=l,s.out}return s}(),await n.taskManager([{cmd:"INIT",init:25,code:n.code.slice()}]),n.concurrency=1;else{n.workers=[],n.pendingDeferreds=[],n.working=[];let e=2;"object"==typeof navigator&&navigator.hardwareConcurrency&&(e=navigator.hardwareConcurrency),0==e&&(e=2),e>64&&(e=64),n.concurrency=e;for(let t=0;t<e;t++)n.workers[t]=new Worker(Vp),n.workers[t].addEventListener("message",i(t)),n.working[t]=!1;const o=[];for(let e=0;e<n.workers.length;e++){const i=t.code.slice();o.push(n.postAction(e,[{cmd:"INIT",init:25,code:i}],[i.buffer]))}await Promise.all(o)}return n;function i(t){return function(e){let o;o=e&&e.data?e.data:e,n.working[t]=!1,n.pendingDeferreds[t].resolve(o),n.processWorks()}}}(t.wasm,t.singleThread),n={};return n.q=gg(t.wasm.q.toString()),n.r=gg(t.wasm.r.toString()),n.name=t.name,n.tm=e,n.prePSize=t.wasm.prePSize,n.preQSize=t.wasm.preQSize,n.Fr=new Dp(e,"frm",t.n8r,t.r),n.F1=new Dp(e,"f1m",t.n8q,t.q),n.F2=new Rp(e,"f2m",n.F1),n.G1=new Gp(e,"g1m",n.F1,t.wasm.pG1gen,t.wasm.pG1b,t.cofactorG1),n.G2=new Gp(e,"g2m",n.F2,t.wasm.pG2gen,t.wasm.pG2b,t.cofactorG2),n.F6=new qp(e,"f6m",n.F2),n.F12=new Rp(e,"ftm",n.F6),n.Gt=n.F12,Jp(n,"G1"),Jp(n,"G2"),Jp(n,"Fr"),Xp(n,"G1"),Xp(n,"G2"),Zp(n,"G1"),Zp(n,"G2"),Zp(n,"Fr"),function(t){const e=t.tm;t.pairing=function(n,o){e.startSyncOp();const i=e.allocBuff(t.G1.toJacobian(n)),r=e.allocBuff(t.G2.toJacobian(o)),a=e.alloc(t.Gt.n8);e.instance.exports[t.name+"_pairing"](i,r,a);const c=e.getBuff(a,t.Gt.n8);return e.endSyncOp(),c},t.pairingEq=async function(){let n,o;arguments.length%2==1?(n=arguments[arguments.length-1],o=(arguments.length-1)/2):(n=t.Gt.one,o=arguments.length/2);const i=[];for(let n=0;n<o;n++){const o=[],r=t.G1.toJacobian(arguments[2*n]);o.push({cmd:"ALLOCSET",var:0,buff:r}),o.push({cmd:"ALLOC",var:1,len:t.prePSize});const a=t.G2.toJacobian(arguments[2*n+1]);o.push({cmd:"ALLOCSET",var:2,buff:a}),o.push({cmd:"ALLOC",var:3,len:t.preQSize}),o.push({cmd:"ALLOC",var:4,len:t.Gt.n8}),o.push({cmd:"CALL",fnName:t.name+"_prepareG1",params:[{var:0},{var:1}]}),o.push({cmd:"CALL",fnName:t.name+"_prepareG2",params:[{var:2},{var:3}]}),o.push({cmd:"CALL",fnName:t.name+"_millerLoop",params:[{var:1},{var:3},{var:4}]}),o.push({cmd:"GET",out:0,var:4,len:t.Gt.n8}),i.push(e.queueAction(o))}const r=await Promise.all(i);e.startSyncOp();const a=e.alloc(t.Gt.n8);e.instance.exports.ftm_one(a);for(let t=0;t<r.length;t++){const n=e.allocBuff(r[t][0]);e.instance.exports.ftm_mul(a,n,a)}e.instance.exports[t.name+"_finalExponentiation"](a,a);const c=e.allocBuff(n),s=!!e.instance.exports.ftm_eq(a,c);return e.endSyncOp(),s},t.prepareG1=function(t){this.tm.startSyncOp();const e=this.tm.allocBuff(t),n=this.tm.alloc(this.prePSize);this.tm.instance.exports[this.name+"_prepareG1"](e,n);const o=this.tm.getBuff(n,this.prePSize);return this.tm.endSyncOp(),o},t.prepareG2=function(t){this.tm.startSyncOp();const e=this.tm.allocBuff(t),n=this.tm.alloc(this.preQSize);this.tm.instance.exports[this.name+"_prepareG2"](e,n);const o=this.tm.getBuff(n,this.preQSize);return this.tm.endSyncOp(),o},t.millerLoop=function(t,e){this.tm.startSyncOp();const n=this.tm.allocBuff(t),o=this.tm.allocBuff(e),i=this.tm.alloc(this.Gt.n8);this.tm.instance.exports[this.name+"_millerLoop"](n,o,i);const r=this.tm.getBuff(i,this.Gt.n8);return this.tm.endSyncOp(),r},t.finalExponentiation=function(t){this.tm.startSyncOp();const e=this.tm.allocBuff(t),n=this.tm.alloc(this.Gt.n8);this.tm.instance.exports[this.name+"_finalExponentiation"](e,n);const o=this.tm.getBuff(n,this.Gt.n8);return this.tm.endSyncOp(),o}}(n),n.array2buffer=function(t,e){const n=new Uint8Array(e*t.length);for(let o=0;o<t.length;o++)n.set(t[o],o*e);return n},n.buffer2array=function(t,e){const n=t.byteLength/e,o=new Array(n);for(let i=0;i<n;i++)o[i]=t.slice(i*e,i*e+e);return o},n}function t_(t){return BigInt(t)}function e_(t){return t<0n}function n_(t){return 0n===t}function o_(t){const e=[],n=t_(t);return e.push(Number(0xFFn&n)),e.push(Number(n>>8n&0xFFn)),e.push(Number(n>>16n&0xFFn)),e.push(Number(n>>24n&0xFFn)),e}function i_(t){const e=function(t){for(var e=[],n=0;n<t.length;n++){var o=t.charCodeAt(n);o<128?e.push(o):o<2048?e.push(192|o>>6,128|63&o):o<55296||o>=57344?e.push(224|o>>12,128|o>>6&63,128|63&o):(n++,o=65536+((1023&o)<<10|1023&t.charCodeAt(n)),e.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|63&o))}return e}(t);return[...l_(e.length),...e]}function r_(t){const e=[];let n=t_(t);if(e_(n))throw new Error("Number cannot be negative");for(;!n_(n);)e.push(Number(0x7Fn&n)),n>>=7n;0==e.length&&e.push(0);for(let t=0;t<e.length-1;t++)e[t]=128|e[t];return e}function a_(t){let e,n;const o=function(t){return e_(t)?t.toString(2).length-1:t.toString(2).length}(t);t<0?(n=!0,e=(1n<<BigInt(o))+t):(n=!1,e=t_(t));const i=7-o%7,r=(1<<7-i)-1|128,a=r_(e+((1n<<BigInt(i))-1n<<BigInt(o)));return n||(a[a.length-1]=a[a.length-1]&r),a}function c_(t){let e=t_(t);if(e>0xFFFFFFFFn)throw new Error("Number too big");if(e>0x7FFFFFFFn&&(e-=0x100000000n),e<-2147483648n)throw new Error("Number too small");return a_(e)}function s_(t){let e=t_(t);if(e>0xFFFFFFFFFFFFFFFFn)throw new Error("Number too big");if(e>0x7FFFFFFFFFFFFFFFn&&(e-=0x10000000000000000n),e<-9223372036854775808n)throw new Error("Number too small");return a_(e)}function l_(t){let e=t_(t);if(e>0xFFFFFFFFn)throw new Error("Number too big");return r_(e)}function d_(t){return Array.from(t,(function(t){return("0"+(255&t).toString(16)).slice(-2)})).join("")}class u_{constructor(t){this.func=t,this.functionName=t.functionName,this.module=t.module}setLocal(t,e){const n=this.func.localIdxByName[t];if(void 0===n)throw new Error("Local Variable not defined: Function: ".concat(this.functionName," local: ").concat(t," "));return[...e,33,...l_(n)]}teeLocal(t,e){const n=this.func.localIdxByName[t];if(void 0===n)throw new Error("Local Variable not defined: Function: ".concat(this.functionName," local: ").concat(t," "));return[...e,34,...l_(n)]}getLocal(t){const e=this.func.localIdxByName[t];if(void 0===e)throw new Error("Local Variable not defined: Function: ".concat(this.functionName," local: ").concat(t," "));return[32,...l_(e)]}i64_load8_s(t,e,n){return[...t,48,void 0===n?0:n,...l_(e||0)]}i64_load8_u(t,e,n){return[...t,49,void 0===n?0:n,...l_(e||0)]}i64_load16_s(t,e,n){return[...t,50,void 0===n?1:n,...l_(e||0)]}i64_load16_u(t,e,n){return[...t,51,void 0===n?1:n,...l_(e||0)]}i64_load32_s(t,e,n){return[...t,52,void 0===n?2:n,...l_(e||0)]}i64_load32_u(t,e,n){return[...t,53,void 0===n?2:n,...l_(e||0)]}i64_load(t,e,n){return[...t,41,void 0===n?3:n,...l_(e||0)]}i64_store(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=3,a=e):Array.isArray(n)?(i=e,r=3,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,55,r,...l_(i)]}i64_store32(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=2,a=e):Array.isArray(n)?(i=e,r=2,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,62,r,...l_(i)]}i64_store16(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=1,a=e):Array.isArray(n)?(i=e,r=1,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,61,r,...l_(i)]}i64_store8(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=0,a=e):Array.isArray(n)?(i=e,r=0,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,60,r,...l_(i)]}i32_load8_s(t,e,n){return[...t,44,void 0===n?0:n,...l_(e||0)]}i32_load8_u(t,e,n){return[...t,45,void 0===n?0:n,...l_(e||0)]}i32_load16_s(t,e,n){return[...t,46,void 0===n?1:n,...l_(e||0)]}i32_load16_u(t,e,n){return[...t,47,void 0===n?1:n,...l_(e||0)]}i32_load(t,e,n){return[...t,40,void 0===n?2:n,...l_(e||0)]}i32_store(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=2,a=e):Array.isArray(n)?(i=e,r=2,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,54,r,...l_(i)]}i32_store16(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=1,a=e):Array.isArray(n)?(i=e,r=1,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,59,r,...l_(i)]}i32_store8(t,e,n,o){let i,r,a;return Array.isArray(e)?(i=0,r=0,a=e):Array.isArray(n)?(i=e,r=0,a=n):Array.isArray(o)&&(i=e,r=n,a=o),[...t,...a,58,r,...l_(i)]}call(t){const e=this.module.functionIdxByName[t];if(void 0===e)throw new Error("Function not defined: Function: ".concat(t));for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return[...[].concat(...o),16,...l_(e)]}call_indirect(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return[...[].concat(...n),...t,17,0,0]}if(t,e,n){return n?[...t,4,64,...e,5,...n,11]:[...t,4,64,...e,11]}block(t){return[2,64,...t,11]}loop(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return[3,64,...[].concat(...e),11]}br_if(t,e){return[...e,13,...l_(t)]}br(t){return[12,...l_(t)]}ret(t){return[...t,15]}drop(t){return[...t,26]}i64_const(t){return[66,...s_(t)]}i32_const(t){return[65,...c_(t)]}i64_eqz(t){return[...t,80]}i64_eq(t,e){return[...t,...e,81]}i64_ne(t,e){return[...t,...e,82]}i64_lt_s(t,e){return[...t,...e,83]}i64_lt_u(t,e){return[...t,...e,84]}i64_gt_s(t,e){return[...t,...e,85]}i64_gt_u(t,e){return[...t,...e,86]}i64_le_s(t,e){return[...t,...e,87]}i64_le_u(t,e){return[...t,...e,88]}i64_ge_s(t,e){return[...t,...e,89]}i64_ge_u(t,e){return[...t,...e,90]}i64_add(t,e){return[...t,...e,124]}i64_sub(t,e){return[...t,...e,125]}i64_mul(t,e){return[...t,...e,126]}i64_div_s(t,e){return[...t,...e,127]}i64_div_u(t,e){return[...t,...e,128]}i64_rem_s(t,e){return[...t,...e,129]}i64_rem_u(t,e){return[...t,...e,130]}i64_and(t,e){return[...t,...e,131]}i64_or(t,e){return[...t,...e,132]}i64_xor(t,e){return[...t,...e,133]}i64_shl(t,e){return[...t,...e,134]}i64_shr_s(t,e){return[...t,...e,135]}i64_shr_u(t,e){return[...t,...e,136]}i64_extend_i32_s(t){return[...t,172]}i64_extend_i32_u(t){return[...t,173]}i64_clz(t){return[...t,121]}i64_ctz(t){return[...t,122]}i32_eqz(t){return[...t,69]}i32_eq(t,e){return[...t,...e,70]}i32_ne(t,e){return[...t,...e,71]}i32_lt_s(t,e){return[...t,...e,72]}i32_lt_u(t,e){return[...t,...e,73]}i32_gt_s(t,e){return[...t,...e,74]}i32_gt_u(t,e){return[...t,...e,75]}i32_le_s(t,e){return[...t,...e,76]}i32_le_u(t,e){return[...t,...e,77]}i32_ge_s(t,e){return[...t,...e,78]}i32_ge_u(t,e){return[...t,...e,79]}i32_add(t,e){return[...t,...e,106]}i32_sub(t,e){return[...t,...e,107]}i32_mul(t,e){return[...t,...e,108]}i32_div_s(t,e){return[...t,...e,109]}i32_div_u(t,e){return[...t,...e,110]}i32_rem_s(t,e){return[...t,...e,111]}i32_rem_u(t,e){return[...t,...e,112]}i32_and(t,e){return[...t,...e,113]}i32_or(t,e){return[...t,...e,114]}i32_xor(t,e){return[...t,...e,115]}i32_shl(t,e){return[...t,...e,116]}i32_shr_s(t,e){return[...t,...e,117]}i32_shr_u(t,e){return[...t,...e,118]}i32_rotl(t,e){return[...t,...e,119]}i32_rotr(t,e){return[...t,...e,120]}i32_wrap_i64(t){return[...t,167]}i32_clz(t){return[...t,103]}i32_ctz(t){return[...t,104]}unreachable(){return[0]}current_memory(){return[63,0]}comment(){return[]}}const f_={i32:127,i64:126,f32:125,f64:124,anyfunc:112,func:96,emptyblock:64};class g_{constructor(t,e,n,o,i){if("import"==n)this.fnType="import",this.moduleName=o,this.fieldName=i;else{if("internal"!=n)throw new Error("Invalid function fnType: "+n);this.fnType="internal"}this.module=t,this.fnName=e,this.params=[],this.locals=[],this.localIdxByName={},this.code=[],this.returnType=null,this.nextLocal=0}addParam(t,e){if(this.localIdxByName[t])throw new Error("param already exists. Function: ".concat(this.fnName,", Param: ").concat(t," "));const n=this.nextLocal++;this.localIdxByName[t]=n,this.params.push({type:e})}addLocal(t,e,n){const o=n||1;if(this.localIdxByName[t])throw new Error("local already exists. Function: ".concat(this.fnName,", Param: ").concat(t," "));const i=this.nextLocal++;this.localIdxByName[t]=i,this.locals.push({type:e,length:o})}setReturnType(t){if(this.returnType)throw new Error("returnType already defined. Function: ".concat(this.fnName));this.returnType=t}getSignature(){return[96,...l_(this.params.length),...this.params.map((t=>f_[t.type])),...this.returnType?[1,f_[this.returnType]]:[0]]}getBody(){const t=this.locals.map((t=>[...l_(t.length),f_[t.type]])),e=[...l_(this.locals.length),...[].concat(...t),...this.code,11];return[...l_(e.length),...e]}addCode(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.code.push(...[].concat(...e))}getCodeBuilder(){return new u_(this)}}class h_{constructor(){this.functions=[],this.functionIdxByName={},this.nImportFunctions=0,this.nInternalFunctions=0,this.memory={pagesSize:1,moduleName:"env",fieldName:"memory"},this.free=8,this.datas=[],this.modules={},this.exports=[],this.functionsTable=[]}build(){return this._setSignatures(),new Uint8Array([...o_(1836278016),...o_(1),...this._buildType(),...this._buildImport(),...this._buildFunctionDeclarations(),...this._buildFunctionsTable(),...this._buildExports(),...this._buildElements(),...this._buildCode(),...this._buildData()])}addFunction(t){if(void 0!==this.functionIdxByName[t])throw new Error("Function already defined: ".concat(t));const e=this.functions.length;return this.functionIdxByName[t]=e,this.functions.push(new g_(this,t,"internal")),this.nInternalFunctions++,this.functions[e]}addIimportFunction(t,e,n){if(void 0!==this.functionIdxByName[t])throw new Error("Function already defined: ".concat(t));if(this.functions.length>0&&"internal"==this.functions[this.functions.length-1].type)throw new Error("Import functions must be declared before internal: ".concat(t));let o=n||t;const i=this.functions.length;return this.functionIdxByName[t]=i,this.functions.push(new g_(this,t,"import",e,o)),this.nImportFunctions++,this.functions[i]}setMemory(t,e,n){this.memory={pagesSize:t,moduleName:e||"env",fieldName:n||"memory"}}exportFunction(t,e){const n=e||t;if(void 0===this.functionIdxByName[t])throw new Error("Function not defined: ".concat(t));const o=this.functionIdxByName[t];n!=t&&(this.functionIdxByName[n]=o),this.exports.push({exportName:n,idx:o})}addFunctionToTable(t){const e=this.functionIdxByName[t];this.functionsTable.push(e)}addData(t,e){this.datas.push({offset:t,bytes:e})}alloc(t,e){let n,o;(Array.isArray(t)||ArrayBuffer.isView(t))&&void 0===e?(n=t.length,o=t):(n=t,o=e),n=1+(n-1>>3)<<3;const i=this.free;return this.free+=n,o&&this.addData(i,o),i}allocString(t){const e=(new globalThis.TextEncoder).encode(t);return this.alloc([...e,0])}_setSignatures(){this.signatures=[];const t={};if(this.functionsTable.length>0){const e=this.functions[this.functionsTable[0]].getSignature();t["s_"+d_(e)]=0,this.signatures.push(e)}for(let e=0;e<this.functions.length;e++){const n=this.functions[e].getSignature(),o="s_"+d_(n);void 0===t[o]&&(t[o]=this.signatures.length,this.signatures.push(n)),this.functions[e].signatureIdx=t[o]}}_buildSection(t,e){return[t,...l_(e.length),...e]}_buildType(){return this._buildSection(1,[...l_(this.signatures.length),...[].concat(...this.signatures)])}_buildImport(){const t=[];t.push([...i_(this.memory.moduleName),...i_(this.memory.fieldName),2,0,...l_(this.memory.pagesSize)]);for(let e=0;e<this.nImportFunctions;e++)t.push([...i_(this.functions[e].moduleName),...i_(this.functions[e].fieldName),0,...l_(this.functions[e].signatureIdx)]);return this._buildSection(2,l_(t.length).concat(...t))}_buildFunctionDeclarations(){const t=[];for(let e=this.nImportFunctions;e<this.nImportFunctions+this.nInternalFunctions;e++)t.push(...l_(this.functions[e].signatureIdx));return this._buildSection(3,[...l_(t.length),...t])}_buildFunctionsTable(){return 0==this.functionsTable.length?[]:this._buildSection(4,[...l_(1),112,0,...l_(this.functionsTable.length)])}_buildElements(){if(0==this.functionsTable.length)return[];const t=[];for(let e=0;e<this.functionsTable.length;e++)t.push(...l_(this.functionsTable[e]));return this._buildSection(9,[...l_(1),...l_(0),65,...c_(0),11,...l_(this.functionsTable.length),...t])}_buildExports(){const t=[];for(let e=0;e<this.exports.length;e++)t.push([...i_(this.exports[e].exportName),0,...l_(this.exports[e].idx)]);return this._buildSection(7,l_(t.length).concat(...t))}_buildCode(){const t=[];for(let e=this.nImportFunctions;e<this.nImportFunctions+this.nInternalFunctions;e++)t.push(this.functions[e].getBody());return this._buildSection(10,l_(t.length).concat(...t))}_buildData(){const t=[];t.push([0,65,0,11,4,...o_(this.free)]);for(let e=0;e<this.datas.length;e++)t.push([0,65,...c_(this.datas[e].offset),11,...l_(this.datas[e].bytes.length),...this.datas[e].bytes]);return this._buildSection(11,l_(t.length).concat(...t))}}async function p_(t,e){if(!t&&globalThis.curve_bn128)return globalThis.curve_bn128;const n=new h_;n.setMemory(25),Ep(n),e&&e(n);const o={};o.code=n.build(),o.pq=n.modules.f1m.pq,o.pr=n.modules.frm.pq,o.pG1gen=n.modules.bn128.pG1gen,o.pG1zero=n.modules.bn128.pG1zero,o.pG1b=n.modules.bn128.pG1b,o.pG2gen=n.modules.bn128.pG2gen,o.pG2zero=n.modules.bn128.pG2zero,o.pG2b=n.modules.bn128.pG2b,o.pOneT=n.modules.bn128.pOneT,o.prePSize=n.modules.bn128.prePSize,o.preQSize=n.modules.bn128.preQSize,o.n8q=32,o.n8r=32,o.q=n.modules.bn128.q,o.r=n.modules.bn128.r;const i={name:"bn128",wasm:o,q:gg("21888242871839275222246405745257275088696311157297823662689037894645226208583"),r:gg("21888242871839275222246405745257275088548364400416034343698204186575808495617"),n8q:32,n8r:32,cofactorG2:gg("30644e72e131a029b85045b68181585e06ceecda572a2489345f2299c0f9fa8d",16),singleThread:!!t},r=await $p(i);return r.terminate=async function(){i.singleThread||(globalThis.curve_bn128=null,await this.tm.terminate())},t||(globalThis.curve_bn128=r),r}async function __(t,e){if(!t&&globalThis.curve_bls12381)return globalThis.curve_bls12381;const n=new h_;n.setMemory(25),Bp(n),e&&e(n);const o={};o.code=n.build(),o.pq=n.modules.f1m.pq,o.pr=n.modules.frm.pq,o.pG1gen=n.modules.bls12381.pG1gen,o.pG1zero=n.modules.bls12381.pG1zero,o.pG1b=n.modules.bls12381.pG1b,o.pG2gen=n.modules.bls12381.pG2gen,o.pG2zero=n.modules.bls12381.pG2zero,o.pG2b=n.modules.bls12381.pG2b,o.pOneT=n.modules.bls12381.pOneT,o.prePSize=n.modules.bls12381.prePSize,o.preQSize=n.modules.bls12381.preQSize,o.n8q=48,o.n8r=32,o.q=n.modules.bls12381.q,o.r=n.modules.bls12381.r;const i={name:"bls12381",wasm:o,q:gg("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),r:gg("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),n8q:48,n8r:32,cofactorG1:gg("0x396c8c005555e1568c00aaab0000aaab",16),cofactorG2:gg("0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5",16),singleThread:!!t},r=await $p(i);return r.terminate=async function(){i.singleThread||(globalThis.curve_bls12381=null,await this.tm.terminate())},t||(globalThis.curve_bls12381=r),r}globalThis.curve_bn128=null,globalThis.curve_bls12381=null,gg("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),gg("21888242871839275222246405745257275088548364400416034343698204186575808495617"),gg("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),gg("21888242871839275222246405745257275088696311157297823662689037894645226208583");const m_=qg,y_=Tp;var L_={};async function b_(t,e,n,o){if(n=n||262144,"number"!=typeof e&&["w+","wx+","r","ax+","a+"].indexOf(e)<0)throw new Error("Invalid open option");const i=await L_.promises.open(t,e),r=await i.stat();return new A_(i,r,n,o,t)}class A_{constructor(t,e,n,o,i){for(this.fileName=i,this.fd=t,this.pos=0,this.pageSize=o||256;this.pageSize<e.blksize;)this.pageSize*=2;this.totalSize=e.size,this.totalPages=Math.floor((e.size-1)/this.pageSize)+1,this.maxPagesLoaded=Math.floor(n/this.pageSize)+1,this.pages={},this.pendingLoads=[],this.writing=!1,this.reading=!1,this.avBuffs=[],this.history={}}_loadPage(t){const e=this,n=new Promise(((n,o)=>{e.pendingLoads.push({page:t,resolve:n,reject:o})}));return e.__statusPage("After Load request: ",t),n}__statusPage(t,e){const n=[],o=this;if(!o.logHistory)return;n.push("=="+t+" "+e);let i="";for(let t=0;t<o.pendingLoads.length;t++)o.pendingLoads[t].page==e&&(i=i+" "+t);if(i&&n.push("Pending loads:"+i),void 0!==o.pages[e]){const t=o.pages[e];n.push("Loaded"),n.push("pendingOps: "+t.pendingOps),t.loading&&n.push("loading: "+t.loading),t.writing&&n.push("writing"),t.dirty&&n.push("dirty")}n.push("=="),o.history[e]||(o.history[e]=[]),o.history[e].push(n)}__printHistory(t){const e=this;e.history[t]||console.log("Empty History ",t),console.log("History "+t);for(let n=0;n<e.history[t].length;n++)for(let o=0;o<e.history[t][n].length;o++)console.log("-> "+e.history[t][n][o])}_triggerLoad(){const t=this;if(t.reading)return;if(0==t.pendingLoads.length)return;const e=Object.keys(t.pages),n=[];for(let o=0;o<e.length;o++){const i=t.pages[parseInt(e[o])];0!=i.dirty||0!=i.pendingOps||i.writing||i.loading||n.push(parseInt(e[o]))}let o=t.maxPagesLoaded-e.length;const i=[];for(;t.pendingLoads.length>0&&(void 0!==t.pages[t.pendingLoads[0].page]||o>0||n.length>0);){const e=t.pendingLoads.shift();if(void 0!==t.pages[e.page]){t.pages[e.page].pendingOps++;const o=n.indexOf(e.page);o>=0&&n.splice(o,1),t.pages[e.page].loading?t.pages[e.page].loading.push(e):e.resolve(),t.__statusPage("After Load (cached): ",e.page)}else{if(o)o--;else{const e=n.shift();t.__statusPage("Before Unload: ",e),t.avBuffs.unshift(t.pages[e]),delete t.pages[e],t.__statusPage("After Unload: ",e)}e.page>=t.totalPages?(t.pages[e.page]=r(),e.resolve(),t.__statusPage("After Load (new): ",e.page)):(t.reading=!0,t.pages[e.page]=r(),t.pages[e.page].loading=[e],i.push(t.fd.read(t.pages[e.page].buff,0,t.pageSize,e.page*t.pageSize).then((n=>{t.pages[e.page].size=n.bytesRead;const o=t.pages[e.page].loading;delete t.pages[e.page].loading;for(let t=0;t<o.length;t++)o[t].resolve();return t.__statusPage("After Load (loaded): ",e.page),n}),(t=>{e.reject(t)}))),t.__statusPage("After Load (loading): ",e.page))}}function r(){if(t.avBuffs.length>0){const e=t.avBuffs.shift();return e.dirty=!1,e.pendingOps=1,e.size=0,e}return{dirty:!1,buff:new Uint8Array(t.pageSize),pendingOps:1,size:0}}Promise.all(i).then((()=>{t.reading=!1,t.pendingLoads.length>0&&setImmediate(t._triggerLoad.bind(t)),t._tryClose()}))}_triggerWrite(){const t=this;if(t.writing)return;const e=Object.keys(t.pages),n=[];for(let o=0;o<e.length;o++){const i=t.pages[parseInt(e[o])];i.dirty&&(i.dirty=!1,i.writing=!0,t.writing=!0,n.push(t.fd.write(i.buff,0,i.size,parseInt(e[o])*t.pageSize).then((()=>{i.writing=!1}),(e=>{console.log("ERROR Writing: "+e),t.error=e,t._tryClose()}))))}t.writing&&Promise.all(n).then((()=>{t.writing=!1,setImmediate(t._triggerWrite.bind(t)),t._tryClose(),t.pendingLoads.length>0&&setImmediate(t._triggerLoad.bind(t))}))}_getDirtyPage(){for(let t in this.pages)if(this.pages[t].dirty)return t;return-1}async write(t,e){if(0==t.byteLength)return;const n=this;if(void 0===e&&(e=n.pos),n.pos=e+t.byteLength,n.totalSize<e+t.byteLength&&(n.totalSize=e+t.byteLength),n.pendingClose)throw new Error("Writing a closing file");const o=Math.floor(e/n.pageSize),i=Math.floor((e+t.byteLength-1)/n.pageSize),r=[];for(let t=o;t<=i;t++)r.push(n._loadPage(t));n._triggerLoad();let a=o,c=e%n.pageSize,s=t.byteLength;for(;s>0;){await r[a-o];const e=c+s>n.pageSize?n.pageSize-c:s,i=t.slice(t.byteLength-s,t.byteLength-s+e);new Uint8Array(n.pages[a].buff.buffer,c,e).set(i),n.pages[a].dirty=!0,n.pages[a].pendingOps--,n.pages[a].size=Math.max(c+e,n.pages[a].size),a>=n.totalPages&&(n.totalPages=a+1),s-=e,a++,c=0,n.writing||setImmediate(n._triggerWrite.bind(n))}}async read(t,e){let n=new Uint8Array(t);return await this.readToBuffer(n,0,t,e),n}async readToBuffer(t,e,n,o){if(0==n)return;const i=this;if(n>i.pageSize*i.maxPagesLoaded*.8){const t=Math.floor(1.1*n);this.maxPagesLoaded=Math.floor(t/i.pageSize)+1}if(void 0===o&&(o=i.pos),i.pos=o+n,i.pendingClose)throw new Error("Reading a closing file");const r=Math.floor(o/i.pageSize),a=Math.floor((o+n-1)/i.pageSize),c=[];for(let t=r;t<=a;t++)c.push(i._loadPage(t));i._triggerLoad();let s=r,l=o%i.pageSize,d=o+n>i.totalSize?n-(o+n-i.totalSize):n;for(;d>0;){await c[s-r],i.__statusPage("After Await (read): ",s);const o=l+d>i.pageSize?i.pageSize-l:d,a=new Uint8Array(i.pages[s].buff.buffer,i.pages[s].buff.byteOffset+l,o);t.set(a,e+n-d),i.pages[s].pendingOps--,i.__statusPage("After Op done: ",s),d-=o,s++,l=0,i.pendingLoads.length>0&&setImmediate(i._triggerLoad.bind(i))}this.pos=o+n}_tryClose(){const t=this;t.pendingClose&&(t.error&&t.pendingCloseReject(t.error),t._getDirtyPage()>=0||t.writing||t.reading||t.pendingLoads.length>0||t.pendingClose())}close(){const t=this;if(t.pendingClose)throw new Error("Closing the file twice");return new Promise(((e,n)=>{t.pendingClose=e,t.pendingCloseReject=n,t._tryClose()})).then((()=>{t.fd.close()}),(e=>{throw t.fd.close(),e}))}async discard(){await this.close(),await L_.promises.unlink(this.fileName)}async writeULE32(t,e){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t,!0),await this.write(n,e)}async writeUBE32(t,e){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t,!1),await this.write(n,e)}async writeULE64(t,e){const n=new Uint8Array(8),o=new DataView(n.buffer);o.setUint32(0,4294967295&t,!0),o.setUint32(4,Math.floor(t/4294967296),!0),await this.write(n,e)}async readULE32(t){const e=await this.read(4,t);return new Uint32Array(e.buffer)[0]}async readUBE32(t){const e=await this.read(4,t);return new DataView(e.buffer).getUint32(0,!1)}async readULE64(t){const e=await this.read(8,t),n=new Uint32Array(e.buffer);return 4294967296*n[1]+n[0]}async readString(t){const e=this;if(e.pendingClose)throw new Error("Reading a closing file");let n=void 0===t?e.pos:t,o=Math.floor(n/e.pageSize),i=!1,r="";for(;!i;){let t=e._loadPage(o);e._triggerLoad(),await t,e.__statusPage("After Await (read): ",o);let a=n%e.pageSize;const c=new Uint8Array(e.pages[o].buff.buffer,e.pages[o].buff.byteOffset+a,e.pageSize-a);let s=c.findIndex((t=>0===t));i=-1!==s,i?(r+=(new TextDecoder).decode(c.slice(0,s)),e.pos=o*this.pageSize+a+s+1):(r+=(new TextDecoder).decode(c),e.pos=o*this.pageSize+a+c.length),e.pages[o].pendingOps--,e.__statusPage("After Op done: ",o),n=e.pos,o++,e.pendingLoads.length>0&&setImmediate(e._triggerLoad.bind(e))}return r}}const w_=new Uint8Array(4),I_=new DataView(w_.buffer),x_=new Uint8Array(8),C_=new DataView(x_.buffer);class v_{constructor(){this.pageSize=16384}_resizeIfNeeded(t){if(t>this.allocSize){const e=Math.max(this.allocSize+(1<<20),Math.floor(1.1*this.allocSize),t),n=new Uint8Array(e);n.set(this.o.data),this.o.data=n,this.allocSize=e}}async write(t,e){if(void 0===e&&(e=this.pos),this.readOnly)throw new Error("Writing a read only file");this._resizeIfNeeded(e+t.byteLength),this.o.data.set(t.slice(),e),e+t.byteLength>this.totalSize&&(this.totalSize=e+t.byteLength),this.pos=e+t.byteLength}async readToBuffer(t,e,n,o){if(void 0===o&&(o=this.pos),this.readOnly&&o+n>this.totalSize)throw new Error("Reading out of bounds");this._resizeIfNeeded(o+n);const i=new Uint8Array(this.o.data.buffer,this.o.data.byteOffset+o,n);t.set(i,e),this.pos=o+n}async read(t,e){const n=new Uint8Array(t);return await this.readToBuffer(n,0,t,e),n}close(){this.o.data.byteLength!=this.totalSize&&(this.o.data=this.o.data.slice(0,this.totalSize))}async discard(){}async writeULE32(t,e){I_.setUint32(0,t,!0),await this.write(w_,e)}async writeUBE32(t,e){I_.setUint32(0,t,!1),await this.write(w_,e)}async writeULE64(t,e){C_.setUint32(0,4294967295&t,!0),C_.setUint32(4,Math.floor(t/4294967296),!0),await this.write(x_,e)}async readULE32(t){const e=await this.read(4,t);return new Uint32Array(e.buffer)[0]}async readUBE32(t){const e=await this.read(4,t);return new DataView(e.buffer).getUint32(0,!1)}async readULE64(t){const e=await this.read(8,t),n=new Uint32Array(e.buffer);return 4294967296*n[1]+n[0]}async readString(t){const e=this;let n=void 0===t?e.pos:t;if(n>this.totalSize){if(this.readOnly)throw new Error("Reading out of bounds");this._resizeIfNeeded(t)}const o=new Uint8Array(e.o.data.buffer,n,this.totalSize-n);let i=o.findIndex((t=>0===t)),r="";return-1!==i?(r=(new TextDecoder).decode(o.slice(0,i)),e.pos=n+i+1):e.pos=n,r}}const E_=1<<22,B_=new Uint8Array(4),F_=new DataView(B_.buffer),O_=new Uint8Array(8),S_=new DataView(O_.buffer);class P_{constructor(){this.pageSize=16384}_resizeIfNeeded(t){if(t<=this.totalSize)return;if(this.readOnly)throw new Error("Reading out of file bounds");const e=Math.floor((t-1)/E_)+1;for(let n=Math.max(this.o.data.length-1,0);n<e;n++){const o=new Uint8Array(n<e-1?E_:t-(e-1)*E_);n==this.o.data.length-1&&o.set(this.o.data[n]),this.o.data[n]=o}this.totalSize=t}async write(t,e){const n=this;if(void 0===e&&(e=n.pos),this.readOnly)throw new Error("Writing a read only file");this._resizeIfNeeded(e+t.byteLength);let o=Math.floor(e/E_),i=e%E_,r=t.byteLength;for(;r>0;){const e=i+r>E_?E_-i:r,a=t.slice(t.byteLength-r,t.byteLength-r+e);new Uint8Array(n.o.data[o].buffer,i,e).set(a),r-=e,o++,i=0}this.pos=e+t.byteLength}async readToBuffer(t,e,n,o){const i=this;if(void 0===o&&(o=i.pos),this.readOnly&&o+n>this.totalSize)throw new Error("Reading out of bounds");this._resizeIfNeeded(o+n);let r=Math.floor(o/E_),a=o%E_,c=n;for(;c>0;){const o=a+c>E_?E_-a:c,s=new Uint8Array(i.o.data[r].buffer,a,o);t.set(s,e+n-c),c-=o,r++,a=0}this.pos=o+n}async read(t,e){const n=new Uint8Array(t);return await this.readToBuffer(n,0,t,e),n}close(){}async discard(){}async writeULE32(t,e){F_.setUint32(0,t,!0),await this.write(B_,e)}async writeUBE32(t,e){F_.setUint32(0,t,!1),await this.write(B_,e)}async writeULE64(t,e){S_.setUint32(0,4294967295&t,!0),S_.setUint32(4,Math.floor(t/4294967296),!0),await this.write(O_,e)}async readULE32(t){const e=await this.read(4,t);return new Uint32Array(e.buffer)[0]}async readUBE32(t){const e=await this.read(4,t);return new DataView(e.buffer).getUint32(0,!1)}async readULE64(t){const e=await this.read(8,t),n=new Uint32Array(e.buffer);return 4294967296*n[1]+n[0]}async readString(t){const e=this;let n=void 0===t?e.pos:t;if(n>this.totalSize){if(this.readOnly)throw new Error("Reading out of bounds");this._resizeIfNeeded(t)}let o=!1,i="";for(;!o;){let t=Math.floor(n/E_),r=n%E_;if(void 0===e.o.data[t])throw new Error("ERROR");let a=Math.min(2048,e.o.data[t].length-r);const c=new Uint8Array(e.o.data[t].buffer,r,a);let s=c.findIndex((t=>0===t));o=-1!==s,o?(i+=(new TextDecoder).decode(c.slice(0,s)),e.pos=t*E_+r+s+1):(i+=(new TextDecoder).decode(c),e.pos=t*E_+r+c.length),n=e.pos}return i}}async function j_(t,e,n){if("string"==typeof t&&(t={type:"file",fileName:t,cacheSize:e||65536,pageSize:n||8192}),"file"==t.type)return await b_(t.fileName,1538,t.cacheSize,t.pageSize);if("mem"==t.type)return function(t){const e=t.initialSize||1<<20,n=new v_;return n.o=t,n.o.data=new Uint8Array(e),n.allocSize=e,n.totalSize=0,n.readOnly=!1,n.pos=0,n}(t);if("bigMem"==t.type)return function(t){const e=t.initialSize||0,n=new P_;n.o=t;const o=e?Math.floor((e-1)/E_)+1:0;n.o.data=[];for(let t=0;t<o-1;t++)n.o.data.push(new Uint8Array(E_));return o&&n.o.data.push(new Uint8Array(e-E_*(o-1))),n.totalSize=0,n.readOnly=!1,n.pos=0,n}(t);throw new Error("Invalid FastFile type: "+t.type)}async function U_(t,e,n){if(t instanceof Uint8Array&&(t={type:"mem",data:t}),"string"==typeof t&&(t={type:"mem",data:await fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return new Uint8Array(t)}))}),"file"==t.type)return await b_(t.fileName,0,t.cacheSize,t.pageSize);if("mem"==t.type)return await function(t){const e=new v_;return e.o=t,e.allocSize=t.data.byteLength,e.totalSize=t.data.byteLength,e.readOnly=!0,e.pos=0,e}(t);if("bigMem"==t.type)return await function(t){const e=new P_;return e.o=t,e.totalSize=(t.data.length-1)*E_+t.data[t.data.length-1].byteLength,e.readOnly=!0,e.pos=0,e}(t);throw new Error("Invalid FastFile type: "+t.type)}async function k_(t,e,n,o,i){const r=await U_(t),a=await r.read(4);let c="";for(let t=0;t<4;t++)c+=String.fromCharCode(a[t]);if(c!=e)throw new Error(t+": Invalid File format");if(await r.readULE32()>n)throw new Error("Version not supported");const s=await r.readULE32();let l=[];for(let t=0;t<s;t++){let t=await r.readULE32(),e=await r.readULE64();void 0===l[t]&&(l[t]=[]),l[t].push({p:r.pos,size:e}),r.pos+=e}return{fd:r,sections:l}}async function M_(t,e){if(void 0!==t.writingSection)throw new Error("Already writing a section");await t.writeULE32(e),t.writingSection={pSectionSize:t.pos},await t.writeULE64(0)}async function T_(t){if(void 0===t.writingSection)throw new Error("Not writing a section");const e=t.pos-t.writingSection.pSectionSize-8,n=t.pos;t.pos=t.writingSection.pSectionSize,await t.writeULE64(e),t.pos=n,delete t.writingSection}async function z_(t,e,n){if(void 0!==t.readingSection)throw new Error("Already reading a section");if(!e[n])throw new Error(t.fileName+": Missing section "+n);if(e[n].length>1)throw new Error(t.fileName+": Section Duplicated "+n);t.pos=e[n][0].p,t.readingSection=e[n][0]}async function Q_(t,e){if(void 0===t.readingSection)throw new Error("Not reading a section");if(!e&&t.pos-t.readingSection.p!=t.readingSection.size)throw new Error("Invalid section size reading");delete t.readingSection}async function N_(t,e,n){const o=await t.read(e,n);return m_.fromRprLE(o,0,e)}async function D_(t,e,n,o,i){if((o=void 0===o?0:o)+(i=void 0===i?e[n][0].size-o:i)>e[n][0].size)throw new Error("Reading out of the range of the section");let r;return r=i<1<<30?new Uint8Array(i):new Qp(i),await t.readToBuffer(r,0,i,e[n][0].p+o),r}m_.e("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),m_.e("21888242871839275222246405745257275088548364400416034343698204186575808495617");const R_=m_.e("1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab",16),q_=m_.e("21888242871839275222246405745257275088696311157297823662689037894645226208583");async function G_(t,e){let n,o=e&&e.singleThread;if(m_.eq(t,q_))n=await p_(o);else{if(!m_.eq(t,R_))throw new Error("Curve not supported: ".concat(m_.toString(t)));n=await __(o)}return n}var K_="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},V_={exports:{}};class H_ extends Error{}H_.prototype.name="AssertionError";var Y_={exports:{}};function J_(t){return t.length}var W_={byteLength:J_,toString:function(t){const e=t.byteLength;let n="";for(let o=0;o<e;o++)n+=String.fromCharCode(t[o]);return n},write:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:J_(e);const i=Math.min(o,t.byteLength-n);for(let o=0;o<i;o++)t[n+o]=e.charCodeAt(o);return i}};const X_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Z_=new Uint8Array(256);for(let t=0;t<64;t++)Z_[X_.charCodeAt(t)]=t;function $_(t){let e=t.length;return 61===t.charCodeAt(e-1)&&e--,e>1&&61===t.charCodeAt(e-1)&&e--,3*e>>>2}Z_[45]=62,Z_[95]=63;var tm={byteLength:$_,toString:function(t){const e=t.byteLength;let n="";for(let o=0;o<e;o+=3)n+=X_[t[o]>>2]+X_[(3&t[o])<<4|t[o+1]>>4]+X_[(15&t[o+1])<<2|t[o+2]>>6]+X_[63&t[o+2]];return e%3==2?n=n.substring(0,n.length-1)+"=":e%3==1&&(n=n.substring(0,n.length-2)+"=="),n},write:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$_(e);const i=Math.min(o,t.byteLength-n);for(let n=0,o=0;o<i;n+=4){const i=Z_[e.charCodeAt(n)],r=Z_[e.charCodeAt(n+1)],a=Z_[e.charCodeAt(n+2)],c=Z_[e.charCodeAt(n+3)];t[o++]=i<<2|r>>4,t[o++]=(15&r)<<4|a>>2,t[o++]=(3&a)<<6|63&c}return i}};function em(t){return t.length>>>1}var nm={byteLength:em,toString:function(t){const e=t.byteLength;t=new DataView(t.buffer,t.byteOffset,e);let n="",o=0;for(let i=e-e%4;o<i;o+=4)n+=t.getUint32(o).toString(16).padStart(8,"0");for(;o<e;o++)n+=t.getUint8(o).toString(16).padStart(2,"0");return n},write:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:em(e);const i=Math.min(o,t.byteLength-n);for(let o=0;o<i;o++){const i=om(e.charCodeAt(2*o)),r=om(e.charCodeAt(2*o+1));if(void 0===i||void 0===r)return t.subarray(0,o);t[n+o]=i<<4|r}return i}};function om(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:void 0}function im(t){let e=0;for(let n=0,o=t.length;n<o;n++){const i=t.charCodeAt(n);if(i>=55296&&i<=56319&&n+1<o){const o=t.charCodeAt(n+1);if(o>=56320&&o<=57343){e+=4,n++;continue}}e+=i<=127?1:i<=2047?2:3}return e}let rm,am;if("undefined"!=typeof TextDecoder){const t=new TextDecoder;rm=function(e){return t.decode(e)}}else rm=function(t){const e=t.byteLength;let n="",o=0;for(;o<e;){let i=t[o];if(i<=127){n+=String.fromCharCode(i),o++;continue}let r=0,a=0;if(i<=223?(r=1,a=31&i):i<=239?(r=2,a=15&i):i<=244&&(r=3,a=7&i),e-o-r>0){let e=0;for(;e<r;)i=t[o+e+1],a=a<<6|63&i,e+=1}else a=65533,r=e-o;n+=String.fromCodePoint(a),o+=r+1}return n};if("undefined"!=typeof TextEncoder){const t=new TextEncoder;am=function(e,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:im(n);const r=Math.min(i,e.byteLength-o);return t.encodeInto(n,e.subarray(o,o+r)),r}}else am=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:im(e);const i=Math.min(o,t.byteLength-n);t=t.subarray(n,n+i);let r=0,a=0;for(;r<e.length;){const n=e.codePointAt(r);if(n<=127){t[a++]=n,r++;continue}let o=0,i=0;for(n<=2047?(o=6,i=192):n<=65535?(o=12,i=224):n<=2097151&&(o=18,i=240),t[a++]=i|n>>o,o-=6;o>=0;)t[a++]=128|n>>o&63,o-=6;r+=n>=65536?2:1}return i};var cm={byteLength:im,toString:rm,write:am};function sm(t){return 2*t.length}var lm,dm,um={byteLength:sm,toString:function(t){const e=t.byteLength;let n="";for(let o=0;o<e-1;o+=2)n+=String.fromCharCode(t[o]+256*t[o+1]);return n},write:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:sm(e);const i=Math.min(o,t.byteLength-n);let r=i;for(let o=0;o<e.length&&!((r-=2)<0);++o){const i=e.charCodeAt(o),r=i>>8,a=i%256;t[n+2*o]=a,t[n+2*o+1]=r}return i}};!function(t,e){const n=W_,o=tm,i=nm,r=cm,a=um,c=255===new Uint8Array(Uint16Array.of(255).buffer)[0];function s(t){switch(t){case"ascii":return n;case"base64":return o;case"hex":return i;case"utf8":case"utf-8":case void 0:return r;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a;default:throw new Error("Unknown encoding: ".concat(t))}}function l(t){return t instanceof Uint8Array}function d(t,e,n){return"string"==typeof t?function(t,e){const n=s(e),o=new Uint8Array(n.byteLength(t));return n.write(o,t,0,o.byteLength),o}(t,e):Array.isArray(t)?function(t){const e=new Uint8Array(t.length);return e.set(t),e}(t):ArrayBuffer.isView(t)?function(t){const e=new Uint8Array(t.byteLength);return e.set(t),e}(t):function(t,e,n){return new Uint8Array(t,e,n)}(t,e,n)}function u(t,e,n,o,i){if(0===t.byteLength)return-1;if("string"==typeof n?(o=n,n=0):void 0===n?n=i?0:t.length-1:n<0&&(n+=t.byteLength),n>=t.byteLength){if(i)return-1;n=t.byteLength-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e)e=d(e,o);else if("number"==typeof e)return e&=255,i?t.indexOf(e,n):t.lastIndexOf(e,n);if(0===e.byteLength)return-1;if(i){let o=-1;for(let i=n;i<t.byteLength;i++)if(t[i]===e[-1===o?0:i-o]){if(-1===o&&(o=i),i-o+1===e.byteLength)return o}else-1!==o&&(i-=i-o),o=-1}else{n+e.byteLength>t.byteLength&&(n=t.byteLength-e.byteLength);for(let o=n;o>=0;o--){let n=!0;for(let i=0;i<e.byteLength;i++)if(t[o+i]!==e[i]){n=!1;break}if(n)return o}}return-1}function f(t,e,n,o){return u(t,e,n,o,!0)}function g(t,e,n){const o=t[e];t[e]=t[n],t[n]=o}t.exports=e={isBuffer:l,isEncoding:function(t){try{return s(t),!0}catch(t){return!1}},alloc:function(t,n,o){const i=new Uint8Array(t);return void 0!==n&&e.fill(i,n,0,i.byteLength,o),i},allocUnsafe:function(t){return new Uint8Array(t)},allocUnsafeSlow:function(t){return new Uint8Array(t)},byteLength:function(t,e){return s(e).byteLength(t)},compare:function(t,e){if(t===e)return 0;const n=Math.min(t.byteLength,e.byteLength);t=new DataView(t.buffer,t.byteOffset,t.byteLength),e=new DataView(e.buffer,e.byteOffset,e.byteLength);let o=0;for(let i=n-n%4;o<i&&t.getUint32(o,c)===e.getUint32(o,c);o+=4);for(;o<n;o++){const n=t.getUint8(o),i=e.getUint8(o);if(n<i)return-1;if(n>i)return 1}return t.byteLength>e.byteLength?1:t.byteLength<e.byteLength?-1:0},concat:function(t,e){void 0===e&&(e=t.reduce(((t,e)=>t+e.byteLength),0));const n=new Uint8Array(e);let o=0;for(const e of t){if(o+e.byteLength>n.byteLength){const t=e.subarray(0,n.byteLength-o);return n.set(t,o),n}n.set(e,o),o+=e.byteLength}return n},copy:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t.byteLength;if(i>0&&i<o)return 0;if(i===o)return 0;if(0===t.byteLength||0===e.byteLength)return 0;if(n<0)throw new RangeError("targetStart is out of range");if(o<0||o>=t.byteLength)throw new RangeError("sourceStart is out of range");if(i<0)throw new RangeError("sourceEnd is out of range");n>=e.byteLength&&(n=e.byteLength),i>t.byteLength&&(i=t.byteLength),e.byteLength-n<i-o&&(i=e.length-n+o);const r=i-o;return t===e?e.copyWithin(n,o,i):e.set(t.subarray(o,i),n),r},equals:function(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;const n=t.byteLength;t=new DataView(t.buffer,t.byteOffset,t.byteLength),e=new DataView(e.buffer,e.byteOffset,e.byteLength);let o=0;for(let i=n-n%4;o<i;o+=4)if(t.getUint32(o,c)!==e.getUint32(o,c))return!1;for(;o<n;o++)if(t.getUint8(o)!==e.getUint8(o))return!1;return!0},fill:function(t,e,n,o,i){if("string"==typeof e?"string"==typeof n?(i=n,n=0,o=t.byteLength):"string"==typeof o&&(i=o,o=t.byteLength):"number"==typeof e?e&=255:"boolean"==typeof e&&(e=+e),n<0||t.byteLength<n||t.byteLength<o)throw new RangeError("Out of range index");if(void 0===n&&(n=0),void 0===o&&(o=t.byteLength),o<=n)return t;if(e||(e=0),"number"==typeof e)for(let i=n;i<o;++i)t[i]=e;else{const r=(e=l(e)?e:d(e,i)).byteLength;for(let i=0;i<o-n;++i)t[i+n]=e[i%r]}return t},from:d,includes:function(t,e,n,o){return-1!==f(t,e,n,o)},indexOf:f,lastIndexOf:function(t,e,n,o){return u(t,e,n,o,!1)},swap16:function(t){const e=t.byteLength;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let n=0;n<e;n+=2)g(t,n,n+1);return t},swap32:function(t){const e=t.byteLength;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let n=0;n<e;n+=4)g(t,n,n+3),g(t,n+1,n+2);return t},swap64:function(t){const e=t.byteLength;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let n=0;n<e;n+=8)g(t,n,n+7),g(t,n+1,n+6),g(t,n+2,n+5),g(t,n+3,n+4);return t},toBuffer:function(t){return t},toString:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.byteLength;const i=t.byteLength;return n>=i||o<=n?"":(n<0&&(n=0),o>i&&(o=i),(0!==n||o<i)&&(t=t.subarray(n,o)),s(e).toString(t))},write:function(t,e,n,o,i){return void 0===n?i="utf8":void 0===o&&"string"==typeof n?(i=n,n=void 0):void 0===i&&"string"==typeof o&&(i=o,o=void 0),s(i).write(t,e,n,o)},writeDoubleLE:function(t,e,n){return void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(n,e,!0),n+8},writeFloatLE:function(t,e,n){return void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(n,e,!0),n+4},writeUInt32LE:function(t,e,n){return void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setUint32(n,e,!0),n+4},writeInt32LE:function(t,e,n){return void 0===n&&(n=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setInt32(n,e,!0),n+4},readDoubleLE:function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat64(e,!0)},readFloatLE:function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getFloat32(e,!0)},readUInt32LE:function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getUint32(e,!0)},readInt32LE:function(t,e){return void 0===e&&(e=0),new DataView(t.buffer,t.byteOffset,t.byteLength).getInt32(e,!0)}}}(Y_,Y_.exports);var fm=function t(e,n){if(!e){var o=new H_(n);throw Error.captureStackTrace&&Error.captureStackTrace(o,t),o}},gm=Y_.exports,hm=null,pm="undefined"!=typeof WebAssembly&&function(){if(dm)return lm;dm=1;var t=(()=>{for(var t=new Uint8Array(128),e=0;e<64;e++)t[e<26?e+65:e<52?e+71:e<62?e-4:4*e-205]=e;return e=>{for(var n=e.length,o=new Uint8Array(3*(n-("="==e[n-1])-("="==e[n-2]))/4|0),i=0,r=0;i<n;){var a=t[e.charCodeAt(i++)],c=t[e.charCodeAt(i++)],s=t[e.charCodeAt(i++)],l=t[e.charCodeAt(i++)];o[r++]=a<<2|c>>4,o[r++]=c<<4|s>>2,o[r++]=s<<6|l}return o}})(),e=((t,e)=>function(){return e||(0,t[Object.keys(t)[0]])((e={exports:{}}).exports,e),e.exports})({"wasm-binary:./blake2b.wat"(e,n){n.exports=t("AGFzbQEAAAABEANgAn9/AGADf39/AGABfwADBQQAAQICBQUBAQroBwdNBQZtZW1vcnkCAAxibGFrZTJiX2luaXQAAA5ibGFrZTJiX3VwZGF0ZQABDWJsYWtlMmJfZmluYWwAAhBibGFrZTJiX2NvbXByZXNzAAMKvz8EwAIAIABCADcDACAAQgA3AwggAEIANwMQIABCADcDGCAAQgA3AyAgAEIANwMoIABCADcDMCAAQgA3AzggAEIANwNAIABCADcDSCAAQgA3A1AgAEIANwNYIABCADcDYCAAQgA3A2ggAEIANwNwIABCADcDeCAAQoiS853/zPmE6gBBACkDAIU3A4ABIABCu86qptjQ67O7f0EIKQMAhTcDiAEgAEKr8NP0r+68tzxBECkDAIU3A5ABIABC8e30+KWn/aelf0EYKQMAhTcDmAEgAELRhZrv+s+Uh9EAQSApAwCFNwOgASAAQp/Y+dnCkdqCm39BKCkDAIU3A6gBIABC6/qG2r+19sEfQTApAwCFNwOwASAAQvnC+JuRo7Pw2wBBOCkDAIU3A7gBIABCADcDwAEgAEIANwPIASAAQgA3A9ABC20BA38gAEHAAWohAyAAQcgBaiEEIAQpAwCnIQUCQANAIAEgAkYNASAFQYABRgRAIAMgAykDACAFrXw3AwBBACEFIAAQAwsgACAFaiABLQAAOgAAIAVBAWohBSABQQFqIQEMAAsLIAQgBa03AwALYQEDfyAAQcABaiEBIABByAFqIQIgASABKQMAIAIpAwB8NwMAIABCfzcD0AEgAikDAKchAwJAA0AgA0GAAUYNASAAIANqQQA6AAAgA0EBaiEDDAALCyACIAOtNwMAIAAQAwuqOwIgfgl/IABBgAFqISEgAEGIAWohIiAAQZABaiEjIABBmAFqISQgAEGgAWohJSAAQagBaiEmIABBsAFqIScgAEG4AWohKCAhKQMAIQEgIikDACECICMpAwAhAyAkKQMAIQQgJSkDACEFICYpAwAhBiAnKQMAIQcgKCkDACEIQoiS853/zPmE6gAhCUK7zqqm2NDrs7t/IQpCq/DT9K/uvLc8IQtC8e30+KWn/aelfyEMQtGFmu/6z5SH0QAhDUKf2PnZwpHagpt/IQ5C6/qG2r+19sEfIQ9C+cL4m5Gjs/DbACEQIAApAwAhESAAKQMIIRIgACkDECETIAApAxghFCAAKQMgIRUgACkDKCEWIAApAzAhFyAAKQM4IRggACkDQCEZIAApA0ghGiAAKQNQIRsgACkDWCEcIAApA2AhHSAAKQNoIR4gACkDcCEfIAApA3ghICANIAApA8ABhSENIA8gACkD0AGFIQ8gASAFIBF8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSASfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgE3x8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBR8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAVfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgFnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBd8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAYfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgGXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBp8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAbfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgHHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIB18fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAefHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgH3x8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFICB8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAffHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgG3x8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBV8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAZfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgGnx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHICB8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAefHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggF3x8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBJ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAdfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgEXx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBN8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAcfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGHx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBZ8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAUfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgHHx8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBl8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAdfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgEXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBZ8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByATfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggIHx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIB58fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAbfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgH3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBR8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAXfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggGHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBJ8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAafHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFXx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBh8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAafHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgFHx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBJ8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAefHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHXx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBx8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAffHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgE3x8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBd8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAWfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgG3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBV8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCARfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgIHx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBl8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAafHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEXx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBZ8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAYfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgE3x8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBV8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAbfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggIHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIB98fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiASfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgHHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIB18fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAXfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggGXx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBR8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAefHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgE3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIB18fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAXfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgG3x8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBF8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAcfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggGXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBR8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAVfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHnx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBh8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAWfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggIHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIB98fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSASfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgGnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIB18fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSAWfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgEnx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGICB8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAffHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgHnx8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBV8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAbfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgEXx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBh8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAXfHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgFHx8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBp8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCATfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgGXx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBx8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSAefHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgHHx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBh8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAffHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgHXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBJ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAUfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGnx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBZ8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiARfHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgIHx8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBV8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAZfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggF3x8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIBN8fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAbfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgF3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFICB8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAffHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGnx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBx8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAUfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggEXx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBl8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiAdfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgE3x8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIB58fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByAYfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggEnx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBV8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAbfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFnx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgASAFIBt8fCEBIA0gAYVCIIohDSAJIA18IQkgBSAJhUIYiiEFIAEgBSATfHwhASANIAGFQhCKIQ0gCSANfCEJIAUgCYVCP4ohBSACIAYgGXx8IQIgDiAChUIgiiEOIAogDnwhCiAGIAqFQhiKIQYgAiAGIBV8fCECIA4gAoVCEIohDiAKIA58IQogBiAKhUI/iiEGIAMgByAYfHwhAyAPIAOFQiCKIQ8gCyAPfCELIAcgC4VCGIohByADIAcgF3x8IQMgDyADhUIQiiEPIAsgD3whCyAHIAuFQj+KIQcgBCAIIBJ8fCEEIBAgBIVCIIohECAMIBB8IQwgCCAMhUIYiiEIIAQgCCAWfHwhBCAQIASFQhCKIRAgDCAQfCEMIAggDIVCP4ohCCABIAYgIHx8IQEgECABhUIgiiEQIAsgEHwhCyAGIAuFQhiKIQYgASAGIBx8fCEBIBAgAYVCEIohECALIBB8IQsgBiALhUI/iiEGIAIgByAafHwhAiANIAKFQiCKIQ0gDCANfCEMIAcgDIVCGIohByACIAcgH3x8IQIgDSAChUIQiiENIAwgDXwhDCAHIAyFQj+KIQcgAyAIIBR8fCEDIA4gA4VCIIohDiAJIA58IQkgCCAJhUIYiiEIIAMgCCAdfHwhAyAOIAOFQhCKIQ4gCSAOfCEJIAggCYVCP4ohCCAEIAUgHnx8IQQgDyAEhUIgiiEPIAogD3whCiAFIAqFQhiKIQUgBCAFIBF8fCEEIA8gBIVCEIohDyAKIA98IQogBSAKhUI/iiEFIAEgBSARfHwhASANIAGFQiCKIQ0gCSANfCEJIAUgCYVCGIohBSABIAUgEnx8IQEgDSABhUIQiiENIAkgDXwhCSAFIAmFQj+KIQUgAiAGIBN8fCECIA4gAoVCIIohDiAKIA58IQogBiAKhUIYiiEGIAIgBiAUfHwhAiAOIAKFQhCKIQ4gCiAOfCEKIAYgCoVCP4ohBiADIAcgFXx8IQMgDyADhUIgiiEPIAsgD3whCyAHIAuFQhiKIQcgAyAHIBZ8fCEDIA8gA4VCEIohDyALIA98IQsgByALhUI/iiEHIAQgCCAXfHwhBCAQIASFQiCKIRAgDCAQfCEMIAggDIVCGIohCCAEIAggGHx8IQQgECAEhUIQiiEQIAwgEHwhDCAIIAyFQj+KIQggASAGIBl8fCEBIBAgAYVCIIohECALIBB8IQsgBiALhUIYiiEGIAEgBiAafHwhASAQIAGFQhCKIRAgCyAQfCELIAYgC4VCP4ohBiACIAcgG3x8IQIgDSAChUIgiiENIAwgDXwhDCAHIAyFQhiKIQcgAiAHIBx8fCECIA0gAoVCEIohDSAMIA18IQwgByAMhUI/iiEHIAMgCCAdfHwhAyAOIAOFQiCKIQ4gCSAOfCEJIAggCYVCGIohCCADIAggHnx8IQMgDiADhUIQiiEOIAkgDnwhCSAIIAmFQj+KIQggBCAFIB98fCEEIA8gBIVCIIohDyAKIA98IQogBSAKhUIYiiEFIAQgBSAgfHwhBCAPIASFQhCKIQ8gCiAPfCEKIAUgCoVCP4ohBSABIAUgH3x8IQEgDSABhUIgiiENIAkgDXwhCSAFIAmFQhiKIQUgASAFIBt8fCEBIA0gAYVCEIohDSAJIA18IQkgBSAJhUI/iiEFIAIgBiAVfHwhAiAOIAKFQiCKIQ4gCiAOfCEKIAYgCoVCGIohBiACIAYgGXx8IQIgDiAChUIQiiEOIAogDnwhCiAGIAqFQj+KIQYgAyAHIBp8fCEDIA8gA4VCIIohDyALIA98IQsgByALhUIYiiEHIAMgByAgfHwhAyAPIAOFQhCKIQ8gCyAPfCELIAcgC4VCP4ohByAEIAggHnx8IQQgECAEhUIgiiEQIAwgEHwhDCAIIAyFQhiKIQggBCAIIBd8fCEEIBAgBIVCEIohECAMIBB8IQwgCCAMhUI/iiEIIAEgBiASfHwhASAQIAGFQiCKIRAgCyAQfCELIAYgC4VCGIohBiABIAYgHXx8IQEgECABhUIQiiEQIAsgEHwhCyAGIAuFQj+KIQYgAiAHIBF8fCECIA0gAoVCIIohDSAMIA18IQwgByAMhUIYiiEHIAIgByATfHwhAiANIAKFQhCKIQ0gDCANfCEMIAcgDIVCP4ohByADIAggHHx8IQMgDiADhUIgiiEOIAkgDnwhCSAIIAmFQhiKIQggAyAIIBh8fCEDIA4gA4VCEIohDiAJIA58IQkgCCAJhUI/iiEIIAQgBSAWfHwhBCAPIASFQiCKIQ8gCiAPfCEKIAUgCoVCGIohBSAEIAUgFHx8IQQgDyAEhUIQiiEPIAogD3whCiAFIAqFQj+KIQUgISAhKQMAIAEgCYWFNwMAICIgIikDACACIAqFhTcDACAjICMpAwAgAyALhYU3AwAgJCAkKQMAIAQgDIWFNwMAICUgJSkDACAFIA2FhTcDACAmICYpAwAgBiAOhYU3AwAgJyAnKQMAIAcgD4WFNwMAICggKCkDACAIIBCFhTcDAAs=")}}),n=e(),o=WebAssembly.compile(n);return lm=async t=>(await WebAssembly.instantiate(await o,t)).exports}()().then((t=>{hm=t})),_m=64,mm=[];V_.exports=xm;var ym=V_.exports.BYTES_MIN=16,Lm=V_.exports.BYTES_MAX=64;V_.exports.BYTES=32;var bm=V_.exports.KEYBYTES_MIN=16,Am=V_.exports.KEYBYTES_MAX=64;V_.exports.KEYBYTES=32;var wm=V_.exports.SALTBYTES=16,Im=V_.exports.PERSONALBYTES=16;function xm(t,e,n,o,i){if(!(this instanceof xm))return new xm(t,e,n,o,i);if(!hm)throw new Error("WASM not loaded. Wait for Blake2b.ready(cb)");t||(t=32),!0!==i&&(fm(t>=ym,"digestLength must be at least "+ym+", was given "+t),fm(t<=Lm,"digestLength must be at most "+Lm+", was given "+t),null!=e&&(fm(e instanceof Uint8Array,"key must be Uint8Array or Buffer"),fm(e.length>=bm,"key must be at least "+bm+", was given "+e.length),fm(e.length<=Am,"key must be at least "+Am+", was given "+e.length)),null!=n&&(fm(n instanceof Uint8Array,"salt must be Uint8Array or Buffer"),fm(n.length===wm,"salt must be exactly "+wm+", was given "+n.length)),null!=o&&(fm(o instanceof Uint8Array,"personal must be Uint8Array or Buffer"),fm(o.length===Im,"personal must be exactly "+Im+", was given "+o.length))),mm.length||(mm.push(_m),_m+=216),this.digestLength=t,this.finalized=!1,this.pointer=mm.pop(),this._memory=new Uint8Array(hm.memory.buffer),this._memory.fill(0,0,64),this._memory[0]=this.digestLength,this._memory[1]=e?e.length:0,this._memory[2]=1,this._memory[3]=1,n&&this._memory.set(n,32),o&&this._memory.set(o,48),this.pointer+216>this._memory.length&&this._realloc(this.pointer+216),hm.blake2b_init(this.pointer,this.digestLength),e&&(this.update(e),this._memory.fill(0,_m,_m+e.length),this._memory[this.pointer+200]=128)}function Cm(){}function vm(t){return(4294901760&t?(t&=4294901760,16):0)|(4278255360&t?(t&=4278255360,8):0)|(4042322160&t?(t&=4042322160,4):0)|(3435973836&t?(t&=3435973836,2):0)|!!(2863311530&t)}xm.prototype._realloc=function(t){hm.memory.grow(Math.max(0,Math.ceil(Math.abs(t-this._memory.length)/65536))),this._memory=new Uint8Array(hm.memory.buffer)},xm.prototype.update=function(t){return fm(!1===this.finalized,"Hash instance finalized"),fm(t instanceof Uint8Array,"input must be Uint8Array or Buffer"),_m+t.length>this._memory.length&&this._realloc(_m+t.length),this._memory.set(t,_m),hm.blake2b_update(this.pointer,_m,_m+t.length),this},xm.prototype.digest=function(t){if(fm(!1===this.finalized,"Hash instance finalized"),this.finalized=!0,mm.push(this.pointer),hm.blake2b_final(this.pointer),!t||"binary"===t)return this._memory.slice(this.pointer+128,this.pointer+128+this.digestLength);if("string"==typeof t)return gm.toString(this._memory,t,this.pointer+128,this.pointer+128+this.digestLength);fm(t instanceof Uint8Array&&t.length>=this.digestLength,"input must be Uint8Array or Buffer");for(var e=0;e<this.digestLength;e++)t[e]=this._memory[this.pointer+128+e];return t},xm.prototype.final=xm.prototype.digest,xm.WASM=hm,xm.SUPPORTED="undefined"!=typeof WebAssembly,xm.ready=function(t){return t||(t=Cm),pm?pm.then((()=>t()),t):t(new Error("WebAssembly not supported"))},xm.prototype.ready=xm.ready,xm.prototype.getPartialHash=function(){return this._memory.slice(this.pointer,this.pointer+216)},xm.prototype.setPartialHash=function(t){this._memory.set(t,this.pointer)};async function Em(t,e,n){const o=await t.read(2*e.G1.F.n8),i=e.G1.fromRprLEM(o,0);return n?e.G1.toObject(i):i}async function Bm(t,e,n){const o=await t.read(2*e.G2.F.n8),i=e.G2.fromRprLEM(o,0);return n?e.G2.toObject(i):i}const{stringifyBigInts:Fm}=y_;async function Om(t,e,n,o){const{fd:i,sections:r}=await k_(e,"wtns",2),a=await async function(t,e){await z_(t,e,1);const n=await t.readULE32(),o=await N_(t,n),i=await t.readULE32();return await Q_(t),{n8:n,q:o,nWitness:i}}(i,r),{fd:c,sections:s}=await k_(t,"zkey",2),l=await async function(t,e,n,o){await z_(t,e,1);const i=await t.readULE32();if(await Q_(t),1===i)return await async function(t,e,n,o){const i={protocol:"groth16"};await z_(t,e,2);const r=await t.readULE32();i.n8q=r,i.q=await N_(t,r);const a=await t.readULE32();return i.n8r=a,i.r=await N_(t,a),i.curve=await G_(i.q,o),i.nVars=await t.readULE32(),i.nPublic=await t.readULE32(),i.domainSize=await t.readULE32(),i.power=vm(i.domainSize),i.vk_alpha_1=await Em(t,i.curve,n),i.vk_beta_1=await Em(t,i.curve,n),i.vk_beta_2=await Bm(t,i.curve,n),i.vk_gamma_2=await Bm(t,i.curve,n),i.vk_delta_1=await Em(t,i.curve,n),i.vk_delta_2=await Bm(t,i.curve,n),await Q_(t),i}(t,e,n,o);if(2===i)return await async function(t,e,n,o){const i={protocol:"plonk"};await z_(t,e,2);const r=await t.readULE32();i.n8q=r,i.q=await N_(t,r);const a=await t.readULE32();return i.n8r=a,i.r=await N_(t,a),i.curve=await G_(i.q,o),i.nVars=await t.readULE32(),i.nPublic=await t.readULE32(),i.domainSize=await t.readULE32(),i.power=vm(i.domainSize),i.nAdditions=await t.readULE32(),i.nConstraints=await t.readULE32(),i.k1=await t.read(a),i.k2=await t.read(a),i.Qm=await Em(t,i.curve,n),i.Ql=await Em(t,i.curve,n),i.Qr=await Em(t,i.curve,n),i.Qo=await Em(t,i.curve,n),i.Qc=await Em(t,i.curve,n),i.S1=await Em(t,i.curve,n),i.S2=await Em(t,i.curve,n),i.S3=await Em(t,i.curve,n),i.X_2=await Bm(t,i.curve,n),await Q_(t),i}(t,e,n,o);if(10===i)return await async function(t,e,n,o){const i={protocol:"fflonk",protocolId:10};await z_(t,e,2);const r=await t.readULE32();i.n8q=r,i.q=await N_(t,r),i.curve=await G_(i.q,o);const a=await t.readULE32();return i.n8r=a,i.r=await N_(t,a),i.nVars=await t.readULE32(),i.nPublic=await t.readULE32(),i.domainSize=await t.readULE32(),i.power=vm(i.domainSize),i.nAdditions=await t.readULE32(),i.nConstraints=await t.readULE32(),i.k1=await t.read(a),i.k2=await t.read(a),i.w3=await t.read(a),i.w4=await t.read(a),i.w8=await t.read(a),i.wr=await t.read(a),i.X_2=await Bm(t,i.curve,n),i.C0=await Em(t,i.curve,n),await Q_(t),i}(t,e,n,o);throw new Error("Protocol not supported: ")}(c,s,void 0,o);if("groth16"!=l.protocol)throw new Error("zkey file is not groth16");if(!m_.eq(l.r,a.q))throw new Error("Curve of the witness does not match the curve of the proving key");if(a.nWitness!=l.nVars)throw new Error("Invalid witness length. Circuit: ".concat(l.nVars,", witness: ").concat(a.nWitness));const d=l.curve,u=d.Fr,f=d.G1,g=d.G2,h=vm(l.domainSize);n&&n.debug("Reading Wtns");const p=await D_(i,r,2);n&&n.debug("Reading Coeffs");const _=await D_(c,s,4);n&&n.debug("Building ABC");const[m,y,L]=await async function(t,e,n,o,i){const r=t.Fr.n8,a=12+e.n8r,c=(o.byteLength-4)/a,s=new Qp(e.domainSize*r),l=new Qp(e.domainSize*r),d=new Qp(e.domainSize*r),u=[s,l];for(let e=0;e<c;e++){i&&e%1e6==0&&i.debug("QAP AB: ".concat(e,"/").concat(c));const s=o.slice(4+e*a,4+e*a+a),l=new DataView(s.buffer),d=l.getUint32(0,!0),f=l.getUint32(4,!0),g=l.getUint32(8,!0),h=s.slice(12,12+r);u[d].set(t.Fr.add(u[d].slice(f*r,f*r+r),t.Fr.mul(h,n.slice(g*r,g*r+r))),f*r)}for(let n=0;n<e.domainSize;n++)i&&n%1e6==0&&i.debug("QAP C: ".concat(n,"/").concat(e.domainSize)),d.set(t.Fr.mul(s.slice(n*r,n*r+r),l.slice(n*r,n*r+r)),n*r);return[s,l,d]}(d,l,p,_,n),b=h==u.s?d.Fr.shift:d.Fr.w[h+1],A=await u.ifft(m,"","",n,"IFFT_A"),w=await u.batchApplyKey(A,u.e(1),b),I=await u.fft(w,"","",n,"FFT_A"),x=await u.ifft(y,"","",n,"IFFT_B"),C=await u.batchApplyKey(x,u.e(1),b),v=await u.fft(C,"","",n,"FFT_B"),E=await u.ifft(L,"","",n,"IFFT_C"),B=await u.batchApplyKey(E,u.e(1),b),F=await u.fft(B,"","",n,"FFT_C");n&&n.debug("Join ABC");const O=await async function(t,e,n,o,i,r){const a=1<<22,c=t.Fr.n8,s=Math.floor(n.byteLength/t.Fr.n8),l=[];for(let e=0;e<s;e+=a){r&&r.debug("JoinABC: ".concat(e,"/").concat(s));const d=Math.min(s-e,a),u=[],f=n.slice(e*c,(e+d)*c),g=o.slice(e*c,(e+d)*c),h=i.slice(e*c,(e+d)*c);u.push({cmd:"ALLOCSET",var:0,buff:f}),u.push({cmd:"ALLOCSET",var:1,buff:g}),u.push({cmd:"ALLOCSET",var:2,buff:h}),u.push({cmd:"ALLOC",var:3,len:d*c}),u.push({cmd:"CALL",fnName:"qap_joinABC",params:[{var:0},{var:1},{var:2},{val:d},{var:3}]}),u.push({cmd:"CALL",fnName:"frm_batchFromMontgomery",params:[{var:3},{val:d},{var:3}]}),u.push({cmd:"GET",out:0,var:3,len:d*c}),l.push(t.tm.queueAction(u))}const d=await Promise.all(l);let u;u=n instanceof Qp?new Qp(n.byteLength):new Uint8Array(n.byteLength);let f=0;for(let t=0;t<d.length;t++)u.set(d[t][0],f),f+=d[t][0].byteLength;return u}(d,0,I,v,F,n);let S={};n&&n.debug("Reading A Points");const P=await D_(c,s,5);S.pi_a=await d.G1.multiExpAffine(P,p,n,"multiexp A"),n&&n.debug("Reading B1 Points");const j=await D_(c,s,6);let U=await d.G1.multiExpAffine(j,p,n,"multiexp B1");n&&n.debug("Reading B2 Points");const k=await D_(c,s,7);S.pi_b=await d.G2.multiExpAffine(k,p,n,"multiexp B2"),n&&n.debug("Reading C Points");const M=await D_(c,s,8);S.pi_c=await d.G1.multiExpAffine(M,p.slice((l.nPublic+1)*d.Fr.n8),n,"multiexp C"),n&&n.debug("Reading H Points");const T=await D_(c,s,9),z=await d.G1.multiExpAffine(T,O,n,"multiexp H"),Q=d.Fr.random(),N=d.Fr.random();S.pi_a=f.add(S.pi_a,l.vk_alpha_1),S.pi_a=f.add(S.pi_a,f.timesFr(l.vk_delta_1,Q)),S.pi_b=g.add(S.pi_b,l.vk_beta_2),S.pi_b=g.add(S.pi_b,g.timesFr(l.vk_delta_2,N)),U=f.add(U,l.vk_beta_1),U=f.add(U,f.timesFr(l.vk_delta_1,N)),S.pi_c=f.add(S.pi_c,z),S.pi_c=f.add(S.pi_c,f.timesFr(S.pi_a,N)),S.pi_c=f.add(S.pi_c,f.timesFr(U,Q)),S.pi_c=f.add(S.pi_c,f.timesFr(l.vk_delta_1,u.neg(u.mul(Q,N))));let D=[];for(let t=1;t<=l.nPublic;t++){const e=p.slice(t*u.n8,t*u.n8+u.n8);D.push(m_.fromRprLE(e))}return S.pi_a=f.toObject(f.toAffine(S.pi_a)),S.pi_b=g.toObject(g.toAffine(S.pi_b)),S.pi_c=f.toObject(f.toAffine(S.pi_c)),S.protocol="groth16",S.curve=d.name,await c.close(),await i.close(),S=Fm(S),D=Fm(D),{proof:S,publicSignals:D}}function Sm(t){let e=[];return function t(e,n){if(Array.isArray(n))for(let o=0;o<n.length;o++)t(e,n[o]);else e.push(n)}(e,t),e}function Pm(t,e){let n=BigInt(t)%e;return n<0&&(n+=e),n}function jm(t){const e=BigInt(2)**BigInt(64);let n=BigInt("0xCBF29CE484222325");for(let o=0;o<t.length;o++)n^=BigInt(t[o].charCodeAt(0)),n*=BigInt(1099511628211),n%=e;let o=n.toString(16),i=16-o.length;return o="0".repeat(i).concat(o),o}function Um(t,e){const n=[];let o=BigInt(t);const i=BigInt(4294967296);for(;o;)n.unshift(Number(o%i)),o/=i;if(e){let t=e-n.length;for(;t>0;)n.unshift(0),t--}return n}class km{constructor(t,e,n){this.memory=t,this.i32=new Uint32Array(t.buffer),this.instance=e,this.n32=(this.instance.exports.getFrLen()>>2)-2;const o=this.instance.exports.getPRawPrime(),i=new Array(this.n32);for(let t=0;t<this.n32;t++)i[this.n32-1-t]=this.i32[(o>>2)+t];this.prime=m_.fromArray(i,4294967296),this.Fr=new eh(this.prime),this.mask32=m_.fromString("FFFFFFFF",16),this.NVars=this.instance.exports.getNVars(),this.n64=Math.floor((this.Fr.bitLength-1)/64)+1,this.R=this.Fr.e(m_.shiftLeft(1,64*this.n64)),this.RInv=this.Fr.inv(this.R),this.sanityCheck=n}circom_version(){return 1}async _doCalculateWitness(t,e){this.instance.exports.init(this.sanityCheck||e?1:0);const n=this.allocInt(),o=this.allocFr();Object.keys(t).forEach((e=>{const i=jm(e),r=parseInt(i.slice(0,8),16),a=parseInt(i.slice(8,16),16);try{this.instance.exports.getSignalOffset32(n,0,r,a)}catch(t){throw new Error("Signal ".concat(e," is not an input of the circuit."))}const c=this.getInt(n),s=Sm(t[e]);for(let t=0;t<s.length;t++)this.setFr(o,s[t]),this.instance.exports.setSignal(0,0,c+t,o)}))}async calculateWitness(t,e){const n=this,o=n.i32[0],i=[];await n._doCalculateWitness(t,e);for(let t=0;t<n.NVars;t++){const e=n.instance.exports.getPWitness(t);i.push(n.getFr(e))}return n.i32[0]=o,i}async calculateBinWitness(t,e){const n=this,o=n.i32[0];await n._doCalculateWitness(t,e);const i=n.instance.exports.getWitnessBuffer();n.i32[0]=o;const r=n.memory.buffer.slice(i,i+n.NVars*n.n64*8);return new Uint8Array(r)}allocInt(){const t=this.i32[0];return this.i32[0]=t+8,t}allocFr(){const t=this.i32[0];return this.i32[0]=t+4*this.n32+8,t}getInt(t){return this.i32[t>>2]}setInt(t,e){this.i32[t>>2]=e}getFr(t){const e=this,n=t>>2;if(2147483648&e.i32[n+1]){const t=new Array(e.n32);for(let o=0;o<e.n32;o++)t[e.n32-1-o]=e.i32[n+2+o];const o=e.Fr.e(m_.fromArray(t,4294967296));return 1073741824&e.i32[n+1]?function(t){return e.Fr.mul(e.RInv,t)}(o):o}return 2147483648&e.i32[n]?e.Fr.e(e.i32[n]-4294967296):e.Fr.e(e.i32[n])}setFr(t,e){const n=this;e=n.Fr.e(e);const o=n.Fr.neg(n.Fr.e("80000000",16)),i=n.Fr.e("7FFFFFFF",16);if(n.Fr.geq(e,o)&&n.Fr.leq(e,i)){let i;return n.Fr.geq(e,n.Fr.zero)?i=m_.toNumber(e):(i=m_.toNumber(n.Fr.sub(e,o)),i-=2147483648,i=4294967296+i),n.i32[t>>2]=i,void(n.i32[1+(t>>2)]=0)}n.i32[t>>2]=0,n.i32[1+(t>>2)]=2147483648;const r=m_.toArray(e,4294967296);for(let e=0;e<n.n32;e++){const o=r.length-1-e;n.i32[2+(t>>2)+e]=o>=0?r[o]:0}}}class Mm{constructor(t,e){this.instance=t,this.version=this.instance.exports.getVersion(),this.n32=this.instance.exports.getFieldNumLen32(),this.instance.exports.getRawPrime();const n=new Uint32Array(this.n32);for(let t=0;t<this.n32;t++)n[this.n32-1-t]=this.instance.exports.readSharedRWMemory(t);this.prime=m_.fromArray(n,4294967296),this.witnessSize=this.instance.exports.getWitnessSize(),this.sanityCheck=e}circom_version(){return this.instance.exports.getVersion()}async _doCalculateWitness(t,e){this.instance.exports.init(this.sanityCheck||e?1:0);const n=Object.keys(t);let o=0;if(n.forEach((e=>{const n=jm(e),i=parseInt(n.slice(0,8),16),r=parseInt(n.slice(8,16),16),a=Sm(t[e]);if("function"==typeof this.instance.exports.getInputSignalSize){let t=this.instance.exports.getInputSignalSize(i,r);if(t<0)throw new Error("Signal ".concat(e," not found\n"));if(a.length<t)throw new Error("Not enough values for input signal ".concat(e,"\n"));if(a.length>t)throw new Error("Too many values for input signal ".concat(e,"\n"))}for(let t=0;t<a.length;t++){const e=Um(Pm(a[t],this.prime),this.n32);for(let t=0;t<this.n32;t++)this.instance.exports.writeSharedRWMemory(t,e[this.n32-1-t]);try{this.instance.exports.setInputSignal(i,r,t),o++}catch(t){throw new Error(t)}}})),o<this.instance.exports.getInputSize())throw new Error("Not all inputs have been set. Only ".concat(o," out of ").concat(this.instance.exports.getInputSize()))}async calculateWitness(t,e){const n=[];await this._doCalculateWitness(t,e);for(let t=0;t<this.witnessSize;t++){this.instance.exports.getWitness(t);const e=new Uint32Array(this.n32);for(let t=0;t<this.n32;t++)e[this.n32-1-t]=this.instance.exports.readSharedRWMemory(t);n.push(m_.fromArray(e,4294967296))}return n}async calculateWTNSBin(t,e){const n=new Uint32Array(this.witnessSize*this.n32+this.n32+11),o=new Uint8Array(n.buffer);await this._doCalculateWitness(t,e),o[0]="w".charCodeAt(0),o[1]="t".charCodeAt(0),o[2]="n".charCodeAt(0),o[3]="s".charCodeAt(0),n[1]=2,n[2]=2,n[3]=1;const i=4*this.n32,r=(8+i).toString(16);n[4]=parseInt(r.slice(0,8),16),n[5]=parseInt(r.slice(8,16),16),n[6]=i,this.instance.exports.getRawPrime();let a=7;for(let t=0;t<this.n32;t++)n[a+t]=this.instance.exports.readSharedRWMemory(t);a+=this.n32,n[a]=this.witnessSize,a++,n[a]=2,a++;const c=(i*this.witnessSize).toString(16);n[a]=parseInt(c.slice(0,8),16),n[a+1]=parseInt(c.slice(8,16),16),a+=2;for(let t=0;t<this.witnessSize;t++){this.instance.exports.getWitness(t);for(let t=0;t<this.n32;t++)n[a+t]=this.instance.exports.readSharedRWMemory(t);a+=this.n32}return o}}const{unstringifyBigInts:Tm}=y_;async function zm(t,e,n,o){const i=Tm(t),r=await U_(e),a=await r.read(r.totalSize);await r.close();const c=await async function(t,e){let n,o,i;e=e||{};let r=1,a=0,c=0,s=!1;if(t instanceof WebAssembly.Instance)n=t,s=!0;else{let s=32767;if(e.memorySize&&(s=parseInt(e.memorySize),s<0))throw new Error("Invalid memory size");let l=!1;for(;!l;)try{i=new WebAssembly.Memory({initial:s}),l=!0}catch(t){if(s<=1)throw t;console.warn("Could not allocate "+1024*s*64+" bytes. This may cause severe instability. Trying with "+1024*s*64/2+" bytes"),s=Math.floor(s/2)}const f=await WebAssembly.compile(t);let g="",h="";n=await WebAssembly.instantiate(f,{env:{memory:i},runtime:{printDebug:function(t){console.log("printDebug:",t)},exceptionHandler:function(t){let e;throw e=1===t?"Signal not found. ":2===t?"Too many signals set. ":3===t?"Signal already set. ":4===t?"Assert Failed. ":5===t?"Not enough memory. ":6===t?"Input signal array access exceeds the size. ":"Unknown error. ",console.error("ERROR: ",t,g),new Error(e+g)},printErrorMessage:function(){g+=d()+"\n"},writeBufferMessage:function(){const t=d();"\n"===t?(console.log(h),h=""):(""!==h&&(h+=" "),h+=t)},showSharedRWMemory:function(){const t=n.exports.getFieldNumLen32(),e=new Uint32Array(t);for(let o=0;o<t;o++)e[t-1-o]=n.exports.readSharedRWMemory(o);if(r>=2&&(a>=1||c>=7)){""!==h&&(h+=" ");const t=m_.fromArray(e,4294967296).toString();h+=t}else console.log(m_.fromArray(e,4294967296))},error:function(t,n,i,r,a,c){let s;throw s=7===t?u(n)+" "+o.getFr(r).toString()+" != "+o.getFr(a).toString()+" "+u(c):9===t?u(n)+" "+o.getFr(r).toString()+" "+u(a):5===t&&e.sym?u(n)+" "+e.sym.labelIdx2Name[a]:u(n)+" "+i+" "+r+" "+a+" "+c,console.log("ERROR: ",t,s),new Error(s)},log:function(t){console.log(o.getFr(t).toString())},logGetSignal:function(t,n){e.logGetSignal&&e.logGetSignal(t,o.getFr(n))},logSetSignal:function(t,n){e.logSetSignal&&e.logSetSignal(t,o.getFr(n))},logStartComponent:function(t){e.logStartComponent&&e.logStartComponent(t)},logFinishComponent:function(t){e.logFinishComponent&&e.logFinishComponent(t)}}})}"function"==typeof n.exports.getVersion&&(r=n.exports.getVersion()),"function"==typeof n.exports.getMinorVersion&&(a=n.exports.getMinorVersion()),"function"==typeof n.exports.getPatchVersion&&(c=n.exports.getPatchVersion());const l=e&&(e.sanityCheck||e.logGetSignal||e.logSetSignal||e.logStartComponent||e.logFinishComponent);if(2===r)o=new Mm(n,l);else{if(1!==r)throw new Error("Unsupported circom version: ".concat(r));if(s)throw new Error("Loading code from WebAssembly instance is not supported for circom version 1");o=new km(i,n,l)}return o;function d(){let t="",e=n.exports.getMessageChar();for(;0!==e;)t+=String.fromCharCode(e),e=n.exports.getMessageChar();return t}function u(t){const e=new Uint8Array(i.buffer),n=[];for(let o=0;e[t+o]>0;o++)n.push(e[t+o]);return String.fromCharCode.apply(null,n)}}(a,o);if(1===c.circom_version()){const t=await c.calculateBinWitness(i),e=await async function(t,e,n,o,i,r){const a=await j_(t,i,r),c=new Uint8Array(4);for(let t=0;t<4;t++)c[t]=e.charCodeAt(t);return await a.write(c,0),await a.writeULE32(n),await a.writeULE32(o),a}(n,"wtns",2,2);await async function(t,e,n){await M_(t,1);const o=8*(Math.floor((m_.bitLength(n)-1)/64)+1);if(await t.writeULE32(o),await async function(t,e,n,o){const i=new Uint8Array(n);m_.toRprLE(i,0,e,n),await t.write(i,o)}(t,n,o),e.byteLength%o!=0)throw new Error("Invalid witness length");await t.writeULE32(e.byteLength/o),await T_(t),await M_(t,2),await t.write(e),await T_(t)}(e,t,c.prime),await e.close()}else{const t=await j_(n),e=await c.calculateWTNSBin(i);await t.write(e),await t.close()}}const{unstringifyBigInts:Qm}=y_,{unstringifyBigInts:Nm}=y_,{unstringifyBigInts:Dm}=y_;function Rm(t){let e=t.toString(16);for(;e.length<64;)e="0"+e;return e='"0x'.concat(e,'"'),e}var qm=Object.freeze({__proto__:null,fullProve:async function(t,e,n,o,i,r){const a=Qm(t),c={type:"mem"};return await zm(a,e,c,i),await Om(n,c,o,r)},prove:Om,verify:async function(t,e,n,o){const i=Nm(t),r=Nm(n),a=Nm(e),c=await async function(t,e){let n,o=e&&e.singleThread;const i=function(t){return t.toUpperCase().match(/[A-Za-z0-9]+/g).join("")}(t);if(["BN128","BN254","ALTBN128"].indexOf(i)>=0)n=await p_(o);else{if(!(["BLS12381"].indexOf(i)>=0))throw new Error("Curve not supported: ".concat(t));n=await __(o)}return n}(i.curve),s=c.G1.fromObject(i.IC[0]),l=new Uint8Array(2*c.G1.F.n8*a.length),d=new Uint8Array(c.Fr.n8*a.length);if(!function(t,e){for(let n=0;n<e.length;n++)if(!m_.lt(e[n],t.r))return!1;return!0}(c,a))return o&&o.error("Public inputs are not valid."),!1;for(let t=0;t<a.length;t++){const e=c.G1.fromObject(i.IC[t+1]);l.set(e,t*c.G1.F.n8*2),m_.toRprLE(d,c.Fr.n8*t,a[t],c.Fr.n8)}let u=await c.G1.multiExpAffine(l,d);u=c.G1.add(u,s);const f=c.G1.fromObject(r.pi_a),g=c.G2.fromObject(r.pi_b),h=c.G1.fromObject(r.pi_c);if(!function(t,e){const n=t.G1,o=t.G2;return n.isValid(e.pi_a)&&o.isValid(e.pi_b)&&n.isValid(e.pi_c)}(c,{pi_a:f,pi_b:g,pi_c:h}))return o&&o.error("Proof commitments are not valid."),!1;const p=c.G2.fromObject(i.vk_gamma_2),_=c.G2.fromObject(i.vk_delta_2),m=c.G1.fromObject(i.vk_alpha_1),y=c.G2.fromObject(i.vk_beta_2);return await c.pairingEq(c.G1.neg(f),g,u,p,h,_,m,y)?(o&&o.info("OK!"),!0):(o&&o.error("Invalid proof"),!1)},exportSolidityCallData:async function(t,e){const n=Dm(t),o=Dm(e);let i,r="";for(let t=0;t<o.length;t++)""!=r&&(r+=","),r+=Rm(o[t]);return i="[".concat(Rm(n.pi_a[0]),", ").concat(Rm(n.pi_a[1]),"],")+"[[".concat(Rm(n.pi_b[0][1]),", ").concat(Rm(n.pi_b[0][0]),"],[").concat(Rm(n.pi_b[1][1]),", ").concat(Rm(n.pi_b[1][0]),"]],")+"[".concat(Rm(n.pi_c[0]),", ").concat(Rm(n.pi_c[1]),"],")+"[".concat(r,"]"),i}});m_.e("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001",16),m_.e("21888242871839275222246405745257275088548364400416034343698204186575808495617");const{unstringifyBigInts:Gm}=y_,{stringifyBigInts:Km}=y_,{unstringifyBigInts:Vm,stringifyBigInts:Hm}=y_;var Ym={exports:{}};!function(t){!function(){var e="input is invalid type",n="object"==typeof window,o=n?window:{};o.JS_SHA3_NO_WINDOW&&(n=!1);var i=!n&&"object"==typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?o=K_:i&&(o=self);var r=!o.JS_SHA3_NO_COMMON_JS&&t.exports,a=!o.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),s=[4,1024,262144,67108864],l=[0,8,16,24],d=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],u=[224,256,384,512],f=[128,256],g=["hex","buffer","arrayBuffer","array","digest"],h={128:168,256:136};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!a||!o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var p=function(t,e,n){return function(o){return new O(t,e,t).update(o)[n]()}},_=function(t,e,n){return function(o,i){return new O(t,e,i).update(o)[n]()}},m=function(t,e,n){return function(e,o,i,r){return w["cshake"+t].update(e,o,i,r)[n]()}},y=function(t,e,n){return function(e,o,i,r){return w["kmac"+t].update(e,o,i,r)[n]()}},L=function(t,e,n,o){for(var i=0;i<g.length;++i){var r=g[i];t[r]=e(n,o,r)}return t},b=function(t,e){var n=p(t,e,"hex");return n.create=function(){return new O(t,e,t)},n.update=function(t){return n.create().update(t)},L(n,p,t,e)},A=[{name:"keccak",padding:[1,256,65536,16777216],bits:u,createMethod:b},{name:"sha3",padding:[6,1536,393216,100663296],bits:u,createMethod:b},{name:"shake",padding:[31,7936,2031616,520093696],bits:f,createMethod:function(t,e){var n=_(t,e,"hex");return n.create=function(n){return new O(t,e,n)},n.update=function(t,e){return n.create(e).update(t)},L(n,_,t,e)}},{name:"cshake",padding:s,bits:f,createMethod:function(t,e){var n=h[t],o=m(t,0,"hex");return o.create=function(o,i,r){return i||r?new O(t,e,o).bytepad([i,r],n):w["shake"+t].create(o)},o.update=function(t,e,n,i){return o.create(e,n,i).update(t)},L(o,m,t,e)}},{name:"kmac",padding:s,bits:f,createMethod:function(t,e){var n=h[t],o=y(t,0,"hex");return o.create=function(o,i,r){return new S(t,e,i).bytepad(["KMAC",r],n).bytepad([o],n)},o.update=function(t,e,n,i){return o.create(t,n,i).update(e)},L(o,y,t,e)}}],w={},I=[],x=0;x<A.length;++x)for(var C=A[x],v=C.bits,E=0;E<v.length;++E){var B=C.name+"_"+v[E];if(I.push(B),w[B]=C.createMethod(v[E],C.padding),"sha3"!==C.name){var F=C.name+v[E];I.push(F),w[F]=w[B]}}function O(t,e,n){this.blocks=[],this.s=[],this.padding=e,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var o=0;o<50;++o)this.s[o]=0}function S(t,e,n){O.call(this,t,e,n)}O.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var n,o=typeof t;if("string"!==o){if("object"!==o)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var i,r,c=this.blocks,s=this.byteCount,d=t.length,u=this.blockCount,f=0,g=this.s;f<d;){if(this.reset)for(this.reset=!1,c[0]=this.block,i=1;i<u+1;++i)c[i]=0;if(n)for(i=this.start;f<d&&i<s;++f)c[i>>2]|=t[f]<<l[3&i++];else for(i=this.start;f<d&&i<s;++f)(r=t.charCodeAt(f))<128?c[i>>2]|=r<<l[3&i++]:r<2048?(c[i>>2]|=(192|r>>6)<<l[3&i++],c[i>>2]|=(128|63&r)<<l[3&i++]):r<55296||r>=57344?(c[i>>2]|=(224|r>>12)<<l[3&i++],c[i>>2]|=(128|r>>6&63)<<l[3&i++],c[i>>2]|=(128|63&r)<<l[3&i++]):(r=65536+((1023&r)<<10|1023&t.charCodeAt(++f)),c[i>>2]|=(240|r>>18)<<l[3&i++],c[i>>2]|=(128|r>>12&63)<<l[3&i++],c[i>>2]|=(128|r>>6&63)<<l[3&i++],c[i>>2]|=(128|63&r)<<l[3&i++]);if(this.lastByteIndex=i,i>=s){for(this.start=i-s,this.block=c[u],i=0;i<u;++i)g[i]^=c[i];P(g),this.reset=!0}else this.start=i}return this},O.prototype.encode=function(t,e){var n=255&t,o=1,i=[n];for(n=255&(t>>=8);n>0;)i.unshift(n),n=255&(t>>=8),++o;return e?i.push(o):i.unshift(o),this.update(i),i.length},O.prototype.encodeString=function(t){var n,o=typeof t;if("string"!==o){if("object"!==o)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}var i=0,r=t.length;if(n)i=r;else for(var c=0;c<t.length;++c){var s=t.charCodeAt(c);s<128?i+=1:s<2048?i+=2:s<55296||s>=57344?i+=3:(s=65536+((1023&s)<<10|1023&t.charCodeAt(++c)),i+=4)}return i+=this.encode(8*i),this.update(t),i},O.prototype.bytepad=function(t,e){for(var n=this.encode(e),o=0;o<t.length;++o)n+=this.encodeString(t[o]);var i=e-n%e,r=[];return r.length=i,this.update(r),this},O.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,n=this.blockCount,o=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[n],e=1;e<n+1;++e)t[e]=0;for(t[n-1]|=2147483648,e=0;e<n;++e)o[e]^=t[e];P(o)}},O.prototype.toString=O.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,r=0,a=0,s="";a<o;){for(r=0;r<e&&a<o;++r,++a)t=n[r],s+=c[t>>4&15]+c[15&t]+c[t>>12&15]+c[t>>8&15]+c[t>>20&15]+c[t>>16&15]+c[t>>28&15]+c[t>>24&15];a%e==0&&(P(n),r=0)}return i&&(t=n[r],s+=c[t>>4&15]+c[15&t],i>1&&(s+=c[t>>12&15]+c[t>>8&15]),i>2&&(s+=c[t>>20&15]+c[t>>16&15])),s},O.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,r=0,a=0,c=this.outputBits>>3;t=i?new ArrayBuffer(o+1<<2):new ArrayBuffer(c);for(var s=new Uint32Array(t);a<o;){for(r=0;r<e&&a<o;++r,++a)s[a]=n[r];a%e==0&&P(n)}return i&&(s[r]=n[r],t=t.slice(0,c)),t},O.prototype.buffer=O.prototype.arrayBuffer,O.prototype.digest=O.prototype.array=function(){this.finalize();for(var t,e,n=this.blockCount,o=this.s,i=this.outputBlocks,r=this.extraBytes,a=0,c=0,s=[];c<i;){for(a=0;a<n&&c<i;++a,++c)t=c<<2,e=o[a],s[t]=255&e,s[t+1]=e>>8&255,s[t+2]=e>>16&255,s[t+3]=e>>24&255;c%n==0&&P(o)}return r&&(t=c<<2,e=o[a],s[t]=255&e,r>1&&(s[t+1]=e>>8&255),r>2&&(s[t+2]=e>>16&255)),s},S.prototype=new O,S.prototype.finalize=function(){return this.encode(this.outputBits,!0),O.prototype.finalize.call(this)};var P=function(t){var e,n,o,i,r,a,c,s,l,u,f,g,h,p,_,m,y,L,b,A,w,I,x,C,v,E,B,F,O,S,P,j,U,k,M,T,z,Q,N,D,R,q,G,K,V,H,Y,J,W,X,Z,$,tt,et,nt,ot,it,rt,at,ct,st,lt,dt;for(o=0;o<48;o+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],r=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],c=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],u=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(g=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|c>>>31),n=(h=t[9]^t[19]^t[29]^t[39]^t[49])^(c<<1|a>>>31),t[0]^=e,t[1]^=n,t[10]^=e,t[11]^=n,t[20]^=e,t[21]^=n,t[30]^=e,t[31]^=n,t[40]^=e,t[41]^=n,e=i^(s<<1|l>>>31),n=r^(l<<1|s>>>31),t[2]^=e,t[3]^=n,t[12]^=e,t[13]^=n,t[22]^=e,t[23]^=n,t[32]^=e,t[33]^=n,t[42]^=e,t[43]^=n,e=a^(u<<1|f>>>31),n=c^(f<<1|u>>>31),t[4]^=e,t[5]^=n,t[14]^=e,t[15]^=n,t[24]^=e,t[25]^=n,t[34]^=e,t[35]^=n,t[44]^=e,t[45]^=n,e=s^(g<<1|h>>>31),n=l^(h<<1|g>>>31),t[6]^=e,t[7]^=n,t[16]^=e,t[17]^=n,t[26]^=e,t[27]^=n,t[36]^=e,t[37]^=n,t[46]^=e,t[47]^=n,e=u^(i<<1|r>>>31),n=f^(r<<1|i>>>31),t[8]^=e,t[9]^=n,t[18]^=e,t[19]^=n,t[28]^=e,t[29]^=n,t[38]^=e,t[39]^=n,t[48]^=e,t[49]^=n,p=t[0],_=t[1],H=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,F=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,ct=t[31]<<9|t[30]>>>23,st=t[30]<<9|t[31]>>>23,q=t[40]<<18|t[41]>>>14,G=t[41]<<18|t[40]>>>14,k=t[2]<<1|t[3]>>>31,M=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,lt=t[42]<<2|t[43]>>>30,dt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,nt=t[4]<<30|t[5]>>>2,T=t[14]<<6|t[15]>>>26,z=t[15]<<6|t[14]>>>26,L=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,U=t[44]<<29|t[45]>>>3,C=t[6]<<28|t[7]>>>4,v=t[7]<<28|t[6]>>>4,ot=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,Q=t[26]<<25|t[27]>>>7,N=t[27]<<25|t[26]>>>7,A=t[36]<<21|t[37]>>>11,w=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,V=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,B=t[19]<<20|t[18]>>>12,rt=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,D=t[38]<<8|t[39]>>>24,R=t[39]<<8|t[38]>>>24,I=t[48]<<14|t[49]>>>18,x=t[49]<<14|t[48]>>>18,t[0]=p^~m&L,t[1]=_^~y&b,t[10]=C^~E&F,t[11]=v^~B&O,t[20]=k^~T&Q,t[21]=M^~z&N,t[30]=K^~H&J,t[31]=V^~Y&W,t[40]=et^~ot&rt,t[41]=nt^~it&at,t[2]=m^~L&A,t[3]=y^~b&w,t[12]=E^~F&S,t[13]=B^~O&P,t[22]=T^~Q&D,t[23]=z^~N&R,t[32]=H^~J&X,t[33]=Y^~W&Z,t[42]=ot^~rt&ct,t[43]=it^~at&st,t[4]=L^~A&I,t[5]=b^~w&x,t[14]=F^~S&j,t[15]=O^~P&U,t[24]=Q^~D&q,t[25]=N^~R&G,t[34]=J^~X&$,t[35]=W^~Z&tt,t[44]=rt^~ct<,t[45]=at^~st&dt,t[6]=A^~I&p,t[7]=w^~x&_,t[16]=S^~j&C,t[17]=P^~U&v,t[26]=D^~q&k,t[27]=R^~G&M,t[36]=X^~$&K,t[37]=Z^~tt&V,t[46]=ct^~lt&et,t[47]=st^~dt&nt,t[8]=I^~p&m,t[9]=x^~_&y,t[18]=j^~C&E,t[19]=U^~v&B,t[28]=q^~k&T,t[29]=G^~M&z,t[38]=$^~K&H,t[39]=tt^~V&Y,t[48]=lt^~et&ot,t[49]=dt^~nt&it,t[0]^=d[o],t[1]^=d[o+1]};if(r)t.exports=w;else for(x=0;x<I.length;++x)o[I[x]]=w[I[x]]}()}(Ym);var Jm=Ym.exports;const{keccak256:Wm}=Jm,{stringifyBigInts:Xm}=y_,{unstringifyBigInts:Zm}=y_,{unstringifyBigInts:$m}=y_,{unstringifyBigInts:ty}=y_,{stringifyBigInts:ey}=y_,{unstringifyBigInts:ny}=y_,{unstringifyBigInts:oy}=y_,{unstringifyBigInts:iy}=y_;function ry(t,e,n){const o=e.split("|").map((t=>t.trim()));for(let n=0;n<o.length;n++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error("invalid value for type ".concat(e));throw i.code="INVALID_ARGUMENT",i.argument="value.".concat(n),i.value=t,i}function ay(t,e,n){for(let o in e){let i=e[o];const r=n?n[o]:null;r&&ry(i,r,o),Object.defineProperty(t,o,{enumerable:!0,value:i,writable:!1})}}function cy(t){if(null==t)return"null";if(Array.isArray(t))return"[ "+t.map(cy).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let o=0;o<t.length;o++)n+=e[t[o]>>4],n+=e[15&t[o]];return n}if("object"==typeof t&&"function"==typeof t.toJSON)return cy(t.toJSON());switch(typeof t){case"boolean":case"symbol":case"number":return t.toString();case"bigint":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map((e=>"".concat(cy(e),": ").concat(cy(t[e])))).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function sy(t,e,n,o){if(!t)throw function(t,e,n){let o,i=t;{const o=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error("value will overwrite populated values: ".concat(cy(n)));for(const t in n){if("shortMessage"===t)continue;const e=n[t];o.push(t+"="+cy(e))}}o.push("code=".concat(e)),o.push("version=".concat("6.13.4")),o.length&&(t+=" ("+o.join(", ")+")")}switch(e){case"INVALID_ARGUMENT":o=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":o=new RangeError(t);break;default:o=new Error(t)}return ay(o,{code:e}),n&&Object.assign(o,n),null==o.shortMessage&&ay(o,{shortMessage:i}),o}(e,n,o)}function ly(t,e,n,o){sy(t,e,"INVALID_ARGUMENT",{argument:n,value:o})}const dy=["NFD","NFC","NFKD","NFKC"].reduce(((t,e)=>{try{if("test"!=="test".normalize(e))throw new Error("bad");if("NFD"===e){if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken")}t.push(e)}catch(t){}return t}),[]);function uy(t,e){return function(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if("string"==typeof t&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const e=new Uint8Array((t.length-2)/2);let n=2;for(let o=0;o<e.length;o++)e[o]=parseInt(t.substring(n,n+2),16),n+=2;return e}ly(!1,"invalid BytesLike value",e||"value",t)}(t,e,!1)}const fy="0123456789abcdef";function gy(t){const e=uy(t);let n="0x";for(let t=0;t<e.length;t++){const o=e[t];n+=fy[(240&o)>>4]+fy[15&o]}return n}let hy=!1;const py=function(t){return jt(t)};let _y=py;function my(t){const e=uy(t,"data");return gy(_y(e))}my._=py,my.lock=function(){hy=!0},my.register=function(t){if(hy)throw new TypeError("keccak256 is locked");_y=t},Object.freeze(my);const yy=BigInt(0),Ly=(BigInt(1),9007199254740991);function by(t,e){switch(typeof t){case"bigint":return t;case"number":return ly(Number.isInteger(t),"underflow",e||"value",t),ly(t>=-Ly&&t<=Ly,"overflow",e||"value",t),BigInt(t);case"string":try{if(""===t)throw new Error("empty string");return"-"===t[0]&&"-"!==t[1]?-BigInt(t.substring(1)):BigInt(t)}catch(n){ly(!1,"invalid BigNumberish string: ".concat(n.message),e||"value",t)}}ly(!1,"invalid BigNumberish value",e||"value",t)}const Ay="0123456789abcdef";function wy(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=Ay[n>>4],e+=Ay[15&n];return BigInt(e)}return by(t)}function Iy(t,e){switch(typeof t){case"bigint":return ly(t>=-Ly&&t<=Ly,"overflow",e||"value",t),Number(t);case"number":return ly(Number.isInteger(t),"underflow",e||"value",t),ly(t>=-Ly&&t<=Ly,"overflow",e||"value",t),t;case"string":try{if(""===t)throw new Error("empty string");return Iy(BigInt(t),e)}catch(n){ly(!1,"invalid numeric string: ".concat(n.message),e||"value",t)}}ly(!1,"invalid numeric value",e||"value",t)}function xy(t,e,n,o,i){if("BAD_PREFIX"===t||"UNEXPECTED_CONTINUE"===t){let t=0;for(let o=e+1;o<n.length&&n[o]>>6==2;o++)t++;return t}return"OVERRUN"===t?n.length-e-1:0}function Cy(t){const e=function(t,e){ly("string"==typeof t,"invalid string value","str",t),null!=e&&(function(t){sy(dy.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}(e),t=t.normalize(e));let n=[];for(let e=0;e<t.length;e++){const o=t.charCodeAt(e);if(o<128)n.push(o);else if(o<2048)n.push(o>>6|192),n.push(63&o|128);else if(55296==(64512&o)){e++;const i=t.charCodeAt(e);ly(e<t.length&&56320==(64512&i),"invalid surrogate pair","str",t);const r=65536+((1023&o)<<10)+(1023&i);n.push(r>>18|240),n.push(r>>12&63|128),n.push(r>>6&63|128),n.push(63&r|128)}else n.push(o>>12|224),n.push(o>>6&63|128),n.push(63&o|128)}return new Uint8Array(n)}(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return function(t,e,n){const o=uy(t);sy(e>=o.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(o),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(o,e-o.length):i.set(o,0),gy(i)}(e,32,!1)}function vy(t){return(BigInt(my(function(t){let e=function(t,e){const n=by(t,e);return sy(n>=yy,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}(t,"value").toString(16);{const n=Iy(32,"width");for(sy(2*n>=e.length,"value exceeds width (".concat(n," bytes)"),"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});e.length<2*n;)e="0"+e}return"0x"+e}(t)))>>8n).toString()}function Ey(t){try{return wy(t)}catch(e){if("string"==typeof t)return wy(Cy(t));throw TypeError(e instanceof Error?e.message:e.toString())}}async function By(t,e,n,o,i,r){var a;let c;if(Fo(t,"identity"),Fo(e,"groupOrMerkleProof"),Fo(n,"message"),Fo(o,"scope"),So(t,"identity"),So(e,"groupOrMerkleProof"),Po(n,"message",["string","bigint","number","Uint8Array"]),Po(o,"scope",["string","bigint","number","Uint8Array"]),i&&function(t){if(!Lo(t))throw new TypeError("Parameter '".concat("merkleTreeDepth","' is not a number, received type: ").concat(typeof t))}(i),r&&So(r,"snarkArtifacts"),n=Ey(n),o=Ey(o),"siblings"in e)c=e;else{const n=e.indexOf(t.commitment);c=e.generateMerkleProof(n)}const s=c.siblings.length;if(void 0!==i){if(i<1||i>32)throw new TypeError("The tree depth must be a number between ".concat(1," and ").concat(32))}else i=0!==s?s:1;null!==(a=r)&&void 0!==a||(r=await async function(t){var e;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!dg.includes(t))throw new Error("Project '".concat(t,"' is not supported"));null!==(e=n.version)&&void 0!==e||(n.version="latest");const o=((t,e)=>"".concat("https://snark-artifacts.pse.dev","/").concat(t,"/").concat(e,"/").concat(t))(t,n.version),i=n.parameters?"-".concat(n.parameters.join("-")):"";return{wasm:"".concat(o).concat(i,".wasm"),zkey:"".concat(o).concat(i,".zkey")}}(lg.SEMAPHORE,{parameters:[i],version:"4.13.0"}));const{wasm:l,zkey:d}=r,u=c.siblings;for(let t=0;t<i;t+=1)void 0===u[t]&&(u[t]=0n);const{proof:f,publicSignals:g}=await qm.fullProve({secret:t.secretScalar,merkleProofLength:s,merkleProofIndex:c.index,merkleProofSiblings:u,scope:vy(o),message:vy(n)},l,d);return{merkleTreeDepth:i,merkleTreeRoot:c.root.toString(),nullifier:g[1],message:n.toString(),scope:o.toString(),points:sg(f)}}Object.freeze({error:function(t,e,n,o,i){ly(!1,"invalid codepoint at offset ".concat(e,"; ").concat(t),"bytes",n)},ignore:xy,replace:function(t,e,n,o,i){return"OVERLONG"===t?(ly("number"==typeof i,"invalid bad code point for replacement","badCodepoint",i),o.push(i),0):(o.push(65533),xy(t,e,n))}});const Fy=(t,e)=>{if(t>e)return!0},Oy=(t,e,n,o)=>t?null:(0,Ka.jsxs)($f,{title:"Insufficient trust level",status:"warning",children:["You need ",e-n," more points."," ",(0,Ka.jsx)(tg,{onClick:async()=>{o()},children:"Complete verifications"})," ","to increase your trust score."]}),Sy=(t,e)=>t?null:(0,Ka.jsxs)(Jf,{status:"error",children:[(0,Ka.jsx)("span",{children:"Required:"}),(0,Ka.jsxs)(ss,{status:"error",children:[e," pts"]})]}),Py=(t,e,n,o,i,r,a,c,s,l,d)=>n?(0,Ka.jsxs)(Xf,{loading:a,size:"default",disabled:Fy(o,i),appearance:"action",onClick:async()=>{c(!0);try{if(!t)throw alert("USER HAS NO KEY"),new Error("USER HAS NO KEY");const n=await(async(t,e,n,o,i)=>{if(!t)throw new Error("userKey is not available");const r=[];let a=0;if(!e||0===e.length)throw new Error("no verifications found");if(e)for(let c=0;c<e.length;c++){if(!i.includes(e[c].credentialGroupId))continue;const{credentialGroupId:s,status:l}=e[c];if(a>=o)break;if("completed"!==l)continue;const d=Do(s,!0);if(!d)continue;const{group:u}=d;a+=u.points;const f=cg.createIdentity(t,s),{commitment:g}=f,h=await cg.getProof(String(g),u.semaphoreGroupId,!0);if(!h)throw new Error("no proof found");const p=Ro(n),{merkleTreeDepth:_,merkleTreeRoot:m,message:y,points:L,nullifier:b}=await By(f,h,"verification",p);r.push({credential_group_id:s,semaphore_proof:{merkle_tree_depth:_,merkle_tree_root:m,nullifier:b,message:y,scope:p,points:L}})}return r})(t,e,r,i,s);d(n),l(),window.close()}catch(t){c(!1),console.log({err:t})}c(!1)},children:["Confirm (",i," pts)"]}):(0,Ka.jsx)(Xf,{onClick:l,appearance:"action",children:"Verify"}),jy=t=>{let{onClose:e,dropAddress:n,pointsRequired:o,points:i,onAccept:r}=t;const[a,c]=(0,Zo.useState)(!1),s=i>=o,l=lu(),d=No(!0),u=jl(),[f,g]=(0,Zo.useState)([]),h=(0,Zo.useMemo)((()=>{let t=0;return u.verifications.forEach((e=>{const n=Do(e.credentialGroupId,!0);n&&"completed"===e.status&&f.includes(n.group.credentialGroupId)&&n&&(t+=n.group.points)})),t}),[f]);return(0,Zo.useEffect)((()=>{u.verifications&&g(u.verifications.reduce(((t,e)=>"completed"===e.status?[...t,e.credentialGroupId]:t),[]))}),[u.verifications]),(0,Ka.jsx)(Gf,{children:(0,Ka.jsxs)(Vf,{children:[(0,Ka.jsx)(Hf,{icon:(0,Ka.jsx)(Zf,{src:ng})}),(0,Ka.jsx)(Kf,{children:"Prove your trust level"}),(0,Ka.jsx)(Yf,{children:"A website is requesting verification of your trust score. This process is completely private and no personal information will be shared."}),Oy(s,o,i,e),Sy(s,o),(0,Ka.jsxs)(Jf,{children:[(0,Ka.jsx)("span",{children:"Current:"}),(0,Ka.jsxs)(ss,{status:"info",children:[i," pts"]})]}),s&&(0,Ka.jsx)(eg,{tasks:d,devMode:!0,verifications:u.verifications,selected:f,onSelect:(t,e)=>{g(e?[...f,t]:f.filter((e=>e!==t)))}}),(0,Ka.jsxs)(Wf,{children:[Py(l.key,u.verifications,s,o,h,n,a,c,f,e,r),(0,Ka.jsx)(Xf,{size:"default",onClick:async()=>{e()},children:"Cancel"})]})]})})};var Uy,ky,My,Ty,zy;function Qy(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Ny=Da.div(Uy||(Uy=Qy(["\n padding: 12px;\n height: 100%;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n z-index: 1;\n left: 0;\n background-color: ",";\n"])),(t=>t.theme.overlayBackgroundColor)),Dy=Da(Uc)(ky||(ky=Qy(["\n text-align: center;\n font-size: 24px;\n margin-bottom: 20px;\n"]))),Ry=Da.div(My||(My=Qy(["\n padding: 24px;\n border-radius: 8px;\n border: 1px solid ",";\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n"])),(t=>t.theme.secondaryBorderColor)),qy=(Da.div(Ty||(Ty=Qy(["\n height: 100%;\n"]))),Da(Va)(zy||(zy=Qy(["\n margin: 0 auto;\n border-color: ",";\n"])),(t=>t.theme.primaryTextColor))),Gy=t=>{let{title:e}=t;return(0,Ka.jsx)(Ny,{children:(0,Ka.jsxs)(Ry,{children:[(0,Ka.jsx)(Dy,{children:e}),(0,Ka.jsx)(qy,{size:"large"})]})})};var Ky,Vy,Hy;function Yy(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Jy=Da.div(Ky||(Ky=Yy(["\n padding: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n"]))),Wy=Da.h3(Vy||(Vy=Yy(["\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n margin: 0;\n color: ",";\n text-align: center;\n"])),(t=>t.theme.secondaryTextColor)),Xy=Da(oc)(Hy||(Hy=Yy(["\n width: max-content;\n margin: 10px auto;\n"]))),Zy=t=>{let{className:e,generateSignature:n}=t;const o=Il();return(0,Ka.jsxs)(Jy,{className:e,children:[(0,Ka.jsx)(Wy,{children:"Connect your wallet to start verifying"}),(0,Ka.jsx)(Xy,{onClick:async()=>{if(!n)return void alert("generateSignature method is not passed");const t=await n("Sign to derive your BringID key.\nRecoverable by re-signing with the same wallet.");var e;console.log({sig:t}),o((e=t,{type:cu["/user/setKey"],payload:e}))},children:"Create BringID key"})]})};var $y,tL;function eL(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const nL=Da.div($y||($y=eL(["\n padding: 16px;\n"]))),oL=Da((t=>{let{verifications:e,onAddVerifications:n,className:o,devMode:i}=t;const r=e.find((t=>"scheduled"===t.status||"pending"===t.status));return(0,Ka.jsxs)(wf,{className:o,children:[r&&(0,Ka.jsxs)(If,{children:["We batch verifications for better privacy."," ",(0,Ka.jsx)(xf,{href:"https://bringid.org/privacy-policy",target:"_blank",children:"Learn more"})]}),0===e.length&&(0,Ka.jsx)(ff,{title:"No verifications yet"}),e.length>0&&e.map((t=>{const e=Do(t.credentialGroupId,i);if(e)return(0,Ka.jsx)(td,{fetched:t.fetched,title:e.title,description:e.description,taskId:t.taskId,points:e.group.points,scheduledTime:t.scheduledTime,status:t.status,selectable:!1,credentialGroupId:t.credentialGroupId},e.taskId)})),(0,Ka.jsx)(Af,{onClick:n,appearance:"action",children:"Add verifications"})]})}))(tL||(tL=eL(["\n margin-bottom: 20px;\n"]))),iL=(t,e,n,o,i,r)=>t?(0,Ka.jsx)(oL,{tasks:e,devMode:o,verifications:n,onAddVerifications:()=>{i("tasks")}}):(0,Ka.jsx)(Zy,{generateSignature:r}),rL=t=>{let{generateSignature:e,setPage:n}=t;const o=jl(),{verifications:i,loading:r}=o,a=lu(),c=No(!0),s=Jo(i,!0);return(0,Ka.jsxs)(nL,{children:[r&&(0,Ka.jsx)(Gy,{title:"Processing verification..."}),(0,Ka.jsx)(af,{points:s,address:a.address,userKey:a.key}),iL(a.key,c,i,!0,n,e)]})};var aL,cL,sL,lL,dL,uL,fL,gL,hL;function pL(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const _L=Da.div(aL||(aL=pL([""]))),mL=Da(Uc)(cL||(cL=pL(["\n margin-bottom: 5px;\n"]))),yL=Da((t=>{let{children:e,className:n}=t;return(0,Ka.jsx)(Mc,{className:n,children:e})}))(sL||(sL=pL(["\n margin: 0;\n"]))),LL=Da.header(lL||(lL=pL(["\n padding: 24px;\n display: flex;\n align-items: center;\n color: ",";\n gap: 12px;\n"])),(t=>t.theme.primaryTextColor)),bL=Da.div(dL||(dL=pL([""]))),AL=Da.div(uL||(uL=pL(["\n padding: 20px;\n"]))),wL=Da(Oc)(fL||(fL=pL(["\n cursor: pointer;\n"]))),IL=Da(Rc)(gL||(gL=pL(["\n text-align: center;\n font-size: 12px;\n padding: 0 12px;\n"]))),xL=Da(Qc)(hL||(hL=pL(["\n font-size: 12px;\n color: ",";\n text-decoration: underline;\n"])),(t=>t.theme.secondaryTextColor)),CL=t=>{let{setPage:e}=t;lu();const n=No(!0),{verifications:o}=jl();return(0,Ka.jsxs)(_L,{children:[(0,Ka.jsxs)(LL,{children:[(0,Ka.jsx)(wL,{onClick:()=>e("home")}),(0,Ka.jsxs)(bL,{children:[(0,Ka.jsx)(mL,{children:"Add Verifications"}),(0,Ka.jsx)(yL,{children:"Connect accounts to build your score"})]})]}),(0,Ka.jsx)(AL,{children:(0,Ka.jsx)(pf,{tasks:n,verifications:o})}),(0,Ka.jsxs)(IL,{children:["No verifications available? Request new ones in our"," ",(0,Ka.jsx)(xL,{target:"_blank",href:"https://t.me/bringid_chat",children:"Telegram group"})]})]})};let vL=null,EL=null;const BL=()=>{vL&&vL()},FL=(t,e)=>EL?EL?EL(t,e):void 0:Promise.reject("requestProofs is not registered");function OL(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function SL(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?OL(Object(n),!0).forEach((function(e){PL(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):OL(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function PL(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let jL=null,UL=null;const kL=(t,e,n)=>{switch(t){case"home":default:return(0,Ka.jsx)(rL,{setPage:e,generateSignature:n});case"tasks":return(0,Ka.jsx)(CL,{setPage:e})}},ML=t=>{let{apiKey:e,address:n,generateSignature:o}=t;const i=Il(),{isOpen:r,loading:a}=pl((t=>t.modal),kl()),{isOpen:c,pointsRequired:s,dropAddress:l}=pl((t=>t.requestProofs)),d=lu(),{verifications:u}=jl();(0,Zo.useEffect)((()=>(vL=()=>{h("home"),i(pu(!1)),i({type:"/modal/setIsOpen",payload:!0})},EL=async(t,e)=>d.key?(i(((t,e)=>({type:gu["/requestProofs/registerRequest"],payload:{pointsRequired:t,dropAddress:e}}))(e,t)),i(pu(!0)),i({type:"/modal/setIsOpen",payload:!0}),new Promise(((t,e)=>{jL=t,UL=e}))):alert("User key is not ready. Please sign in to BringID widget first"),()=>{jL=null,UL=null})),[d.key]),(0,Zo.useEffect)((()=>{if(!u)return;const t=setInterval((async()=>{try{if(0===u.filter((t=>"completed"!==t.status)).length)return;let t=!1;const e=u.map((e=>{if("completed"!==e.status){const n=+new Date;if(e.scheduledTime-n<=0)return t=!0,SL(SL({},e),{},{status:"completed"})}return e}));console.log({verificationsUpdated:e}),t&&i(Pl(e))}catch(t){console.log({err:t})}}),1e3);return()=>clearInterval(t)}),[u]);const f=No(!0),[g,h]=(0,Zo.useState)("home");(0,Zo.useEffect)((()=>{n&&i((t=>({type:cu["/user/setAddress"],payload:t}))(n)),e&&i((t=>({type:cu["/user/setApiKey"],payload:t}))(e))}),[e,n]),(0,Zo.useEffect)((()=>{d.key&&(async(t,e,n)=>{n(!0);for(const n of t)for(const t of n.groups){const r=cg.createIdentity(String(e),t.credentialGroupId),{commitment:a}=r;try{await cg.getProof(String(a),t.semaphoreGroupId)&&(o={credentialGroupId:t.credentialGroupId,status:"completed",scheduledTime:+new Date,fetched:!0,taskId:n.id},i(Sl(o)))}catch(t){console.log("proof for ".concat(a," was not added before"))}}var o;n(!1)})(f,d.key,(t=>i(Dl(t))))}),[d.key]);const p=Jo(u,!0);return(0,Ka.jsx)(Qu,{children:(0,Ka.jsxs)(zu,{dialogClassName:Tu,visible:r,onClose:()=>i({type:"/modal/setIsOpen",payload:!1}),children:[c&&s&&l&&(0,Ka.jsx)(jy,{pointsRequired:s,dropAddress:l,points:p,onClose:()=>{var t;null===(t=UL)||void 0===t||t("User cancelled"),UL=null,i(pu(!1)),i(pu(!1))},onAccept:t=>{var e;null===(e=jL)||void 0===e||e(t),jL=null,i(pu(!1))}}),a&&(0,Ka.jsx)(Gy,{title:"Loading..."}),kL(g,h,o)]})})},TL=t=>{let{apiKey:e,address:n,generateSignature:o}=t;return(0,Ka.jsx)(Oa,{theme:qd,children:(0,Ka.jsx)(Ll,{store:yu,children:(0,Ka.jsx)(ML,{apiKey:e,address:n,generateSignature:o})})})}})(),r})()));
|