ckpay-sdk
Version:
CkPay SDK for Internet Computer payment processing - a decentralized payment solution with multi-token support, modal integration, and subscription management.
2 lines • 661 kB
JavaScript
/*! For license information please see index.js.LICENSE.txt */
var __webpack_modules__={20:(e,t,r)=>{var n=r(540),i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,A={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,r){var n,o={},l=null,c=null;for(n in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(c=t.ref),t)a.call(t,n)&&!A.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===o[n]&&(o[n]=t[n]);return{$$typeof:i,type:e,key:l,ref:c,props:o,_owner:s.current}}t.jsx=l,t.jsxs=l},57:(e,t,r)=>{r.r(t),r.d(t,{encodePath:()=>c,request:()=>l});var n=r(664),i=r(336),o=r(857),a=r(151),s=r(957),A=r(358);const l=async e=>{const{canisterId:t,agent:r,paths:n}=e,i=[...new Set(n)],s=i.map(e=>c(e,t)),A=new Map,l=i.map((e,n)=>(async()=>{var l;try{const o=await r.readState(t,{paths:[s[n]]}),l=(await a.us.create({certificate:o.certificate,rootKey:r.rootKey,canisterId:t})).lookup(c(i[n],t));if(l)switch(e){case"time":A.set(e,d(l));break;case"controllers":A.set(e,p(l));break;case"module_hash":A.set(e,u(l));break;case"candid":A.set(e,(new TextDecoder).decode(l));break;default:if("string"!=typeof e&&"key"in e&&"path"in e)switch(e.decodeStrategy){case"raw":A.set(e.key,l);break;case"leb128":A.set(e.key,g(l));break;case"cbor":A.set(e.key,h(l));break;case"hex":A.set(e.key,u(l));break;case"utf-8":A.set(e.key,f(l))}}else console.warn(`Expected to find result for path ${e}, but instead found nothing.`),"string"==typeof e?A.set(e,null):A.set(e.key,null)}catch(t){if(null===(l=null==t?void 0:t.message)||void 0===l?void 0:l.includes("Invalid certificate"))throw new o.Y(t.message);"string"!=typeof e&&"key"in e&&"path"in e?A.set(e.key,null):A.set(e,null),console.group(),console.warn(`Expected to find result for path ${e}, but instead found nothing.`),console.warn(t),console.groupEnd()}})());return await Promise.all(l),A},c=(e,t)=>{const r=new TextEncoder,n=e=>new DataView(r.encode(e).buffer).buffer,i=new DataView(t.toUint8Array().buffer).buffer;switch(e){case"time":return[n("time")];case"controllers":return[n("canister"),i,n("controllers")];case"module_hash":return[n("canister"),i,n("module_hash")];case"subnet":return[n("subnet")];case"candid":return[n("canister"),i,n("metadata"),n("candid:service")];default:if("key"in e&&"path"in e){if("string"==typeof e.path||e.path instanceof ArrayBuffer){const t=e.path,r="string"==typeof t?n(t):t;return[n("canister"),i,n("metadata"),r]}return e.path}}throw new Error(`An unexpeected error was encountered while encoding your path for canister status. Please ensure that your path, ${e} was formatted correctly.`)},u=e=>(0,s.nj)(e),g=e=>(0,n.Ui)(new n.Ki(e)),h=e=>A.D4(e),f=e=>(new TextDecoder).decode(e),d=e=>{const t=g(e);return new Date(Number(t/BigInt(1e6)))},p=e=>{const[t,...r]=h(e);return r.map(e=>i.p.fromUint8Array(new Uint8Array(e)))}},80:(e,t,r)=>{const n=r(729),i=n.MT,o=n.SIMPLE,a=n.SYMS;class s{constructor(e){if("number"!=typeof e)throw new Error("Invalid Simple type: "+typeof e);if(e<0||e>255||(0|e)!==e)throw new Error("value must be a small positive integer: "+e);this.value=e}toString(){return"simple("+this.value+")"}inspect(){return"simple("+this.value+")"}encodeCBOR(e){return e._pushInt(this.value,i.SIMPLE_FLOAT)}static isSimple(e){return e instanceof s}static decode(e,t){switch(null==t&&(t=!0),e){case o.FALSE:return!1;case o.TRUE:return!0;case o.NULL:return t?null:a.NULL;case o.UNDEFINED:return t?void 0:a.UNDEFINED;case-1:if(!t)throw new Error("Invalid BREAK");return a.BREAK;default:return new s(e)}}}e.exports=s},141:(e,t,r)=>{r.d(t,{Gb:()=>c,tW:()=>s});var n=r(664),i=r(516),o=r(312),a=r(957);function s(e){return o.sha256.create().update(new Uint8Array(e)).arrayBuffer()}function A(e){if(e instanceof i.Tagged)return A(e.value);if("string"==typeof e)return l(e);if("number"==typeof e)return s((0,n.kk)(e));if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))return s(e);if(Array.isArray(e)){const t=e.map(A);return s((0,a.xW)(...t))}if(e&&"object"==typeof e&&e._isPrincipal)return s(e.toUint8Array());if("object"==typeof e&&null!==e&&"function"==typeof e.toHash)return A(e.toHash());if("bigint"==typeof e)return s((0,n.kk)(e));throw Object.assign(new Error(`Attempt to hash a value of unsupported type: ${e}`),{value:e})}const l=e=>s((new TextEncoder).encode(e));function c(e){const t=Object.entries(e).filter(([,e])=>void 0!==e).map(([e,t])=>[l(e),A(t)]).sort(([e],[t])=>(0,a.UD)(e,t));return s((0,a.xW)(...t.map(e=>(0,a.xW)(...e))))}},151:(e,t,r)=>{r.d(t,{us:()=>u});var n=r(358),i=r(857),o=r(141),a=r(957),s=r(336),A=r(554);class l extends i.Y{constructor(e){super(`Invalid certificate: ${e}`)}}function c(e,t){if(e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),n=new Uint8Array(t);for(let e=0;e<r.length;e++)if(r[e]!==n[e])return!1;return!0}class u{constructor(e,t,r,i){this._rootKey=t,this._canisterId=r,this._blsVerify=i,this.cert=n.D4(new Uint8Array(e))}static async create(e){let t=e.blsVerify;t||(t=A.r);const r=new u(e.certificate,e.rootKey,e.canisterId,t);return await r.verify(),r}lookup(e){return p(e,this.cert.tree)}async verify(){const e=await f(this.cert.tree),t=await this._checkDelegationAndGetKey(this.cert.delegation),r=this.cert.signature,n=function(e){const t=g.byteLength+h;if(e.byteLength!==t)throw new TypeError(`BLS DER-encoded public key must be ${t} bytes long`);const r=e.slice(0,g.byteLength);if(!c(r,g))throw new TypeError(`BLS DER-encoded public key is invalid. Expect the following prefix: ${g}, but get ${r}`);return e.slice(g.byteLength)}(t),i=(0,a.xW)(d("ic-state-root"),e);let o=!1;try{o=await this._blsVerify(new Uint8Array(n),new Uint8Array(r),new Uint8Array(i))}catch(e){o=!1}if(!o)throw new l("Signature verification failed")}async _checkDelegationAndGetKey(e){if(!e)return this._rootKey;const t=await u.create({certificate:e.certificate,rootKey:this._rootKey,canisterId:this._canisterId}),r=t.lookup(["subnet",e.subnet_id,"canister_ranges"]);if(!r)throw new l(`Could not find canister ranges for subnet 0x${(0,a.nj)(e.subnet_id)}`);if(!n.D4(r).map(e=>[s.p.fromUint8Array(e[0]),s.p.fromUint8Array(e[1])]).some(e=>e[0].ltEq(this._canisterId)&&e[1].gtEq(this._canisterId)))throw new l(`Canister ${this._canisterId} not in range of delegations for subnet 0x${(0,a.nj)(e.subnet_id)}`);const i=t.lookup(["subnet",e.subnet_id,"public_key"]);if(!i)throw new Error(`Could not find subnet key for subnet 0x${(0,a.nj)(e.subnet_id)}`);return i}}const g=(0,a.aD)("308182301d060d2b0601040182dc7c0503010201060c2b0601040182dc7c05030201036100"),h=96;async function f(e){switch(e[0]){case 0:return(0,o.tW)(d("ic-hashtree-empty"));case 4:return e[1];case 3:return(0,o.tW)((0,a.xW)(d("ic-hashtree-leaf"),e[1]));case 2:return(0,o.tW)((0,a.xW)(d("ic-hashtree-labeled"),e[1],await f(e[2])));case 1:return(0,o.tW)((0,a.xW)(d("ic-hashtree-fork"),await f(e[1]),await f(e[2])));default:throw new Error("unreachable")}}function d(e){const t=new Uint8Array([e.length]),r=(new TextEncoder).encode(e);return(0,a.xW)(t,r)}function p(e,t){if(0===e.length)return 3===t[0]?new Uint8Array(t[1]).buffer:void 0;const r=function(e,t){if(0===t.length)return;for(const r of t)if(2===r[0]){if(c(e,r[1]))return r[2]}}("string"==typeof e[0]?(new TextEncoder).encode(e[0]):e[0],m(t));return r?p(e.slice(1),r):void 0}function m(e){switch(e[0]){case 0:return[];case 1:return m(e[1]).concat(m(e[2]));default:return[e]}}},205:(e,t,r)=>{const{Buffer:n}=r(279),i=r(594).BigNumber,o=r(729),a=o.SHIFT32,s=o.SHIFT16;function A(e){return e<16?"0"+e.toString(16):e.toString(16)}t.parseHalf=function(e){var t,r,n;return n=128&e[0]?-1:1,t=(124&e[0])>>2,r=(3&e[0])<<8|e[1],t?31===t?n*(r?NaN:Infinity):n*Math.pow(2,t-25)*(1024+r):5.960464477539063e-8*n*r},t.arrayBufferToBignumber=function(e){const t=e.byteLength;let r="";for(let n=0;n<t;n++)r+=A(e[n]);return new i(r,16)},t.buildMap=e=>{const t=new Map,r=Object.keys(e),n=r.length;for(let i=0;i<n;i++)t.set(r[i],e[r[i]]);return t},t.buildInt32=(e,t)=>e*s+t,t.buildInt64=(e,r,n,o)=>{const s=t.buildInt32(e,r),A=t.buildInt32(n,o);return s>2097151?new i(s).times(a).plus(A):s*a+A},t.writeHalf=function(e,t){const r=n.allocUnsafe(4);r.writeFloatBE(t,0);const i=r.readUInt32BE(0);if(8191&i)return!1;var o=i>>16&32768;const a=i>>23&255,s=8388607&i;if(a>=113&&a<=142)o+=(a-112<<10)+(s>>13);else{if(!(a>=103&&a<113))return!1;if(s&(1<<126-a)-1)return!1;o+=s+8388608>>126-a}return e.writeUInt16BE(o,0),!0},t.keySorter=function(e,t){var r=e[0].byteLength,n=t[0].byteLength;return r>n?1:n>r?-1:e[0].compare(t[0])},t.isNegativeZero=e=>0===e&&1/e<0,t.nextPowerOf2=e=>{let t=0;if(e&&!(e&e-1))return e;for(;0!==e;)e>>=1,t+=1;return 1<<t}},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,A=(1<<s)-1,l=A>>1,c=-7,u=r?i-1:0,g=r?-1:1,h=e[t+u];for(u+=g,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+u],u+=g,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+u],u+=g,c-=8);if(0===o)o=1-l;else{if(o===A)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=l}return(h?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,A,l=8*o-i-1,c=(1<<l)-1,u=c>>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,f=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(A=Math.pow(2,-a))<1&&(a--,A*=2),(t+=a+u>=1?g/A:g*Math.pow(2,1-u))*A>=2&&(a++,A/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(t*A-1)*Math.pow(2,i),a+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=f,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[r+h]=255&a,h+=f,a/=256,l-=8);e[r+h-f]|=128*d}},279:(e,t,r)=>{var n=r(526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=A,t.SlowBuffer=function(e){+e!=e&&(e=0);return A.alloc(+e)},t.INSPECT_MAX_BYTES=50;var a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,A.prototype),t}function A(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!A.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|d(e,t),n=s(r),i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(O(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return g(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(O(e,SharedArrayBuffer)||e&&O(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return A.from(n,t,r);var i=function(e){if(A.isBuffer(e)){var t=0|f(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||V(e.length)?s(0):g(e);if("Buffer"===e.type&&Array.isArray(e.data))return g(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return A.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),s(e<0?0:0|f(e))}function g(e){for(var t=e.length<0?0:0|f(e.length),r=s(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,A.prototype),n}function f(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function d(e,t){if(A.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(i)return n?-1:L(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return b(this,t,r);case"ascii":return _(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return v(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),V(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=A.from(t,n)),A.isBuffer(t))return 0===t.length?-1:E(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):E(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function E(e,t,r,n,i){var o,a=1,s=e.length,A=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,A/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;o<s;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===A)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+A>s&&(r=s-A),o=r;o>=0;o--){for(var u=!0,g=0;g<A;g++)if(l(e,o+g)!==l(t,g)){u=!1;break}if(u)return o}return-1}function B(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(V(s))return a;e[r+a]=s}return a}function I(e,t,r,n){return G(L(t,e.length-r),e,r,n)}function C(e,t,r,n){return G(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function Q(e,t,r,n){return G(U(t),e,r,n)}function w(e,t,r,n){return G(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function v(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function b(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,A,l=e[i],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u<=r)switch(u){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(A=(31&l)<<6|63&o)>127&&(c=A);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(A=(15&l)<<12|(63&o)<<6|63&a)>2047&&(A<55296||A>57343)&&(c=A);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(A=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&A<1114112&&(c=A)}null===c?(c=65533,u=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=u}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=S));return r}(n)}t.kMaxLength=a,A.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),A.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(A.prototype,"parent",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.buffer}}),Object.defineProperty(A.prototype,"offset",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.byteOffset}}),A.poolSize=8192,A.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(A.prototype,Uint8Array.prototype),Object.setPrototypeOf(A,Uint8Array),A.alloc=function(e,t,r){return function(e,t,r){return c(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},A.allocUnsafe=function(e){return u(e)},A.allocUnsafeSlow=function(e){return u(e)},A.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==A.prototype},A.compare=function(e,t){if(O(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),O(t,Uint8Array)&&(t=A.from(t,t.offset,t.byteLength)),!A.isBuffer(e)||!A.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},A.isEncoding=function(e){switch(String(e).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}},A.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return A.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=A.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(O(o,Uint8Array))i+o.length>n.length?A.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!A.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},A.byteLength=d,A.prototype._isBuffer=!0,A.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},A.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},A.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},A.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?b(this,0,e):p.apply(this,arguments)},A.prototype.toLocaleString=A.prototype.toString,A.prototype.equals=function(e){if(!A.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===A.compare(this,e)},A.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(A.prototype[o]=A.prototype.inspect),A.prototype.compare=function(e,t,r,n,i){if(O(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),!A.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(n,i),c=e.slice(t,r),u=0;u<s;++u)if(l[u]!==c[u]){o=l[u],a=c[u];break}return o<a?-1:a<o?1:0},A.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},A.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},A.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},A.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return B(this,e,t,r);case"utf8":case"utf-8":return I(this,e,t,r);case"ascii":case"latin1":case"binary":return C(this,e,t,r);case"base64":return Q(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},A.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function _(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function x(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function k(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=H[e[o]];return i}function D(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function T(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,o){if(!A.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,o){return t=+t,r>>>=0,o||R(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,o){return t=+t,r>>>=0,o||R(e,0,r,8),i.write(e,t,r,n,52,8),r+8}A.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,A.prototype),n},A.prototype.readUintLE=A.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},A.prototype.readUintBE=A.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},A.prototype.readUint8=A.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},A.prototype.readUint16LE=A.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},A.prototype.readUint16BE=A.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},A.prototype.readUint32LE=A.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},A.prototype.readUint32BE=A.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},A.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},A.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},A.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},A.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},A.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},A.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},A.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},A.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!0,23,4)},A.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),i.read(this,e,!1,23,4)},A.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!0,52,8)},A.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),i.read(this,e,!1,52,8)},A.prototype.writeUintLE=A.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},A.prototype.writeUintBE=A.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},A.prototype.writeUint8=A.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},A.prototype.writeUint16LE=A.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},A.prototype.writeUint16BE=A.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},A.prototype.writeUint32LE=A.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},A.prototype.writeUint32BE=A.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},A.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+r},A.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+r},A.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},A.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},A.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},A.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},A.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},A.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},A.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},A.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},A.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},A.prototype.copy=function(e,t,r,n){if(!A.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},A.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!A.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=A.isBuffer(e)?e:A.from(e,n),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var P=/[^+/0-9A-Za-z-_]/g;function L(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function U(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function O(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function V(e){return e!=e}var H=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},281:()=>{},283:function(e,t,r){var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(771));const i=n(r(770));t.value=i},287:(e,t)=>{var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),A=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),h=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},d=Object.assign,p={};function m(e,t,r){this.props=e,this.context=t,this.refs=p,this.updater=r||f}function y(){}function E(e,t,r){this.props=e,this.context=t,this.refs=p,this.updater=r||f}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=m.prototype;var B=E.prototype=new y;B.constructor=E,d(B,m.prototype),B.isPureReactComponent=!0;var I=Array.isArray,C=Object.prototype.hasOwnProperty,Q={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function v(e,t,n){var i,o={},a=null,s=null;if(null!=t)for(i in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)C.call(t,i)&&!w.hasOwnProperty(i)&&(o[i]=t[i]);var A=arguments.length-2;if(1===A)o.children=n;else if(1<A){for(var l=Array(A),c=0;c<A;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(i in A=e.defaultProps)void 0===o[i]&&(o[i]=A[i]);return{$$typeof:r,type:e,key:a,ref:s,props:o,_owner:Q.current}}function b(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var S=/\/+/g;function _(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function x(e,t,i,o,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var A=!1;if(null===e)A=!0;else switch(s){case"string":case"number":A=!0;break;case"object":switch(e.$$typeof){case r:case n:A=!0}}if(A)return a=a(A=e),e=""===o?"."+_(A,0):o,I(a)?(i="",null!=e&&(i=e.replace(S,"$&/")+"/"),x(a,t,i,"",function(e){return e})):null!=a&&(b(a)&&(a=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,i+(!a.key||A&&A.key===a.key?"":(""+a.key).replace(S,"$&/")+"/")+e)),t.push(a)),1;if(A=0,o=""===o?".":o+":",I(e))for(var l=0;l<e.length;l++){var c=o+_(s=e[l],l);A+=x(s,t,i,c,a)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=h&&e[h]||e["@@iterator"])?e:null}(e),"function"==typeof c)for(e=c.call(e),l=0;!(s=e.next()).done;)A+=x(s=s.value,t,i,c=o+_(s,l++),a);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return A}function k(e,t,r){if(null==e)return e;var n=[],i=0;return x(e,n,"","",function(e){return t.call(r,e,i++)}),n}function D(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var T={current:null},N={transition:null},R={ReactCurrentDispatcher:T,ReactCurrentBatchConfig:N,ReactCurrentOwner:Q};function F(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:k,forEach:function(e,t,r){k(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return k(e,function(){t++}),t},toArray:function(e){return k(e,function(e){return e})||[]},only:function(e){if(!b(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=m,t.Fragment=i,t.Profiler=a,t.PureComponent=E,t.StrictMode=o,t.Suspense=c,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,t.act=F,t.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=d({},e.props),o=e.key,a=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,s=Q.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var A=e.type.defaultProps;for(l in t)C.call(t,l)&&!w.hasOwnProperty(l)&&(i[l]=void 0===t[l]&&void 0!==A?A[l]:t[l])}var l=arguments.length-2;if(1===l)i.children=n;else if(1<l){A=Array(l);for(var c=0;c<l;c++)A[c]=arguments[c+2];i.children=A}return{$$typeof:r,type:e.type,key:o,ref:a,props:i,_owner:s}},t.createContext=function(e){return(e={$$typeof:A,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=v,t.createFactory=function(e){var t=v.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=b,t.lazy=function(e){return{$$typeof:g,_payload:{_status:-1,_result:e},_init:D}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=N.transition;N.transition={};try{e()}finally{N.transition=t}},t.unstable_act=F,t.useCallback=function(e,t){return T.current.useCallback(e,t)},t.useContext=function(e){return T.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return T.current.useDeferredValue(e)},t.useEffect=function(e,t){return T.current.useEffect(e,t)},t.useId=function(){return T.current.useId()},t.useImperativeHandle=function(e,t,r){return T.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return T.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return T.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return T.current.useMemo(e,t)},t.useReducer=function(e,t,r){return T.current.useReducer(e,t,r)},t.useRef=function(e){return T.current.useRef(e)},t.useState=function(e){return T.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return T.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return T.current.useTransition()},t.version="18.3.1"},312:(module,exports,__webpack_require__)=>{var process=__webpack_require__(606),__WEBPACK_AMD_DEFINE_RESULT__;(function(){var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=__webpack_require__.g:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,AMD=__webpack_require__.amdO,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(r){return new Sha256(t,!0).update(r)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];t[n]=createOutputMethod(n,e)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(e){if("string"==typeof e)return crypto.createHash(algorithm).update(e,"utf8").digest("hex");if(null==e)throw new Error(ERROR);return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod},createHmacOutputMethod=function(e,t){return function(r,n){return new HmacSha256(r,t,!0).update(n)[e]()}},createHmacMethod=function(e){var t=createHmacOutputMethod("hex",e);t.create=function(t){return new HmacSha256(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];t[n]=createHmacOutputMethod(n,e)}return t};function Sha256(e,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function HmacSha256(e,t,r){var n,i=typeof e;if("string"===i){var o,a=[],s=e.length,A=0;for(n=0;n<s;++n)(o=e.charCodeAt(n))<128?a[A++]=o:o<2048?(a[A++]=192|o>>6,a[A++]=128|63&o):o<55296||o>=57344?(a[A++]=224|o>>12,a[A++]=128|o>>6&63,a[A++]=128|63&o):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++n)),a[A++]=240|o>>18,a[A++]=128|o>>12&63,a[A++]=128|o>>6&63,a[A++]=128|63&o);e=a}else{if("object"!==i)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR)}e.length>64&&(e=new Sha256(t,!0).update(e).array());var l=[],c=[];for(n=0;n<64;++n){var u=e[n]||0;l[n]=92^u,c[n]=54^u}Sha256.call(this,t,r),this.update(c),this.oKeyPad=l,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR);t=!0}for(var n,i,o=0,a=e.length,s=this.blocks;o<a;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),t)for(i=this.start;o<a&&i<64;++o)s[i>>2]|=e[o]<<SHIFT[3&i++];else for(i=this.start;o<a&&i<64;++o)(n=e.charCodeAt(o))<128?s[i>>2]|=n<<SHIFT[3&i++]:n<2048?(s[i>>2]|=(192|n>>6)<<SHIFT[3&i++],s[i>>2]|=(128|63&n)<<SHIFT[3&i++]):n<55296||n>=57344?(s[i>>2]|=(224|n>>12)<<SHIFT[3&i++],s[i>>2]|=(128|n>>6&63)<<SHIFT[3&i++],s[i>>2]|=(128|63&n)<<SHIFT[3&i++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),s[i>>2]|=(240|n>>18)<<SHIFT[3&i++],s[i>>2]|=(128|n>>12&63)<<SHIFT[3&i++],s[i>>2]|=(128|n>>6&63)<<SHIFT[3&i++],s[i>>2]|=(128|63&n)<<SHIFT[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=s[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e,t,r,n,i,o,a,s,A,l=this.h0,c=this.h1,u=this.h2,g=this.h3,h=this.h4,f=this.h5,d=this.h6,p=this.h7,m=this.blocks;for(e=16;e<64;++e)t=((i=m[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,r=((i=m[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,m[e]=m[e-16]+t+m[e-7]+r|0;for(A=c&u,e=0;e<64;e+=4)this.first?(this.is224?(o=300032,p=(i=m[0]-1413257819)-150054599|0,g=i+24177077|0):(o=704751109,p=(i=m[0]-210244248)-1521486534|0,g=i+143694565|0),this.first=!1):(t=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(o=l&c)^l&u^A,p=g+(i=p+(r=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&f^~h&d)+K[e]+m[e])|0,g=i+(t+n)|0),t=(g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10),n=(a=g&l)^g&c^o,d=u+(i=d+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&h^~p&f)+K[e+1]+m[e+1])|0,t=((u=i+(t+n)|0)>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(s=u&g)^u&l^a,f=c+(i=f+(r=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&p^~d&h)+K[e+2]+m[e+2])|0,t=((c=i+(t+n)|0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),n=(A=c&u)^c&g^s,h=l+(i=h+(r=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&d^~f&p)+K[e+3]+m[e+3])|0,l=i+(t+n)|0;this.h0=this.h0+l|0,this.h1=this.h1+c|0,this.h2=this.h2+u|0,this.h3=this.h3+g|0,this.h4=this.h4+h|0,this.h5=this.h5+f|0,this.h6=this.h6+d|0,this.h7=this.h7+p|0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,A=HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a];return this.is224||(A+=HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]),A},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,a=this.h6,s=this.h7,A=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,a>>24&255,a>>16&255,a>>8&255,255&a];return this.is224||A.push(s>>24&255,s>>16&255,s>>8&255,255&s),A},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()},316:(e,t,r)=>{r.r(t),r.d(t,{AuthClient:()=>ie,ERROR_USER_INTERRUPT:()=>ne,IdbKeyVal:()=>z,IdbStorage:()=>ee,IdleManager:()=>x,KEY_STORAGE_DELEGATION:()=>X,KEY_STORAGE_KEY:()=>W,LocalStorage:()=>Z});var n=r(977),i=r(947);function o(e){var t;return new Uint8Array((null!==(t=e.match(/.{1,2}/g))&&void 0!==t?t:[]).map(e=>parseInt(e,16))).buffer}function a(e){return new Uint8Array(e).reduce((e,t)=>e+t.toString(16).padStart(2,"0"),"")}const s=e=>{if(e<=127)return 1;if(e<=255)return 2;if(e<=65535)return 3;if(e<=16777215)return 4;throw new Error("Length too long (> 4 bytes)")},A=(e,t,r)=>{if(r<=127)return e[t]=r,1;if(r<=255)return e[t]=129,e[t+1]=r,2;if(r<=65535)return e[t]=130,e[t+1]=r>>8,e[t+2]=r,3;if(r<=16777215)return e[t]=131,e[t+1]=r>>16,e[t+2]=r>>8,e[t+3]=r,4;throw new Error("Length too long (> 4 bytes)")},l=(e,t)=>{if(e[t]<128)return 1;if(128===e[t])throw new Error("Invalid length 0");if(129===e[t])return 2;if(130===e[t])return 3;if(131===e[t])return 4;throw new Error("Length too long (> 4 bytes)")},c=(Uint8Array.from([48,12,6,10,43,6,1,4,1,131,184,67,1,1]),Uint8Array.from([48,5,6,3,43,101,112]));Uint8Array.from([48,16,6,7,42,134,72,206,61,2,1,6,5,43,129,4,0,10]);function u(e,t){const r=2+s(e.byteLength+1),n=t.byteLength+r+e.byteLength;let i=0;const o=new Uint8Array(1+s(n)+n);return o[i++]=48,i+=A(o,i,n),o.set(t,i),i+=t.byteLength,o[i++]=3,i+=A(o,i,e.byteLength+1),o[i++]=0,o.set(new Uint8Array(e),i),o}const g=(e,t)=>{let r=0;const n=(e,t)=>{if(i[r++]!==e)throw new Error("Expected: "+t)},i=new Uint8Array(e);if(n(48,"sequence"),r+=l(i,r),!((e,t)=>{if(e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),n=new Uint8Array(t);for(let e=0;e<r.length;e++)if(r[e]!==n[e])return!1;return!0})(i.slice(r,r+t.byteLength),t))throw new Error("Not the expected OID.");r+=t.byteLength,n(3,"bit string");const o=((e,t)=>{const r=l(e,t);if(1===r)return e[t];if(2===r)return e[t+1];if(3===r)return(e[t+1]<<8)+e[t+2];if(4===r)return(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];throw new Error("Length too long (> 4 bytes)")})(i,r)-1;r+=l(i,r),n(0,"0 padding");const a=i.slice(r);if(o!==a.length)throw new Error(`DER payload mismatch: Expected length ${o} actual length ${a.length}`);return a};class h{constructor(e){this.rawKey=e,this.derKey=h.derEncode(e)}static from(e){return this.fromDer(e.toDer())}static fromRaw(e){return new h(e)}s